/* 縮小失敗。正在傳回未縮小的內容。 (2191,61-62): run-time error JS1195: Expected expression: > (2191,73-74): run-time error JS1004: Expected ';': ) (2191,94-95): run-time error JS1195: Expected expression: > (2194,65-66): run-time error JS1195: Expected expression: > (2194,89-90): run-time error JS1004: Expected ';': ) (2196,53-54): run-time error JS1195: Expected expression: > (2196,65-66): run-time error JS1004: Expected ';': ) (2201,14-15): run-time error JS1195: Expected expression: , (2203,41-42): run-time error JS1195: Expected expression: ) (2203,43-44): run-time error JS1004: Expected ';': { (2205,14-15): run-time error JS1195: Expected expression: , (2207,35-36): run-time error JS1195: Expected expression: ) (2207,37-38): run-time error JS1004: Expected ';': { (2209,14-15): run-time error JS1195: Expected expression: , (2211,35-36): run-time error JS1195: Expected expression: ) (2211,37-38): run-time error JS1004: Expected ';': { (2213,14-15): run-time error JS1195: Expected expression: , (2215,34-35): run-time error JS1195: Expected expression: ) (2215,36-37): run-time error JS1004: Expected ';': { (2217,14-15): run-time error JS1195: Expected expression: , (2219,35-36): run-time error JS1195: Expected expression: ) (2219,37-38): run-time error JS1004: Expected ';': { (2221,14-15): run-time error JS1195: Expected expression: , (2223,36-37): run-time error JS1195: Expected expression: ) (2223,38-39): run-time error JS1004: Expected ';': { (2225,14-15): run-time error JS1195: Expected expression: , (2226,35-36): run-time error JS1195: Expected expression: ) (2226,37-38): run-time error JS1004: Expected ';': { (2227,62-63): run-time error JS1195: Expected expression: > (2227,69-70): run-time error JS1197: Too many errors. The file might not be a JavaScript file: . (2224,17-97): run-time error JS1018: 'return' statement outside of function: return this.TotalCount - this.EDTotalCount - this.CTotalCount - this.FTotalCount (2220,17-74): run-time error JS1018: 'return' statement outside of function: return this.AdultCount + this.ChildCount + this.BabyCount (2216,17-38): run-time error JS1018: 'return' statement outside of function: return this.BabyTotal (2212,17-39): run-time error JS1018: 'return' statement outside of function: return this.ChildTotal (2208,17-39): run-time error JS1018: 'return' statement outside of function: return this.AdultTotal (2204,17-188): run-time error JS1018: 'return' statement outside of function: return this.Result.Group.Name + '' + (this.Result.Group.JoinAllExplain ? ('[' + this.Result.Group.JoinAllExplain + ']') : "" )+'' */ /* ========================================================= * bootstrap-datetimepicker.js * ========================================================= * Copyright 2012 Stefan Petre * * Improvements by Andrew Rowls * Improvements by Sebastien Malot * Improvements by Yun Lai * Improvements by Kenneth Henderick * Improvements by CuGBabyBeaR * Improvements by Christian Vaas * * Project URL : http://www.malot.fr/bootstrap-datetimepicker * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ (function(factory){ if (typeof define === 'function' && define.amd) define(['jquery'], factory); else if (typeof exports === 'object') factory(require('jquery')); else factory(jQuery); }(function($, undefined){ // Add ECMA262-5 Array methods if not supported natively (IE8) if (!('indexOf' in Array.prototype)) { Array.prototype.indexOf = function (find, i) { if (i === undefined) i = 0; if (i < 0) i += this.length; if (i < 0) i = 0; for (var n = this.length; i < n; i++) { if (i in this && this[i] === find) { return i; } } return -1; } } // Add timezone abbreviation support for ie6+, Chrome, Firefox function timeZoneAbbreviation() { var abbreviation, date, formattedStr, i, len, matchedStrings, ref, str; date = (new Date()).toString(); formattedStr = ((ref = date.split('(')[1]) != null ? ref.slice(0, -1) : 0) || date.split(' '); if (formattedStr instanceof Array) { matchedStrings = []; for (var i = 0, len = formattedStr.length; i < len; i++) { str = formattedStr[i]; if ((abbreviation = (ref = str.match(/\b[A-Z]+\b/)) !== null) ? ref[0] : 0) { matchedStrings.push(abbreviation); } } formattedStr = matchedStrings.pop(); } return formattedStr; } function UTCDate() { return new Date(Date.UTC.apply(Date, arguments)); } // Picker object var Datetimepicker = function (element, options) { var that = this; this.element = $(element); // add container for single page application // when page switch the datetimepicker div will be removed also. this.container = options.container || 'body'; this.language = options.language || this.element.data('date-language') || 'en'; this.language = this.language in dates ? this.language : this.language.split('-')[0]; // fr-CA fallback to fr this.language = this.language in dates ? this.language : 'en'; this.isRTL = dates[this.language].rtl || false; this.formatType = options.formatType || this.element.data('format-type') || 'standard'; this.format = DPGlobal.parseFormat(options.format || this.element.data('date-format') || dates[this.language].format || DPGlobal.getDefaultFormat(this.formatType, 'input'), this.formatType); this.isInline = false; this.isVisible = false; this.isInput = this.element.is('input'); this.fontAwesome = options.fontAwesome || this.element.data('font-awesome') || false; this.bootcssVer = options.bootcssVer || (this.isInput ? (this.element.is('.form-control') ? 3 : 2) : ( this.bootcssVer = this.element.is('.input-group') ? 3 : 2 )); this.component = this.element.is('.date') ? ( this.bootcssVer === 3 ? this.element.find('.input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o').parent() : this.element.find('.add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o').parent()) : false; this.componentReset = this.element.is('.date') ? ( this.bootcssVer === 3 ? this.element.find('.input-group-addon .glyphicon-remove, .input-group-addon .fa-times').parent():this.element.find('.add-on .icon-remove, .add-on .fa-times').parent()) : false; this.hasInput = this.component && this.element.find('input').length; if (this.component && this.component.length === 0) { this.component = false; } this.linkField = options.linkField || this.element.data('link-field') || false; this.linkFormat = DPGlobal.parseFormat(options.linkFormat || this.element.data('link-format') || DPGlobal.getDefaultFormat(this.formatType, 'link'), this.formatType); this.minuteStep = options.minuteStep || this.element.data('minute-step') || 5; this.pickerPosition = options.pickerPosition || this.element.data('picker-position') || 'bottom-right'; this.showMeridian = options.showMeridian || this.element.data('show-meridian') || false; this.initialDate = options.initialDate || new Date(); this.zIndex = options.zIndex || this.element.data('z-index') || undefined; this.title = typeof options.title === 'undefined' ? false : options.title; this.timezone = options.timezone || timeZoneAbbreviation(); this.icons = { leftArrow: this.fontAwesome ? 'fa-arrow-left' : (this.bootcssVer === 3 ? 'glyphicon-arrow-left' : 'icon-arrow-left'), rightArrow: this.fontAwesome ? 'fa-arrow-right' : (this.bootcssVer === 3 ? 'glyphicon-arrow-right' : 'icon-arrow-right') } this.icontype = this.fontAwesome ? 'fa' : 'glyphicon'; this._attachEvents(); this.clickedOutside = function (e) { // Clicked outside the datetimepicker, hide it if ($(e.target).closest('.datetimepicker').length === 0) { that.hide(); } } this.formatViewType = 'datetime'; if ('formatViewType' in options) { this.formatViewType = options.formatViewType; } else if ('formatViewType' in this.element.data()) { this.formatViewType = this.element.data('formatViewType'); } this.minView = 0; if ('minView' in options) { this.minView = options.minView; } else if ('minView' in this.element.data()) { this.minView = this.element.data('min-view'); } this.minView = DPGlobal.convertViewMode(this.minView); this.maxView = DPGlobal.modes.length - 1; if ('maxView' in options) { this.maxView = options.maxView; } else if ('maxView' in this.element.data()) { this.maxView = this.element.data('max-view'); } this.maxView = DPGlobal.convertViewMode(this.maxView); this.wheelViewModeNavigation = false; if ('wheelViewModeNavigation' in options) { this.wheelViewModeNavigation = options.wheelViewModeNavigation; } else if ('wheelViewModeNavigation' in this.element.data()) { this.wheelViewModeNavigation = this.element.data('view-mode-wheel-navigation'); } this.wheelViewModeNavigationInverseDirection = false; if ('wheelViewModeNavigationInverseDirection' in options) { this.wheelViewModeNavigationInverseDirection = options.wheelViewModeNavigationInverseDirection; } else if ('wheelViewModeNavigationInverseDirection' in this.element.data()) { this.wheelViewModeNavigationInverseDirection = this.element.data('view-mode-wheel-navigation-inverse-dir'); } this.wheelViewModeNavigationDelay = 100; if ('wheelViewModeNavigationDelay' in options) { this.wheelViewModeNavigationDelay = options.wheelViewModeNavigationDelay; } else if ('wheelViewModeNavigationDelay' in this.element.data()) { this.wheelViewModeNavigationDelay = this.element.data('view-mode-wheel-navigation-delay'); } this.startViewMode = 2; if ('startView' in options) { this.startViewMode = options.startView; } else if ('startView' in this.element.data()) { this.startViewMode = this.element.data('start-view'); } this.startViewMode = DPGlobal.convertViewMode(this.startViewMode); this.viewMode = this.startViewMode; this.viewSelect = this.minView; if ('viewSelect' in options) { this.viewSelect = options.viewSelect; } else if ('viewSelect' in this.element.data()) { this.viewSelect = this.element.data('view-select'); } this.viewSelect = DPGlobal.convertViewMode(this.viewSelect); this.forceParse = true; if ('forceParse' in options) { this.forceParse = options.forceParse; } else if ('dateForceParse' in this.element.data()) { this.forceParse = this.element.data('date-force-parse'); } var template = this.bootcssVer === 3 ? DPGlobal.templateV3 : DPGlobal.template; while (template.indexOf('{iconType}') !== -1) { template = template.replace('{iconType}', this.icontype); } while (template.indexOf('{leftArrow}') !== -1) { template = template.replace('{leftArrow}', this.icons.leftArrow); } while (template.indexOf('{rightArrow}') !== -1) { template = template.replace('{rightArrow}', this.icons.rightArrow); } this.picker = $(template) .appendTo(this.isInline ? this.element : this.container) // 'body') .on({ click: $.proxy(this.click, this), mousedown: $.proxy(this.mousedown, this) }); if (this.wheelViewModeNavigation) { if ($.fn.mousewheel) { this.picker.on({mousewheel: $.proxy(this.mousewheel, this)}); } else { console.log('Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option'); } } if (this.isInline) { this.picker.addClass('datetimepicker-inline'); } else { this.picker.addClass('datetimepicker-dropdown-' + this.pickerPosition + ' dropdown-menu'); } if (this.isRTL) { this.picker.addClass('datetimepicker-rtl'); var selector = this.bootcssVer === 3 ? '.prev span, .next span' : '.prev i, .next i'; this.picker.find(selector).toggleClass(this.icons.leftArrow + ' ' + this.icons.rightArrow); } $(document).on('mousedown touchend', this.clickedOutside); this.autoclose = false; if ('autoclose' in options) { this.autoclose = options.autoclose; } else if ('dateAutoclose' in this.element.data()) { this.autoclose = this.element.data('date-autoclose'); } this.keyboardNavigation = true; if ('keyboardNavigation' in options) { this.keyboardNavigation = options.keyboardNavigation; } else if ('dateKeyboardNavigation' in this.element.data()) { this.keyboardNavigation = this.element.data('date-keyboard-navigation'); } this.todayBtn = (options.todayBtn || this.element.data('date-today-btn') || false); this.clearBtn = (options.clearBtn || this.element.data('date-clear-btn') || false); this.todayHighlight = (options.todayHighlight || this.element.data('date-today-highlight') || false); this.weekStart = 0; if (typeof options.weekStart !== 'undefined') { this.weekStart = options.weekStart; } else if (typeof this.element.data('date-weekstart') !== 'undefined') { this.weekStart = this.element.data('date-weekstart'); } else if (typeof dates[this.language].weekStart !== 'undefined') { this.weekStart = dates[this.language].weekStart; } this.weekStart = this.weekStart % 7; this.weekEnd = ((this.weekStart + 6) % 7); this.onRenderDay = function (date) { var render = (options.onRenderDay || function () { return []; })(date); if (typeof render === 'string') { render = [render]; } var res = ['day']; return res.concat((render ? render : [])); }; this.onRenderHour = function (date) { var render = (options.onRenderHour || function () { return []; })(date); var res = ['hour']; if (typeof render === 'string') { render = [render]; } return res.concat((render ? render : [])); }; this.onRenderMinute = function (date) { var render = (options.onRenderMinute || function () { return []; })(date); var res = ['minute']; if (typeof render === 'string') { render = [render]; } if (date < this.startDate || date > this.endDate) { res.push('disabled'); } else if (Math.floor(this.date.getUTCMinutes() / this.minuteStep) === Math.floor(date.getUTCMinutes() / this.minuteStep)) { res.push('active'); } return res.concat((render ? render : [])); }; this.onRenderYear = function (date) { var render = (options.onRenderYear || function () { return []; })(date); var res = ['year']; if (typeof render === 'string') { render = [render]; } if (this.date.getUTCFullYear() === date.getUTCFullYear()) { res.push('active'); } if (date < this.startDate || date > this.endDate) { res.push('disabled'); } return res.concat((render ? render : [])); } this.onRenderMonth = function (date) { var render = (options.onRenderMonth || function () { return []; })(date); var res = ['month']; if (typeof render === 'string') { render = [render]; } return res.concat((render ? render : [])); } this.startDate = new Date(-8639968443048000); this.endDate = new Date(8639968443048000); this.datesDisabled = []; this.daysOfWeekDisabled = []; this.setStartDate(options.startDate || this.element.data('date-startdate')); this.setEndDate(options.endDate || this.element.data('date-enddate')); this.setDatesDisabled(options.datesDisabled || this.element.data('date-dates-disabled')); this.setDaysOfWeekDisabled(options.daysOfWeekDisabled || this.element.data('date-days-of-week-disabled')); this.setMinutesDisabled(options.minutesDisabled || this.element.data('date-minute-disabled')); this.setHoursDisabled(options.hoursDisabled || this.element.data('date-hour-disabled')); this.fillDow(); this.fillMonths(); this.update(); this.showMode(); if (this.isInline) { this.show(); } }; Datetimepicker.prototype = { constructor: Datetimepicker, _events: [], _attachEvents: function () { this._detachEvents(); if (this.isInput) { // single input this._events = [ [this.element, { focus: $.proxy(this.show, this), keyup: $.proxy(this.update, this), keydown: $.proxy(this.keydown, this) }] ]; } else if (this.component && this.hasInput) { // component: input + button this._events = [ // For components that are not readonly, allow keyboard nav [this.element.find('input'), { focus: $.proxy(this.show, this), keyup: $.proxy(this.update, this), keydown: $.proxy(this.keydown, this) }], [this.component, { click: $.proxy(this.show, this) }] ]; if (this.componentReset) { this._events.push([ this.componentReset, {click: $.proxy(this.reset, this)} ]); } } else if (this.element.is('div')) { // inline datetimepicker this.isInline = true; } else { this._events = [ [this.element, { click: $.proxy(this.show, this) }] ]; } for (var i = 0, el, ev; i < this._events.length; i++) { el = this._events[i][0]; ev = this._events[i][1]; el.on(ev); } }, _detachEvents: function () { for (var i = 0, el, ev; i < this._events.length; i++) { el = this._events[i][0]; ev = this._events[i][1]; el.off(ev); } this._events = []; }, show: function (e) { this.picker.show(); this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); if (this.forceParse) { this.update(); } this.place(); $(window).on('resize', $.proxy(this.place, this)); if (e) { e.stopPropagation(); e.preventDefault(); } this.isVisible = true; this.element.trigger({ type: 'show', date: this.date }); }, hide: function () { if (!this.isVisible) return; if (this.isInline) return; this.picker.hide(); $(window).off('resize', this.place); this.viewMode = this.startViewMode; this.showMode(); if (!this.isInput) { $(document).off('mousedown', this.hide); } if ( this.forceParse && ( this.isInput && this.element.val() || this.hasInput && this.element.find('input').val() ) ) this.setValue(); this.isVisible = false; this.element.trigger({ type: 'hide', date: this.date }); }, remove: function () { this._detachEvents(); $(document).off('mousedown', this.clickedOutside); this.picker.remove(); delete this.picker; delete this.element.data().datetimepicker; }, getDate: function () { var d = this.getUTCDate(); if (d === null) { return null; } return new Date(d.getTime() + (d.getTimezoneOffset() * 60000)); }, getUTCDate: function () { return this.date; }, getInitialDate: function () { return this.initialDate }, setInitialDate: function (initialDate) { this.initialDate = initialDate; }, setDate: function (d) { this.setUTCDate(new Date(d.getTime() - (d.getTimezoneOffset() * 60000))); }, setUTCDate: function (d) { if (d >= this.startDate && d <= this.endDate) { this.date = d; this.setValue(); this.viewDate = this.date; this.fill(); } else { this.element.trigger({ type: 'outOfRange', date: d, startDate: this.startDate, endDate: this.endDate }); } }, setFormat: function (format) { this.format = DPGlobal.parseFormat(format, this.formatType); var element; if (this.isInput) { element = this.element; } else if (this.component) { element = this.element.find('input'); } if (element && element.val()) { this.setValue(); } }, setValue: function () { var formatted = this.getFormattedDate(); if (!this.isInput) { if (this.component) { this.element.find('input').val(formatted); } this.element.data('date', formatted); } else { this.element.val(formatted); } if (this.linkField) { $('#' + this.linkField).val(this.getFormattedDate(this.linkFormat)); } }, getFormattedDate: function (format) { format = format || this.format; return DPGlobal.formatDate(this.date, format, this.language, this.formatType, this.timezone); }, setStartDate: function (startDate) { this.startDate = startDate || this.startDate; if (this.startDate.valueOf() !== 8639968443048000) { this.startDate = DPGlobal.parseDate(this.startDate, this.format, this.language, this.formatType, this.timezone); } this.update(); this.updateNavArrows(); }, setEndDate: function (endDate) { this.endDate = endDate || this.endDate; if (this.endDate.valueOf() !== 8639968443048000) { this.endDate = DPGlobal.parseDate(this.endDate, this.format, this.language, this.formatType, this.timezone); } this.update(); this.updateNavArrows(); }, setDatesDisabled: function (datesDisabled) { this.datesDisabled = datesDisabled || []; if (!$.isArray(this.datesDisabled)) { this.datesDisabled = this.datesDisabled.split(/,\s*/); } var mThis = this; this.datesDisabled = $.map(this.datesDisabled, function (d) { return DPGlobal.parseDate(d, mThis.format, mThis.language, mThis.formatType, mThis.timezone).toDateString(); }); this.update(); this.updateNavArrows(); }, setTitle: function (selector, value) { return this.picker.find(selector) .find('th:eq(1)') .text(this.title === false ? value : this.title); }, setDaysOfWeekDisabled: function (daysOfWeekDisabled) { this.daysOfWeekDisabled = daysOfWeekDisabled || []; if (!$.isArray(this.daysOfWeekDisabled)) { this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/); } this.daysOfWeekDisabled = $.map(this.daysOfWeekDisabled, function (d) { return parseInt(d, 10); }); this.update(); this.updateNavArrows(); }, setMinutesDisabled: function (minutesDisabled) { this.minutesDisabled = minutesDisabled || []; if (!$.isArray(this.minutesDisabled)) { this.minutesDisabled = this.minutesDisabled.split(/,\s*/); } this.minutesDisabled = $.map(this.minutesDisabled, function (d) { return parseInt(d, 10); }); this.update(); this.updateNavArrows(); }, setHoursDisabled: function (hoursDisabled) { this.hoursDisabled = hoursDisabled || []; if (!$.isArray(this.hoursDisabled)) { this.hoursDisabled = this.hoursDisabled.split(/,\s*/); } this.hoursDisabled = $.map(this.hoursDisabled, function (d) { return parseInt(d, 10); }); this.update(); this.updateNavArrows(); }, place: function () { if (this.isInline) return; if (!this.zIndex) { var index_highest = 0; $('div').each(function () { var index_current = parseInt($(this).css('zIndex'), 10); if (index_current > index_highest) { index_highest = index_current; } }); this.zIndex = index_highest + 10; } var offset, top, left, containerOffset; if (this.container instanceof $) { containerOffset = this.container.offset(); } else { containerOffset = $(this.container).offset(); } if (this.component) { offset = this.component.offset(); left = offset.left; if (this.pickerPosition === 'bottom-left' || this.pickerPosition === 'top-left') { left += this.component.outerWidth() - this.picker.outerWidth(); } } else { offset = this.element.offset(); left = offset.left; if (this.pickerPosition === 'bottom-left' || this.pickerPosition === 'top-left') { left += this.element.outerWidth() - this.picker.outerWidth(); } } var bodyWidth = document.body.clientWidth || window.innerWidth; if (left + 220 > bodyWidth) { left = bodyWidth - 220; } if (this.pickerPosition === 'top-left' || this.pickerPosition === 'top-right') { top = offset.top - this.picker.outerHeight(); } else { top = offset.top + this.height; } top = top - containerOffset.top; left = left - containerOffset.left; this.picker.css({ top: top, left: left, zIndex: this.zIndex }); }, hour_minute: "^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]", update: function () { var date, fromArgs = false; if (arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) { date = arguments[0]; fromArgs = true; } else { date = (this.isInput ? this.element.val() : this.element.find('input').val()) || this.element.data('date') || this.initialDate; if (typeof date === 'string') { date = date.replace(/^\s+|\s+$/g,''); } } if (!date) { date = new Date(); fromArgs = false; } if (typeof date === "string") { if (new RegExp(this.hour_minute).test(date) || new RegExp(this.hour_minute + ":[0-5][0-9]").test(date)) { date = this.getDate() } } this.date = DPGlobal.parseDate(date, this.format, this.language, this.formatType, this.timezone); if (fromArgs) this.setValue(); if (this.date < this.startDate) { this.viewDate = new Date(this.startDate); } else if (this.date > this.endDate) { this.viewDate = new Date(this.endDate); } else { this.viewDate = new Date(this.date); } this.fill(); }, fillDow: function () { var dowCnt = this.weekStart, html = ''; while (dowCnt < this.weekStart + 7) { html += '' + dates[this.language].daysMin[(dowCnt++) % 7] + ''; } html += ''; this.picker.find('.datetimepicker-days thead').append(html); }, fillMonths: function () { var html = ''; var d = new Date(this.viewDate); for (var i = 0; i < 12; i++) { d.setUTCMonth(i); var classes = this.onRenderMonth(d); html += '' + dates[this.language].monthsShort[i] + ''; } this.picker.find('.datetimepicker-months td').html(html); }, fill: function () { if (!this.date || !this.viewDate) { return; } var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(), dayMonth = d.getUTCDate(), hours = d.getUTCHours(), startYear = this.startDate.getUTCFullYear(), startMonth = this.startDate.getUTCMonth(), endYear = this.endDate.getUTCFullYear(), endMonth = this.endDate.getUTCMonth() + 1, currentDate = (new UTCDate(this.date.getUTCFullYear(), this.date.getUTCMonth(), this.date.getUTCDate())).valueOf(), today = new Date(); this.setTitle('.datetimepicker-days', dates[this.language].months[month] + ' ' + year) if (this.formatViewType === 'time') { var formatted = this.getFormattedDate(); this.setTitle('.datetimepicker-hours', formatted); this.setTitle('.datetimepicker-minutes', formatted); } else { this.setTitle('.datetimepicker-hours', dayMonth + ' ' + dates[this.language].months[month] + ' ' + year); this.setTitle('.datetimepicker-minutes', dayMonth + ' ' + dates[this.language].months[month] + ' ' + year); } this.picker.find('tfoot th.today') .text(dates[this.language].today || dates['en'].today) .toggle(this.todayBtn !== false); this.picker.find('tfoot th.clear') .text(dates[this.language].clear || dates['en'].clear) .toggle(this.clearBtn !== false); this.updateNavArrows(); this.fillMonths(); var prevMonth = UTCDate(year, month - 1, 28, 0, 0, 0, 0), day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth()); prevMonth.setUTCDate(day); prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.weekStart + 7) % 7); var nextMonth = new Date(prevMonth); nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); nextMonth = nextMonth.valueOf(); var html = []; var classes; while (prevMonth.valueOf() < nextMonth) { if (prevMonth.getUTCDay() === this.weekStart) { html.push(''); } classes = this.onRenderDay(prevMonth); if (prevMonth.getUTCFullYear() < year || (prevMonth.getUTCFullYear() === year && prevMonth.getUTCMonth() < month)) { classes.push('old'); } else if (prevMonth.getUTCFullYear() > year || (prevMonth.getUTCFullYear() === year && prevMonth.getUTCMonth() > month)) { classes.push('new'); } // Compare internal UTC date with local today, not UTC today if (this.todayHighlight && prevMonth.getUTCFullYear() === today.getFullYear() && prevMonth.getUTCMonth() === today.getMonth() && prevMonth.getUTCDate() === today.getDate()) { classes.push('today'); } if (prevMonth.valueOf() === currentDate) { classes.push('active'); } if ((prevMonth.valueOf() + 86400000) <= this.startDate || prevMonth.valueOf() > this.endDate || $.inArray(prevMonth.getUTCDay(), this.daysOfWeekDisabled) !== -1 || $.inArray(prevMonth.toDateString(), this.datesDisabled) !== -1) { classes.push('disabled'); } html.push('' + prevMonth.getUTCDate() + ''); if (prevMonth.getUTCDay() === this.weekEnd) { html.push(''); } prevMonth.setUTCDate(prevMonth.getUTCDate() + 1); } this.picker.find('.datetimepicker-days tbody').empty().append(html.join('')); html = []; var txt = '', meridian = '', meridianOld = ''; var hoursDisabled = this.hoursDisabled || []; d = new Date(this.viewDate) for (var i = 0; i < 24; i++) { d.setUTCHours(i); classes = this.onRenderHour(d); if (hoursDisabled.indexOf(i) !== -1) { classes.push('disabled'); } var actual = UTCDate(year, month, dayMonth, i); // We want the previous hour for the startDate if ((actual.valueOf() + 3600000) <= this.startDate || actual.valueOf() > this.endDate) { classes.push('disabled'); } else if (hours === i) { classes.push('active'); } if (this.showMeridian && dates[this.language].meridiem.length === 2) { meridian = (i < 12 ? dates[this.language].meridiem[0] : dates[this.language].meridiem[1]); if (meridian !== meridianOld) { if (meridianOld !== '') { html.push(''); } html.push('
' + meridian.toUpperCase() + ''); } meridianOld = meridian; txt = (i % 12 ? i % 12 : 12); if (i < 12) { classes.push('hour_am'); } else { classes.push('hour_pm'); } html.push('' + txt + ''); if (i === 23) { html.push('
'); } } else { txt = i + ':00'; html.push('' + txt + ''); } } this.picker.find('.datetimepicker-hours td').html(html.join('')); html = []; txt = ''; meridian = ''; meridianOld = ''; var minutesDisabled = this.minutesDisabled || []; d = new Date(this.viewDate); for (var i = 0; i < 60; i += this.minuteStep) { if (minutesDisabled.indexOf(i) !== -1) continue; d.setUTCMinutes(i); d.setUTCSeconds(0); classes = this.onRenderMinute(d); if (this.showMeridian && dates[this.language].meridiem.length === 2) { meridian = (hours < 12 ? dates[this.language].meridiem[0] : dates[this.language].meridiem[1]); if (meridian !== meridianOld) { if (meridianOld !== '') { html.push(''); } html.push('
' + meridian.toUpperCase() + ''); } meridianOld = meridian; txt = (hours % 12 ? hours % 12 : 12); html.push('' + txt + ':' + (i < 10 ? '0' + i : i) + ''); if (i === 59) { html.push('
'); } } else { txt = i + ':00'; html.push('' + hours + ':' + (i < 10 ? '0' + i : i) + ''); } } this.picker.find('.datetimepicker-minutes td').html(html.join('')); var currentYear = this.date.getUTCFullYear(); var months = this.setTitle('.datetimepicker-months', year) .end() .find('.month').removeClass('active'); if (currentYear === year) { // getUTCMonths() returns 0 based, and we need to select the next one // To cater bootstrap 2 we don't need to select the next one months.eq(this.date.getUTCMonth()).addClass('active'); } if (year < startYear || year > endYear) { months.addClass('disabled'); } if (year === startYear) { months.slice(0, startMonth).addClass('disabled'); } if (year === endYear) { months.slice(endMonth).addClass('disabled'); } html = ''; year = parseInt(year / 10, 10) * 10; var yearCont = this.setTitle('.datetimepicker-years', year + '-' + (year + 9)) .end() .find('td'); year -= 1; d = new Date(this.viewDate); for (var i = -1; i < 11; i++) { d.setUTCFullYear(year); classes = this.onRenderYear(d); if (i === -1 || i === 10) { classes.push(old); } html += '' + year + ''; year += 1; } yearCont.html(html); this.place(); }, updateNavArrows: function () { var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(), day = d.getUTCDate(), hour = d.getUTCHours(); switch (this.viewMode) { case 0: if (year <= this.startDate.getUTCFullYear() && month <= this.startDate.getUTCMonth() && day <= this.startDate.getUTCDate() && hour <= this.startDate.getUTCHours()) { this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (year >= this.endDate.getUTCFullYear() && month >= this.endDate.getUTCMonth() && day >= this.endDate.getUTCDate() && hour >= this.endDate.getUTCHours()) { this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; case 1: if (year <= this.startDate.getUTCFullYear() && month <= this.startDate.getUTCMonth() && day <= this.startDate.getUTCDate()) { this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (year >= this.endDate.getUTCFullYear() && month >= this.endDate.getUTCMonth() && day >= this.endDate.getUTCDate()) { this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; case 2: if (year <= this.startDate.getUTCFullYear() && month <= this.startDate.getUTCMonth()) { this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (year >= this.endDate.getUTCFullYear() && month >= this.endDate.getUTCMonth()) { this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; case 3: case 4: if (year <= this.startDate.getUTCFullYear()) { this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (year >= this.endDate.getUTCFullYear()) { this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; } }, mousewheel: function (e) { e.preventDefault(); e.stopPropagation(); if (this.wheelPause) { return; } this.wheelPause = true; var originalEvent = e.originalEvent; var delta = originalEvent.wheelDelta; var mode = delta > 0 ? 1 : (delta === 0) ? 0 : -1; if (this.wheelViewModeNavigationInverseDirection) { mode = -mode; } this.showMode(mode); setTimeout($.proxy(function () { this.wheelPause = false }, this), this.wheelViewModeNavigationDelay); }, click: function (e) { e.stopPropagation(); e.preventDefault(); var target = $(e.target).closest('span, td, th, legend'); if (target.is('.' + this.icontype)) { target = $(target).parent().closest('span, td, th, legend'); } if (target.length === 1) { if (target.is('.disabled')) { this.element.trigger({ type: 'outOfRange', date: this.viewDate, startDate: this.startDate, endDate: this.endDate }); return; } switch (target[0].nodeName.toLowerCase()) { case 'th': switch (target[0].className) { case 'switch': this.showMode(1); break; case 'prev': case 'next': var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1); switch (this.viewMode) { case 0: this.viewDate = this.moveHour(this.viewDate, dir); break; case 1: this.viewDate = this.moveDate(this.viewDate, dir); break; case 2: this.viewDate = this.moveMonth(this.viewDate, dir); break; case 3: case 4: this.viewDate = this.moveYear(this.viewDate, dir); break; } this.fill(); this.element.trigger({ type: target[0].className + ':' + this.convertViewModeText(this.viewMode), date: this.viewDate, startDate: this.startDate, endDate: this.endDate }); break; case 'clear': this.reset(); if (this.autoclose) { this.hide(); } break; case 'today': var date = new Date(); date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0); // Respect startDate and endDate. if (date < this.startDate) date = this.startDate; else if (date > this.endDate) date = this.endDate; this.viewMode = this.startViewMode; this.showMode(0); this._setDate(date); this.fill(); if (this.autoclose) { this.hide(); } break; } break; case 'span': if (!target.is('.disabled')) { var year = this.viewDate.getUTCFullYear(), month = this.viewDate.getUTCMonth(), day = this.viewDate.getUTCDate(), hours = this.viewDate.getUTCHours(), minutes = this.viewDate.getUTCMinutes(), seconds = this.viewDate.getUTCSeconds(); if (target.is('.month')) { this.viewDate.setUTCDate(1); month = target.parent().find('span').index(target); day = this.viewDate.getUTCDate(); this.viewDate.setUTCMonth(month); this.element.trigger({ type: 'changeMonth', date: this.viewDate }); if (this.viewSelect >= 3) { this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0)); } } else if (target.is('.year')) { this.viewDate.setUTCDate(1); year = parseInt(target.text(), 10) || 0; this.viewDate.setUTCFullYear(year); this.element.trigger({ type: 'changeYear', date: this.viewDate }); if (this.viewSelect >= 4) { this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0)); } } else if (target.is('.hour')) { hours = parseInt(target.text(), 10) || 0; if (target.hasClass('hour_am') || target.hasClass('hour_pm')) { if (hours === 12 && target.hasClass('hour_am')) { hours = 0; } else if (hours !== 12 && target.hasClass('hour_pm')) { hours += 12; } } this.viewDate.setUTCHours(hours); this.element.trigger({ type: 'changeHour', date: this.viewDate }); if (this.viewSelect >= 1) { this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0)); } } else if (target.is('.minute')) { minutes = parseInt(target.text().substr(target.text().indexOf(':') + 1), 10) || 0; this.viewDate.setUTCMinutes(minutes); this.element.trigger({ type: 'changeMinute', date: this.viewDate }); if (this.viewSelect >= 0) { this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0)); } } if (this.viewMode !== 0) { var oldViewMode = this.viewMode; this.showMode(-1); this.fill(); if (oldViewMode === this.viewMode && this.autoclose) { this.hide(); } } else { this.fill(); if (this.autoclose) { this.hide(); } } } break; case 'td': if (target.is('.day') && !target.is('.disabled')) { var day = parseInt(target.text(), 10) || 1; var year = this.viewDate.getUTCFullYear(), month = this.viewDate.getUTCMonth(), hours = this.viewDate.getUTCHours(), minutes = this.viewDate.getUTCMinutes(), seconds = this.viewDate.getUTCSeconds(); if (target.is('.old')) { if (month === 0) { month = 11; year -= 1; } else { month -= 1; } } else if (target.is('.new')) { if (month === 11) { month = 0; year += 1; } else { month += 1; } } this.viewDate.setUTCFullYear(year); this.viewDate.setUTCMonth(month, day); this.element.trigger({ type: 'changeDay', date: this.viewDate }); if (this.viewSelect >= 2) { this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0)); } } var oldViewMode = this.viewMode; this.showMode(-1); this.fill(); if (oldViewMode === this.viewMode && this.autoclose) { this.hide(); } break; } } }, _setDate: function (date, which) { if (!which || which === 'date') this.date = date; if (!which || which === 'view') this.viewDate = date; this.fill(); this.setValue(); var element; if (this.isInput) { element = this.element; } else if (this.component) { element = this.element.find('input'); } if (element) { element.change(); } this.element.trigger({ type: 'changeDate', date: this.getDate() }); if(date === null) this.date = this.viewDate; }, moveMinute: function (date, dir) { if (!dir) return date; var new_date = new Date(date.valueOf()); //dir = dir > 0 ? 1 : -1; new_date.setUTCMinutes(new_date.getUTCMinutes() + (dir * this.minuteStep)); return new_date; }, moveHour: function (date, dir) { if (!dir) return date; var new_date = new Date(date.valueOf()); //dir = dir > 0 ? 1 : -1; new_date.setUTCHours(new_date.getUTCHours() + dir); return new_date; }, moveDate: function (date, dir) { if (!dir) return date; var new_date = new Date(date.valueOf()); //dir = dir > 0 ? 1 : -1; new_date.setUTCDate(new_date.getUTCDate() + dir); return new_date; }, moveMonth: function (date, dir) { if (!dir) return date; var new_date = new Date(date.valueOf()), day = new_date.getUTCDate(), month = new_date.getUTCMonth(), mag = Math.abs(dir), new_month, test; dir = dir > 0 ? 1 : -1; if (mag === 1) { test = dir === -1 // If going back one month, make sure month is not current month // (eg, Mar 31 -> Feb 31 === Feb 28, not Mar 02) ? function () { return new_date.getUTCMonth() === month; } // If going forward one month, make sure month is as expected // (eg, Jan 31 -> Feb 31 === Feb 28, not Mar 02) : function () { return new_date.getUTCMonth() !== new_month; }; new_month = month + dir; new_date.setUTCMonth(new_month); // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 if (new_month < 0 || new_month > 11) new_month = (new_month + 12) % 12; } else { // For magnitudes >1, move one month at a time... for (var i = 0; i < mag; i++) // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)... new_date = this.moveMonth(new_date, dir); // ...then reset the day, keeping it in the new month new_month = new_date.getUTCMonth(); new_date.setUTCDate(day); test = function () { return new_month !== new_date.getUTCMonth(); }; } // Common date-resetting loop -- if date is beyond end of month, make it // end of month while (test()) { new_date.setUTCDate(--day); new_date.setUTCMonth(new_month); } return new_date; }, moveYear: function (date, dir) { return this.moveMonth(date, dir * 12); }, dateWithinRange: function (date) { return date >= this.startDate && date <= this.endDate; }, keydown: function (e) { if (this.picker.is(':not(:visible)')) { if (e.keyCode === 27) // allow escape to hide and re-show picker this.show(); return; } var dateChanged = false, dir, newDate, newViewDate; switch (e.keyCode) { case 27: // escape this.hide(); e.preventDefault(); break; case 37: // left case 39: // right if (!this.keyboardNavigation) break; dir = e.keyCode === 37 ? -1 : 1; var viewMode = this.viewMode; if (e.ctrlKey) { viewMode += 2; } else if (e.shiftKey) { viewMode += 1; } if (viewMode === 4) { newDate = this.moveYear(this.date, dir); newViewDate = this.moveYear(this.viewDate, dir); } else if (viewMode === 3) { newDate = this.moveMonth(this.date, dir); newViewDate = this.moveMonth(this.viewDate, dir); } else if (viewMode === 2) { newDate = this.moveDate(this.date, dir); newViewDate = this.moveDate(this.viewDate, dir); } else if (viewMode === 1) { newDate = this.moveHour(this.date, dir); newViewDate = this.moveHour(this.viewDate, dir); } else if (viewMode === 0) { newDate = this.moveMinute(this.date, dir); newViewDate = this.moveMinute(this.viewDate, dir); } if (this.dateWithinRange(newDate)) { this.date = newDate; this.viewDate = newViewDate; this.setValue(); this.update(); e.preventDefault(); dateChanged = true; } break; case 38: // up case 40: // down if (!this.keyboardNavigation) break; dir = e.keyCode === 38 ? -1 : 1; viewMode = this.viewMode; if (e.ctrlKey) { viewMode += 2; } else if (e.shiftKey) { viewMode += 1; } if (viewMode === 4) { newDate = this.moveYear(this.date, dir); newViewDate = this.moveYear(this.viewDate, dir); } else if (viewMode === 3) { newDate = this.moveMonth(this.date, dir); newViewDate = this.moveMonth(this.viewDate, dir); } else if (viewMode === 2) { newDate = this.moveDate(this.date, dir * 7); newViewDate = this.moveDate(this.viewDate, dir * 7); } else if (viewMode === 1) { if (this.showMeridian) { newDate = this.moveHour(this.date, dir * 6); newViewDate = this.moveHour(this.viewDate, dir * 6); } else { newDate = this.moveHour(this.date, dir * 4); newViewDate = this.moveHour(this.viewDate, dir * 4); } } else if (viewMode === 0) { newDate = this.moveMinute(this.date, dir * 4); newViewDate = this.moveMinute(this.viewDate, dir * 4); } if (this.dateWithinRange(newDate)) { this.date = newDate; this.viewDate = newViewDate; this.setValue(); this.update(); e.preventDefault(); dateChanged = true; } break; case 13: // enter if (this.viewMode !== 0) { var oldViewMode = this.viewMode; this.showMode(-1); this.fill(); if (oldViewMode === this.viewMode && this.autoclose) { this.hide(); } } else { this.fill(); if (this.autoclose) { this.hide(); } } e.preventDefault(); break; case 9: // tab this.hide(); break; } if (dateChanged) { var element; if (this.isInput) { element = this.element; } else if (this.component) { element = this.element.find('input'); } if (element) { element.change(); } this.element.trigger({ type: 'changeDate', date: this.getDate() }); } }, showMode: function (dir) { if (dir) { var newViewMode = Math.max(0, Math.min(DPGlobal.modes.length - 1, this.viewMode + dir)); if (newViewMode >= this.minView && newViewMode <= this.maxView) { this.element.trigger({ type: 'changeMode', date: this.viewDate, oldViewMode: this.viewMode, newViewMode: newViewMode }); this.viewMode = newViewMode; } } /* vitalets: fixing bug of very special conditions: jquery 1.7.1 + webkit + show inline datetimepicker in bootstrap popover. Method show() does not set display css correctly and datetimepicker is not shown. Changed to .css('display', 'block') solve the problem. See https://github.com/vitalets/x-editable/issues/37 In jquery 1.7.2+ everything works fine. */ //this.picker.find('>div').hide().filter('.datetimepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); this.picker.find('>div').hide().filter('.datetimepicker-' + DPGlobal.modes[this.viewMode].clsName).css('display', 'block'); this.updateNavArrows(); }, reset: function () { this._setDate(null, 'date'); }, convertViewModeText: function (viewMode) { switch (viewMode) { case 4: return 'decade'; case 3: return 'year'; case 2: return 'month'; case 1: return 'day'; case 0: return 'hour'; } } }; var old = $.fn.datetimepicker; $.fn.datetimepicker = function (option) { var args = Array.apply(null, arguments); args.shift(); var internal_return; this.each(function () { var $this = $(this), data = $this.data('datetimepicker'), options = typeof option === 'object' && option; if (!data) { $this.data('datetimepicker', (data = new Datetimepicker(this, $.extend({}, $.fn.datetimepicker.defaults, options)))); } if (typeof option === 'string' && typeof data[option] === 'function') { internal_return = data[option].apply(data, args); if (internal_return !== undefined) { return false; } } }); if (internal_return !== undefined) return internal_return; else return this; }; $.fn.datetimepicker.defaults = { }; $.fn.datetimepicker.Constructor = Datetimepicker; var dates = $.fn.datetimepicker.dates = { en: { days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], daysMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'], months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], meridiem: ['am', 'pm'], suffix: ['st', 'nd', 'rd', 'th'], today: 'Today', clear: 'Clear' } }; var DPGlobal = { modes: [ { clsName: 'minutes', navFnc: 'Hours', navStep: 1 }, { clsName: 'hours', navFnc: 'Date', navStep: 1 }, { clsName: 'days', navFnc: 'Month', navStep: 1 }, { clsName: 'months', navFnc: 'FullYear', navStep: 1 }, { clsName: 'years', navFnc: 'FullYear', navStep: 10 } ], isLeapYear: function (year) { return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) }, getDaysInMonth: function (year, month) { return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] }, getDefaultFormat: function (type, field) { if (type === 'standard') { if (field === 'input') return 'yyyy-mm-dd hh:ii'; else return 'yyyy-mm-dd hh:ii:ss'; } else if (type === 'php') { if (field === 'input') return 'Y-m-d H:i'; else return 'Y-m-d H:i:s'; } else { throw new Error('Invalid format type.'); } }, validParts: function (type) { if (type === 'standard') { return /t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g; } else if (type === 'php') { return /[dDjlNwzFmMnStyYaABgGhHis]/g; } else { throw new Error('Invalid format type.'); } }, nonpunctuation: /[^ -\/:-@\[-`{-~\t\n\rTZ]+/g, parseFormat: function (format, type) { // IE treats \0 as a string end in inputs (truncating the value), // so it's a bad format delimiter, anyway var separators = format.replace(this.validParts(type), '\0').split('\0'), parts = format.match(this.validParts(type)); if (!separators || !separators.length || !parts || parts.length === 0) { throw new Error('Invalid date format.'); } return {separators: separators, parts: parts}; }, parseDate: function (date, format, language, type, timezone) { if (date instanceof Date) { var dateUTC = new Date(date.valueOf() - date.getTimezoneOffset() * 60000); dateUTC.setMilliseconds(0); return dateUTC; } if (/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(date)) { format = this.parseFormat('yyyy-mm-dd', type); } if (/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(date)) { format = this.parseFormat('yyyy-mm-dd hh:ii', type); } if (/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(date)) { format = this.parseFormat('yyyy-mm-dd hh:ii:ss', type); } if (/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(date)) { var part_re = /([-+]\d+)([dmwy])/, parts = date.match(/([-+]\d+)([dmwy])/g), part, dir; date = new Date(); for (var i = 0; i < parts.length; i++) { part = part_re.exec(parts[i]); dir = parseInt(part[1]); switch (part[2]) { case 'd': date.setUTCDate(date.getUTCDate() + dir); break; case 'm': date = Datetimepicker.prototype.moveMonth.call(Datetimepicker.prototype, date, dir); break; case 'w': date.setUTCDate(date.getUTCDate() + dir * 7); break; case 'y': date = Datetimepicker.prototype.moveYear.call(Datetimepicker.prototype, date, dir); break; } } return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), 0); } var parts = date && date.toString().match(this.nonpunctuation) || [], date = new Date(0, 0, 0, 0, 0, 0, 0), parsed = {}, setters_order = ['hh', 'h', 'ii', 'i', 'ss', 's', 'yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'D', 'DD', 'd', 'dd', 'H', 'HH', 'p', 'P', 'z', 'Z'], setters_map = { hh: function (d, v) { return d.setUTCHours(v); }, h: function (d, v) { return d.setUTCHours(v); }, HH: function (d, v) { return d.setUTCHours(v === 12 ? 0 : v); }, H: function (d, v) { return d.setUTCHours(v === 12 ? 0 : v); }, ii: function (d, v) { return d.setUTCMinutes(v); }, i: function (d, v) { return d.setUTCMinutes(v); }, ss: function (d, v) { return d.setUTCSeconds(v); }, s: function (d, v) { return d.setUTCSeconds(v); }, yyyy: function (d, v) { return d.setUTCFullYear(v); }, yy: function (d, v) { return d.setUTCFullYear(2000 + v); }, m: function (d, v) { v -= 1; while (v < 0) v += 12; v %= 12; d.setUTCMonth(v); while (d.getUTCMonth() !== v) if (isNaN(d.getUTCMonth())) return d; else d.setUTCDate(d.getUTCDate() - 1); return d; }, d: function (d, v) { return d.setUTCDate(v); }, p: function (d, v) { return d.setUTCHours(v === 1 ? d.getUTCHours() + 12 : d.getUTCHours()); }, z: function () { return timezone } }, val, filtered, part; setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; setters_map['dd'] = setters_map['d']; setters_map['P'] = setters_map['p']; setters_map['Z'] = setters_map['z']; date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()); if (parts.length === format.parts.length) { for (var i = 0, cnt = format.parts.length; i < cnt; i++) { val = parseInt(parts[i], 10); part = format.parts[i]; if (isNaN(val)) { switch (part) { case 'MM': filtered = $(dates[language].months).filter(function () { var m = this.slice(0, parts[i].length), p = parts[i].slice(0, m.length); return m === p; }); val = $.inArray(filtered[0], dates[language].months) + 1; break; case 'M': filtered = $(dates[language].monthsShort).filter(function () { var m = this.slice(0, parts[i].length), p = parts[i].slice(0, m.length); return m.toLowerCase() === p.toLowerCase(); }); val = $.inArray(filtered[0], dates[language].monthsShort) + 1; break; case 'p': case 'P': val = $.inArray(parts[i].toLowerCase(), dates[language].meridiem); break; case 'z': case 'Z': timezone; break; } } parsed[part] = val; } for (var i = 0, s; i < setters_order.length; i++) { s = setters_order[i]; if (s in parsed && !isNaN(parsed[s])) setters_map[s](date, parsed[s]) } } return date; }, formatDate: function (date, format, language, type, timezone) { if (date === null) { return ''; } var val; if (type === 'standard') { val = { t: date.getTime(), // year yy: date.getUTCFullYear().toString().substring(2), yyyy: date.getUTCFullYear(), // month m: date.getUTCMonth() + 1, M: dates[language].monthsShort[date.getUTCMonth()], MM: dates[language].months[date.getUTCMonth()], // day d: date.getUTCDate(), D: dates[language].daysShort[date.getUTCDay()], DD: dates[language].days[date.getUTCDay()], p: (dates[language].meridiem.length === 2 ? dates[language].meridiem[date.getUTCHours() < 12 ? 0 : 1] : ''), // hour h: date.getUTCHours(), // minute i: date.getUTCMinutes(), // second s: date.getUTCSeconds(), // timezone z: timezone }; if (dates[language].meridiem.length === 2) { val.H = (val.h % 12 === 0 ? 12 : val.h % 12); } else { val.H = val.h; } val.HH = (val.H < 10 ? '0' : '') + val.H; val.P = val.p.toUpperCase(); val.Z = val.z; val.hh = (val.h < 10 ? '0' : '') + val.h; val.ii = (val.i < 10 ? '0' : '') + val.i; val.ss = (val.s < 10 ? '0' : '') + val.s; val.dd = (val.d < 10 ? '0' : '') + val.d; val.mm = (val.m < 10 ? '0' : '') + val.m; } else if (type === 'php') { // php format val = { // year y: date.getUTCFullYear().toString().substring(2), Y: date.getUTCFullYear(), // month F: dates[language].months[date.getUTCMonth()], M: dates[language].monthsShort[date.getUTCMonth()], n: date.getUTCMonth() + 1, t: DPGlobal.getDaysInMonth(date.getUTCFullYear(), date.getUTCMonth()), // day j: date.getUTCDate(), l: dates[language].days[date.getUTCDay()], D: dates[language].daysShort[date.getUTCDay()], w: date.getUTCDay(), // 0 -> 6 N: (date.getUTCDay() === 0 ? 7 : date.getUTCDay()), // 1 -> 7 S: (date.getUTCDate() % 10 <= dates[language].suffix.length ? dates[language].suffix[date.getUTCDate() % 10 - 1] : ''), // hour a: (dates[language].meridiem.length === 2 ? dates[language].meridiem[date.getUTCHours() < 12 ? 0 : 1] : ''), g: (date.getUTCHours() % 12 === 0 ? 12 : date.getUTCHours() % 12), G: date.getUTCHours(), // minute i: date.getUTCMinutes(), // second s: date.getUTCSeconds() }; val.m = (val.n < 10 ? '0' : '') + val.n; val.d = (val.j < 10 ? '0' : '') + val.j; val.A = val.a.toString().toUpperCase(); val.h = (val.g < 10 ? '0' : '') + val.g; val.H = (val.G < 10 ? '0' : '') + val.G; val.i = (val.i < 10 ? '0' : '') + val.i; val.s = (val.s < 10 ? '0' : '') + val.s; } else { throw new Error('Invalid format type.'); } var date = [], seps = $.extend([], format.separators); for (var i = 0, cnt = format.parts.length; i < cnt; i++) { if (seps.length) { date.push(seps.shift()); } date.push(val[format.parts[i]]); } if (seps.length) { date.push(seps.shift()); } return date.join(''); }, convertViewMode: function (viewMode) { switch (viewMode) { case 4: case 'decade': viewMode = 4; break; case 3: case 'year': viewMode = 3; break; case 2: case 'month': viewMode = 2; break; case 1: case 'day': viewMode = 1; break; case 0: case 'hour': viewMode = 0; break; } return viewMode; }, headTemplate: '' + '' + '' + '' + '' + '' + '', headTemplateV3: '' + '' + ' ' + '' + ' ' + '' + '', contTemplate: '', footTemplate: '' + '' + '' + '' }; DPGlobal.template = '
' + '
' + '' + DPGlobal.headTemplate + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplate + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplate + '' + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplate + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplate + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
'; DPGlobal.templateV3 = '
' + '
' + '' + DPGlobal.headTemplateV3 + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplateV3 + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplateV3 + '' + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplateV3 + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
' + '' + DPGlobal.headTemplateV3 + DPGlobal.contTemplate + DPGlobal.footTemplate + '
' + '
' + '
'; $.fn.datetimepicker.DPGlobal = DPGlobal; /* DATETIMEPICKER NO CONFLICT * =================== */ $.fn.datetimepicker.noConflict = function () { $.fn.datetimepicker = old; return this; }; /* DATETIMEPICKER DATA-API * ================== */ $(document).on( 'focus.datetimepicker.data-api click.datetimepicker.data-api', '[data-provide="datetimepicker"]', function (e) { var $this = $(this); if ($this.data('datetimepicker')) return; e.preventDefault(); // component click requires us to explicitly show it $this.datetimepicker('show'); } ); $(function () { $('[data-provide="datetimepicker-inline"]').datetimepicker(); }); })); ; /** * Ukrainian translation for bootstrap-datepicker * Igor Polynets */ (function ($) { $.fn.datetimepicker.dates['zh-TW'] = { days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], daysShort: ["週日", "週一", "週二", "週三", "週四", "週五", "週六", "週日"], daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], meridiem: ["上午", "下午"], today: "今天", clear: "清除" }; }(jQuery)); ; // Closure (function () { /** * Decimal adjustment of a number. * * @param {String} type The type of adjustment. * @param {Number} value The number. * @param {Integer} exp The exponent (the 10 logarithm of the adjustment base). * @returns {Number} The adjusted value. */ function decimalAdjust(type, value, exp) { // If the exp is undefined or zero... if (typeof exp === 'undefined' || +exp === 0) { return Math[type](value); } value = +value; exp = +exp; // If the value is not a number or the exp is not an integer... if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) { return NaN; } // Shift value = value.toString().split('e'); value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))); // Shift back value = value.toString().split('e'); return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)); } // Decimal round if (!Math.round10) { Math.round10 = function (value, exp) { return decimalAdjust('round', value, exp); }; } // Decimal floor if (!Math.floor10) { Math.floor10 = function (value, exp) { return decimalAdjust('floor', value, exp); }; } // Decimal ceil if (!Math.ceil10) { Math.ceil10 = function (value, exp) { return decimalAdjust('ceil', value, exp); }; } })();; /*! * Vue.js v2.6.11 * (c) 2014-2019 Evan You * Released under the MIT License. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(z)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!z&&!V&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Pe(String,i.type);(c<0||s0&&(st((u=e(u,(a||"")+"_"+c))[0])&&st(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?st(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):st(u)&&st(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function st(e){return n(e)&&n(e.text)&&!1===e.isComment}function ct(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=pt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=dt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function pt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:at(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function dt(e,t){return function(){return e[t]}}function vt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;idocument.createEvent("Event").timeStamp&&(sn=function(){return cn.now()})}function un(){var e,t;for(an=sn(),rn=!0,Qt.sort(function(e,t){return e.id-t.id}),on=0;onon&&Qt[n].id>e.id;)n--;Qt.splice(n+1,0,e)}else Qt.push(e);nn||(nn=!0,Ye(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:S,set:S};function dn(e,t,n){pn.get=function(){return this[t][n]},pn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,pn)}function vn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);xe(r,o,a),o in e||dn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return Re(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&dn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new fn(e,a||S,S,hn)),i in e||mn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function An(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=xn(a.componentOptions);s&&!t(s)&&On(n,o,r,i)}}}function On(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=bn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De($n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ut(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Yt(n,"beforeCreate"),function(e){var t=ct(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),vn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Yt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(wn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(wn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&On(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Ye,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),M.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Tn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Cn(e),function(e){M.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(wn),Object.defineProperty(wn.prototype,"$isServer",{get:te}),Object.defineProperty(wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wn,"FunctionalRenderContext",{value:Tt}),wn.version="2.6.11";var En=p("style,class"),Nn=p("input,textarea,option,select,progress"),jn=function(e,t,n){return"value"===n&&Nn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Dn=p("contenteditable,draggable,spellcheck"),Ln=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Hn(t)||"false"===t?"false":"contenteditable"===e&&Ln(t)?t:"true"},In=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Fn="http://www.w3.org/1999/xlink",Pn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Rn=function(e){return Pn(e)?e.slice(6,e.length):""},Hn=function(e){return null==e||!1===e};function Bn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Un(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Un(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Vn(t));return""}(t.staticClass,t.class)}function Un(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Vn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?hr(e,t,n):In(t)?Hn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Mn(t,n)):Pn(t)?Hn(n)?e.removeAttributeNS(Fn,Rn(t)):e.setAttributeNS(Fn,t,n):hr(e,t,n)}function hr(e,t,n){if(Hn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var mr={create:dr,update:dr};function yr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Bn(r),c=i._transitionClasses;n(c)&&(s=zn(s,Vn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var gr,_r,br,$r,wr,Cr,xr={create:yr,update:yr},kr=/[\w).+\-_$\]]/;function Ar(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&kr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,$r),key:'"'+e.slice($r+1)+'"'}:{exp:e,key:null};_r=e,$r=wr=Cr=0;for(;!zr();)Vr(br=Ur())?Jr(br):91===br&&Kr(br);return{exp:e.slice(0,wr),key:e.slice(wr+1,Cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Ur(){return _r.charCodeAt(++$r)}function zr(){return $r>=gr}function Vr(e){return 34===e||39===e}function Kr(e){var t=1;for(wr=$r;!zr();)if(Vr(e=Ur()))Jr(e);else if(91===e&&t++,93===e&&t--,0===t){Cr=$r;break}}function Jr(e){for(var t=e;!zr()&&(e=Ur())!==t;);}var qr,Wr="__r",Zr="__c";function Gr(e,t,n){var r=qr;return function i(){null!==t.apply(null,arguments)&&Qr(e,i,n,r)}}var Xr=Ve&&!(X&&Number(X[1])<=53);function Yr(e,t,n,r){if(Xr){var i=an,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}qr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function Qr(e,t,n,r){(r||qr).removeEventListener(e,t._wrapper||t,n)}function ei(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};qr=r.elm,function(e){if(n(e[Wr])){var t=q?"change":"input";e[t]=[].concat(e[Wr],e[t]||[]),delete e[Wr]}n(e[Zr])&&(e.change=[].concat(e[Zr],e.change||[]),delete e[Zr])}(i),rt(i,o,Yr,Qr,Gr,r.context),qr=void 0}}var ti,ni={create:ei,update:ei};function ri(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);ii(a,u)&&(a.value=u)}else if("innerHTML"===i&&qn(a.tagName)&&t(a.innerHTML)){(ti=ti||document.createElement("div")).innerHTML=""+o+"";for(var l=ti.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function ii(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var oi={create:ri,update:ri},ai=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function si(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?O(e):"string"==typeof e?ai(e):e}var ui,li=/^--/,fi=/\s*!important$/,pi=function(e,t,n){if(li.test(t))e.style.setProperty(t,n);else if(fi.test(n))e.style.setProperty(C(t),n.replace(fi,""),"important");else{var r=vi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(yi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function _i(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function bi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,$i(e.name||"v")),A(t,e),t}return"string"==typeof e?$i(e):void 0}}var $i=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),wi=z&&!W,Ci="transition",xi="animation",ki="transition",Ai="transitionend",Oi="animation",Si="animationend";wi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ki="WebkitTransition",Ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi="WebkitAnimation",Si="webkitAnimationEnd"));var Ti=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ti(function(){Ti(e)})}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gi(e,t))}function ji(e,t){e._transitionClasses&&h(e._transitionClasses,t),_i(e,t)}function Di(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ci?Ai:Si,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=Ci,l=a,f=o.length):t===xi?u>0&&(n=xi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ci:xi:null)?n===Ci?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ci&&Li.test(r[ki+"Property"])}}function Ii(e,t){for(;e.length1}function Ui(e,t){!0!==t.data.show&&Pi(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Wi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function qi(e,t){return t.every(function(t){return!N(t,e)})}function Wi(e){return"_value"in e?e._value:e.value}function Zi(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,"input"))}function Xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Yi(e){return!e.componentInstance||e.data&&e.data.transition?e:Yi(e.componentInstance._vnode)}var Qi={model:Vi,show:{bind:function(e,t,n){var r=t.value,i=(n=Yi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Pi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Yi(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,function(){e.style.display=e.__vOriginalDisplay}):Ri(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},eo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function to(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?to(zt(t.children)):e}function no(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function ro(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var io=function(e){return e.tag||Ut(e)},oo=function(e){return"show"===e.name},ao={name:"transition",props:eo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(io)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=to(o);if(!a)return o;if(this._leaving)return ro(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=no(this),u=this._vnode,l=to(u);if(a.data.directives&&a.data.directives.some(oo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!Ut(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,it(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),ro(e,o);if("in-out"===r){if(Ut(a))return u;var p,d=function(){p()};it(c,"afterEnter",d),it(c,"enterCancelled",d),it(f,"delayLeave",function(e){p=e})}}return o}}},so=A({tag:String,moveClass:String},eo);function co(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function uo(e){e.data.newPos=e.elm.getBoundingClientRect()}function lo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete so.mode;var fo={Transition:ao,TransitionGroup:{props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=no(this),s=0;s-1?Gn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Gn[e]=/HTMLUnknownElement/.test(t.toString())},A(wn.options.directives,Qi),A(wn.options.components,fo),wn.prototype.__patch__=z?zi:S,wn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Yt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new fn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Yt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Yt(e,"mounted")),e}(this,e=e&&z?Yn(e):void 0,t)},z&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",wn)},0);var po=/\{\{((?:.|\r?\n)+?)\}\}/g,vo=/[-.*+?^${}()|[\]\/\\]/g,ho=g(function(e){var t=e[0].replace(vo,"\\$&"),n=e[1].replace(vo,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var mo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Fr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Ir(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var yo,go={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Fr(e,"style");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Ir(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},_o=function(e){return(yo=yo||document.createElement("div")).innerHTML=e,yo.textContent},bo=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),$o=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),wo=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Co=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xo=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Ao="((?:"+ko+"\\:)?"+ko+")",Oo=new RegExp("^<"+Ao),So=/^\s*(\/?)>/,To=new RegExp("^<\\/"+Ao+"[^>]*>"),Eo=/^]+>/i,No=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Io=/&(?:lt|gt|quot|amp|#39);/g,Fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Po=p("pre,textarea",!0),Ro=function(e,t){return e&&Po(e)&&"\n"===t[0]};function Ho(e,t){var n=t?Fo:Io;return e.replace(n,function(e){return Mo[e]})}var Bo,Uo,zo,Vo,Ko,Jo,qo,Wo,Zo=/^@|^v-on:/,Go=/^v-|^@|^:|^#/,Xo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Yo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qo=/^\(|\)$/g,ea=/^\[.*\]$/,ta=/:(.*)$/,na=/^:|^\.|^v-bind:/,ra=/\.[^.\]]+(?=[^\]]*$)/g,ia=/^v-slot(:|$)|^#/,oa=/[\r\n]/,aa=/\s+/g,sa=g(_o),ca="_empty_";function ua(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ma(t),rawAttrsMap:{},parent:n,children:[]}}function la(e,t){Bo=t.warn||Sr,Jo=t.isPreTag||T,qo=t.mustUseProp||T,Wo=t.getTagNamespace||T;t.isReservedTag;zo=Tr(t.modules,"transformNode"),Vo=Tr(t.modules,"preTransformNode"),Ko=Tr(t.modules,"postTransformNode"),Uo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=fa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&da(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&da(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Jo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Do(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Ro(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(No.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(jo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(To);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ro(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(To.test($)||Oo.test($)||No.test($)||jo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(Oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(So))&&(r=e.match(xo)||e.match(Co));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&wo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Wo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Ar(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Br(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Br(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Br(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Br(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Wr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Br(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Hr(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:bo,mustUseProp:jn,canBeLeftOpenTag:$o,isReservedTag:Wn,getTagNamespace:Zn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(ba)},xa=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function ka(e,t){e&&($a=xa(t.staticKeys||""),wa=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!wa(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every($a)))}(t);if(1===t.type){if(!wa(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,Oa=/\([^)]*?\);*$/,Sa=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ta={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Na=function(e){return"if("+e+")return null;"},ja={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Na("$event.target !== $event.currentTarget"),ctrl:Na("!$event.ctrlKey"),shift:Na("!$event.shiftKey"),alt:Na("!$event.altKey"),meta:Na("!$event.metaKey"),left:Na("'button' in $event && $event.button !== 0"),middle:Na("'button' in $event && $event.button !== 1"),right:Na("'button' in $event && $event.button !== 2")};function Da(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=La(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function La(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return La(e)}).join(",")+"]";var t=Sa.test(e.value),n=Aa.test(e.value),r=Sa.test(e.value.replace(Oa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ja[s])o+=ja[s],Ta[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=Na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ta[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ia={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Fa=function(e){this.options=e,this.warn=e.warn||Sr,this.transforms=Tr(e.modules,"transformCode"),this.dataGenFns=Tr(e.modules,"genData"),this.directives=A(A({},Ia),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Pa(e,t){var n=new Fa(t);return{render:"with(this){return "+(e?Ra(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ra(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ha(e,t);if(e.once&&!e.onceProcessed)return Ba(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Ua(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=qa(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?Ga((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:qa(t,n,!0);return"_c("+e+","+Va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Va(e,t));var i=e.inlineTemplate?null:qa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Pa(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Ga(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ka(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ka))}function Ja(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Ua(e,t,Ja,"null");if(e.for&&!e.forProcessed)return za(e,t,Ja);var r=e.slotScope===ca?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(qa(e,t)||"undefined")+":undefined":qa(e,t)||"undefined":Ra(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function qa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ra)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r':'
',ts.innerHTML.indexOf(" ")>0}var os=!!z&&is(!1),as=!!z&&is(!0),ss=g(function(e){var t=Yn(e);return t&&t.innerHTML}),cs=wn.prototype.$mount;return wn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ss(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=rs(r,{outputSourceRange:!1,shouldDecodeNewlines:os,shouldDecodeNewlinesForHref:as,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return cs.call(this,e,t)},wn.compile=rs,wn});; function extend(obj1,obj2){for(var attr in obj2){obj1[attr]=obj2[attr];}} function SetStep(arg){this.body=document.body;this.opt={skin:1,show:false,content:'.stepCont',pageCont:'.pageCont',imgWidth:20,stepContainerMar:20,nextBtn:'.nextBtn',prevBtn:'.prevBtn',steps:['01','02','03'],descriptionHeader:['步骤一','步骤二','步骤三'],description:['','',''],stepCounts:3,curStep:1,animating:false,showBtn:true,clickAble:true,onLoad:function(){}};var options=$.extend({},this.opt,arg);switch(options.skin){case 1:this.init(arg);break;case 2:$(options.content).addClass("stepY");this.initY(arg);break;case 3:$(options.content).addClass("jiantou");this.initJanTou(arg);break;default:this.init(arg);}} SetStep.prototype.initJanTou=function(arg){var _that=this;extend(this.opt,arg);this.opt.stepCounts=this.opt.steps.length;this.content=$(this.opt.content);this.pageCont=this.content.find(this.opt.pageCont);var w_con=$(this.content).width();var w_li=(w_con-this.opt.stepContainerMar*2)/this.opt.stepCounts/2;var stepContainer=this.content.find('.ystep-container');this.stepContainer=stepContainer;var stepsHtml=$("
    ");var stepDisc="
  • ";var stepP=$("
    "+ "

    "+ "
    ");var stepButtonHtml=$("
    "+ "
    ");stepP.css('width',w_li*2*(this.opt.stepCounts-1));stepP.find('.ystep-progress-bar').css('width',w_li*2*(this.opt.stepCounts-1)) for(var i=0;i'+this.opt.steps[i]+''+this.opt.descriptionHeader[i]+'').addClass('')}else{var _s=$(stepDisc).html(''+this.opt.steps[i]+''+this.opt.descriptionHeader[i]+'')} stepsHtml.append(_s);} stepsHtml.find('li').css('width',w_li*2).css("padding-left","0px") stepContainer.append(stepsHtml).append(stepP);stepContainer.css('left',(w_con-stepP.width()-this.opt.imgWidth-0-this.opt.stepContainerMar*2)/3-120) stepContainer.css('height',stepsHtml.height()-20);this.content.css('overflow','hidden') this.setProgress(this.stepContainer,this.opt.curStep,this.opt.stepCounts) if(this.opt.showBtn){this.content.append(stepButtonHtml) this.prevBtn=this.content.find(this.opt.prevBtn) this.nextBtn=this.content.find(this.opt.nextBtn) this.prevBtn.on('click',function(){if($(_that).attr('disabled')||_that.opt.animating){return false;}else{_that.opt.animating=true;_that.opt.curStep--;_that.setProgress(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)}}) this.nextBtn.on('click',function(){if($(_that).attr('disabled')||_that.opt.animating){return false;}else{_that.opt.animating=true;_that.opt.curStep++;_that.setProgress(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)}})} if(this.opt.clickAble){stepsHtml.find('li').on('click',function(){_that.opt.curStep=$(this).index()+1;_that.setProgress(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)})} $(window).resize(function(){var w_con=$(_that.content).width();var w_li=w_con/_that.opt.stepCounts/2;stepP.css('width',w_li*2*(_that.opt.stepCounts-1));stepP.find('.ystep-progress-bar').css('width',w_li*2*(_that.opt.stepCounts-1)) stepsHtml.find('li').css('width',w_li*2).css("padding-left","0px") stepContainer.css('left',(w_con-stepP.width()-_that.opt.imgWidth-10-_that.opt.stepContainerMar*2)/2-120)})} SetStep.prototype.init=function(arg){var _that=this;extend(this.opt,arg);this.opt.stepCounts=this.opt.steps.length;this.content=$(this.opt.content);this.pageCont=this.content.find(this.opt.pageCont);var w_con=$(this.content).width();var w_li=(w_con-this.opt.stepContainerMar*2)/this.opt.stepCounts/2;var stepContainer=this.content.find('.ystep-container');this.stepContainer=stepContainer;var stepsHtml=$("
      ");var stepDisc="
    • ";var stepP=$("
      "+ "

      "+ "
      ");var stepButtonHtml=$("
      "+ "
      ");stepP.css('width',w_li*2*(this.opt.stepCounts-1));stepP.find('.ystep-progress-bar').css('width',w_li*2*(this.opt.stepCounts-1)) for(var i=0;i'+this.opt.steps[i]+'

      '+this.opt.descriptionHeader[i]+'

      '+this.opt.description[i]+'
      ').addClass('')}else{var _s=$(stepDisc).html(''+this.opt.steps[i]+'

      '+this.opt.descriptionHeader[i]+'

      '+this.opt.description[i]+'
      ')} stepsHtml.append(_s);} stepsHtml.find('li').css('width','40px').css('marginRight',w_li*2-40) stepContainer.append(stepsHtml).append(stepP);stepContainer.css('left',(w_con-stepP.width()-this.opt.imgWidth-10-this.opt.stepContainerMar*2)/2) stepContainer.css('height',stepsHtml.height()-25);this.content.css('overflow','hidden') this.setProgress(this.stepContainer,this.opt.curStep,this.opt.stepCounts) if(this.opt.showBtn){this.content.append(stepButtonHtml) this.prevBtn=this.content.find(this.opt.prevBtn) this.nextBtn=this.content.find(this.opt.nextBtn) this.prevBtn.on('click',function(){if($(_that).attr('disabled')||_that.opt.animating){return false;}else{_that.opt.animating=true;_that.opt.curStep--;_that.setProgress(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)}}) this.nextBtn.on('click',function(){if($(_that).attr('disabled')||_that.opt.animating){return false;}else{_that.opt.animating=true;_that.opt.curStep++;_that.setProgress(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)}})} if(this.opt.clickAble){stepsHtml.find('li').on('click',function(){_that.opt.curStep=$(this).index()+1;_that.setProgress(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)})} $(window).resize(function(){var w_con=$(_that.content).width();var w_li=w_con/_that.opt.stepCounts/2;stepP.css('width',w_li*2*(_that.opt.stepCounts-1));stepP.find('.ystep-progress-bar').css('width',w_li*2*(_that.opt.stepCounts-1)) stepsHtml.find('li').css('width','40px').css('marginRight',w_li*2-40) stepContainer.css('left',(w_con-stepP.width()-_that.opt.imgWidth-10-_that.opt.stepContainerMar*2)/2)})} SetStep.prototype.initY=function(arg){var _that=this;extend(this.opt,arg);this.opt.stepCounts=this.opt.steps.length;this.content=$(this.opt.content);this.pageCont=this.content.find(this.opt.pageCont);var w_con=$(this.content).width();var h_con=$(this.content).height();console.log(h_con,w_con) var w_li=(w_con-this.opt.stepContainerMar*2)/this.opt.stepCounts/2-60;var h_li=(h_con-this.opt.stepContainerMar*2)/this.opt.stepCounts/2;var stepContainer=this.content.find('.ystep-container');this.stepContainer=stepContainer;var stepsHtml=$("
        ");var stepDisc="
      • ";var stepP=$("
        "+ "

        "+ "
        ");var stepButtonHtml=$("
        "+ "
        ");stepP.css('height',w_li*2*(this.opt.stepCounts-1));stepP.find('.ystep-progress-bar').css('height',w_li*2*(this.opt.stepCounts-1)) for(var i=0;i'+this.opt.steps[i]+'

        '+this.opt.descriptionHeader[i]+'

        '+this.opt.description[i]+'
        ').addClass('')}else{var _s=$(stepDisc).html(''+this.opt.steps[i]+'

        '+this.opt.descriptionHeader[i]+'

        '+this.opt.description[i]+'
        ')} stepsHtml.append(_s);} stepsHtml.find('li').css('height','40px').css('marginBottom',w_li*2-40) stepContainer.append(stepsHtml).append(stepP);stepContainer.css('height',stepsHtml.height()-25);this.setProgressY(this.stepContainer,this.opt.curStep,this.opt.stepCounts) if(this.opt.showBtn){this.content.append(stepButtonHtml) this.prevBtn=this.content.find(this.opt.prevBtn) this.nextBtn=this.content.find(this.opt.nextBtn) this.prevBtn.on('click',function(){if($(_that).attr('disabled')||_that.opt.animating){return false;}else{_that.opt.animating=true;_that.opt.curStep--;_that.setProgressY(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)}}) this.nextBtn.on('click',function(){if($(_that).attr('disabled')||_that.opt.animating){return false;}else{_that.opt.animating=true;_that.opt.curStep++;_that.setProgressY(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)}})} if(this.opt.clickAble){stepsHtml.find('li').on('click',function(){_that.opt.curStep=$(this).index()+1;_that.setProgressY(_that.stepContainer,_that.opt.curStep,_that.opt.stepCounts)})}} SetStep.prototype.setProgressY=function(n,curIndex,stepsLen){var _that=this;var $steps=$(n).find("li");var $progress=$(n).find(".ystep-progress-highlight");if(1<=curIndex&&curIndex<=$steps.length){var scale="%";scale=Math.round((curIndex-1)*100/($steps.length-1))+scale;$progress.animate({height:scale},{speed:1000,done:function(){$steps.each(function(j,m){var _$m=$(m);var _j=j+1;if(_jcurIndex){_$m.attr("class","ystep-step-undone");}}) if(_that.opt.showBtn){if(curIndex==1){_that.prevBtn.attr('disabled','true') _that.nextBtn.removeAttr('disabled')}else if(curIndex==stepsLen){_that.prevBtn.removeAttr('disabled') _that.nextBtn.attr('disabled','true')}else if(1curIndex){_$m.attr("class","ystep-step-undone");}}) if(_that.opt.showBtn){if(curIndex==1){_that.prevBtn.attr('disabled','true') _that.nextBtn.removeAttr('disabled')}else if(curIndex==stepsLen){_that.prevBtn.removeAttr('disabled') _that.nextBtn.attr('disabled','true')}else if(1 0) itemsAmount = $.map(this.BuyedItems, o => o.SubTotal).reduce((pre, cur) => pre + cur); var extrasAmount = 0; var extras = this.BuyedExtras.filter((idx, el) => el.IsInClude === false); if (extras.length > 0) extrasAmount = $.map(extras, o => o.SubTotal).reduce((pre, cur) => pre + cur); var total = itemsAmount + extrasAmount; this.Result.Group.TotalAmount = total; return total; }, // 產品title的div內容 團名+全程說明 ProductTitleHtml: function () { return this.Result.Group.Name + '' + (this.Result.Group.JoinAllExplain ? ('[' + this.Result.Group.JoinAllExplain + ']') : "" )+''; }, // 大人數量 AdultCount: function () { return this.AdultTotal; }, // 小孩數量 ChildCount: function () { return this.ChildTotal; }, // 嬰兒數量 BabyCount: function () { return this.BabyTotal; }, // 總人數 TotalCount: function () { return this.AdultCount + this.ChildCount + this.BabyCount; }, // 總人數(Y艙) YTotalCount: function () { return this.TotalCount - this.EDTotalCount - this.CTotalCount - this.FTotalCount; }, hasEDClass: function () { return (this.Result.Group.Extras.find(extra => extra.ClassType === "ED") != null); }, hasCClass: function () { return (this.Result.Group.Extras.find(extra => extra.ClassType === "C") != null); }, hasFClass: function () { return (this.Result.Group.Extras.find(extra => extra.ClassType === "F") != null); }, // 總人數(ED艙) EDTotalCount: function () { return this.hasEDClass ? this.Result.Group.Extras.find(extra => extra.ClassType === "ED").Count : 0; }, // 總人數(C艙) CTotalCount: function () { return this.hasCClass ? this.Result.Group.Extras.find(extra => extra.ClassType === "C").Count : 0; }, // 總人數(F艙) FTotalCount: function () { return this.hasFClass ? this.Result.Group.Extras.find(extra => extra.ClassType === "F").Count : 0; }, // ED艙加價 EDUnit: function () { return this.hasEDClass ? this.Result.Group.Extras.find(extra => extra.ClassType === "ED").Unit : 0; }, // C艙加價 CUnit: function () { return this.hasCClass ? this.Result.Group.Extras.find(extra => extra.ClassType === "C").Unit : 0; }, // F艙加價 FUnit: function () { return this.hasFClass ? this.Result.Group.Extras.find(extra => extra.ClassType === "F").Unit : 0; }, // 不包含嬰兒的人數 SeatCount: function () { return this.AdultCount + this.ChildCount; }, //可售人數(Y艙) YAvailableCount: function () { return this.Result.Group.YClassAvailableCount; }, //可售人數(ED艙) EDAvailableCount: function () { return this.Result.Group.EDClassAvailableCount; }, //可售人數(C艙) CAvailableCount: function () { return this.Result.Group.CClassAvailableCount; }, //可售人數(F艙) FAvailableCount: function () { return this.Result.Group.FClassAvailableCount; }, //報名狀態(2:候補/3:可報名) SignUpStatus: function () { if (this.Result.Group.SignUpStatus == 2 || (this.Result.Group.SignUpStatus == 3 && this.Result.Group.IsGroupConfirm == true)) return 2; return this.Result.Group.SignUpStatus; }, //顯示在畫面上的額外購買項目列表 ExtraList: function () { var extraList = this.Result.Group.Extras.filter((extra) => (extra.Unit !== 0 && extra.Name !== "") || extra.IsPayFirst || extra.IsInClude || extra.IsMustBuy); if (this.EDAvailableCount <= 0) extraList = extraList.filter((extra) => extra.ClassType != "ED"); if (this.CAvailableCount <= 0) extraList = extraList.filter((extra) => extra.ClassType != "C"); if (this.FAvailableCount <= 0) extraList = extraList.filter((extra) => extra.ClassType != "F"); return extraList; }, // 購買的項目 BuyedItems: function () { return $(this.Result.Group.Items).filter((index, element) => Number(element.Count) > 0); }, // 購買的額外項目 BuyedExtras: function () { return $(this.Result.Group.Extras).filter((index, element) => Number(element.Count) > 0); }, ////國內/國外旅遊契約書URL //TravelContractUrl: function () { // return this.Result.Group.IsForeign ? this.Result.ForeignTravelContractUrl : this.Result.InternalTravelContractUrl; //}, //國內/國外旅遊契約書 TravelContract: function () { return this.Result.Group.IsForeign ? this.Result.ForeignTravelContract : this.Result.InternalTravelContract; }, //更新訂購人資訊 UpdateOrderer: function () { this.Result.Orderer.Mobile = $('.subscriber_info_content [data-rel="mobile"]').val(); this.Result.Orderer.Email = $('.subscriber_info_content [data-rel="email"]').val(); this.Result.Orderer.Name = $('.subscriber_info_content [data-rel="name"]').val(); this.CutName; }, //分割名字 CutName: function () { var eventName = this.Result.Orderer.Name; if (eventName.indexOf(' ') >= 0) { this.Result.Orderer.LastName = eventName.substring(0, eventName.indexOf(' ')); this.Result.Orderer.FirstName = eventName.substring(eventName.indexOf(' ')); } else { this.Result.Orderer.LastName = eventName.substring(0, 1); this.Result.Orderer.FirstName = eventName.substring(1); } }, //能否從step1 to step2 CanNextStep: function () { return this.CanNext; } }, //監控項目, 重新判斷是否能到下一步 watch: { checkCanNextStep: function () { if (!this.checkCanNextStep == false) { this.ExeCheckCanNextStep(); } }, IsAgreeContract: function () { this.ExeCheckCanNextStep(); }, AdultCount: function () { this.ExeCheckCanNextStep(); } }, mounted: function () { let self = this; window.mobile_checker.addEventListener(window.mobile_checker.Events.MobileVerify, function (event) { self.CheckValidate(); }); window.mobile_checker.addEventListener(window.mobile_checker.Events.NameChange, function (event) { var eventName = $.trim(event.detail.value); self.Result.Orderer.Name = eventName; //2022-02-23: [Jacky][PMK103306] - 點"同訂購人"才會帶入 self.CutName; self.CheckValidate(); }); window.mobile_checker.addEventListener(window.mobile_checker.Events.EmailChange, function (event) { self.Result.Orderer.Email = event.detail.value; self.CheckValidate(); }); window.mobile_checker.addEventListener(window.mobile_checker.Events.MobileChange, function (event) { self.Result.Orderer.Mobile = event.detail.value; self.CheckValidate(); }); }, methods: { // 訂購人欄位驗證 CheckValidate: function () { this.CheckName(); this.CheckEmail(); this.CheckMobile(); this.IsValidate = (window.mobile_checker.isVerified()); }, CheckName: function () { if (!this.Result.Orderer.Name) this.NameValidate = false; else this.NameValidate = true; }, CheckEmail: function () { if (!this.Result.Orderer.Email) this.EmailValidate = false; else this.EmailValidate = true; }, CheckMobile: function () { if (!this.Result.Orderer.Mobile) this.MobileValidate = false; else this.MobileValidate = true; }, // 金額格式化 CurrentStr: function (value) { return this.Result.ShowPriceFormat.replace('{Price}', Number(value.toFixed(1)).toLocaleString()); }, // 計算主項目的小計 CalcItemSubTotal: function (index) { this.Result.Group.Items[index].SubTotal = this.Result.Group.Items[index].Unit * GetListCount(index); }, // 計算額外項目的小計 CalcExtraSubTotal: function (index) { this.ExtraList[index].SubTotal = this.ExtraList[index].Unit * this.ExtraList[index].Count; }, // 當變更參團人數時,必買和包含在團費裡的附加項目數量也須更改 ChangeItemCount: function () { for (var extra of this.ExtraList) { if (extra.IsMustBuy || extra.IsInClude) { if (extra.Type === "1") { extra.Count = this.AdultCount; } else if (extra.Type === "2") { extra.Count = this.ChildCount; } else { extra.Count = this.TotalCount; } } //數量異常修正(選購數量大於對應類型數量) if (extra.Type === "1" && extra.Count > this.AdultCount) { extra.Count = this.AdultCount; } else if (extra.Type === "2" && extra.Count > this.ChildCount) { extra.Count = this.ChildCount; } else if (extra.Count > this.TotalCount){ extra.Count = this.TotalCount; } this.CalcExtraSubTotal(this.ExtraList.indexOf(extra)); } }, //檢查是否能夠到下一步驟, 切換按鈕圖示 ExeCheckCanNextStep: function () { //使用者狀態異常(審核中、被關閉等等) if (this.Result.UserStatusError) return false; //訂購狀態確認 if (!this.Result.Group.AllowSignUp) return false; var checkResult = this.IsAgreeContract && (window.mobile_checker.isVerified()) && this.BuyedItems.length > 0 && this.AdultCount >= 1; if (checkResult) { $("#nextButton").removeClass("l_benNoopen"); $("#nextButton").addClass("l_benPrimary"); this.CanNext = true; } else { $("#nextButton").removeClass("l_benPrimary"); $("#nextButton").addClass("l_benNoopen"); this.CanNext = false; } this.checkCanNextStep = false; }, // 第一步送出至第二步 Check: function () { if (!this.Result.Group.AllowSignUp) { return false; } window.mobile_checker.setSubmitFlag(); // 點了確認訂購 [jacky] this.CheckValidate(); if (!this.CanNextStep) { if (!this.IsValidate) { $(window).scrollTop(0); } else if (!this.IsAgreeContract) { alert('請閱讀並同意「訂購須知」、「旅遊契約書」、及「隱私權政策」。'); } else { $(window).scrollTop(0); } return false; } else { // 團控核准或引用團(不跳訊息) /*if (this.Result.Group.SignUpStatus === 3 && (this.Result.Group.IsGroupConfirm || this.Result.Group.SAcctNo)) { alert('此團將由專人為您再次確認機位狀態,請按[確定]進行報名流程。'); } else if (this.Result.Group.SignUpStatus === 2 || this.Result.Group.WaitingCount) { alert('您好,本產品尚有候補訂單未確認,您的訂單將成為候補訂單,暫不需付款!\n確認訂單後,客服人員將盡快與您聯繫!'); } else if (this.YTotalCount > this.YAvailableCount || this.EDTotalCount > this.EDAvailableCount || this.CTotalCount > this.CAvailableCount || this.FTotalCount > this.FAvailableCount) { alert('您好,訂購人數超過可售機位,您的訂單將成為候補訂單,暫不需付款!\n確認訂單後,客服人員將盡快與您聯繫!'); }*/ CreatBuyedItems(this); this.UpdateOrderer; SumbitForm(this.Result); } }, // 更改步驟 ClickStepButton: function (obj) { var newStep = $(obj).index() + 1; // 只能往前更改步驟,若已完成訂單則不可更改 if (newStep < this.step.opt.curStep && this.step.opt.curStep !== this.step.opt.stepCounts) { this.ChangeStep(newStep); } }, // 變更步驟 ChangeStep: function (newStep) { this.step.opt.animating = true; this.step.opt.curStep = newStep; this.step.setProgress(this.step.stepContainer, this.step.opt.curStep, this.step.opt.stepCounts); }, // 立即付款 PayNow: function () { this.Result.IsPayFirst = true; this.Submit(); }, // 送出訂單 Submit: function () { var vm = this; var data = this.Result; delete data.PrivacyPolicy; delete data.OrderNotice; delete data.ForeignTravelContract; delete data.InternalTravelContract; $.post($(this.$el).data('submitUrl'), data, function (data) { vm.Redirect(data); }); }, // 完成後導頁 Redirect: function (data) { var redirectUrl = ""; if (data.Success) { redirectUrl = $(this.$el).data('finishUrl') + '/' + data.Order.ID; if (data.PayUrl) { redirectUrl = data.PayUrl; } if (this.Result.IsVender && this.Result.IsSyncVender) { window.location.href = $(this.$el).data('redirectUrl') + '?redirect_url=' + redirectUrl; } else { window.location.href = redirectUrl; } } else { window.location.href = $(this.$el).data('failUrl') + '?errorcode=' + data.Type; } } }, updated: function () { if (this.YTotalCount === 0) return; } }); next(app); } //檢查這團會不會是候補團,會的話alert訊息 function CheckStandBy(vm) { if (vm.Result.AlertSubstituteMsg) // 是否要提示為候補團 { alert('此團將由專人為您再次確認機位狀態,請按[確定]進行報名流程。'); vm.IsAlerted = true; } } //當使用者驗證或登入時觸發 function BindUserStatusChange(vm) { //驗證/登入時觸發事件 $('input[id$="IsMobileVerification"]').change(function (e) { $('[data-rel="travel_contract"]').trigger('setContract'); }); } function BindChangeCount(vm) { $('.select-num .select-btn').click(function (e) { /* Act on the event */ e.preventDefault(); // 未完成驗證不可更改訂購數量 //vm.CheckValidate();//如果vm.isVerified 需要執行過vm.CheckValidate() //if (!vm.isVerified) return; var isItem = $(this).parents('[data-rel="group-item"]').length > 0; var index = isItem ? $('[data-rel="group-item"]').index($(this).parents('[data-rel="group-item"]')) : $('[data-rel="group-extra"] .select-num').index($(this).parents('.select-num')); var total = 0; var allTotalCount = 0; var count = $(this).data('count'); var classTp = $(this).data('ctype'); total = parseInt($(this).parents('.select-num').find('.num').html()); if (count === 'minus') { total === 0 ? total = total : total--; } else { total++; allTotalCount = vm.YTotalCount + 1; } if (isItem) { //做人數上限判斷 if (count === 'add') { if (!CheckClassCount(vm, total, classTp)) { total--; } } //填入各艙等數量 AddClassCont(vm, total, classTp, index); //人數統計 CountEveryTotal(vm); vm.ChangeItemCount(); vm.CalcItemSubTotal(index); } else { // 額外項目數量上限限制 switch (vm.ExtraList[index].Type) { //大人 case "1": total = total > vm.AdultCount ? vm.AdultCount : total; break; //小孩 case "2": total = total > vm.ChildCount ? vm.ChildCount : total; break; //不限 default: total = total > vm.TotalCount ? vm.TotalCount : total; break; } vm.ExtraList[index].Count = total; vm.CalcExtraSubTotal(index); } CheckAllAddBtnStatus(vm); }); } //重計各類人數 function CountEveryTotal(vm) { var childTotal = 0; var babyTotal = 0; var adultTotal = 0; for (var Item of vm.Result.Group.Items) { if (Item.Type == "2" || Item.Type == "3") childTotal += GetListCount(vm.Result.Group.Items.indexOf(Item)); else if (Item.Type == "5") babyTotal += GetListCount(vm.Result.Group.Items.indexOf(Item)); else adultTotal += GetListCount(vm.Result.Group.Items.indexOf(Item)); } vm.BabyTotal = babyTotal; vm.ChildTotal = childTotal; vm.AdultTotal = adultTotal; } //取得該列數量 function GetListCount(index) { var total = 0; $('[data-rel="group-item"]:eq(' + index + ') .num').each(function () { total += parseInt($(this).html()); }); return total; } //填入各艙等數量 function AddClassCont(vm, num, tp, index) { $('[data-rel="group-item"]:eq(' + index + ') div[name="' + tp + 'Count"]').html(num); vm.Result.Group.Items[index].Count = GetListCount(index); if (tp != "Y") { var total = 0; $('div[name="' + tp + 'Count"]').each(function () { total += parseInt($(this).html()); }); vm.Result.Group.Extras.find(extra => extra.ClassType == tp).Count = total; } } //檢查各艙等數量 function CheckClassCount(vm, num, tp) { var returnValue = true; var classTotalCount = 1; var classAvailableCount = 0; switch (tp) { case "Y": classTotalCount += vm.YTotalCount; classAvailableCount = vm.YAvailableCount; break; case "ED": classTotalCount += vm.EDTotalCount; classAvailableCount = vm.EDAvailableCount; break; case "C": classTotalCount += vm.CTotalCount; classAvailableCount = vm.CAvailableCount; break; case "F": classTotalCount += vm.FTotalCount; classAvailableCount = vm.FAvailableCount; break; } //每項人數最多可以超過可售+10人 if (num > (classAvailableCount + 10)) { returnValue = false; } else if (!vm.IsAlerted && classTotalCount > classAvailableCount) { alert("注意!!訂購人數超過可售機位,您的訂單將成為候補訂單。") vm.IsAlerted = true; } //單筆訂單超過99人的話中台就會錯誤 if (vm.TotalCount+1 > 99) { returnValue = false; alert("請勿超過單筆訂單最高上限人數99位。") } return returnValue; } //檢查所有的+按鈕狀態 function CheckAllAddBtnStatus(vm) { //訂購內容"+"按鈕狀態確認 $('[data-rel="group-item"] [data-count="add"]').each(function () { var idx = $('[data-rel="group-item"]').index($(this).parents('[data-rel="group-item"]')); var classTp = $(this).data('ctype'); var classCount = 0; var classAvailableCount = 0; if (classTp === "Y") { classCount = vm.Result.Group.Items[idx].Count; } else { classCount = parseInt($(this).parents('.select-num').find('.num').html()); } switch (classTp) { case "Y": classAvailableCount = vm.YAvailableCount; break; case "ED": classAvailableCount = vm.EDAvailableCount; break; case "C": classAvailableCount = vm.CAvailableCount; break; case "F": classAvailableCount = vm.FAvailableCount; break; } if (classCount >= classAvailableCount + 10 || vm.TotalCount >= 99) $(this).addClass('select-btn-full'); else $(this).removeClass('select-btn-full'); }); //加購項目"+"按鈕狀態確認 $('[data-rel="group-extra"] [data-count="add"]').each(function () { // 額外項目數量上限限制 var idx = $('[data-rel="group-extra"] .select-num').index($(this).parents('.select-num')); switch (vm.ExtraList[idx].Type) { //大人 case "1": if (vm.ExtraList[idx].Count >= vm.AdultCount) $(this).addClass('select-btn-full'); else $(this).removeClass('select-btn-full'); break; //小孩 case "2": if (vm.ExtraList[idx].Count >= vm.ChildCount) $(this).addClass('select-btn-full'); else $(this).removeClass('select-btn-full'); break; //不限 default: if (vm.ExtraList[idx].Count >= vm.TotalCount) $(this).addClass('select-btn-full'); else $(this).removeClass('select-btn-full'); break; } }); } //由Items建立BuyedItems function CreatBuyedItems(vm) { var index = 0; var newCount = 0; for (var item of vm.Result.Group.Items) { if (item.Count > 0) { newCount = $('[data-rel="group-item"]:eq(' + vm.Result.Group.Items.indexOf(item) + ') div[name="YCount"]').html(); if (newCount > 0) { vm.Result.Group.BuyedItems[index] = { Count: newCount, JoinType: item.JoinType, Name: item.Name, PriceLevel: item.PriceLevel, SubTotal: newCount * item.Unit, Type: item.Type, Unit: item.Unit, ClassType: "Y" }; index++; } var extrasObj = vm.Result.Group.Extras.filter(extra => extra.ClassType === "ED" || extra.ClassType === "C" || extra.ClassType === "F"); var availableCount = 0; for (var extra of extrasObj) { switch (extra.ClassType) { case "ED": availableCount = vm.Result.Group.EDClassAvailableCount; break; case "C": availableCount = vm.Result.Group.CClassAvailableCount; break; case "F": availableCount = vm.Result.Group.FClassAvailableCount; break; } if (availableCount > 0) { newCount = $('[data-rel="group-item"]:eq(' + vm.Result.Group.Items.indexOf(item) + ') div[name="' + extra.ClassType + 'Count"]').html(); if (newCount > 0) { vm.Result.Group.BuyedItems[index] = { Count: newCount, JoinType: item.JoinType, Name: item.Name, PriceLevel: item.PriceLevel, SubTotal: newCount * (item.Unit + extra.Unit), Type: item.Type, Unit: item.Unit + extra.Unit, ClassType: extra.ClassType }; index++; } } } } } } function SumbitForm(data) { delete data.PrivacyPolicy; delete data.OrderNotice; delete data.ForeignTravelContract; delete data.InternalTravelContract; $('#frm').html(''); $('#frm').append(GetSubmitInput(data, [])); $('#frm').submit(); } function GetSubmitInput(obj, res, prefix, isarray) { Object.keys(obj).forEach(function (k) { var name = prefix ? prefix + '.' + k : k; if (isarray) { name = prefix ? prefix + '[' + k + ']' : k; } if (typeof obj[k] == 'object') { obj[k] && GetSubmitInput(obj[k], res, name, $.isArray(obj[k])); } else { res.push(''); } }); return res; } //取出內容不包含最外層html標籤 function getTextWithoutHtmlTag(str) { return $('
        ').html(str).text(); }; //< //data-rel="travel_contract" //data-action="url" //data-name-id="#ContractName" //data-contract-pdf-iframe-id="#ContractPDFIframe" //data-contract-pdf-download-link-id="#ContractPDFDownloadName" //> $(document).ready(function () { $(document).on("setContract", '[data-rel="travel_contract"]', function () { var _data = $(this).data(); $.get(_data.action, function (data) { if (!data.Error) { $(_data.nameId).html(data.ContractName); $(_data.contractPdfIframeId).prop('src', data.ContractPDFUrl); $(_data.contractPdfDownloadLinkId).prop('href', data.ContractPDFUrl + '&download=true'); } }) }); });;