]> git.r.bdr.sh - rbdr/sorting-hat-renderer/blob - assets/bundle.js
4141d106c87f9104441160230fedc2b7277c9624
[rbdr/sorting-hat-renderer] / assets / bundle.js
1 (function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["SortingHat"] = factory();
8 else
9 root["SortingHat"] = factory();
10 })(this, function() {
11 return /******/ (function(modules) { // webpackBootstrap
12 /******/ // The module cache
13 /******/ var installedModules = {};
14 /******/
15 /******/ // The require function
16 /******/ function __webpack_require__(moduleId) {
17 /******/
18 /******/ // Check if module is in cache
19 /******/ if(installedModules[moduleId]) {
20 /******/ return installedModules[moduleId].exports;
21 /******/ }
22 /******/ // Create a new module (and put it into the cache)
23 /******/ var module = installedModules[moduleId] = {
24 /******/ i: moduleId,
25 /******/ l: false,
26 /******/ exports: {}
27 /******/ };
28 /******/
29 /******/ // Execute the module function
30 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31 /******/
32 /******/ // Flag the module as loaded
33 /******/ module.l = true;
34 /******/
35 /******/ // Return the exports of the module
36 /******/ return module.exports;
37 /******/ }
38 /******/
39 /******/
40 /******/ // expose the modules object (__webpack_modules__)
41 /******/ __webpack_require__.m = modules;
42 /******/
43 /******/ // expose the module cache
44 /******/ __webpack_require__.c = installedModules;
45 /******/
46 /******/ // define getter function for harmony exports
47 /******/ __webpack_require__.d = function(exports, name, getter) {
48 /******/ if(!__webpack_require__.o(exports, name)) {
49 /******/ Object.defineProperty(exports, name, {
50 /******/ configurable: false,
51 /******/ enumerable: true,
52 /******/ get: getter
53 /******/ });
54 /******/ }
55 /******/ };
56 /******/
57 /******/ // getDefaultExport function for compatibility with non-harmony modules
58 /******/ __webpack_require__.n = function(module) {
59 /******/ var getter = module && module.__esModule ?
60 /******/ function getDefault() { return module['default']; } :
61 /******/ function getModuleExports() { return module; };
62 /******/ __webpack_require__.d(getter, 'a', getter);
63 /******/ return getter;
64 /******/ };
65 /******/
66 /******/ // Object.prototype.hasOwnProperty.call
67 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68 /******/
69 /******/ // __webpack_public_path__
70 /******/ __webpack_require__.p = "/assets/";
71 /******/
72 /******/ // Load entry module and return exports
73 /******/ return __webpack_require__(__webpack_require__.s = 2);
74 /******/ })
75 /************************************************************************/
76 /******/ ([
77 /* 0 */
78 /***/ (function(module, __webpack_exports__, __webpack_require__) {
79
80 "use strict";
81 /* WEBPACK VAR INJECTION */(function(process, global) {/*!
82 * Vue.js v2.4.2
83 * (c) 2014-2017 Evan You
84 * Released under the MIT License.
85 */
86 /* */
87
88 // these helpers produces better vm code in JS engines due to their
89 // explicitness and function inlining
90 function isUndef(v) {
91 return v === undefined || v === null;
92 }
93
94 function isDef(v) {
95 return v !== undefined && v !== null;
96 }
97
98 function isTrue(v) {
99 return v === true;
100 }
101
102 function isFalse(v) {
103 return v === false;
104 }
105
106 /**
107 * Check if value is primitive
108 */
109 function isPrimitive(value) {
110 return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
111 }
112
113 /**
114 * Quick object check - this is primarily used to tell
115 * Objects from primitive values when we know the value
116 * is a JSON-compliant type.
117 */
118 function isObject(obj) {
119 return obj !== null && typeof obj === 'object';
120 }
121
122 var _toString = Object.prototype.toString;
123
124 /**
125 * Strict object type check. Only returns true
126 * for plain JavaScript objects.
127 */
128 function isPlainObject(obj) {
129 return _toString.call(obj) === '[object Object]';
130 }
131
132 function isRegExp(v) {
133 return _toString.call(v) === '[object RegExp]';
134 }
135
136 /**
137 * Check if val is a valid array index.
138 */
139 function isValidArrayIndex(val) {
140 var n = parseFloat(val);
141 return n >= 0 && Math.floor(n) === n && isFinite(val);
142 }
143
144 /**
145 * Convert a value to a string that is actually rendered.
146 */
147 function toString(val) {
148 return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) : String(val);
149 }
150
151 /**
152 * Convert a input value to a number for persistence.
153 * If the conversion fails, return original string.
154 */
155 function toNumber(val) {
156 var n = parseFloat(val);
157 return isNaN(n) ? val : n;
158 }
159
160 /**
161 * Make a map and return a function for checking if a key
162 * is in that map.
163 */
164 function makeMap(str, expectsLowerCase) {
165 var map = Object.create(null);
166 var list = str.split(',');
167 for (var i = 0; i < list.length; i++) {
168 map[list[i]] = true;
169 }
170 return expectsLowerCase ? function (val) {
171 return map[val.toLowerCase()];
172 } : function (val) {
173 return map[val];
174 };
175 }
176
177 /**
178 * Check if a tag is a built-in tag.
179 */
180 var isBuiltInTag = makeMap('slot,component', true);
181
182 /**
183 * Check if a attribute is a reserved attribute.
184 */
185 var isReservedAttribute = makeMap('key,ref,slot,is');
186
187 /**
188 * Remove an item from an array
189 */
190 function remove(arr, item) {
191 if (arr.length) {
192 var index = arr.indexOf(item);
193 if (index > -1) {
194 return arr.splice(index, 1);
195 }
196 }
197 }
198
199 /**
200 * Check whether the object has the property.
201 */
202 var hasOwnProperty = Object.prototype.hasOwnProperty;
203 function hasOwn(obj, key) {
204 return hasOwnProperty.call(obj, key);
205 }
206
207 /**
208 * Create a cached version of a pure function.
209 */
210 function cached(fn) {
211 var cache = Object.create(null);
212 return function cachedFn(str) {
213 var hit = cache[str];
214 return hit || (cache[str] = fn(str));
215 };
216 }
217
218 /**
219 * Camelize a hyphen-delimited string.
220 */
221 var camelizeRE = /-(\w)/g;
222 var camelize = cached(function (str) {
223 return str.replace(camelizeRE, function (_, c) {
224 return c ? c.toUpperCase() : '';
225 });
226 });
227
228 /**
229 * Capitalize a string.
230 */
231 var capitalize = cached(function (str) {
232 return str.charAt(0).toUpperCase() + str.slice(1);
233 });
234
235 /**
236 * Hyphenate a camelCase string.
237 */
238 var hyphenateRE = /([^-])([A-Z])/g;
239 var hyphenate = cached(function (str) {
240 return str.replace(hyphenateRE, '$1-$2').replace(hyphenateRE, '$1-$2').toLowerCase();
241 });
242
243 /**
244 * Simple bind, faster than native
245 */
246 function bind(fn, ctx) {
247 function boundFn(a) {
248 var l = arguments.length;
249 return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
250 }
251 // record original fn length
252 boundFn._length = fn.length;
253 return boundFn;
254 }
255
256 /**
257 * Convert an Array-like object to a real Array.
258 */
259 function toArray(list, start) {
260 start = start || 0;
261 var i = list.length - start;
262 var ret = new Array(i);
263 while (i--) {
264 ret[i] = list[i + start];
265 }
266 return ret;
267 }
268
269 /**
270 * Mix properties into target object.
271 */
272 function extend(to, _from) {
273 for (var key in _from) {
274 to[key] = _from[key];
275 }
276 return to;
277 }
278
279 /**
280 * Merge an Array of Objects into a single Object.
281 */
282 function toObject(arr) {
283 var res = {};
284 for (var i = 0; i < arr.length; i++) {
285 if (arr[i]) {
286 extend(res, arr[i]);
287 }
288 }
289 return res;
290 }
291
292 /**
293 * Perform no operation.
294 * Stubbing args to make Flow happy without leaving useless transpiled code
295 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
296 */
297 function noop(a, b, c) {}
298
299 /**
300 * Always return false.
301 */
302 var no = function (a, b, c) {
303 return false;
304 };
305
306 /**
307 * Return same value
308 */
309 var identity = function (_) {
310 return _;
311 };
312
313 /**
314 * Generate a static keys string from compiler modules.
315 */
316 function genStaticKeys(modules) {
317 return modules.reduce(function (keys, m) {
318 return keys.concat(m.staticKeys || []);
319 }, []).join(',');
320 }
321
322 /**
323 * Check if two values are loosely equal - that is,
324 * if they are plain objects, do they have the same shape?
325 */
326 function looseEqual(a, b) {
327 if (a === b) {
328 return true;
329 }
330 var isObjectA = isObject(a);
331 var isObjectB = isObject(b);
332 if (isObjectA && isObjectB) {
333 try {
334 var isArrayA = Array.isArray(a);
335 var isArrayB = Array.isArray(b);
336 if (isArrayA && isArrayB) {
337 return a.length === b.length && a.every(function (e, i) {
338 return looseEqual(e, b[i]);
339 });
340 } else if (!isArrayA && !isArrayB) {
341 var keysA = Object.keys(a);
342 var keysB = Object.keys(b);
343 return keysA.length === keysB.length && keysA.every(function (key) {
344 return looseEqual(a[key], b[key]);
345 });
346 } else {
347 /* istanbul ignore next */
348 return false;
349 }
350 } catch (e) {
351 /* istanbul ignore next */
352 return false;
353 }
354 } else if (!isObjectA && !isObjectB) {
355 return String(a) === String(b);
356 } else {
357 return false;
358 }
359 }
360
361 function looseIndexOf(arr, val) {
362 for (var i = 0; i < arr.length; i++) {
363 if (looseEqual(arr[i], val)) {
364 return i;
365 }
366 }
367 return -1;
368 }
369
370 /**
371 * Ensure a function is called only once.
372 */
373 function once(fn) {
374 var called = false;
375 return function () {
376 if (!called) {
377 called = true;
378 fn.apply(this, arguments);
379 }
380 };
381 }
382
383 var SSR_ATTR = 'data-server-rendered';
384
385 var ASSET_TYPES = ['component', 'directive', 'filter'];
386
387 var LIFECYCLE_HOOKS = ['beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'beforeDestroy', 'destroyed', 'activated', 'deactivated'];
388
389 /* */
390
391 var config = {
392 /**
393 * Option merge strategies (used in core/util/options)
394 */
395 optionMergeStrategies: Object.create(null),
396
397 /**
398 * Whether to suppress warnings.
399 */
400 silent: false,
401
402 /**
403 * Show production mode tip message on boot?
404 */
405 productionTip: process.env.NODE_ENV !== 'production',
406
407 /**
408 * Whether to enable devtools
409 */
410 devtools: process.env.NODE_ENV !== 'production',
411
412 /**
413 * Whether to record perf
414 */
415 performance: false,
416
417 /**
418 * Error handler for watcher errors
419 */
420 errorHandler: null,
421
422 /**
423 * Warn handler for watcher warns
424 */
425 warnHandler: null,
426
427 /**
428 * Ignore certain custom elements
429 */
430 ignoredElements: [],
431
432 /**
433 * Custom user key aliases for v-on
434 */
435 keyCodes: Object.create(null),
436
437 /**
438 * Check if a tag is reserved so that it cannot be registered as a
439 * component. This is platform-dependent and may be overwritten.
440 */
441 isReservedTag: no,
442
443 /**
444 * Check if an attribute is reserved so that it cannot be used as a component
445 * prop. This is platform-dependent and may be overwritten.
446 */
447 isReservedAttr: no,
448
449 /**
450 * Check if a tag is an unknown element.
451 * Platform-dependent.
452 */
453 isUnknownElement: no,
454
455 /**
456 * Get the namespace of an element
457 */
458 getTagNamespace: noop,
459
460 /**
461 * Parse the real tag name for the specific platform.
462 */
463 parsePlatformTagName: identity,
464
465 /**
466 * Check if an attribute must be bound using property, e.g. value
467 * Platform-dependent.
468 */
469 mustUseProp: no,
470
471 /**
472 * Exposed for legacy reasons
473 */
474 _lifecycleHooks: LIFECYCLE_HOOKS
475 };
476
477 /* */
478
479 var emptyObject = Object.freeze({});
480
481 /**
482 * Check if a string starts with $ or _
483 */
484 function isReserved(str) {
485 var c = (str + '').charCodeAt(0);
486 return c === 0x24 || c === 0x5F;
487 }
488
489 /**
490 * Define a property.
491 */
492 function def(obj, key, val, enumerable) {
493 Object.defineProperty(obj, key, {
494 value: val,
495 enumerable: !!enumerable,
496 writable: true,
497 configurable: true
498 });
499 }
500
501 /**
502 * Parse simple path.
503 */
504 var bailRE = /[^\w.$]/;
505 function parsePath(path) {
506 if (bailRE.test(path)) {
507 return;
508 }
509 var segments = path.split('.');
510 return function (obj) {
511 for (var i = 0; i < segments.length; i++) {
512 if (!obj) {
513 return;
514 }
515 obj = obj[segments[i]];
516 }
517 return obj;
518 };
519 }
520
521 /* */
522
523 var warn = noop;
524 var tip = noop;
525 var formatComponentName = null; // work around flow check
526
527 if (process.env.NODE_ENV !== 'production') {
528 var hasConsole = typeof console !== 'undefined';
529 var classifyRE = /(?:^|[-_])(\w)/g;
530 var classify = function (str) {
531 return str.replace(classifyRE, function (c) {
532 return c.toUpperCase();
533 }).replace(/[-_]/g, '');
534 };
535
536 warn = function (msg, vm) {
537 var trace = vm ? generateComponentTrace(vm) : '';
538
539 if (config.warnHandler) {
540 config.warnHandler.call(null, msg, vm, trace);
541 } else if (hasConsole && !config.silent) {
542 console.error("[Vue warn]: " + msg + trace);
543 }
544 };
545
546 tip = function (msg, vm) {
547 if (hasConsole && !config.silent) {
548 console.warn("[Vue tip]: " + msg + (vm ? generateComponentTrace(vm) : ''));
549 }
550 };
551
552 formatComponentName = function (vm, includeFile) {
553 if (vm.$root === vm) {
554 return '<Root>';
555 }
556 var name = typeof vm === 'string' ? vm : typeof vm === 'function' && vm.options ? vm.options.name : vm._isVue ? vm.$options.name || vm.$options._componentTag : vm.name;
557
558 var file = vm._isVue && vm.$options.__file;
559 if (!name && file) {
560 var match = file.match(/([^/\\]+)\.vue$/);
561 name = match && match[1];
562 }
563
564 return (name ? "<" + classify(name) + ">" : "<Anonymous>") + (file && includeFile !== false ? " at " + file : '');
565 };
566
567 var repeat = function (str, n) {
568 var res = '';
569 while (n) {
570 if (n % 2 === 1) {
571 res += str;
572 }
573 if (n > 1) {
574 str += str;
575 }
576 n >>= 1;
577 }
578 return res;
579 };
580
581 var generateComponentTrace = function (vm) {
582 if (vm._isVue && vm.$parent) {
583 var tree = [];
584 var currentRecursiveSequence = 0;
585 while (vm) {
586 if (tree.length > 0) {
587 var last = tree[tree.length - 1];
588 if (last.constructor === vm.constructor) {
589 currentRecursiveSequence++;
590 vm = vm.$parent;
591 continue;
592 } else if (currentRecursiveSequence > 0) {
593 tree[tree.length - 1] = [last, currentRecursiveSequence];
594 currentRecursiveSequence = 0;
595 }
596 }
597 tree.push(vm);
598 vm = vm.$parent;
599 }
600 return '\n\nfound in\n\n' + tree.map(function (vm, i) {
601 return "" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) ? formatComponentName(vm[0]) + "... (" + vm[1] + " recursive calls)" : formatComponentName(vm));
602 }).join('\n');
603 } else {
604 return "\n\n(found in " + formatComponentName(vm) + ")";
605 }
606 };
607 }
608
609 /* */
610
611 function handleError(err, vm, info) {
612 if (config.errorHandler) {
613 config.errorHandler.call(null, err, vm, info);
614 } else {
615 if (process.env.NODE_ENV !== 'production') {
616 warn("Error in " + info + ": \"" + err.toString() + "\"", vm);
617 }
618 /* istanbul ignore else */
619 if (inBrowser && typeof console !== 'undefined') {
620 console.error(err);
621 } else {
622 throw err;
623 }
624 }
625 }
626
627 /* */
628 /* globals MutationObserver */
629
630 // can we use __proto__?
631 var hasProto = '__proto__' in {};
632
633 // Browser environment sniffing
634 var inBrowser = typeof window !== 'undefined';
635 var UA = inBrowser && window.navigator.userAgent.toLowerCase();
636 var isIE = UA && /msie|trident/.test(UA);
637 var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
638 var isEdge = UA && UA.indexOf('edge/') > 0;
639 var isAndroid = UA && UA.indexOf('android') > 0;
640 var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
641 var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
642
643 // Firefix has a "watch" function on Object.prototype...
644 var nativeWatch = {}.watch;
645
646 var supportsPassive = false;
647 if (inBrowser) {
648 try {
649 var opts = {};
650 Object.defineProperty(opts, 'passive', {
651 get: function get() {
652 /* istanbul ignore next */
653 supportsPassive = true;
654 }
655 }); // https://github.com/facebook/flow/issues/285
656 window.addEventListener('test-passive', null, opts);
657 } catch (e) {}
658 }
659
660 // this needs to be lazy-evaled because vue may be required before
661 // vue-server-renderer can set VUE_ENV
662 var _isServer;
663 var isServerRendering = function () {
664 if (_isServer === undefined) {
665 /* istanbul ignore if */
666 if (!inBrowser && typeof global !== 'undefined') {
667 // detect presence of vue-server-renderer and avoid
668 // Webpack shimming the process
669 _isServer = global['process'].env.VUE_ENV === 'server';
670 } else {
671 _isServer = false;
672 }
673 }
674 return _isServer;
675 };
676
677 // detect devtools
678 var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
679
680 /* istanbul ignore next */
681 function isNative(Ctor) {
682 return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
683 }
684
685 var hasSymbol = typeof Symbol !== 'undefined' && isNative(Symbol) && typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
686
687 /**
688 * Defer a task to execute it asynchronously.
689 */
690 var nextTick = function () {
691 var callbacks = [];
692 var pending = false;
693 var timerFunc;
694
695 function nextTickHandler() {
696 pending = false;
697 var copies = callbacks.slice(0);
698 callbacks.length = 0;
699 for (var i = 0; i < copies.length; i++) {
700 copies[i]();
701 }
702 }
703
704 // the nextTick behavior leverages the microtask queue, which can be accessed
705 // via either native Promise.then or MutationObserver.
706 // MutationObserver has wider support, however it is seriously bugged in
707 // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
708 // completely stops working after triggering a few times... so, if native
709 // Promise is available, we will use it:
710 /* istanbul ignore if */
711 if (typeof Promise !== 'undefined' && isNative(Promise)) {
712 var p = Promise.resolve();
713 var logError = function (err) {
714 console.error(err);
715 };
716 timerFunc = function () {
717 p.then(nextTickHandler).catch(logError);
718 // in problematic UIWebViews, Promise.then doesn't completely break, but
719 // it can get stuck in a weird state where callbacks are pushed into the
720 // microtask queue but the queue isn't being flushed, until the browser
721 // needs to do some other work, e.g. handle a timer. Therefore we can
722 // "force" the microtask queue to be flushed by adding an empty timer.
723 if (isIOS) {
724 setTimeout(noop);
725 }
726 };
727 } else if (typeof MutationObserver !== 'undefined' && (isNative(MutationObserver) ||
728 // PhantomJS and iOS 7.x
729 MutationObserver.toString() === '[object MutationObserverConstructor]')) {
730 // use MutationObserver where native Promise is not available,
731 // e.g. PhantomJS IE11, iOS7, Android 4.4
732 var counter = 1;
733 var observer = new MutationObserver(nextTickHandler);
734 var textNode = document.createTextNode(String(counter));
735 observer.observe(textNode, {
736 characterData: true
737 });
738 timerFunc = function () {
739 counter = (counter + 1) % 2;
740 textNode.data = String(counter);
741 };
742 } else {
743 // fallback to setTimeout
744 /* istanbul ignore next */
745 timerFunc = function () {
746 setTimeout(nextTickHandler, 0);
747 };
748 }
749
750 return function queueNextTick(cb, ctx) {
751 var _resolve;
752 callbacks.push(function () {
753 if (cb) {
754 try {
755 cb.call(ctx);
756 } catch (e) {
757 handleError(e, ctx, 'nextTick');
758 }
759 } else if (_resolve) {
760 _resolve(ctx);
761 }
762 });
763 if (!pending) {
764 pending = true;
765 timerFunc();
766 }
767 if (!cb && typeof Promise !== 'undefined') {
768 return new Promise(function (resolve, reject) {
769 _resolve = resolve;
770 });
771 }
772 };
773 }();
774
775 var _Set;
776 /* istanbul ignore if */
777 if (typeof Set !== 'undefined' && isNative(Set)) {
778 // use native Set when available.
779 _Set = Set;
780 } else {
781 // a non-standard Set polyfill that only works with primitive keys.
782 _Set = function () {
783 function Set() {
784 this.set = Object.create(null);
785 }
786 Set.prototype.has = function has(key) {
787 return this.set[key] === true;
788 };
789 Set.prototype.add = function add(key) {
790 this.set[key] = true;
791 };
792 Set.prototype.clear = function clear() {
793 this.set = Object.create(null);
794 };
795
796 return Set;
797 }();
798 }
799
800 /* */
801
802 var uid = 0;
803
804 /**
805 * A dep is an observable that can have multiple
806 * directives subscribing to it.
807 */
808 var Dep = function Dep() {
809 this.id = uid++;
810 this.subs = [];
811 };
812
813 Dep.prototype.addSub = function addSub(sub) {
814 this.subs.push(sub);
815 };
816
817 Dep.prototype.removeSub = function removeSub(sub) {
818 remove(this.subs, sub);
819 };
820
821 Dep.prototype.depend = function depend() {
822 if (Dep.target) {
823 Dep.target.addDep(this);
824 }
825 };
826
827 Dep.prototype.notify = function notify() {
828 // stabilize the subscriber list first
829 var subs = this.subs.slice();
830 for (var i = 0, l = subs.length; i < l; i++) {
831 subs[i].update();
832 }
833 };
834
835 // the current target watcher being evaluated.
836 // this is globally unique because there could be only one
837 // watcher being evaluated at any time.
838 Dep.target = null;
839 var targetStack = [];
840
841 function pushTarget(_target) {
842 if (Dep.target) {
843 targetStack.push(Dep.target);
844 }
845 Dep.target = _target;
846 }
847
848 function popTarget() {
849 Dep.target = targetStack.pop();
850 }
851
852 /*
853 * not type checking this file because flow doesn't play well with
854 * dynamically accessing methods on Array prototype
855 */
856
857 var arrayProto = Array.prototype;
858 var arrayMethods = Object.create(arrayProto);['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'].forEach(function (method) {
859 // cache original method
860 var original = arrayProto[method];
861 def(arrayMethods, method, function mutator() {
862 var args = [],
863 len = arguments.length;
864 while (len--) args[len] = arguments[len];
865
866 var result = original.apply(this, args);
867 var ob = this.__ob__;
868 var inserted;
869 switch (method) {
870 case 'push':
871 case 'unshift':
872 inserted = args;
873 break;
874 case 'splice':
875 inserted = args.slice(2);
876 break;
877 }
878 if (inserted) {
879 ob.observeArray(inserted);
880 }
881 // notify change
882 ob.dep.notify();
883 return result;
884 });
885 });
886
887 /* */
888
889 var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
890
891 /**
892 * By default, when a reactive property is set, the new value is
893 * also converted to become reactive. However when passing down props,
894 * we don't want to force conversion because the value may be a nested value
895 * under a frozen data structure. Converting it would defeat the optimization.
896 */
897 var observerState = {
898 shouldConvert: true
899 };
900
901 /**
902 * Observer class that are attached to each observed
903 * object. Once attached, the observer converts target
904 * object's property keys into getter/setters that
905 * collect dependencies and dispatches updates.
906 */
907 var Observer = function Observer(value) {
908 this.value = value;
909 this.dep = new Dep();
910 this.vmCount = 0;
911 def(value, '__ob__', this);
912 if (Array.isArray(value)) {
913 var augment = hasProto ? protoAugment : copyAugment;
914 augment(value, arrayMethods, arrayKeys);
915 this.observeArray(value);
916 } else {
917 this.walk(value);
918 }
919 };
920
921 /**
922 * Walk through each property and convert them into
923 * getter/setters. This method should only be called when
924 * value type is Object.
925 */
926 Observer.prototype.walk = function walk(obj) {
927 var keys = Object.keys(obj);
928 for (var i = 0; i < keys.length; i++) {
929 defineReactive$$1(obj, keys[i], obj[keys[i]]);
930 }
931 };
932
933 /**
934 * Observe a list of Array items.
935 */
936 Observer.prototype.observeArray = function observeArray(items) {
937 for (var i = 0, l = items.length; i < l; i++) {
938 observe(items[i]);
939 }
940 };
941
942 // helpers
943
944 /**
945 * Augment an target Object or Array by intercepting
946 * the prototype chain using __proto__
947 */
948 function protoAugment(target, src, keys) {
949 /* eslint-disable no-proto */
950 target.__proto__ = src;
951 /* eslint-enable no-proto */
952 }
953
954 /**
955 * Augment an target Object or Array by defining
956 * hidden properties.
957 */
958 /* istanbul ignore next */
959 function copyAugment(target, src, keys) {
960 for (var i = 0, l = keys.length; i < l; i++) {
961 var key = keys[i];
962 def(target, key, src[key]);
963 }
964 }
965
966 /**
967 * Attempt to create an observer instance for a value,
968 * returns the new observer if successfully observed,
969 * or the existing observer if the value already has one.
970 */
971 function observe(value, asRootData) {
972 if (!isObject(value)) {
973 return;
974 }
975 var ob;
976 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
977 ob = value.__ob__;
978 } else if (observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {
979 ob = new Observer(value);
980 }
981 if (asRootData && ob) {
982 ob.vmCount++;
983 }
984 return ob;
985 }
986
987 /**
988 * Define a reactive property on an Object.
989 */
990 function defineReactive$$1(obj, key, val, customSetter, shallow) {
991 var dep = new Dep();
992
993 var property = Object.getOwnPropertyDescriptor(obj, key);
994 if (property && property.configurable === false) {
995 return;
996 }
997
998 // cater for pre-defined getter/setters
999 var getter = property && property.get;
1000 var setter = property && property.set;
1001
1002 var childOb = !shallow && observe(val);
1003 Object.defineProperty(obj, key, {
1004 enumerable: true,
1005 configurable: true,
1006 get: function reactiveGetter() {
1007 var value = getter ? getter.call(obj) : val;
1008 if (Dep.target) {
1009 dep.depend();
1010 if (childOb) {
1011 childOb.dep.depend();
1012 }
1013 if (Array.isArray(value)) {
1014 dependArray(value);
1015 }
1016 }
1017 return value;
1018 },
1019 set: function reactiveSetter(newVal) {
1020 var value = getter ? getter.call(obj) : val;
1021 /* eslint-disable no-self-compare */
1022 if (newVal === value || newVal !== newVal && value !== value) {
1023 return;
1024 }
1025 /* eslint-enable no-self-compare */
1026 if (process.env.NODE_ENV !== 'production' && customSetter) {
1027 customSetter();
1028 }
1029 if (setter) {
1030 setter.call(obj, newVal);
1031 } else {
1032 val = newVal;
1033 }
1034 childOb = !shallow && observe(newVal);
1035 dep.notify();
1036 }
1037 });
1038 }
1039
1040 /**
1041 * Set a property on an object. Adds the new property and
1042 * triggers change notification if the property doesn't
1043 * already exist.
1044 */
1045 function set(target, key, val) {
1046 if (Array.isArray(target) && isValidArrayIndex(key)) {
1047 target.length = Math.max(target.length, key);
1048 target.splice(key, 1, val);
1049 return val;
1050 }
1051 if (hasOwn(target, key)) {
1052 target[key] = val;
1053 return val;
1054 }
1055 var ob = target.__ob__;
1056 if (target._isVue || ob && ob.vmCount) {
1057 process.env.NODE_ENV !== 'production' && warn('Avoid adding reactive properties to a Vue instance or its root $data ' + 'at runtime - declare it upfront in the data option.');
1058 return val;
1059 }
1060 if (!ob) {
1061 target[key] = val;
1062 return val;
1063 }
1064 defineReactive$$1(ob.value, key, val);
1065 ob.dep.notify();
1066 return val;
1067 }
1068
1069 /**
1070 * Delete a property and trigger change if necessary.
1071 */
1072 function del(target, key) {
1073 if (Array.isArray(target) && isValidArrayIndex(key)) {
1074 target.splice(key, 1);
1075 return;
1076 }
1077 var ob = target.__ob__;
1078 if (target._isVue || ob && ob.vmCount) {
1079 process.env.NODE_ENV !== 'production' && warn('Avoid deleting properties on a Vue instance or its root $data ' + '- just set it to null.');
1080 return;
1081 }
1082 if (!hasOwn(target, key)) {
1083 return;
1084 }
1085 delete target[key];
1086 if (!ob) {
1087 return;
1088 }
1089 ob.dep.notify();
1090 }
1091
1092 /**
1093 * Collect dependencies on array elements when the array is touched, since
1094 * we cannot intercept array element access like property getters.
1095 */
1096 function dependArray(value) {
1097 for (var e = void 0, i = 0, l = value.length; i < l; i++) {
1098 e = value[i];
1099 e && e.__ob__ && e.__ob__.dep.depend();
1100 if (Array.isArray(e)) {
1101 dependArray(e);
1102 }
1103 }
1104 }
1105
1106 /* */
1107
1108 /**
1109 * Option overwriting strategies are functions that handle
1110 * how to merge a parent option value and a child option
1111 * value into the final value.
1112 */
1113 var strats = config.optionMergeStrategies;
1114
1115 /**
1116 * Options with restrictions
1117 */
1118 if (process.env.NODE_ENV !== 'production') {
1119 strats.el = strats.propsData = function (parent, child, vm, key) {
1120 if (!vm) {
1121 warn("option \"" + key + "\" can only be used during instance " + 'creation with the `new` keyword.');
1122 }
1123 return defaultStrat(parent, child);
1124 };
1125 }
1126
1127 /**
1128 * Helper that recursively merges two data objects together.
1129 */
1130 function mergeData(to, from) {
1131 if (!from) {
1132 return to;
1133 }
1134 var key, toVal, fromVal;
1135 var keys = Object.keys(from);
1136 for (var i = 0; i < keys.length; i++) {
1137 key = keys[i];
1138 toVal = to[key];
1139 fromVal = from[key];
1140 if (!hasOwn(to, key)) {
1141 set(to, key, fromVal);
1142 } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
1143 mergeData(toVal, fromVal);
1144 }
1145 }
1146 return to;
1147 }
1148
1149 /**
1150 * Data
1151 */
1152 function mergeDataOrFn(parentVal, childVal, vm) {
1153 if (!vm) {
1154 // in a Vue.extend merge, both should be functions
1155 if (!childVal) {
1156 return parentVal;
1157 }
1158 if (!parentVal) {
1159 return childVal;
1160 }
1161 // when parentVal & childVal are both present,
1162 // we need to return a function that returns the
1163 // merged result of both functions... no need to
1164 // check if parentVal is a function here because
1165 // it has to be a function to pass previous merges.
1166 return function mergedDataFn() {
1167 return mergeData(typeof childVal === 'function' ? childVal.call(this) : childVal, typeof parentVal === 'function' ? parentVal.call(this) : parentVal);
1168 };
1169 } else if (parentVal || childVal) {
1170 return function mergedInstanceDataFn() {
1171 // instance merge
1172 var instanceData = typeof childVal === 'function' ? childVal.call(vm) : childVal;
1173 var defaultData = typeof parentVal === 'function' ? parentVal.call(vm) : undefined;
1174 if (instanceData) {
1175 return mergeData(instanceData, defaultData);
1176 } else {
1177 return defaultData;
1178 }
1179 };
1180 }
1181 }
1182
1183 strats.data = function (parentVal, childVal, vm) {
1184 if (!vm) {
1185 if (childVal && typeof childVal !== 'function') {
1186 process.env.NODE_ENV !== 'production' && warn('The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);
1187
1188 return parentVal;
1189 }
1190 return mergeDataOrFn.call(this, parentVal, childVal);
1191 }
1192
1193 return mergeDataOrFn(parentVal, childVal, vm);
1194 };
1195
1196 /**
1197 * Hooks and props are merged as arrays.
1198 */
1199 function mergeHook(parentVal, childVal) {
1200 return childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
1201 }
1202
1203 LIFECYCLE_HOOKS.forEach(function (hook) {
1204 strats[hook] = mergeHook;
1205 });
1206
1207 /**
1208 * Assets
1209 *
1210 * When a vm is present (instance creation), we need to do
1211 * a three-way merge between constructor options, instance
1212 * options and parent options.
1213 */
1214 function mergeAssets(parentVal, childVal) {
1215 var res = Object.create(parentVal || null);
1216 return childVal ? extend(res, childVal) : res;
1217 }
1218
1219 ASSET_TYPES.forEach(function (type) {
1220 strats[type + 's'] = mergeAssets;
1221 });
1222
1223 /**
1224 * Watchers.
1225 *
1226 * Watchers hashes should not overwrite one
1227 * another, so we merge them as arrays.
1228 */
1229 strats.watch = function (parentVal, childVal) {
1230 // work around Firefox's Object.prototype.watch...
1231 if (parentVal === nativeWatch) {
1232 parentVal = undefined;
1233 }
1234 if (childVal === nativeWatch) {
1235 childVal = undefined;
1236 }
1237 /* istanbul ignore if */
1238 if (!childVal) {
1239 return Object.create(parentVal || null);
1240 }
1241 if (!parentVal) {
1242 return childVal;
1243 }
1244 var ret = {};
1245 extend(ret, parentVal);
1246 for (var key in childVal) {
1247 var parent = ret[key];
1248 var child = childVal[key];
1249 if (parent && !Array.isArray(parent)) {
1250 parent = [parent];
1251 }
1252 ret[key] = parent ? parent.concat(child) : Array.isArray(child) ? child : [child];
1253 }
1254 return ret;
1255 };
1256
1257 /**
1258 * Other object hashes.
1259 */
1260 strats.props = strats.methods = strats.inject = strats.computed = function (parentVal, childVal) {
1261 if (!parentVal) {
1262 return childVal;
1263 }
1264 var ret = Object.create(null);
1265 extend(ret, parentVal);
1266 if (childVal) {
1267 extend(ret, childVal);
1268 }
1269 return ret;
1270 };
1271 strats.provide = mergeDataOrFn;
1272
1273 /**
1274 * Default strategy.
1275 */
1276 var defaultStrat = function (parentVal, childVal) {
1277 return childVal === undefined ? parentVal : childVal;
1278 };
1279
1280 /**
1281 * Validate component names
1282 */
1283 function checkComponents(options) {
1284 for (var key in options.components) {
1285 var lower = key.toLowerCase();
1286 if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
1287 warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + key);
1288 }
1289 }
1290 }
1291
1292 /**
1293 * Ensure all props option syntax are normalized into the
1294 * Object-based format.
1295 */
1296 function normalizeProps(options) {
1297 var props = options.props;
1298 if (!props) {
1299 return;
1300 }
1301 var res = {};
1302 var i, val, name;
1303 if (Array.isArray(props)) {
1304 i = props.length;
1305 while (i--) {
1306 val = props[i];
1307 if (typeof val === 'string') {
1308 name = camelize(val);
1309 res[name] = { type: null };
1310 } else if (process.env.NODE_ENV !== 'production') {
1311 warn('props must be strings when using array syntax.');
1312 }
1313 }
1314 } else if (isPlainObject(props)) {
1315 for (var key in props) {
1316 val = props[key];
1317 name = camelize(key);
1318 res[name] = isPlainObject(val) ? val : { type: val };
1319 }
1320 }
1321 options.props = res;
1322 }
1323
1324 /**
1325 * Normalize all injections into Object-based format
1326 */
1327 function normalizeInject(options) {
1328 var inject = options.inject;
1329 if (Array.isArray(inject)) {
1330 var normalized = options.inject = {};
1331 for (var i = 0; i < inject.length; i++) {
1332 normalized[inject[i]] = inject[i];
1333 }
1334 }
1335 }
1336
1337 /**
1338 * Normalize raw function directives into object format.
1339 */
1340 function normalizeDirectives(options) {
1341 var dirs = options.directives;
1342 if (dirs) {
1343 for (var key in dirs) {
1344 var def = dirs[key];
1345 if (typeof def === 'function') {
1346 dirs[key] = { bind: def, update: def };
1347 }
1348 }
1349 }
1350 }
1351
1352 /**
1353 * Merge two option objects into a new one.
1354 * Core utility used in both instantiation and inheritance.
1355 */
1356 function mergeOptions(parent, child, vm) {
1357 if (process.env.NODE_ENV !== 'production') {
1358 checkComponents(child);
1359 }
1360
1361 if (typeof child === 'function') {
1362 child = child.options;
1363 }
1364
1365 normalizeProps(child);
1366 normalizeInject(child);
1367 normalizeDirectives(child);
1368 var extendsFrom = child.extends;
1369 if (extendsFrom) {
1370 parent = mergeOptions(parent, extendsFrom, vm);
1371 }
1372 if (child.mixins) {
1373 for (var i = 0, l = child.mixins.length; i < l; i++) {
1374 parent = mergeOptions(parent, child.mixins[i], vm);
1375 }
1376 }
1377 var options = {};
1378 var key;
1379 for (key in parent) {
1380 mergeField(key);
1381 }
1382 for (key in child) {
1383 if (!hasOwn(parent, key)) {
1384 mergeField(key);
1385 }
1386 }
1387 function mergeField(key) {
1388 var strat = strats[key] || defaultStrat;
1389 options[key] = strat(parent[key], child[key], vm, key);
1390 }
1391 return options;
1392 }
1393
1394 /**
1395 * Resolve an asset.
1396 * This function is used because child instances need access
1397 * to assets defined in its ancestor chain.
1398 */
1399 function resolveAsset(options, type, id, warnMissing) {
1400 /* istanbul ignore if */
1401 if (typeof id !== 'string') {
1402 return;
1403 }
1404 var assets = options[type];
1405 // check local registration variations first
1406 if (hasOwn(assets, id)) {
1407 return assets[id];
1408 }
1409 var camelizedId = camelize(id);
1410 if (hasOwn(assets, camelizedId)) {
1411 return assets[camelizedId];
1412 }
1413 var PascalCaseId = capitalize(camelizedId);
1414 if (hasOwn(assets, PascalCaseId)) {
1415 return assets[PascalCaseId];
1416 }
1417 // fallback to prototype chain
1418 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
1419 if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
1420 warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id, options);
1421 }
1422 return res;
1423 }
1424
1425 /* */
1426
1427 function validateProp(key, propOptions, propsData, vm) {
1428 var prop = propOptions[key];
1429 var absent = !hasOwn(propsData, key);
1430 var value = propsData[key];
1431 // handle boolean props
1432 if (isType(Boolean, prop.type)) {
1433 if (absent && !hasOwn(prop, 'default')) {
1434 value = false;
1435 } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
1436 value = true;
1437 }
1438 }
1439 // check default value
1440 if (value === undefined) {
1441 value = getPropDefaultValue(vm, prop, key);
1442 // since the default value is a fresh copy,
1443 // make sure to observe it.
1444 var prevShouldConvert = observerState.shouldConvert;
1445 observerState.shouldConvert = true;
1446 observe(value);
1447 observerState.shouldConvert = prevShouldConvert;
1448 }
1449 if (process.env.NODE_ENV !== 'production') {
1450 assertProp(prop, key, value, vm, absent);
1451 }
1452 return value;
1453 }
1454
1455 /**
1456 * Get the default value of a prop.
1457 */
1458 function getPropDefaultValue(vm, prop, key) {
1459 // no default, return undefined
1460 if (!hasOwn(prop, 'default')) {
1461 return undefined;
1462 }
1463 var def = prop.default;
1464 // warn against non-factory defaults for Object & Array
1465 if (process.env.NODE_ENV !== 'production' && isObject(def)) {
1466 warn('Invalid default value for prop "' + key + '": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm);
1467 }
1468 // the raw prop value was also undefined from previous render,
1469 // return previous default value to avoid unnecessary watcher trigger
1470 if (vm && vm.$options.propsData && vm.$options.propsData[key] === undefined && vm._props[key] !== undefined) {
1471 return vm._props[key];
1472 }
1473 // call factory function for non-Function types
1474 // a value is Function if its prototype is function even across different execution context
1475 return typeof def === 'function' && getType(prop.type) !== 'Function' ? def.call(vm) : def;
1476 }
1477
1478 /**
1479 * Assert whether a prop is valid.
1480 */
1481 function assertProp(prop, name, value, vm, absent) {
1482 if (prop.required && absent) {
1483 warn('Missing required prop: "' + name + '"', vm);
1484 return;
1485 }
1486 if (value == null && !prop.required) {
1487 return;
1488 }
1489 var type = prop.type;
1490 var valid = !type || type === true;
1491 var expectedTypes = [];
1492 if (type) {
1493 if (!Array.isArray(type)) {
1494 type = [type];
1495 }
1496 for (var i = 0; i < type.length && !valid; i++) {
1497 var assertedType = assertType(value, type[i]);
1498 expectedTypes.push(assertedType.expectedType || '');
1499 valid = assertedType.valid;
1500 }
1501 }
1502 if (!valid) {
1503 warn('Invalid prop: type check failed for prop "' + name + '".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm);
1504 return;
1505 }
1506 var validator = prop.validator;
1507 if (validator) {
1508 if (!validator(value)) {
1509 warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
1510 }
1511 }
1512 }
1513
1514 var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1515
1516 function assertType(value, type) {
1517 var valid;
1518 var expectedType = getType(type);
1519 if (simpleCheckRE.test(expectedType)) {
1520 valid = typeof value === expectedType.toLowerCase();
1521 } else if (expectedType === 'Object') {
1522 valid = isPlainObject(value);
1523 } else if (expectedType === 'Array') {
1524 valid = Array.isArray(value);
1525 } else {
1526 valid = value instanceof type;
1527 }
1528 return {
1529 valid: valid,
1530 expectedType: expectedType
1531 };
1532 }
1533
1534 /**
1535 * Use function string name to check built-in types,
1536 * because a simple equality check will fail when running
1537 * across different vms / iframes.
1538 */
1539 function getType(fn) {
1540 var match = fn && fn.toString().match(/^\s*function (\w+)/);
1541 return match ? match[1] : '';
1542 }
1543
1544 function isType(type, fn) {
1545 if (!Array.isArray(fn)) {
1546 return getType(fn) === getType(type);
1547 }
1548 for (var i = 0, len = fn.length; i < len; i++) {
1549 if (getType(fn[i]) === getType(type)) {
1550 return true;
1551 }
1552 }
1553 /* istanbul ignore next */
1554 return false;
1555 }
1556
1557 /* */
1558
1559 var mark;
1560 var measure;
1561
1562 if (process.env.NODE_ENV !== 'production') {
1563 var perf = inBrowser && window.performance;
1564 /* istanbul ignore if */
1565 if (perf && perf.mark && perf.measure && perf.clearMarks && perf.clearMeasures) {
1566 mark = function (tag) {
1567 return perf.mark(tag);
1568 };
1569 measure = function (name, startTag, endTag) {
1570 perf.measure(name, startTag, endTag);
1571 perf.clearMarks(startTag);
1572 perf.clearMarks(endTag);
1573 perf.clearMeasures(name);
1574 };
1575 }
1576 }
1577
1578 /* not type checking this file because flow doesn't play well with Proxy */
1579
1580 var initProxy;
1581
1582 if (process.env.NODE_ENV !== 'production') {
1583 var allowedGlobals = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + 'require' // for Webpack/Browserify
1584 );
1585
1586 var warnNonPresent = function (target, key) {
1587 warn("Property or method \"" + key + "\" is not defined on the instance but " + "referenced during render. Make sure to declare reactive data " + "properties in the data option.", target);
1588 };
1589
1590 var hasProxy = typeof Proxy !== 'undefined' && Proxy.toString().match(/native code/);
1591
1592 if (hasProxy) {
1593 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
1594 config.keyCodes = new Proxy(config.keyCodes, {
1595 set: function set(target, key, value) {
1596 if (isBuiltInModifier(key)) {
1597 warn("Avoid overwriting built-in modifier in config.keyCodes: ." + key);
1598 return false;
1599 } else {
1600 target[key] = value;
1601 return true;
1602 }
1603 }
1604 });
1605 }
1606
1607 var hasHandler = {
1608 has: function has(target, key) {
1609 var has = key in target;
1610 var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1611 if (!has && !isAllowed) {
1612 warnNonPresent(target, key);
1613 }
1614 return has || !isAllowed;
1615 }
1616 };
1617
1618 var getHandler = {
1619 get: function get(target, key) {
1620 if (typeof key === 'string' && !(key in target)) {
1621 warnNonPresent(target, key);
1622 }
1623 return target[key];
1624 }
1625 };
1626
1627 initProxy = function initProxy(vm) {
1628 if (hasProxy) {
1629 // determine which proxy handler to use
1630 var options = vm.$options;
1631 var handlers = options.render && options.render._withStripped ? getHandler : hasHandler;
1632 vm._renderProxy = new Proxy(vm, handlers);
1633 } else {
1634 vm._renderProxy = vm;
1635 }
1636 };
1637 }
1638
1639 /* */
1640
1641 var VNode = function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
1642 this.tag = tag;
1643 this.data = data;
1644 this.children = children;
1645 this.text = text;
1646 this.elm = elm;
1647 this.ns = undefined;
1648 this.context = context;
1649 this.functionalContext = undefined;
1650 this.key = data && data.key;
1651 this.componentOptions = componentOptions;
1652 this.componentInstance = undefined;
1653 this.parent = undefined;
1654 this.raw = false;
1655 this.isStatic = false;
1656 this.isRootInsert = true;
1657 this.isComment = false;
1658 this.isCloned = false;
1659 this.isOnce = false;
1660 this.asyncFactory = asyncFactory;
1661 this.asyncMeta = undefined;
1662 this.isAsyncPlaceholder = false;
1663 };
1664
1665 var prototypeAccessors = { child: {} };
1666
1667 // DEPRECATED: alias for componentInstance for backwards compat.
1668 /* istanbul ignore next */
1669 prototypeAccessors.child.get = function () {
1670 return this.componentInstance;
1671 };
1672
1673 Object.defineProperties(VNode.prototype, prototypeAccessors);
1674
1675 var createEmptyVNode = function (text) {
1676 if (text === void 0) text = '';
1677
1678 var node = new VNode();
1679 node.text = text;
1680 node.isComment = true;
1681 return node;
1682 };
1683
1684 function createTextVNode(val) {
1685 return new VNode(undefined, undefined, undefined, String(val));
1686 }
1687
1688 // optimized shallow clone
1689 // used for static nodes and slot nodes because they may be reused across
1690 // multiple renders, cloning them avoids errors when DOM manipulations rely
1691 // on their elm reference.
1692 function cloneVNode(vnode) {
1693 var cloned = new VNode(vnode.tag, vnode.data, vnode.children, vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
1694 cloned.ns = vnode.ns;
1695 cloned.isStatic = vnode.isStatic;
1696 cloned.key = vnode.key;
1697 cloned.isComment = vnode.isComment;
1698 cloned.isCloned = true;
1699 return cloned;
1700 }
1701
1702 function cloneVNodes(vnodes) {
1703 var len = vnodes.length;
1704 var res = new Array(len);
1705 for (var i = 0; i < len; i++) {
1706 res[i] = cloneVNode(vnodes[i]);
1707 }
1708 return res;
1709 }
1710
1711 /* */
1712
1713 var normalizeEvent = cached(function (name) {
1714 var passive = name.charAt(0) === '&';
1715 name = passive ? name.slice(1) : name;
1716 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
1717 name = once$$1 ? name.slice(1) : name;
1718 var capture = name.charAt(0) === '!';
1719 name = capture ? name.slice(1) : name;
1720 return {
1721 name: name,
1722 once: once$$1,
1723 capture: capture,
1724 passive: passive
1725 };
1726 });
1727
1728 function createFnInvoker(fns) {
1729 function invoker() {
1730 var arguments$1 = arguments;
1731
1732 var fns = invoker.fns;
1733 if (Array.isArray(fns)) {
1734 var cloned = fns.slice();
1735 for (var i = 0; i < cloned.length; i++) {
1736 cloned[i].apply(null, arguments$1);
1737 }
1738 } else {
1739 // return handler return value for single handlers
1740 return fns.apply(null, arguments);
1741 }
1742 }
1743 invoker.fns = fns;
1744 return invoker;
1745 }
1746
1747 function updateListeners(on, oldOn, add, remove$$1, vm) {
1748 var name, cur, old, event;
1749 for (name in on) {
1750 cur = on[name];
1751 old = oldOn[name];
1752 event = normalizeEvent(name);
1753 if (isUndef(cur)) {
1754 process.env.NODE_ENV !== 'production' && warn("Invalid handler for event \"" + event.name + "\": got " + String(cur), vm);
1755 } else if (isUndef(old)) {
1756 if (isUndef(cur.fns)) {
1757 cur = on[name] = createFnInvoker(cur);
1758 }
1759 add(event.name, cur, event.once, event.capture, event.passive);
1760 } else if (cur !== old) {
1761 old.fns = cur;
1762 on[name] = old;
1763 }
1764 }
1765 for (name in oldOn) {
1766 if (isUndef(on[name])) {
1767 event = normalizeEvent(name);
1768 remove$$1(event.name, oldOn[name], event.capture);
1769 }
1770 }
1771 }
1772
1773 /* */
1774
1775 function mergeVNodeHook(def, hookKey, hook) {
1776 var invoker;
1777 var oldHook = def[hookKey];
1778
1779 function wrappedHook() {
1780 hook.apply(this, arguments);
1781 // important: remove merged hook to ensure it's called only once
1782 // and prevent memory leak
1783 remove(invoker.fns, wrappedHook);
1784 }
1785
1786 if (isUndef(oldHook)) {
1787 // no existing hook
1788 invoker = createFnInvoker([wrappedHook]);
1789 } else {
1790 /* istanbul ignore if */
1791 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
1792 // already a merged invoker
1793 invoker = oldHook;
1794 invoker.fns.push(wrappedHook);
1795 } else {
1796 // existing plain hook
1797 invoker = createFnInvoker([oldHook, wrappedHook]);
1798 }
1799 }
1800
1801 invoker.merged = true;
1802 def[hookKey] = invoker;
1803 }
1804
1805 /* */
1806
1807 function extractPropsFromVNodeData(data, Ctor, tag) {
1808 // we are only extracting raw values here.
1809 // validation and default values are handled in the child
1810 // component itself.
1811 var propOptions = Ctor.options.props;
1812 if (isUndef(propOptions)) {
1813 return;
1814 }
1815 var res = {};
1816 var attrs = data.attrs;
1817 var props = data.props;
1818 if (isDef(attrs) || isDef(props)) {
1819 for (var key in propOptions) {
1820 var altKey = hyphenate(key);
1821 if (process.env.NODE_ENV !== 'production') {
1822 var keyInLowerCase = key.toLowerCase();
1823 if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
1824 tip("Prop \"" + keyInLowerCase + "\" is passed to component " + formatComponentName(tag || Ctor) + ", but the declared prop name is" + " \"" + key + "\". " + "Note that HTML attributes are case-insensitive and camelCased " + "props need to use their kebab-case equivalents when using in-DOM " + "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\".");
1825 }
1826 }
1827 checkProp(res, props, key, altKey, true) || checkProp(res, attrs, key, altKey, false);
1828 }
1829 }
1830 return res;
1831 }
1832
1833 function checkProp(res, hash, key, altKey, preserve) {
1834 if (isDef(hash)) {
1835 if (hasOwn(hash, key)) {
1836 res[key] = hash[key];
1837 if (!preserve) {
1838 delete hash[key];
1839 }
1840 return true;
1841 } else if (hasOwn(hash, altKey)) {
1842 res[key] = hash[altKey];
1843 if (!preserve) {
1844 delete hash[altKey];
1845 }
1846 return true;
1847 }
1848 }
1849 return false;
1850 }
1851
1852 /* */
1853
1854 // The template compiler attempts to minimize the need for normalization by
1855 // statically analyzing the template at compile time.
1856 //
1857 // For plain HTML markup, normalization can be completely skipped because the
1858 // generated render function is guaranteed to return Array<VNode>. There are
1859 // two cases where extra normalization is needed:
1860
1861 // 1. When the children contains components - because a functional component
1862 // may return an Array instead of a single root. In this case, just a simple
1863 // normalization is needed - if any child is an Array, we flatten the whole
1864 // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
1865 // because functional components already normalize their own children.
1866 function simpleNormalizeChildren(children) {
1867 for (var i = 0; i < children.length; i++) {
1868 if (Array.isArray(children[i])) {
1869 return Array.prototype.concat.apply([], children);
1870 }
1871 }
1872 return children;
1873 }
1874
1875 // 2. When the children contains constructs that always generated nested Arrays,
1876 // e.g. <template>, <slot>, v-for, or when the children is provided by user
1877 // with hand-written render functions / JSX. In such cases a full normalization
1878 // is needed to cater to all possible types of children values.
1879 function normalizeChildren(children) {
1880 return isPrimitive(children) ? [createTextVNode(children)] : Array.isArray(children) ? normalizeArrayChildren(children) : undefined;
1881 }
1882
1883 function isTextNode(node) {
1884 return isDef(node) && isDef(node.text) && isFalse(node.isComment);
1885 }
1886
1887 function normalizeArrayChildren(children, nestedIndex) {
1888 var res = [];
1889 var i, c, last;
1890 for (i = 0; i < children.length; i++) {
1891 c = children[i];
1892 if (isUndef(c) || typeof c === 'boolean') {
1893 continue;
1894 }
1895 last = res[res.length - 1];
1896 // nested
1897 if (Array.isArray(c)) {
1898 res.push.apply(res, normalizeArrayChildren(c, (nestedIndex || '') + "_" + i));
1899 } else if (isPrimitive(c)) {
1900 if (isTextNode(last)) {
1901 // merge adjacent text nodes
1902 // this is necessary for SSR hydration because text nodes are
1903 // essentially merged when rendered to HTML strings
1904 last.text += String(c);
1905 } else if (c !== '') {
1906 // convert primitive to vnode
1907 res.push(createTextVNode(c));
1908 }
1909 } else {
1910 if (isTextNode(c) && isTextNode(last)) {
1911 // merge adjacent text nodes
1912 res[res.length - 1] = createTextVNode(last.text + c.text);
1913 } else {
1914 // default key for nested array children (likely generated by v-for)
1915 if (isTrue(children._isVList) && isDef(c.tag) && isUndef(c.key) && isDef(nestedIndex)) {
1916 c.key = "__vlist" + nestedIndex + "_" + i + "__";
1917 }
1918 res.push(c);
1919 }
1920 }
1921 }
1922 return res;
1923 }
1924
1925 /* */
1926
1927 function ensureCtor(comp, base) {
1928 if (comp.__esModule && comp.default) {
1929 comp = comp.default;
1930 }
1931 return isObject(comp) ? base.extend(comp) : comp;
1932 }
1933
1934 function createAsyncPlaceholder(factory, data, context, children, tag) {
1935 var node = createEmptyVNode();
1936 node.asyncFactory = factory;
1937 node.asyncMeta = { data: data, context: context, children: children, tag: tag };
1938 return node;
1939 }
1940
1941 function resolveAsyncComponent(factory, baseCtor, context) {
1942 if (isTrue(factory.error) && isDef(factory.errorComp)) {
1943 return factory.errorComp;
1944 }
1945
1946 if (isDef(factory.resolved)) {
1947 return factory.resolved;
1948 }
1949
1950 if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
1951 return factory.loadingComp;
1952 }
1953
1954 if (isDef(factory.contexts)) {
1955 // already pending
1956 factory.contexts.push(context);
1957 } else {
1958 var contexts = factory.contexts = [context];
1959 var sync = true;
1960
1961 var forceRender = function () {
1962 for (var i = 0, l = contexts.length; i < l; i++) {
1963 contexts[i].$forceUpdate();
1964 }
1965 };
1966
1967 var resolve = once(function (res) {
1968 // cache resolved
1969 factory.resolved = ensureCtor(res, baseCtor);
1970 // invoke callbacks only if this is not a synchronous resolve
1971 // (async resolves are shimmed as synchronous during SSR)
1972 if (!sync) {
1973 forceRender();
1974 }
1975 });
1976
1977 var reject = once(function (reason) {
1978 process.env.NODE_ENV !== 'production' && warn("Failed to resolve async component: " + String(factory) + (reason ? "\nReason: " + reason : ''));
1979 if (isDef(factory.errorComp)) {
1980 factory.error = true;
1981 forceRender();
1982 }
1983 });
1984
1985 var res = factory(resolve, reject);
1986
1987 if (isObject(res)) {
1988 if (typeof res.then === 'function') {
1989 // () => Promise
1990 if (isUndef(factory.resolved)) {
1991 res.then(resolve, reject);
1992 }
1993 } else if (isDef(res.component) && typeof res.component.then === 'function') {
1994 res.component.then(resolve, reject);
1995
1996 if (isDef(res.error)) {
1997 factory.errorComp = ensureCtor(res.error, baseCtor);
1998 }
1999
2000 if (isDef(res.loading)) {
2001 factory.loadingComp = ensureCtor(res.loading, baseCtor);
2002 if (res.delay === 0) {
2003 factory.loading = true;
2004 } else {
2005 setTimeout(function () {
2006 if (isUndef(factory.resolved) && isUndef(factory.error)) {
2007 factory.loading = true;
2008 forceRender();
2009 }
2010 }, res.delay || 200);
2011 }
2012 }
2013
2014 if (isDef(res.timeout)) {
2015 setTimeout(function () {
2016 if (isUndef(factory.resolved)) {
2017 reject(process.env.NODE_ENV !== 'production' ? "timeout (" + res.timeout + "ms)" : null);
2018 }
2019 }, res.timeout);
2020 }
2021 }
2022 }
2023
2024 sync = false;
2025 // return in case resolved synchronously
2026 return factory.loading ? factory.loadingComp : factory.resolved;
2027 }
2028 }
2029
2030 /* */
2031
2032 function getFirstComponentChild(children) {
2033 if (Array.isArray(children)) {
2034 for (var i = 0; i < children.length; i++) {
2035 var c = children[i];
2036 if (isDef(c) && isDef(c.componentOptions)) {
2037 return c;
2038 }
2039 }
2040 }
2041 }
2042
2043 /* */
2044
2045 /* */
2046
2047 function initEvents(vm) {
2048 vm._events = Object.create(null);
2049 vm._hasHookEvent = false;
2050 // init parent attached events
2051 var listeners = vm.$options._parentListeners;
2052 if (listeners) {
2053 updateComponentListeners(vm, listeners);
2054 }
2055 }
2056
2057 var target;
2058
2059 function add(event, fn, once$$1) {
2060 if (once$$1) {
2061 target.$once(event, fn);
2062 } else {
2063 target.$on(event, fn);
2064 }
2065 }
2066
2067 function remove$1(event, fn) {
2068 target.$off(event, fn);
2069 }
2070
2071 function updateComponentListeners(vm, listeners, oldListeners) {
2072 target = vm;
2073 updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
2074 }
2075
2076 function eventsMixin(Vue) {
2077 var hookRE = /^hook:/;
2078 Vue.prototype.$on = function (event, fn) {
2079 var this$1 = this;
2080
2081 var vm = this;
2082 if (Array.isArray(event)) {
2083 for (var i = 0, l = event.length; i < l; i++) {
2084 this$1.$on(event[i], fn);
2085 }
2086 } else {
2087 (vm._events[event] || (vm._events[event] = [])).push(fn);
2088 // optimize hook:event cost by using a boolean flag marked at registration
2089 // instead of a hash lookup
2090 if (hookRE.test(event)) {
2091 vm._hasHookEvent = true;
2092 }
2093 }
2094 return vm;
2095 };
2096
2097 Vue.prototype.$once = function (event, fn) {
2098 var vm = this;
2099 function on() {
2100 vm.$off(event, on);
2101 fn.apply(vm, arguments);
2102 }
2103 on.fn = fn;
2104 vm.$on(event, on);
2105 return vm;
2106 };
2107
2108 Vue.prototype.$off = function (event, fn) {
2109 var this$1 = this;
2110
2111 var vm = this;
2112 // all
2113 if (!arguments.length) {
2114 vm._events = Object.create(null);
2115 return vm;
2116 }
2117 // array of events
2118 if (Array.isArray(event)) {
2119 for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
2120 this$1.$off(event[i$1], fn);
2121 }
2122 return vm;
2123 }
2124 // specific event
2125 var cbs = vm._events[event];
2126 if (!cbs) {
2127 return vm;
2128 }
2129 if (arguments.length === 1) {
2130 vm._events[event] = null;
2131 return vm;
2132 }
2133 // specific handler
2134 var cb;
2135 var i = cbs.length;
2136 while (i--) {
2137 cb = cbs[i];
2138 if (cb === fn || cb.fn === fn) {
2139 cbs.splice(i, 1);
2140 break;
2141 }
2142 }
2143 return vm;
2144 };
2145
2146 Vue.prototype.$emit = function (event) {
2147 var vm = this;
2148 if (process.env.NODE_ENV !== 'production') {
2149 var lowerCaseEvent = event.toLowerCase();
2150 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
2151 tip("Event \"" + lowerCaseEvent + "\" is emitted in component " + formatComponentName(vm) + " but the handler is registered for \"" + event + "\". " + "Note that HTML attributes are case-insensitive and you cannot use " + "v-on to listen to camelCase events when using in-DOM templates. " + "You should probably use \"" + hyphenate(event) + "\" instead of \"" + event + "\".");
2152 }
2153 }
2154 var cbs = vm._events[event];
2155 if (cbs) {
2156 cbs = cbs.length > 1 ? toArray(cbs) : cbs;
2157 var args = toArray(arguments, 1);
2158 for (var i = 0, l = cbs.length; i < l; i++) {
2159 try {
2160 cbs[i].apply(vm, args);
2161 } catch (e) {
2162 handleError(e, vm, "event handler for \"" + event + "\"");
2163 }
2164 }
2165 }
2166 return vm;
2167 };
2168 }
2169
2170 /* */
2171
2172 /**
2173 * Runtime helper for resolving raw children VNodes into a slot object.
2174 */
2175 function resolveSlots(children, context) {
2176 var slots = {};
2177 if (!children) {
2178 return slots;
2179 }
2180 var defaultSlot = [];
2181 for (var i = 0, l = children.length; i < l; i++) {
2182 var child = children[i];
2183 // named slots should only be respected if the vnode was rendered in the
2184 // same context.
2185 if ((child.context === context || child.functionalContext === context) && child.data && child.data.slot != null) {
2186 var name = child.data.slot;
2187 var slot = slots[name] || (slots[name] = []);
2188 if (child.tag === 'template') {
2189 slot.push.apply(slot, child.children);
2190 } else {
2191 slot.push(child);
2192 }
2193 } else {
2194 defaultSlot.push(child);
2195 }
2196 }
2197 // ignore whitespace
2198 if (!defaultSlot.every(isWhitespace)) {
2199 slots.default = defaultSlot;
2200 }
2201 return slots;
2202 }
2203
2204 function isWhitespace(node) {
2205 return node.isComment || node.text === ' ';
2206 }
2207
2208 function resolveScopedSlots(fns, // see flow/vnode
2209 res) {
2210 res = res || {};
2211 for (var i = 0; i < fns.length; i++) {
2212 if (Array.isArray(fns[i])) {
2213 resolveScopedSlots(fns[i], res);
2214 } else {
2215 res[fns[i].key] = fns[i].fn;
2216 }
2217 }
2218 return res;
2219 }
2220
2221 /* */
2222
2223 var activeInstance = null;
2224 var isUpdatingChildComponent = false;
2225
2226 function initLifecycle(vm) {
2227 var options = vm.$options;
2228
2229 // locate first non-abstract parent
2230 var parent = options.parent;
2231 if (parent && !options.abstract) {
2232 while (parent.$options.abstract && parent.$parent) {
2233 parent = parent.$parent;
2234 }
2235 parent.$children.push(vm);
2236 }
2237
2238 vm.$parent = parent;
2239 vm.$root = parent ? parent.$root : vm;
2240
2241 vm.$children = [];
2242 vm.$refs = {};
2243
2244 vm._watcher = null;
2245 vm._inactive = null;
2246 vm._directInactive = false;
2247 vm._isMounted = false;
2248 vm._isDestroyed = false;
2249 vm._isBeingDestroyed = false;
2250 }
2251
2252 function lifecycleMixin(Vue) {
2253 Vue.prototype._update = function (vnode, hydrating) {
2254 var vm = this;
2255 if (vm._isMounted) {
2256 callHook(vm, 'beforeUpdate');
2257 }
2258 var prevEl = vm.$el;
2259 var prevVnode = vm._vnode;
2260 var prevActiveInstance = activeInstance;
2261 activeInstance = vm;
2262 vm._vnode = vnode;
2263 // Vue.prototype.__patch__ is injected in entry points
2264 // based on the rendering backend used.
2265 if (!prevVnode) {
2266 // initial render
2267 vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */
2268 , vm.$options._parentElm, vm.$options._refElm);
2269 // no need for the ref nodes after initial patch
2270 // this prevents keeping a detached DOM tree in memory (#5851)
2271 vm.$options._parentElm = vm.$options._refElm = null;
2272 } else {
2273 // updates
2274 vm.$el = vm.__patch__(prevVnode, vnode);
2275 }
2276 activeInstance = prevActiveInstance;
2277 // update __vue__ reference
2278 if (prevEl) {
2279 prevEl.__vue__ = null;
2280 }
2281 if (vm.$el) {
2282 vm.$el.__vue__ = vm;
2283 }
2284 // if parent is an HOC, update its $el as well
2285 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
2286 vm.$parent.$el = vm.$el;
2287 }
2288 // updated hook is called by the scheduler to ensure that children are
2289 // updated in a parent's updated hook.
2290 };
2291
2292 Vue.prototype.$forceUpdate = function () {
2293 var vm = this;
2294 if (vm._watcher) {
2295 vm._watcher.update();
2296 }
2297 };
2298
2299 Vue.prototype.$destroy = function () {
2300 var vm = this;
2301 if (vm._isBeingDestroyed) {
2302 return;
2303 }
2304 callHook(vm, 'beforeDestroy');
2305 vm._isBeingDestroyed = true;
2306 // remove self from parent
2307 var parent = vm.$parent;
2308 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
2309 remove(parent.$children, vm);
2310 }
2311 // teardown watchers
2312 if (vm._watcher) {
2313 vm._watcher.teardown();
2314 }
2315 var i = vm._watchers.length;
2316 while (i--) {
2317 vm._watchers[i].teardown();
2318 }
2319 // remove reference from data ob
2320 // frozen object may not have observer.
2321 if (vm._data.__ob__) {
2322 vm._data.__ob__.vmCount--;
2323 }
2324 // call the last hook...
2325 vm._isDestroyed = true;
2326 // invoke destroy hooks on current rendered tree
2327 vm.__patch__(vm._vnode, null);
2328 // fire destroyed hook
2329 callHook(vm, 'destroyed');
2330 // turn off all instance listeners.
2331 vm.$off();
2332 // remove __vue__ reference
2333 if (vm.$el) {
2334 vm.$el.__vue__ = null;
2335 }
2336 };
2337 }
2338
2339 function mountComponent(vm, el, hydrating) {
2340 vm.$el = el;
2341 if (!vm.$options.render) {
2342 vm.$options.render = createEmptyVNode;
2343 if (process.env.NODE_ENV !== 'production') {
2344 /* istanbul ignore if */
2345 if (vm.$options.template && vm.$options.template.charAt(0) !== '#' || vm.$options.el || el) {
2346 warn('You are using the runtime-only build of Vue where the template ' + 'compiler is not available. Either pre-compile the templates into ' + 'render functions, or use the compiler-included build.', vm);
2347 } else {
2348 warn('Failed to mount component: template or render function not defined.', vm);
2349 }
2350 }
2351 }
2352 callHook(vm, 'beforeMount');
2353
2354 var updateComponent;
2355 /* istanbul ignore if */
2356 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
2357 updateComponent = function () {
2358 var name = vm._name;
2359 var id = vm._uid;
2360 var startTag = "vue-perf-start:" + id;
2361 var endTag = "vue-perf-end:" + id;
2362
2363 mark(startTag);
2364 var vnode = vm._render();
2365 mark(endTag);
2366 measure(name + " render", startTag, endTag);
2367
2368 mark(startTag);
2369 vm._update(vnode, hydrating);
2370 mark(endTag);
2371 measure(name + " patch", startTag, endTag);
2372 };
2373 } else {
2374 updateComponent = function () {
2375 vm._update(vm._render(), hydrating);
2376 };
2377 }
2378
2379 vm._watcher = new Watcher(vm, updateComponent, noop);
2380 hydrating = false;
2381
2382 // manually mounted instance, call mounted on self
2383 // mounted is called for render-created child components in its inserted hook
2384 if (vm.$vnode == null) {
2385 vm._isMounted = true;
2386 callHook(vm, 'mounted');
2387 }
2388 return vm;
2389 }
2390
2391 function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
2392 if (process.env.NODE_ENV !== 'production') {
2393 isUpdatingChildComponent = true;
2394 }
2395
2396 // determine whether component has slot children
2397 // we need to do this before overwriting $options._renderChildren
2398 var hasChildren = !!(renderChildren || // has new static slots
2399 vm.$options._renderChildren || // has old static slots
2400 parentVnode.data.scopedSlots || // has new scoped slots
2401 vm.$scopedSlots !== emptyObject // has old scoped slots
2402 );
2403
2404 vm.$options._parentVnode = parentVnode;
2405 vm.$vnode = parentVnode; // update vm's placeholder node without re-render
2406
2407 if (vm._vnode) {
2408 // update child tree's parent
2409 vm._vnode.parent = parentVnode;
2410 }
2411 vm.$options._renderChildren = renderChildren;
2412
2413 // update $attrs and $listensers hash
2414 // these are also reactive so they may trigger child update if the child
2415 // used them during render
2416 vm.$attrs = parentVnode.data && parentVnode.data.attrs;
2417 vm.$listeners = listeners;
2418
2419 // update props
2420 if (propsData && vm.$options.props) {
2421 observerState.shouldConvert = false;
2422 var props = vm._props;
2423 var propKeys = vm.$options._propKeys || [];
2424 for (var i = 0; i < propKeys.length; i++) {
2425 var key = propKeys[i];
2426 props[key] = validateProp(key, vm.$options.props, propsData, vm);
2427 }
2428 observerState.shouldConvert = true;
2429 // keep a copy of raw propsData
2430 vm.$options.propsData = propsData;
2431 }
2432
2433 // update listeners
2434 if (listeners) {
2435 var oldListeners = vm.$options._parentListeners;
2436 vm.$options._parentListeners = listeners;
2437 updateComponentListeners(vm, listeners, oldListeners);
2438 }
2439 // resolve slots + force update if has children
2440 if (hasChildren) {
2441 vm.$slots = resolveSlots(renderChildren, parentVnode.context);
2442 vm.$forceUpdate();
2443 }
2444
2445 if (process.env.NODE_ENV !== 'production') {
2446 isUpdatingChildComponent = false;
2447 }
2448 }
2449
2450 function isInInactiveTree(vm) {
2451 while (vm && (vm = vm.$parent)) {
2452 if (vm._inactive) {
2453 return true;
2454 }
2455 }
2456 return false;
2457 }
2458
2459 function activateChildComponent(vm, direct) {
2460 if (direct) {
2461 vm._directInactive = false;
2462 if (isInInactiveTree(vm)) {
2463 return;
2464 }
2465 } else if (vm._directInactive) {
2466 return;
2467 }
2468 if (vm._inactive || vm._inactive === null) {
2469 vm._inactive = false;
2470 for (var i = 0; i < vm.$children.length; i++) {
2471 activateChildComponent(vm.$children[i]);
2472 }
2473 callHook(vm, 'activated');
2474 }
2475 }
2476
2477 function deactivateChildComponent(vm, direct) {
2478 if (direct) {
2479 vm._directInactive = true;
2480 if (isInInactiveTree(vm)) {
2481 return;
2482 }
2483 }
2484 if (!vm._inactive) {
2485 vm._inactive = true;
2486 for (var i = 0; i < vm.$children.length; i++) {
2487 deactivateChildComponent(vm.$children[i]);
2488 }
2489 callHook(vm, 'deactivated');
2490 }
2491 }
2492
2493 function callHook(vm, hook) {
2494 var handlers = vm.$options[hook];
2495 if (handlers) {
2496 for (var i = 0, j = handlers.length; i < j; i++) {
2497 try {
2498 handlers[i].call(vm);
2499 } catch (e) {
2500 handleError(e, vm, hook + " hook");
2501 }
2502 }
2503 }
2504 if (vm._hasHookEvent) {
2505 vm.$emit('hook:' + hook);
2506 }
2507 }
2508
2509 /* */
2510
2511 var MAX_UPDATE_COUNT = 100;
2512
2513 var queue = [];
2514 var activatedChildren = [];
2515 var has = {};
2516 var circular = {};
2517 var waiting = false;
2518 var flushing = false;
2519 var index = 0;
2520
2521 /**
2522 * Reset the scheduler's state.
2523 */
2524 function resetSchedulerState() {
2525 index = queue.length = activatedChildren.length = 0;
2526 has = {};
2527 if (process.env.NODE_ENV !== 'production') {
2528 circular = {};
2529 }
2530 waiting = flushing = false;
2531 }
2532
2533 /**
2534 * Flush both queues and run the watchers.
2535 */
2536 function flushSchedulerQueue() {
2537 flushing = true;
2538 var watcher, id;
2539
2540 // Sort queue before flush.
2541 // This ensures that:
2542 // 1. Components are updated from parent to child. (because parent is always
2543 // created before the child)
2544 // 2. A component's user watchers are run before its render watcher (because
2545 // user watchers are created before the render watcher)
2546 // 3. If a component is destroyed during a parent component's watcher run,
2547 // its watchers can be skipped.
2548 queue.sort(function (a, b) {
2549 return a.id - b.id;
2550 });
2551
2552 // do not cache length because more watchers might be pushed
2553 // as we run existing watchers
2554 for (index = 0; index < queue.length; index++) {
2555 watcher = queue[index];
2556 id = watcher.id;
2557 has[id] = null;
2558 watcher.run();
2559 // in dev build, check and stop circular updates.
2560 if (process.env.NODE_ENV !== 'production' && has[id] != null) {
2561 circular[id] = (circular[id] || 0) + 1;
2562 if (circular[id] > MAX_UPDATE_COUNT) {
2563 warn('You may have an infinite update loop ' + (watcher.user ? "in watcher with expression \"" + watcher.expression + "\"" : "in a component render function."), watcher.vm);
2564 break;
2565 }
2566 }
2567 }
2568
2569 // keep copies of post queues before resetting state
2570 var activatedQueue = activatedChildren.slice();
2571 var updatedQueue = queue.slice();
2572
2573 resetSchedulerState();
2574
2575 // call component updated and activated hooks
2576 callActivatedHooks(activatedQueue);
2577 callUpdatedHooks(updatedQueue);
2578
2579 // devtool hook
2580 /* istanbul ignore if */
2581 if (devtools && config.devtools) {
2582 devtools.emit('flush');
2583 }
2584 }
2585
2586 function callUpdatedHooks(queue) {
2587 var i = queue.length;
2588 while (i--) {
2589 var watcher = queue[i];
2590 var vm = watcher.vm;
2591 if (vm._watcher === watcher && vm._isMounted) {
2592 callHook(vm, 'updated');
2593 }
2594 }
2595 }
2596
2597 /**
2598 * Queue a kept-alive component that was activated during patch.
2599 * The queue will be processed after the entire tree has been patched.
2600 */
2601 function queueActivatedComponent(vm) {
2602 // setting _inactive to false here so that a render function can
2603 // rely on checking whether it's in an inactive tree (e.g. router-view)
2604 vm._inactive = false;
2605 activatedChildren.push(vm);
2606 }
2607
2608 function callActivatedHooks(queue) {
2609 for (var i = 0; i < queue.length; i++) {
2610 queue[i]._inactive = true;
2611 activateChildComponent(queue[i], true /* true */);
2612 }
2613 }
2614
2615 /**
2616 * Push a watcher into the watcher queue.
2617 * Jobs with duplicate IDs will be skipped unless it's
2618 * pushed when the queue is being flushed.
2619 */
2620 function queueWatcher(watcher) {
2621 var id = watcher.id;
2622 if (has[id] == null) {
2623 has[id] = true;
2624 if (!flushing) {
2625 queue.push(watcher);
2626 } else {
2627 // if already flushing, splice the watcher based on its id
2628 // if already past its id, it will be run next immediately.
2629 var i = queue.length - 1;
2630 while (i > index && queue[i].id > watcher.id) {
2631 i--;
2632 }
2633 queue.splice(i + 1, 0, watcher);
2634 }
2635 // queue the flush
2636 if (!waiting) {
2637 waiting = true;
2638 nextTick(flushSchedulerQueue);
2639 }
2640 }
2641 }
2642
2643 /* */
2644
2645 var uid$2 = 0;
2646
2647 /**
2648 * A watcher parses an expression, collects dependencies,
2649 * and fires callback when the expression value changes.
2650 * This is used for both the $watch() api and directives.
2651 */
2652 var Watcher = function Watcher(vm, expOrFn, cb, options) {
2653 this.vm = vm;
2654 vm._watchers.push(this);
2655 // options
2656 if (options) {
2657 this.deep = !!options.deep;
2658 this.user = !!options.user;
2659 this.lazy = !!options.lazy;
2660 this.sync = !!options.sync;
2661 } else {
2662 this.deep = this.user = this.lazy = this.sync = false;
2663 }
2664 this.cb = cb;
2665 this.id = ++uid$2; // uid for batching
2666 this.active = true;
2667 this.dirty = this.lazy; // for lazy watchers
2668 this.deps = [];
2669 this.newDeps = [];
2670 this.depIds = new _Set();
2671 this.newDepIds = new _Set();
2672 this.expression = process.env.NODE_ENV !== 'production' ? expOrFn.toString() : '';
2673 // parse expression for getter
2674 if (typeof expOrFn === 'function') {
2675 this.getter = expOrFn;
2676 } else {
2677 this.getter = parsePath(expOrFn);
2678 if (!this.getter) {
2679 this.getter = function () {};
2680 process.env.NODE_ENV !== 'production' && warn("Failed watching path: \"" + expOrFn + "\" " + 'Watcher only accepts simple dot-delimited paths. ' + 'For full control, use a function instead.', vm);
2681 }
2682 }
2683 this.value = this.lazy ? undefined : this.get();
2684 };
2685
2686 /**
2687 * Evaluate the getter, and re-collect dependencies.
2688 */
2689 Watcher.prototype.get = function get() {
2690 pushTarget(this);
2691 var value;
2692 var vm = this.vm;
2693 try {
2694 value = this.getter.call(vm, vm);
2695 } catch (e) {
2696 if (this.user) {
2697 handleError(e, vm, "getter for watcher \"" + this.expression + "\"");
2698 } else {
2699 throw e;
2700 }
2701 } finally {
2702 // "touch" every property so they are all tracked as
2703 // dependencies for deep watching
2704 if (this.deep) {
2705 traverse(value);
2706 }
2707 popTarget();
2708 this.cleanupDeps();
2709 }
2710 return value;
2711 };
2712
2713 /**
2714 * Add a dependency to this directive.
2715 */
2716 Watcher.prototype.addDep = function addDep(dep) {
2717 var id = dep.id;
2718 if (!this.newDepIds.has(id)) {
2719 this.newDepIds.add(id);
2720 this.newDeps.push(dep);
2721 if (!this.depIds.has(id)) {
2722 dep.addSub(this);
2723 }
2724 }
2725 };
2726
2727 /**
2728 * Clean up for dependency collection.
2729 */
2730 Watcher.prototype.cleanupDeps = function cleanupDeps() {
2731 var this$1 = this;
2732
2733 var i = this.deps.length;
2734 while (i--) {
2735 var dep = this$1.deps[i];
2736 if (!this$1.newDepIds.has(dep.id)) {
2737 dep.removeSub(this$1);
2738 }
2739 }
2740 var tmp = this.depIds;
2741 this.depIds = this.newDepIds;
2742 this.newDepIds = tmp;
2743 this.newDepIds.clear();
2744 tmp = this.deps;
2745 this.deps = this.newDeps;
2746 this.newDeps = tmp;
2747 this.newDeps.length = 0;
2748 };
2749
2750 /**
2751 * Subscriber interface.
2752 * Will be called when a dependency changes.
2753 */
2754 Watcher.prototype.update = function update() {
2755 /* istanbul ignore else */
2756 if (this.lazy) {
2757 this.dirty = true;
2758 } else if (this.sync) {
2759 this.run();
2760 } else {
2761 queueWatcher(this);
2762 }
2763 };
2764
2765 /**
2766 * Scheduler job interface.
2767 * Will be called by the scheduler.
2768 */
2769 Watcher.prototype.run = function run() {
2770 if (this.active) {
2771 var value = this.get();
2772 if (value !== this.value ||
2773 // Deep watchers and watchers on Object/Arrays should fire even
2774 // when the value is the same, because the value may
2775 // have mutated.
2776 isObject(value) || this.deep) {
2777 // set new value
2778 var oldValue = this.value;
2779 this.value = value;
2780 if (this.user) {
2781 try {
2782 this.cb.call(this.vm, value, oldValue);
2783 } catch (e) {
2784 handleError(e, this.vm, "callback for watcher \"" + this.expression + "\"");
2785 }
2786 } else {
2787 this.cb.call(this.vm, value, oldValue);
2788 }
2789 }
2790 }
2791 };
2792
2793 /**
2794 * Evaluate the value of the watcher.
2795 * This only gets called for lazy watchers.
2796 */
2797 Watcher.prototype.evaluate = function evaluate() {
2798 this.value = this.get();
2799 this.dirty = false;
2800 };
2801
2802 /**
2803 * Depend on all deps collected by this watcher.
2804 */
2805 Watcher.prototype.depend = function depend() {
2806 var this$1 = this;
2807
2808 var i = this.deps.length;
2809 while (i--) {
2810 this$1.deps[i].depend();
2811 }
2812 };
2813
2814 /**
2815 * Remove self from all dependencies' subscriber list.
2816 */
2817 Watcher.prototype.teardown = function teardown() {
2818 var this$1 = this;
2819
2820 if (this.active) {
2821 // remove self from vm's watcher list
2822 // this is a somewhat expensive operation so we skip it
2823 // if the vm is being destroyed.
2824 if (!this.vm._isBeingDestroyed) {
2825 remove(this.vm._watchers, this);
2826 }
2827 var i = this.deps.length;
2828 while (i--) {
2829 this$1.deps[i].removeSub(this$1);
2830 }
2831 this.active = false;
2832 }
2833 };
2834
2835 /**
2836 * Recursively traverse an object to evoke all converted
2837 * getters, so that every nested property inside the object
2838 * is collected as a "deep" dependency.
2839 */
2840 var seenObjects = new _Set();
2841 function traverse(val) {
2842 seenObjects.clear();
2843 _traverse(val, seenObjects);
2844 }
2845
2846 function _traverse(val, seen) {
2847 var i, keys;
2848 var isA = Array.isArray(val);
2849 if (!isA && !isObject(val) || !Object.isExtensible(val)) {
2850 return;
2851 }
2852 if (val.__ob__) {
2853 var depId = val.__ob__.dep.id;
2854 if (seen.has(depId)) {
2855 return;
2856 }
2857 seen.add(depId);
2858 }
2859 if (isA) {
2860 i = val.length;
2861 while (i--) {
2862 _traverse(val[i], seen);
2863 }
2864 } else {
2865 keys = Object.keys(val);
2866 i = keys.length;
2867 while (i--) {
2868 _traverse(val[keys[i]], seen);
2869 }
2870 }
2871 }
2872
2873 /* */
2874
2875 var sharedPropertyDefinition = {
2876 enumerable: true,
2877 configurable: true,
2878 get: noop,
2879 set: noop
2880 };
2881
2882 function proxy(target, sourceKey, key) {
2883 sharedPropertyDefinition.get = function proxyGetter() {
2884 return this[sourceKey][key];
2885 };
2886 sharedPropertyDefinition.set = function proxySetter(val) {
2887 this[sourceKey][key] = val;
2888 };
2889 Object.defineProperty(target, key, sharedPropertyDefinition);
2890 }
2891
2892 function initState(vm) {
2893 vm._watchers = [];
2894 var opts = vm.$options;
2895 if (opts.props) {
2896 initProps(vm, opts.props);
2897 }
2898 if (opts.methods) {
2899 initMethods(vm, opts.methods);
2900 }
2901 if (opts.data) {
2902 initData(vm);
2903 } else {
2904 observe(vm._data = {}, true /* asRootData */);
2905 }
2906 if (opts.computed) {
2907 initComputed(vm, opts.computed);
2908 }
2909 if (opts.watch && opts.watch !== nativeWatch) {
2910 initWatch(vm, opts.watch);
2911 }
2912 }
2913
2914 function checkOptionType(vm, name) {
2915 var option = vm.$options[name];
2916 if (!isPlainObject(option)) {
2917 warn("component option \"" + name + "\" should be an object.", vm);
2918 }
2919 }
2920
2921 function initProps(vm, propsOptions) {
2922 var propsData = vm.$options.propsData || {};
2923 var props = vm._props = {};
2924 // cache prop keys so that future props updates can iterate using Array
2925 // instead of dynamic object key enumeration.
2926 var keys = vm.$options._propKeys = [];
2927 var isRoot = !vm.$parent;
2928 // root instance props should be converted
2929 observerState.shouldConvert = isRoot;
2930 var loop = function (key) {
2931 keys.push(key);
2932 var value = validateProp(key, propsOptions, propsData, vm);
2933 /* istanbul ignore else */
2934 if (process.env.NODE_ENV !== 'production') {
2935 if (isReservedAttribute(key) || config.isReservedAttr(key)) {
2936 warn("\"" + key + "\" is a reserved attribute and cannot be used as component prop.", vm);
2937 }
2938 defineReactive$$1(props, key, value, function () {
2939 if (vm.$parent && !isUpdatingChildComponent) {
2940 warn("Avoid mutating a prop directly since the value will be " + "overwritten whenever the parent component re-renders. " + "Instead, use a data or computed property based on the prop's " + "value. Prop being mutated: \"" + key + "\"", vm);
2941 }
2942 });
2943 } else {
2944 defineReactive$$1(props, key, value);
2945 }
2946 // static props are already proxied on the component's prototype
2947 // during Vue.extend(). We only need to proxy props defined at
2948 // instantiation here.
2949 if (!(key in vm)) {
2950 proxy(vm, "_props", key);
2951 }
2952 };
2953
2954 for (var key in propsOptions) loop(key);
2955 observerState.shouldConvert = true;
2956 }
2957
2958 function initData(vm) {
2959 var data = vm.$options.data;
2960 data = vm._data = typeof data === 'function' ? getData(data, vm) : data || {};
2961 if (!isPlainObject(data)) {
2962 data = {};
2963 process.env.NODE_ENV !== 'production' && warn('data functions should return an object:\n' + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
2964 }
2965 // proxy data on instance
2966 var keys = Object.keys(data);
2967 var props = vm.$options.props;
2968 var methods = vm.$options.methods;
2969 var i = keys.length;
2970 while (i--) {
2971 var key = keys[i];
2972 if (process.env.NODE_ENV !== 'production') {
2973 if (methods && hasOwn(methods, key)) {
2974 warn("method \"" + key + "\" has already been defined as a data property.", vm);
2975 }
2976 }
2977 if (props && hasOwn(props, key)) {
2978 process.env.NODE_ENV !== 'production' && warn("The data property \"" + key + "\" is already declared as a prop. " + "Use prop default value instead.", vm);
2979 } else if (!isReserved(key)) {
2980 proxy(vm, "_data", key);
2981 }
2982 }
2983 // observe data
2984 observe(data, true /* asRootData */);
2985 }
2986
2987 function getData(data, vm) {
2988 try {
2989 return data.call(vm);
2990 } catch (e) {
2991 handleError(e, vm, "data()");
2992 return {};
2993 }
2994 }
2995
2996 var computedWatcherOptions = { lazy: true };
2997
2998 function initComputed(vm, computed) {
2999 process.env.NODE_ENV !== 'production' && checkOptionType(vm, 'computed');
3000 var watchers = vm._computedWatchers = Object.create(null);
3001
3002 for (var key in computed) {
3003 var userDef = computed[key];
3004 var getter = typeof userDef === 'function' ? userDef : userDef.get;
3005 if (process.env.NODE_ENV !== 'production' && getter == null) {
3006 warn("Getter is missing for computed property \"" + key + "\".", vm);
3007 }
3008 // create internal watcher for the computed property.
3009 watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
3010
3011 // component-defined computed properties are already defined on the
3012 // component prototype. We only need to define computed properties defined
3013 // at instantiation here.
3014 if (!(key in vm)) {
3015 defineComputed(vm, key, userDef);
3016 } else if (process.env.NODE_ENV !== 'production') {
3017 if (key in vm.$data) {
3018 warn("The computed property \"" + key + "\" is already defined in data.", vm);
3019 } else if (vm.$options.props && key in vm.$options.props) {
3020 warn("The computed property \"" + key + "\" is already defined as a prop.", vm);
3021 }
3022 }
3023 }
3024 }
3025
3026 function defineComputed(target, key, userDef) {
3027 if (typeof userDef === 'function') {
3028 sharedPropertyDefinition.get = createComputedGetter(key);
3029 sharedPropertyDefinition.set = noop;
3030 } else {
3031 sharedPropertyDefinition.get = userDef.get ? userDef.cache !== false ? createComputedGetter(key) : userDef.get : noop;
3032 sharedPropertyDefinition.set = userDef.set ? userDef.set : noop;
3033 }
3034 if (process.env.NODE_ENV !== 'production' && sharedPropertyDefinition.set === noop) {
3035 sharedPropertyDefinition.set = function () {
3036 warn("Computed property \"" + key + "\" was assigned to but it has no setter.", this);
3037 };
3038 }
3039 Object.defineProperty(target, key, sharedPropertyDefinition);
3040 }
3041
3042 function createComputedGetter(key) {
3043 return function computedGetter() {
3044 var watcher = this._computedWatchers && this._computedWatchers[key];
3045 if (watcher) {
3046 if (watcher.dirty) {
3047 watcher.evaluate();
3048 }
3049 if (Dep.target) {
3050 watcher.depend();
3051 }
3052 return watcher.value;
3053 }
3054 };
3055 }
3056
3057 function initMethods(vm, methods) {
3058 process.env.NODE_ENV !== 'production' && checkOptionType(vm, 'methods');
3059 var props = vm.$options.props;
3060 for (var key in methods) {
3061 vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
3062 if (process.env.NODE_ENV !== 'production') {
3063 if (methods[key] == null) {
3064 warn("method \"" + key + "\" has an undefined value in the component definition. " + "Did you reference the function correctly?", vm);
3065 }
3066 if (props && hasOwn(props, key)) {
3067 warn("method \"" + key + "\" has already been defined as a prop.", vm);
3068 }
3069 }
3070 }
3071 }
3072
3073 function initWatch(vm, watch) {
3074 process.env.NODE_ENV !== 'production' && checkOptionType(vm, 'watch');
3075 for (var key in watch) {
3076 var handler = watch[key];
3077 if (Array.isArray(handler)) {
3078 for (var i = 0; i < handler.length; i++) {
3079 createWatcher(vm, key, handler[i]);
3080 }
3081 } else {
3082 createWatcher(vm, key, handler);
3083 }
3084 }
3085 }
3086
3087 function createWatcher(vm, keyOrFn, handler, options) {
3088 if (isPlainObject(handler)) {
3089 options = handler;
3090 handler = handler.handler;
3091 }
3092 if (typeof handler === 'string') {
3093 handler = vm[handler];
3094 }
3095 return vm.$watch(keyOrFn, handler, options);
3096 }
3097
3098 function stateMixin(Vue) {
3099 // flow somehow has problems with directly declared definition object
3100 // when using Object.defineProperty, so we have to procedurally build up
3101 // the object here.
3102 var dataDef = {};
3103 dataDef.get = function () {
3104 return this._data;
3105 };
3106 var propsDef = {};
3107 propsDef.get = function () {
3108 return this._props;
3109 };
3110 if (process.env.NODE_ENV !== 'production') {
3111 dataDef.set = function (newData) {
3112 warn('Avoid replacing instance root $data. ' + 'Use nested data properties instead.', this);
3113 };
3114 propsDef.set = function () {
3115 warn("$props is readonly.", this);
3116 };
3117 }
3118 Object.defineProperty(Vue.prototype, '$data', dataDef);
3119 Object.defineProperty(Vue.prototype, '$props', propsDef);
3120
3121 Vue.prototype.$set = set;
3122 Vue.prototype.$delete = del;
3123
3124 Vue.prototype.$watch = function (expOrFn, cb, options) {
3125 var vm = this;
3126 if (isPlainObject(cb)) {
3127 return createWatcher(vm, expOrFn, cb, options);
3128 }
3129 options = options || {};
3130 options.user = true;
3131 var watcher = new Watcher(vm, expOrFn, cb, options);
3132 if (options.immediate) {
3133 cb.call(vm, watcher.value);
3134 }
3135 return function unwatchFn() {
3136 watcher.teardown();
3137 };
3138 };
3139 }
3140
3141 /* */
3142
3143 function initProvide(vm) {
3144 var provide = vm.$options.provide;
3145 if (provide) {
3146 vm._provided = typeof provide === 'function' ? provide.call(vm) : provide;
3147 }
3148 }
3149
3150 function initInjections(vm) {
3151 var result = resolveInject(vm.$options.inject, vm);
3152 if (result) {
3153 observerState.shouldConvert = false;
3154 Object.keys(result).forEach(function (key) {
3155 /* istanbul ignore else */
3156 if (process.env.NODE_ENV !== 'production') {
3157 defineReactive$$1(vm, key, result[key], function () {
3158 warn("Avoid mutating an injected value directly since the changes will be " + "overwritten whenever the provided component re-renders. " + "injection being mutated: \"" + key + "\"", vm);
3159 });
3160 } else {
3161 defineReactive$$1(vm, key, result[key]);
3162 }
3163 });
3164 observerState.shouldConvert = true;
3165 }
3166 }
3167
3168 function resolveInject(inject, vm) {
3169 if (inject) {
3170 // inject is :any because flow is not smart enough to figure out cached
3171 var result = Object.create(null);
3172 var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
3173
3174 for (var i = 0; i < keys.length; i++) {
3175 var key = keys[i];
3176 var provideKey = inject[key];
3177 var source = vm;
3178 while (source) {
3179 if (source._provided && provideKey in source._provided) {
3180 result[key] = source._provided[provideKey];
3181 break;
3182 }
3183 source = source.$parent;
3184 }
3185 if (process.env.NODE_ENV !== 'production' && !source) {
3186 warn("Injection \"" + key + "\" not found", vm);
3187 }
3188 }
3189 return result;
3190 }
3191 }
3192
3193 /* */
3194
3195 function createFunctionalComponent(Ctor, propsData, data, context, children) {
3196 var props = {};
3197 var propOptions = Ctor.options.props;
3198 if (isDef(propOptions)) {
3199 for (var key in propOptions) {
3200 props[key] = validateProp(key, propOptions, propsData || {});
3201 }
3202 } else {
3203 if (isDef(data.attrs)) {
3204 mergeProps(props, data.attrs);
3205 }
3206 if (isDef(data.props)) {
3207 mergeProps(props, data.props);
3208 }
3209 }
3210 // ensure the createElement function in functional components
3211 // gets a unique context - this is necessary for correct named slot check
3212 var _context = Object.create(context);
3213 var h = function (a, b, c, d) {
3214 return createElement(_context, a, b, c, d, true);
3215 };
3216 var vnode = Ctor.options.render.call(null, h, {
3217 data: data,
3218 props: props,
3219 children: children,
3220 parent: context,
3221 listeners: data.on || {},
3222 injections: resolveInject(Ctor.options.inject, context),
3223 slots: function () {
3224 return resolveSlots(children, context);
3225 }
3226 });
3227 if (vnode instanceof VNode) {
3228 vnode.functionalContext = context;
3229 vnode.functionalOptions = Ctor.options;
3230 if (data.slot) {
3231 (vnode.data || (vnode.data = {})).slot = data.slot;
3232 }
3233 }
3234 return vnode;
3235 }
3236
3237 function mergeProps(to, from) {
3238 for (var key in from) {
3239 to[camelize(key)] = from[key];
3240 }
3241 }
3242
3243 /* */
3244
3245 // hooks to be invoked on component VNodes during patch
3246 var componentVNodeHooks = {
3247 init: function init(vnode, hydrating, parentElm, refElm) {
3248 if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
3249 var child = vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance, parentElm, refElm);
3250 child.$mount(hydrating ? vnode.elm : undefined, hydrating);
3251 } else if (vnode.data.keepAlive) {
3252 // kept-alive components, treat as a patch
3253 var mountedNode = vnode; // work around flow
3254 componentVNodeHooks.prepatch(mountedNode, mountedNode);
3255 }
3256 },
3257
3258 prepatch: function prepatch(oldVnode, vnode) {
3259 var options = vnode.componentOptions;
3260 var child = vnode.componentInstance = oldVnode.componentInstance;
3261 updateChildComponent(child, options.propsData, // updated props
3262 options.listeners, // updated listeners
3263 vnode, // new parent vnode
3264 options.children // new children
3265 );
3266 },
3267
3268 insert: function insert(vnode) {
3269 var context = vnode.context;
3270 var componentInstance = vnode.componentInstance;
3271 if (!componentInstance._isMounted) {
3272 componentInstance._isMounted = true;
3273 callHook(componentInstance, 'mounted');
3274 }
3275 if (vnode.data.keepAlive) {
3276 if (context._isMounted) {
3277 // vue-router#1212
3278 // During updates, a kept-alive component's child components may
3279 // change, so directly walking the tree here may call activated hooks
3280 // on incorrect children. Instead we push them into a queue which will
3281 // be processed after the whole patch process ended.
3282 queueActivatedComponent(componentInstance);
3283 } else {
3284 activateChildComponent(componentInstance, true /* direct */);
3285 }
3286 }
3287 },
3288
3289 destroy: function destroy(vnode) {
3290 var componentInstance = vnode.componentInstance;
3291 if (!componentInstance._isDestroyed) {
3292 if (!vnode.data.keepAlive) {
3293 componentInstance.$destroy();
3294 } else {
3295 deactivateChildComponent(componentInstance, true /* direct */);
3296 }
3297 }
3298 }
3299 };
3300
3301 var hooksToMerge = Object.keys(componentVNodeHooks);
3302
3303 function createComponent(Ctor, data, context, children, tag) {
3304 if (isUndef(Ctor)) {
3305 return;
3306 }
3307
3308 var baseCtor = context.$options._base;
3309
3310 // plain options object: turn it into a constructor
3311 if (isObject(Ctor)) {
3312 Ctor = baseCtor.extend(Ctor);
3313 }
3314
3315 // if at this stage it's not a constructor or an async component factory,
3316 // reject.
3317 if (typeof Ctor !== 'function') {
3318 if (process.env.NODE_ENV !== 'production') {
3319 warn("Invalid Component definition: " + String(Ctor), context);
3320 }
3321 return;
3322 }
3323
3324 // async component
3325 var asyncFactory;
3326 if (isUndef(Ctor.cid)) {
3327 asyncFactory = Ctor;
3328 Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context);
3329 if (Ctor === undefined) {
3330 // return a placeholder node for async component, which is rendered
3331 // as a comment node but preserves all the raw information for the node.
3332 // the information will be used for async server-rendering and hydration.
3333 return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
3334 }
3335 }
3336
3337 data = data || {};
3338
3339 // resolve constructor options in case global mixins are applied after
3340 // component constructor creation
3341 resolveConstructorOptions(Ctor);
3342
3343 // transform component v-model data into props & events
3344 if (isDef(data.model)) {
3345 transformModel(Ctor.options, data);
3346 }
3347
3348 // extract props
3349 var propsData = extractPropsFromVNodeData(data, Ctor, tag);
3350
3351 // functional component
3352 if (isTrue(Ctor.options.functional)) {
3353 return createFunctionalComponent(Ctor, propsData, data, context, children);
3354 }
3355
3356 // extract listeners, since these needs to be treated as
3357 // child component listeners instead of DOM listeners
3358 var listeners = data.on;
3359 // replace with listeners with .native modifier
3360 // so it gets processed during parent component patch.
3361 data.on = data.nativeOn;
3362
3363 if (isTrue(Ctor.options.abstract)) {
3364 // abstract components do not keep anything
3365 // other than props & listeners & slot
3366
3367 // work around flow
3368 var slot = data.slot;
3369 data = {};
3370 if (slot) {
3371 data.slot = slot;
3372 }
3373 }
3374
3375 // merge component management hooks onto the placeholder node
3376 mergeHooks(data);
3377
3378 // return a placeholder vnode
3379 var name = Ctor.options.name || tag;
3380 var vnode = new VNode("vue-component-" + Ctor.cid + (name ? "-" + name : ''), data, undefined, undefined, undefined, context, { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
3381 return vnode;
3382 }
3383
3384 function createComponentInstanceForVnode(vnode, // we know it's MountedComponentVNode but flow doesn't
3385 parent, // activeInstance in lifecycle state
3386 parentElm, refElm) {
3387 var vnodeComponentOptions = vnode.componentOptions;
3388 var options = {
3389 _isComponent: true,
3390 parent: parent,
3391 propsData: vnodeComponentOptions.propsData,
3392 _componentTag: vnodeComponentOptions.tag,
3393 _parentVnode: vnode,
3394 _parentListeners: vnodeComponentOptions.listeners,
3395 _renderChildren: vnodeComponentOptions.children,
3396 _parentElm: parentElm || null,
3397 _refElm: refElm || null
3398 };
3399 // check inline-template render functions
3400 var inlineTemplate = vnode.data.inlineTemplate;
3401 if (isDef(inlineTemplate)) {
3402 options.render = inlineTemplate.render;
3403 options.staticRenderFns = inlineTemplate.staticRenderFns;
3404 }
3405 return new vnodeComponentOptions.Ctor(options);
3406 }
3407
3408 function mergeHooks(data) {
3409 if (!data.hook) {
3410 data.hook = {};
3411 }
3412 for (var i = 0; i < hooksToMerge.length; i++) {
3413 var key = hooksToMerge[i];
3414 var fromParent = data.hook[key];
3415 var ours = componentVNodeHooks[key];
3416 data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
3417 }
3418 }
3419
3420 function mergeHook$1(one, two) {
3421 return function (a, b, c, d) {
3422 one(a, b, c, d);
3423 two(a, b, c, d);
3424 };
3425 }
3426
3427 // transform component v-model info (value and callback) into
3428 // prop and event handler respectively.
3429 function transformModel(options, data) {
3430 var prop = options.model && options.model.prop || 'value';
3431 var event = options.model && options.model.event || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
3432 var on = data.on || (data.on = {});
3433 if (isDef(on[event])) {
3434 on[event] = [data.model.callback].concat(on[event]);
3435 } else {
3436 on[event] = data.model.callback;
3437 }
3438 }
3439
3440 /* */
3441
3442 var SIMPLE_NORMALIZE = 1;
3443 var ALWAYS_NORMALIZE = 2;
3444
3445 // wrapper function for providing a more flexible interface
3446 // without getting yelled at by flow
3447 function createElement(context, tag, data, children, normalizationType, alwaysNormalize) {
3448 if (Array.isArray(data) || isPrimitive(data)) {
3449 normalizationType = children;
3450 children = data;
3451 data = undefined;
3452 }
3453 if (isTrue(alwaysNormalize)) {
3454 normalizationType = ALWAYS_NORMALIZE;
3455 }
3456 return _createElement(context, tag, data, children, normalizationType);
3457 }
3458
3459 function _createElement(context, tag, data, children, normalizationType) {
3460 if (isDef(data) && isDef(data.__ob__)) {
3461 process.env.NODE_ENV !== 'production' && warn("Avoid using observed data object as vnode data: " + JSON.stringify(data) + "\n" + 'Always create fresh vnode data objects in each render!', context);
3462 return createEmptyVNode();
3463 }
3464 // object syntax in v-bind
3465 if (isDef(data) && isDef(data.is)) {
3466 tag = data.is;
3467 }
3468 if (!tag) {
3469 // in case of component :is set to falsy value
3470 return createEmptyVNode();
3471 }
3472 // warn against non-primitive key
3473 if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
3474 warn('Avoid using non-primitive value as key, ' + 'use string/number value instead.', context);
3475 }
3476 // support single function children as default scoped slot
3477 if (Array.isArray(children) && typeof children[0] === 'function') {
3478 data = data || {};
3479 data.scopedSlots = { default: children[0] };
3480 children.length = 0;
3481 }
3482 if (normalizationType === ALWAYS_NORMALIZE) {
3483 children = normalizeChildren(children);
3484 } else if (normalizationType === SIMPLE_NORMALIZE) {
3485 children = simpleNormalizeChildren(children);
3486 }
3487 var vnode, ns;
3488 if (typeof tag === 'string') {
3489 var Ctor;
3490 ns = config.getTagNamespace(tag);
3491 if (config.isReservedTag(tag)) {
3492 // platform built-in elements
3493 vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
3494 } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
3495 // component
3496 vnode = createComponent(Ctor, data, context, children, tag);
3497 } else {
3498 // unknown or unlisted namespaced elements
3499 // check at runtime because it may get assigned a namespace when its
3500 // parent normalizes children
3501 vnode = new VNode(tag, data, children, undefined, undefined, context);
3502 }
3503 } else {
3504 // direct component options / constructor
3505 vnode = createComponent(tag, data, context, children);
3506 }
3507 if (isDef(vnode)) {
3508 if (ns) {
3509 applyNS(vnode, ns);
3510 }
3511 return vnode;
3512 } else {
3513 return createEmptyVNode();
3514 }
3515 }
3516
3517 function applyNS(vnode, ns) {
3518 vnode.ns = ns;
3519 if (vnode.tag === 'foreignObject') {
3520 // use default namespace inside foreignObject
3521 return;
3522 }
3523 if (isDef(vnode.children)) {
3524 for (var i = 0, l = vnode.children.length; i < l; i++) {
3525 var child = vnode.children[i];
3526 if (isDef(child.tag) && isUndef(child.ns)) {
3527 applyNS(child, ns);
3528 }
3529 }
3530 }
3531 }
3532
3533 /* */
3534
3535 /**
3536 * Runtime helper for rendering v-for lists.
3537 */
3538 function renderList(val, render) {
3539 var ret, i, l, keys, key;
3540 if (Array.isArray(val) || typeof val === 'string') {
3541 ret = new Array(val.length);
3542 for (i = 0, l = val.length; i < l; i++) {
3543 ret[i] = render(val[i], i);
3544 }
3545 } else if (typeof val === 'number') {
3546 ret = new Array(val);
3547 for (i = 0; i < val; i++) {
3548 ret[i] = render(i + 1, i);
3549 }
3550 } else if (isObject(val)) {
3551 keys = Object.keys(val);
3552 ret = new Array(keys.length);
3553 for (i = 0, l = keys.length; i < l; i++) {
3554 key = keys[i];
3555 ret[i] = render(val[key], key, i);
3556 }
3557 }
3558 if (isDef(ret)) {
3559 ret._isVList = true;
3560 }
3561 return ret;
3562 }
3563
3564 /* */
3565
3566 /**
3567 * Runtime helper for rendering <slot>
3568 */
3569 function renderSlot(name, fallback, props, bindObject) {
3570 var scopedSlotFn = this.$scopedSlots[name];
3571 if (scopedSlotFn) {
3572 // scoped slot
3573 props = props || {};
3574 if (bindObject) {
3575 props = extend(extend({}, bindObject), props);
3576 }
3577 return scopedSlotFn(props) || fallback;
3578 } else {
3579 var slotNodes = this.$slots[name];
3580 // warn duplicate slot usage
3581 if (slotNodes && process.env.NODE_ENV !== 'production') {
3582 slotNodes._rendered && warn("Duplicate presence of slot \"" + name + "\" found in the same render tree " + "- this will likely cause render errors.", this);
3583 slotNodes._rendered = true;
3584 }
3585 return slotNodes || fallback;
3586 }
3587 }
3588
3589 /* */
3590
3591 /**
3592 * Runtime helper for resolving filters
3593 */
3594 function resolveFilter(id) {
3595 return resolveAsset(this.$options, 'filters', id, true) || identity;
3596 }
3597
3598 /* */
3599
3600 /**
3601 * Runtime helper for checking keyCodes from config.
3602 */
3603 function checkKeyCodes(eventKeyCode, key, builtInAlias) {
3604 var keyCodes = config.keyCodes[key] || builtInAlias;
3605 if (Array.isArray(keyCodes)) {
3606 return keyCodes.indexOf(eventKeyCode) === -1;
3607 } else {
3608 return keyCodes !== eventKeyCode;
3609 }
3610 }
3611
3612 /* */
3613
3614 /**
3615 * Runtime helper for merging v-bind="object" into a VNode's data.
3616 */
3617 function bindObjectProps(data, tag, value, asProp, isSync) {
3618 if (value) {
3619 if (!isObject(value)) {
3620 process.env.NODE_ENV !== 'production' && warn('v-bind without argument expects an Object or Array value', this);
3621 } else {
3622 if (Array.isArray(value)) {
3623 value = toObject(value);
3624 }
3625 var hash;
3626 var loop = function (key) {
3627 if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
3628 hash = data;
3629 } else {
3630 var type = data.attrs && data.attrs.type;
3631 hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});
3632 }
3633 if (!(key in hash)) {
3634 hash[key] = value[key];
3635
3636 if (isSync) {
3637 var on = data.on || (data.on = {});
3638 on["update:" + key] = function ($event) {
3639 value[key] = $event;
3640 };
3641 }
3642 }
3643 };
3644
3645 for (var key in value) loop(key);
3646 }
3647 }
3648 return data;
3649 }
3650
3651 /* */
3652
3653 /**
3654 * Runtime helper for rendering static trees.
3655 */
3656 function renderStatic(index, isInFor) {
3657 var tree = this._staticTrees[index];
3658 // if has already-rendered static tree and not inside v-for,
3659 // we can reuse the same tree by doing a shallow clone.
3660 if (tree && !isInFor) {
3661 return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree);
3662 }
3663 // otherwise, render a fresh tree.
3664 tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
3665 markStatic(tree, "__static__" + index, false);
3666 return tree;
3667 }
3668
3669 /**
3670 * Runtime helper for v-once.
3671 * Effectively it means marking the node as static with a unique key.
3672 */
3673 function markOnce(tree, index, key) {
3674 markStatic(tree, "__once__" + index + (key ? "_" + key : ""), true);
3675 return tree;
3676 }
3677
3678 function markStatic(tree, key, isOnce) {
3679 if (Array.isArray(tree)) {
3680 for (var i = 0; i < tree.length; i++) {
3681 if (tree[i] && typeof tree[i] !== 'string') {
3682 markStaticNode(tree[i], key + "_" + i, isOnce);
3683 }
3684 }
3685 } else {
3686 markStaticNode(tree, key, isOnce);
3687 }
3688 }
3689
3690 function markStaticNode(node, key, isOnce) {
3691 node.isStatic = true;
3692 node.key = key;
3693 node.isOnce = isOnce;
3694 }
3695
3696 /* */
3697
3698 function bindObjectListeners(data, value) {
3699 if (value) {
3700 if (!isPlainObject(value)) {
3701 process.env.NODE_ENV !== 'production' && warn('v-on without argument expects an Object value', this);
3702 } else {
3703 var on = data.on = data.on ? extend({}, data.on) : {};
3704 for (var key in value) {
3705 var existing = on[key];
3706 var ours = value[key];
3707 on[key] = existing ? [].concat(ours, existing) : ours;
3708 }
3709 }
3710 }
3711 return data;
3712 }
3713
3714 /* */
3715
3716 function initRender(vm) {
3717 vm._vnode = null; // the root of the child tree
3718 vm._staticTrees = null;
3719 var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree
3720 var renderContext = parentVnode && parentVnode.context;
3721 vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
3722 vm.$scopedSlots = emptyObject;
3723 // bind the createElement fn to this instance
3724 // so that we get proper render context inside it.
3725 // args order: tag, data, children, normalizationType, alwaysNormalize
3726 // internal version is used by render functions compiled from templates
3727 vm._c = function (a, b, c, d) {
3728 return createElement(vm, a, b, c, d, false);
3729 };
3730 // normalization is always applied for the public version, used in
3731 // user-written render functions.
3732 vm.$createElement = function (a, b, c, d) {
3733 return createElement(vm, a, b, c, d, true);
3734 };
3735
3736 // $attrs & $listeners are exposed for easier HOC creation.
3737 // they need to be reactive so that HOCs using them are always updated
3738 var parentData = parentVnode && parentVnode.data;
3739 /* istanbul ignore else */
3740 if (process.env.NODE_ENV !== 'production') {
3741 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs, function () {
3742 !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
3743 }, true);
3744 defineReactive$$1(vm, '$listeners', vm.$options._parentListeners, function () {
3745 !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
3746 }, true);
3747 } else {
3748 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs, null, true);
3749 defineReactive$$1(vm, '$listeners', vm.$options._parentListeners, null, true);
3750 }
3751 }
3752
3753 function renderMixin(Vue) {
3754 Vue.prototype.$nextTick = function (fn) {
3755 return nextTick(fn, this);
3756 };
3757
3758 Vue.prototype._render = function () {
3759 var vm = this;
3760 var ref = vm.$options;
3761 var render = ref.render;
3762 var staticRenderFns = ref.staticRenderFns;
3763 var _parentVnode = ref._parentVnode;
3764
3765 if (vm._isMounted) {
3766 // clone slot nodes on re-renders
3767 for (var key in vm.$slots) {
3768 vm.$slots[key] = cloneVNodes(vm.$slots[key]);
3769 }
3770 }
3771
3772 vm.$scopedSlots = _parentVnode && _parentVnode.data.scopedSlots || emptyObject;
3773
3774 if (staticRenderFns && !vm._staticTrees) {
3775 vm._staticTrees = [];
3776 }
3777 // set parent vnode. this allows render functions to have access
3778 // to the data on the placeholder node.
3779 vm.$vnode = _parentVnode;
3780 // render self
3781 var vnode;
3782 try {
3783 vnode = render.call(vm._renderProxy, vm.$createElement);
3784 } catch (e) {
3785 handleError(e, vm, "render function");
3786 // return error render result,
3787 // or previous vnode to prevent render error causing blank component
3788 /* istanbul ignore else */
3789 if (process.env.NODE_ENV !== 'production') {
3790 vnode = vm.$options.renderError ? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e) : vm._vnode;
3791 } else {
3792 vnode = vm._vnode;
3793 }
3794 }
3795 // return empty vnode in case the render function errored out
3796 if (!(vnode instanceof VNode)) {
3797 if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
3798 warn('Multiple root nodes returned from render function. Render function ' + 'should return a single root node.', vm);
3799 }
3800 vnode = createEmptyVNode();
3801 }
3802 // set parent
3803 vnode.parent = _parentVnode;
3804 return vnode;
3805 };
3806
3807 // internal render helpers.
3808 // these are exposed on the instance prototype to reduce generated render
3809 // code size.
3810 Vue.prototype._o = markOnce;
3811 Vue.prototype._n = toNumber;
3812 Vue.prototype._s = toString;
3813 Vue.prototype._l = renderList;
3814 Vue.prototype._t = renderSlot;
3815 Vue.prototype._q = looseEqual;
3816 Vue.prototype._i = looseIndexOf;
3817 Vue.prototype._m = renderStatic;
3818 Vue.prototype._f = resolveFilter;
3819 Vue.prototype._k = checkKeyCodes;
3820 Vue.prototype._b = bindObjectProps;
3821 Vue.prototype._v = createTextVNode;
3822 Vue.prototype._e = createEmptyVNode;
3823 Vue.prototype._u = resolveScopedSlots;
3824 Vue.prototype._g = bindObjectListeners;
3825 }
3826
3827 /* */
3828
3829 var uid$1 = 0;
3830
3831 function initMixin(Vue) {
3832 Vue.prototype._init = function (options) {
3833 var vm = this;
3834 // a uid
3835 vm._uid = uid$1++;
3836
3837 var startTag, endTag;
3838 /* istanbul ignore if */
3839 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
3840 startTag = "vue-perf-init:" + vm._uid;
3841 endTag = "vue-perf-end:" + vm._uid;
3842 mark(startTag);
3843 }
3844
3845 // a flag to avoid this being observed
3846 vm._isVue = true;
3847 // merge options
3848 if (options && options._isComponent) {
3849 // optimize internal component instantiation
3850 // since dynamic options merging is pretty slow, and none of the
3851 // internal component options needs special treatment.
3852 initInternalComponent(vm, options);
3853 } else {
3854 vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
3855 }
3856 /* istanbul ignore else */
3857 if (process.env.NODE_ENV !== 'production') {
3858 initProxy(vm);
3859 } else {
3860 vm._renderProxy = vm;
3861 }
3862 // expose real self
3863 vm._self = vm;
3864 initLifecycle(vm);
3865 initEvents(vm);
3866 initRender(vm);
3867 callHook(vm, 'beforeCreate');
3868 initInjections(vm); // resolve injections before data/props
3869 initState(vm);
3870 initProvide(vm); // resolve provide after data/props
3871 callHook(vm, 'created');
3872
3873 /* istanbul ignore if */
3874 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
3875 vm._name = formatComponentName(vm, false);
3876 mark(endTag);
3877 measure(vm._name + " init", startTag, endTag);
3878 }
3879
3880 if (vm.$options.el) {
3881 vm.$mount(vm.$options.el);
3882 }
3883 };
3884 }
3885
3886 function initInternalComponent(vm, options) {
3887 var opts = vm.$options = Object.create(vm.constructor.options);
3888 // doing this because it's faster than dynamic enumeration.
3889 opts.parent = options.parent;
3890 opts.propsData = options.propsData;
3891 opts._parentVnode = options._parentVnode;
3892 opts._parentListeners = options._parentListeners;
3893 opts._renderChildren = options._renderChildren;
3894 opts._componentTag = options._componentTag;
3895 opts._parentElm = options._parentElm;
3896 opts._refElm = options._refElm;
3897 if (options.render) {
3898 opts.render = options.render;
3899 opts.staticRenderFns = options.staticRenderFns;
3900 }
3901 }
3902
3903 function resolveConstructorOptions(Ctor) {
3904 var options = Ctor.options;
3905 if (Ctor.super) {
3906 var superOptions = resolveConstructorOptions(Ctor.super);
3907 var cachedSuperOptions = Ctor.superOptions;
3908 if (superOptions !== cachedSuperOptions) {
3909 // super option changed,
3910 // need to resolve new options.
3911 Ctor.superOptions = superOptions;
3912 // check if there are any late-modified/attached options (#4976)
3913 var modifiedOptions = resolveModifiedOptions(Ctor);
3914 // update base extend options
3915 if (modifiedOptions) {
3916 extend(Ctor.extendOptions, modifiedOptions);
3917 }
3918 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
3919 if (options.name) {
3920 options.components[options.name] = Ctor;
3921 }
3922 }
3923 }
3924 return options;
3925 }
3926
3927 function resolveModifiedOptions(Ctor) {
3928 var modified;
3929 var latest = Ctor.options;
3930 var extended = Ctor.extendOptions;
3931 var sealed = Ctor.sealedOptions;
3932 for (var key in latest) {
3933 if (latest[key] !== sealed[key]) {
3934 if (!modified) {
3935 modified = {};
3936 }
3937 modified[key] = dedupe(latest[key], extended[key], sealed[key]);
3938 }
3939 }
3940 return modified;
3941 }
3942
3943 function dedupe(latest, extended, sealed) {
3944 // compare latest and sealed to ensure lifecycle hooks won't be duplicated
3945 // between merges
3946 if (Array.isArray(latest)) {
3947 var res = [];
3948 sealed = Array.isArray(sealed) ? sealed : [sealed];
3949 extended = Array.isArray(extended) ? extended : [extended];
3950 for (var i = 0; i < latest.length; i++) {
3951 // push original options and not sealed options to exclude duplicated options
3952 if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
3953 res.push(latest[i]);
3954 }
3955 }
3956 return res;
3957 } else {
3958 return latest;
3959 }
3960 }
3961
3962 function Vue$3(options) {
3963 if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue$3)) {
3964 warn('Vue is a constructor and should be called with the `new` keyword');
3965 }
3966 this._init(options);
3967 }
3968
3969 initMixin(Vue$3);
3970 stateMixin(Vue$3);
3971 eventsMixin(Vue$3);
3972 lifecycleMixin(Vue$3);
3973 renderMixin(Vue$3);
3974
3975 /* */
3976
3977 function initUse(Vue) {
3978 Vue.use = function (plugin) {
3979 var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
3980 if (installedPlugins.indexOf(plugin) > -1) {
3981 return this;
3982 }
3983
3984 // additional parameters
3985 var args = toArray(arguments, 1);
3986 args.unshift(this);
3987 if (typeof plugin.install === 'function') {
3988 plugin.install.apply(plugin, args);
3989 } else if (typeof plugin === 'function') {
3990 plugin.apply(null, args);
3991 }
3992 installedPlugins.push(plugin);
3993 return this;
3994 };
3995 }
3996
3997 /* */
3998
3999 function initMixin$1(Vue) {
4000 Vue.mixin = function (mixin) {
4001 this.options = mergeOptions(this.options, mixin);
4002 return this;
4003 };
4004 }
4005
4006 /* */
4007
4008 function initExtend(Vue) {
4009 /**
4010 * Each instance constructor, including Vue, has a unique
4011 * cid. This enables us to create wrapped "child
4012 * constructors" for prototypal inheritance and cache them.
4013 */
4014 Vue.cid = 0;
4015 var cid = 1;
4016
4017 /**
4018 * Class inheritance
4019 */
4020 Vue.extend = function (extendOptions) {
4021 extendOptions = extendOptions || {};
4022 var Super = this;
4023 var SuperId = Super.cid;
4024 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
4025 if (cachedCtors[SuperId]) {
4026 return cachedCtors[SuperId];
4027 }
4028
4029 var name = extendOptions.name || Super.options.name;
4030 if (process.env.NODE_ENV !== 'production') {
4031 if (!/^[a-zA-Z][\w-]*$/.test(name)) {
4032 warn('Invalid component name: "' + name + '". Component names ' + 'can only contain alphanumeric characters and the hyphen, ' + 'and must start with a letter.');
4033 }
4034 }
4035
4036 var Sub = function VueComponent(options) {
4037 this._init(options);
4038 };
4039 Sub.prototype = Object.create(Super.prototype);
4040 Sub.prototype.constructor = Sub;
4041 Sub.cid = cid++;
4042 Sub.options = mergeOptions(Super.options, extendOptions);
4043 Sub['super'] = Super;
4044
4045 // For props and computed properties, we define the proxy getters on
4046 // the Vue instances at extension time, on the extended prototype. This
4047 // avoids Object.defineProperty calls for each instance created.
4048 if (Sub.options.props) {
4049 initProps$1(Sub);
4050 }
4051 if (Sub.options.computed) {
4052 initComputed$1(Sub);
4053 }
4054
4055 // allow further extension/mixin/plugin usage
4056 Sub.extend = Super.extend;
4057 Sub.mixin = Super.mixin;
4058 Sub.use = Super.use;
4059
4060 // create asset registers, so extended classes
4061 // can have their private assets too.
4062 ASSET_TYPES.forEach(function (type) {
4063 Sub[type] = Super[type];
4064 });
4065 // enable recursive self-lookup
4066 if (name) {
4067 Sub.options.components[name] = Sub;
4068 }
4069
4070 // keep a reference to the super options at extension time.
4071 // later at instantiation we can check if Super's options have
4072 // been updated.
4073 Sub.superOptions = Super.options;
4074 Sub.extendOptions = extendOptions;
4075 Sub.sealedOptions = extend({}, Sub.options);
4076
4077 // cache constructor
4078 cachedCtors[SuperId] = Sub;
4079 return Sub;
4080 };
4081 }
4082
4083 function initProps$1(Comp) {
4084 var props = Comp.options.props;
4085 for (var key in props) {
4086 proxy(Comp.prototype, "_props", key);
4087 }
4088 }
4089
4090 function initComputed$1(Comp) {
4091 var computed = Comp.options.computed;
4092 for (var key in computed) {
4093 defineComputed(Comp.prototype, key, computed[key]);
4094 }
4095 }
4096
4097 /* */
4098
4099 function initAssetRegisters(Vue) {
4100 /**
4101 * Create asset registration methods.
4102 */
4103 ASSET_TYPES.forEach(function (type) {
4104 Vue[type] = function (id, definition) {
4105 if (!definition) {
4106 return this.options[type + 's'][id];
4107 } else {
4108 /* istanbul ignore if */
4109 if (process.env.NODE_ENV !== 'production') {
4110 if (type === 'component' && config.isReservedTag(id)) {
4111 warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + id);
4112 }
4113 }
4114 if (type === 'component' && isPlainObject(definition)) {
4115 definition.name = definition.name || id;
4116 definition = this.options._base.extend(definition);
4117 }
4118 if (type === 'directive' && typeof definition === 'function') {
4119 definition = { bind: definition, update: definition };
4120 }
4121 this.options[type + 's'][id] = definition;
4122 return definition;
4123 }
4124 };
4125 });
4126 }
4127
4128 /* */
4129
4130 var patternTypes = [String, RegExp, Array];
4131
4132 function getComponentName(opts) {
4133 return opts && (opts.Ctor.options.name || opts.tag);
4134 }
4135
4136 function matches(pattern, name) {
4137 if (Array.isArray(pattern)) {
4138 return pattern.indexOf(name) > -1;
4139 } else if (typeof pattern === 'string') {
4140 return pattern.split(',').indexOf(name) > -1;
4141 } else if (isRegExp(pattern)) {
4142 return pattern.test(name);
4143 }
4144 /* istanbul ignore next */
4145 return false;
4146 }
4147
4148 function pruneCache(cache, current, filter) {
4149 for (var key in cache) {
4150 var cachedNode = cache[key];
4151 if (cachedNode) {
4152 var name = getComponentName(cachedNode.componentOptions);
4153 if (name && !filter(name)) {
4154 if (cachedNode !== current) {
4155 pruneCacheEntry(cachedNode);
4156 }
4157 cache[key] = null;
4158 }
4159 }
4160 }
4161 }
4162
4163 function pruneCacheEntry(vnode) {
4164 if (vnode) {
4165 vnode.componentInstance.$destroy();
4166 }
4167 }
4168
4169 var KeepAlive = {
4170 name: 'keep-alive',
4171 abstract: true,
4172
4173 props: {
4174 include: patternTypes,
4175 exclude: patternTypes
4176 },
4177
4178 created: function created() {
4179 this.cache = Object.create(null);
4180 },
4181
4182 destroyed: function destroyed() {
4183 var this$1 = this;
4184
4185 for (var key in this$1.cache) {
4186 pruneCacheEntry(this$1.cache[key]);
4187 }
4188 },
4189
4190 watch: {
4191 include: function include(val) {
4192 pruneCache(this.cache, this._vnode, function (name) {
4193 return matches(val, name);
4194 });
4195 },
4196 exclude: function exclude(val) {
4197 pruneCache(this.cache, this._vnode, function (name) {
4198 return !matches(val, name);
4199 });
4200 }
4201 },
4202
4203 render: function render() {
4204 var vnode = getFirstComponentChild(this.$slots.default);
4205 var componentOptions = vnode && vnode.componentOptions;
4206 if (componentOptions) {
4207 // check pattern
4208 var name = getComponentName(componentOptions);
4209 if (name && (this.include && !matches(this.include, name) || this.exclude && matches(this.exclude, name))) {
4210 return vnode;
4211 }
4212 var key = vnode.key == null
4213 // same constructor may get registered as different local components
4214 // so cid alone is not enough (#3269)
4215 ? componentOptions.Ctor.cid + (componentOptions.tag ? "::" + componentOptions.tag : '') : vnode.key;
4216 if (this.cache[key]) {
4217 vnode.componentInstance = this.cache[key].componentInstance;
4218 } else {
4219 this.cache[key] = vnode;
4220 }
4221 vnode.data.keepAlive = true;
4222 }
4223 return vnode;
4224 }
4225 };
4226
4227 var builtInComponents = {
4228 KeepAlive: KeepAlive
4229 };
4230
4231 /* */
4232
4233 function initGlobalAPI(Vue) {
4234 // config
4235 var configDef = {};
4236 configDef.get = function () {
4237 return config;
4238 };
4239 if (process.env.NODE_ENV !== 'production') {
4240 configDef.set = function () {
4241 warn('Do not replace the Vue.config object, set individual fields instead.');
4242 };
4243 }
4244 Object.defineProperty(Vue, 'config', configDef);
4245
4246 // exposed util methods.
4247 // NOTE: these are not considered part of the public API - avoid relying on
4248 // them unless you are aware of the risk.
4249 Vue.util = {
4250 warn: warn,
4251 extend: extend,
4252 mergeOptions: mergeOptions,
4253 defineReactive: defineReactive$$1
4254 };
4255
4256 Vue.set = set;
4257 Vue.delete = del;
4258 Vue.nextTick = nextTick;
4259
4260 Vue.options = Object.create(null);
4261 ASSET_TYPES.forEach(function (type) {
4262 Vue.options[type + 's'] = Object.create(null);
4263 });
4264
4265 // this is used to identify the "base" constructor to extend all plain-object
4266 // components with in Weex's multi-instance scenarios.
4267 Vue.options._base = Vue;
4268
4269 extend(Vue.options.components, builtInComponents);
4270
4271 initUse(Vue);
4272 initMixin$1(Vue);
4273 initExtend(Vue);
4274 initAssetRegisters(Vue);
4275 }
4276
4277 initGlobalAPI(Vue$3);
4278
4279 Object.defineProperty(Vue$3.prototype, '$isServer', {
4280 get: isServerRendering
4281 });
4282
4283 Object.defineProperty(Vue$3.prototype, '$ssrContext', {
4284 get: function get() {
4285 /* istanbul ignore next */
4286 return this.$vnode && this.$vnode.ssrContext;
4287 }
4288 });
4289
4290 Vue$3.version = '2.4.2';
4291
4292 /* */
4293
4294 // these are reserved for web because they are directly compiled away
4295 // during template compilation
4296 var isReservedAttr = makeMap('style,class');
4297
4298 // attributes that should be using props for binding
4299 var acceptValue = makeMap('input,textarea,option,select');
4300 var mustUseProp = function (tag, type, attr) {
4301 return attr === 'value' && acceptValue(tag) && type !== 'button' || attr === 'selected' && tag === 'option' || attr === 'checked' && tag === 'input' || attr === 'muted' && tag === 'video';
4302 };
4303
4304 var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
4305
4306 var isBooleanAttr = makeMap('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');
4307
4308 var xlinkNS = 'http://www.w3.org/1999/xlink';
4309
4310 var isXlink = function (name) {
4311 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
4312 };
4313
4314 var getXlinkProp = function (name) {
4315 return isXlink(name) ? name.slice(6, name.length) : '';
4316 };
4317
4318 var isFalsyAttrValue = function (val) {
4319 return val == null || val === false;
4320 };
4321
4322 /* */
4323
4324 function genClassForVnode(vnode) {
4325 var data = vnode.data;
4326 var parentNode = vnode;
4327 var childNode = vnode;
4328 while (isDef(childNode.componentInstance)) {
4329 childNode = childNode.componentInstance._vnode;
4330 if (childNode.data) {
4331 data = mergeClassData(childNode.data, data);
4332 }
4333 }
4334 while (isDef(parentNode = parentNode.parent)) {
4335 if (parentNode.data) {
4336 data = mergeClassData(data, parentNode.data);
4337 }
4338 }
4339 return renderClass(data.staticClass, data.class);
4340 }
4341
4342 function mergeClassData(child, parent) {
4343 return {
4344 staticClass: concat(child.staticClass, parent.staticClass),
4345 class: isDef(child.class) ? [child.class, parent.class] : parent.class
4346 };
4347 }
4348
4349 function renderClass(staticClass, dynamicClass) {
4350 if (isDef(staticClass) || isDef(dynamicClass)) {
4351 return concat(staticClass, stringifyClass(dynamicClass));
4352 }
4353 /* istanbul ignore next */
4354 return '';
4355 }
4356
4357 function concat(a, b) {
4358 return a ? b ? a + ' ' + b : a : b || '';
4359 }
4360
4361 function stringifyClass(value) {
4362 if (Array.isArray(value)) {
4363 return stringifyArray(value);
4364 }
4365 if (isObject(value)) {
4366 return stringifyObject(value);
4367 }
4368 if (typeof value === 'string') {
4369 return value;
4370 }
4371 /* istanbul ignore next */
4372 return '';
4373 }
4374
4375 function stringifyArray(value) {
4376 var res = '';
4377 var stringified;
4378 for (var i = 0, l = value.length; i < l; i++) {
4379 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
4380 if (res) {
4381 res += ' ';
4382 }
4383 res += stringified;
4384 }
4385 }
4386 return res;
4387 }
4388
4389 function stringifyObject(value) {
4390 var res = '';
4391 for (var key in value) {
4392 if (value[key]) {
4393 if (res) {
4394 res += ' ';
4395 }
4396 res += key;
4397 }
4398 }
4399 return res;
4400 }
4401
4402 /* */
4403
4404 var namespaceMap = {
4405 svg: 'http://www.w3.org/2000/svg',
4406 math: 'http://www.w3.org/1998/Math/MathML'
4407 };
4408
4409 var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' + 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 'embed,object,param,source,canvas,script,noscript,del,ins,' + 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 'output,progress,select,textarea,' + 'details,dialog,menu,menuitem,summary,' + 'content,element,shadow,template,blockquote,iframe,tfoot');
4410
4411 // this map is intentionally selective, only covering SVG elements that may
4412 // contain child elements.
4413 var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
4414
4415 var isPreTag = function (tag) {
4416 return tag === 'pre';
4417 };
4418
4419 var isReservedTag = function (tag) {
4420 return isHTMLTag(tag) || isSVG(tag);
4421 };
4422
4423 function getTagNamespace(tag) {
4424 if (isSVG(tag)) {
4425 return 'svg';
4426 }
4427 // basic support for MathML
4428 // note it doesn't support other MathML elements being component roots
4429 if (tag === 'math') {
4430 return 'math';
4431 }
4432 }
4433
4434 var unknownElementCache = Object.create(null);
4435 function isUnknownElement(tag) {
4436 /* istanbul ignore if */
4437 if (!inBrowser) {
4438 return true;
4439 }
4440 if (isReservedTag(tag)) {
4441 return false;
4442 }
4443 tag = tag.toLowerCase();
4444 /* istanbul ignore if */
4445 if (unknownElementCache[tag] != null) {
4446 return unknownElementCache[tag];
4447 }
4448 var el = document.createElement(tag);
4449 if (tag.indexOf('-') > -1) {
4450 // http://stackoverflow.com/a/28210364/1070244
4451 return unknownElementCache[tag] = el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement;
4452 } else {
4453 return unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString());
4454 }
4455 }
4456
4457 /* */
4458
4459 /**
4460 * Query an element selector if it's not an element already.
4461 */
4462 function query(el) {
4463 if (typeof el === 'string') {
4464 var selected = document.querySelector(el);
4465 if (!selected) {
4466 process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + el);
4467 return document.createElement('div');
4468 }
4469 return selected;
4470 } else {
4471 return el;
4472 }
4473 }
4474
4475 /* */
4476
4477 function createElement$1(tagName, vnode) {
4478 var elm = document.createElement(tagName);
4479 if (tagName !== 'select') {
4480 return elm;
4481 }
4482 // false or null will remove the attribute but undefined will not
4483 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
4484 elm.setAttribute('multiple', 'multiple');
4485 }
4486 return elm;
4487 }
4488
4489 function createElementNS(namespace, tagName) {
4490 return document.createElementNS(namespaceMap[namespace], tagName);
4491 }
4492
4493 function createTextNode(text) {
4494 return document.createTextNode(text);
4495 }
4496
4497 function createComment(text) {
4498 return document.createComment(text);
4499 }
4500
4501 function insertBefore(parentNode, newNode, referenceNode) {
4502 parentNode.insertBefore(newNode, referenceNode);
4503 }
4504
4505 function removeChild(node, child) {
4506 node.removeChild(child);
4507 }
4508
4509 function appendChild(node, child) {
4510 node.appendChild(child);
4511 }
4512
4513 function parentNode(node) {
4514 return node.parentNode;
4515 }
4516
4517 function nextSibling(node) {
4518 return node.nextSibling;
4519 }
4520
4521 function tagName(node) {
4522 return node.tagName;
4523 }
4524
4525 function setTextContent(node, text) {
4526 node.textContent = text;
4527 }
4528
4529 function setAttribute(node, key, val) {
4530 node.setAttribute(key, val);
4531 }
4532
4533 var nodeOps = Object.freeze({
4534 createElement: createElement$1,
4535 createElementNS: createElementNS,
4536 createTextNode: createTextNode,
4537 createComment: createComment,
4538 insertBefore: insertBefore,
4539 removeChild: removeChild,
4540 appendChild: appendChild,
4541 parentNode: parentNode,
4542 nextSibling: nextSibling,
4543 tagName: tagName,
4544 setTextContent: setTextContent,
4545 setAttribute: setAttribute
4546 });
4547
4548 /* */
4549
4550 var ref = {
4551 create: function create(_, vnode) {
4552 registerRef(vnode);
4553 },
4554 update: function update(oldVnode, vnode) {
4555 if (oldVnode.data.ref !== vnode.data.ref) {
4556 registerRef(oldVnode, true);
4557 registerRef(vnode);
4558 }
4559 },
4560 destroy: function destroy(vnode) {
4561 registerRef(vnode, true);
4562 }
4563 };
4564
4565 function registerRef(vnode, isRemoval) {
4566 var key = vnode.data.ref;
4567 if (!key) {
4568 return;
4569 }
4570
4571 var vm = vnode.context;
4572 var ref = vnode.componentInstance || vnode.elm;
4573 var refs = vm.$refs;
4574 if (isRemoval) {
4575 if (Array.isArray(refs[key])) {
4576 remove(refs[key], ref);
4577 } else if (refs[key] === ref) {
4578 refs[key] = undefined;
4579 }
4580 } else {
4581 if (vnode.data.refInFor) {
4582 if (!Array.isArray(refs[key])) {
4583 refs[key] = [ref];
4584 } else if (refs[key].indexOf(ref) < 0) {
4585 // $flow-disable-line
4586 refs[key].push(ref);
4587 }
4588 } else {
4589 refs[key] = ref;
4590 }
4591 }
4592 }
4593
4594 /**
4595 * Virtual DOM patching algorithm based on Snabbdom by
4596 * Simon Friis Vindum (@paldepind)
4597 * Licensed under the MIT License
4598 * https://github.com/paldepind/snabbdom/blob/master/LICENSE
4599 *
4600 * modified by Evan You (@yyx990803)
4601 *
4602
4603 /*
4604 * Not type-checking this because this file is perf-critical and the cost
4605 * of making flow understand it is not worth it.
4606 */
4607
4608 var emptyNode = new VNode('', {}, []);
4609
4610 var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
4611
4612 function sameVnode(a, b) {
4613 return a.key === b.key && (a.tag === b.tag && a.isComment === b.isComment && isDef(a.data) === isDef(b.data) && sameInputType(a, b) || isTrue(a.isAsyncPlaceholder) && a.asyncFactory === b.asyncFactory && isUndef(b.asyncFactory.error));
4614 }
4615
4616 // Some browsers do not support dynamically changing type for <input>
4617 // so they need to be treated as different nodes
4618 function sameInputType(a, b) {
4619 if (a.tag !== 'input') {
4620 return true;
4621 }
4622 var i;
4623 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
4624 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
4625 return typeA === typeB;
4626 }
4627
4628 function createKeyToOldIdx(children, beginIdx, endIdx) {
4629 var i, key;
4630 var map = {};
4631 for (i = beginIdx; i <= endIdx; ++i) {
4632 key = children[i].key;
4633 if (isDef(key)) {
4634 map[key] = i;
4635 }
4636 }
4637 return map;
4638 }
4639
4640 function createPatchFunction(backend) {
4641 var i, j;
4642 var cbs = {};
4643
4644 var modules = backend.modules;
4645 var nodeOps = backend.nodeOps;
4646
4647 for (i = 0; i < hooks.length; ++i) {
4648 cbs[hooks[i]] = [];
4649 for (j = 0; j < modules.length; ++j) {
4650 if (isDef(modules[j][hooks[i]])) {
4651 cbs[hooks[i]].push(modules[j][hooks[i]]);
4652 }
4653 }
4654 }
4655
4656 function emptyNodeAt(elm) {
4657 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
4658 }
4659
4660 function createRmCb(childElm, listeners) {
4661 function remove$$1() {
4662 if (--remove$$1.listeners === 0) {
4663 removeNode(childElm);
4664 }
4665 }
4666 remove$$1.listeners = listeners;
4667 return remove$$1;
4668 }
4669
4670 function removeNode(el) {
4671 var parent = nodeOps.parentNode(el);
4672 // element may have already been removed due to v-html / v-text
4673 if (isDef(parent)) {
4674 nodeOps.removeChild(parent, el);
4675 }
4676 }
4677
4678 var inPre = 0;
4679 function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested) {
4680 vnode.isRootInsert = !nested; // for transition enter check
4681 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
4682 return;
4683 }
4684
4685 var data = vnode.data;
4686 var children = vnode.children;
4687 var tag = vnode.tag;
4688 if (isDef(tag)) {
4689 if (process.env.NODE_ENV !== 'production') {
4690 if (data && data.pre) {
4691 inPre++;
4692 }
4693 if (!inPre && !vnode.ns && !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) && config.isUnknownElement(tag)) {
4694 warn('Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly? For recursive components, ' + 'make sure to provide the "name" option.', vnode.context);
4695 }
4696 }
4697 vnode.elm = vnode.ns ? nodeOps.createElementNS(vnode.ns, tag) : nodeOps.createElement(tag, vnode);
4698 setScope(vnode);
4699
4700 /* istanbul ignore if */
4701 {
4702 createChildren(vnode, children, insertedVnodeQueue);
4703 if (isDef(data)) {
4704 invokeCreateHooks(vnode, insertedVnodeQueue);
4705 }
4706 insert(parentElm, vnode.elm, refElm);
4707 }
4708
4709 if (process.env.NODE_ENV !== 'production' && data && data.pre) {
4710 inPre--;
4711 }
4712 } else if (isTrue(vnode.isComment)) {
4713 vnode.elm = nodeOps.createComment(vnode.text);
4714 insert(parentElm, vnode.elm, refElm);
4715 } else {
4716 vnode.elm = nodeOps.createTextNode(vnode.text);
4717 insert(parentElm, vnode.elm, refElm);
4718 }
4719 }
4720
4721 function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
4722 var i = vnode.data;
4723 if (isDef(i)) {
4724 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
4725 if (isDef(i = i.hook) && isDef(i = i.init)) {
4726 i(vnode, false /* hydrating */, parentElm, refElm);
4727 }
4728 // after calling the init hook, if the vnode is a child component
4729 // it should've created a child instance and mounted it. the child
4730 // component also has set the placeholder vnode's elm.
4731 // in that case we can just return the element and be done.
4732 if (isDef(vnode.componentInstance)) {
4733 initComponent(vnode, insertedVnodeQueue);
4734 if (isTrue(isReactivated)) {
4735 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
4736 }
4737 return true;
4738 }
4739 }
4740 }
4741
4742 function initComponent(vnode, insertedVnodeQueue) {
4743 if (isDef(vnode.data.pendingInsert)) {
4744 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
4745 vnode.data.pendingInsert = null;
4746 }
4747 vnode.elm = vnode.componentInstance.$el;
4748 if (isPatchable(vnode)) {
4749 invokeCreateHooks(vnode, insertedVnodeQueue);
4750 setScope(vnode);
4751 } else {
4752 // empty component root.
4753 // skip all element-related modules except for ref (#3455)
4754 registerRef(vnode);
4755 // make sure to invoke the insert hook
4756 insertedVnodeQueue.push(vnode);
4757 }
4758 }
4759
4760 function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
4761 var i;
4762 // hack for #4339: a reactivated component with inner transition
4763 // does not trigger because the inner node's created hooks are not called
4764 // again. It's not ideal to involve module-specific logic in here but
4765 // there doesn't seem to be a better way to do it.
4766 var innerNode = vnode;
4767 while (innerNode.componentInstance) {
4768 innerNode = innerNode.componentInstance._vnode;
4769 if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
4770 for (i = 0; i < cbs.activate.length; ++i) {
4771 cbs.activate[i](emptyNode, innerNode);
4772 }
4773 insertedVnodeQueue.push(innerNode);
4774 break;
4775 }
4776 }
4777 // unlike a newly created component,
4778 // a reactivated keep-alive component doesn't insert itself
4779 insert(parentElm, vnode.elm, refElm);
4780 }
4781
4782 function insert(parent, elm, ref$$1) {
4783 if (isDef(parent)) {
4784 if (isDef(ref$$1)) {
4785 if (ref$$1.parentNode === parent) {
4786 nodeOps.insertBefore(parent, elm, ref$$1);
4787 }
4788 } else {
4789 nodeOps.appendChild(parent, elm);
4790 }
4791 }
4792 }
4793
4794 function createChildren(vnode, children, insertedVnodeQueue) {
4795 if (Array.isArray(children)) {
4796 for (var i = 0; i < children.length; ++i) {
4797 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
4798 }
4799 } else if (isPrimitive(vnode.text)) {
4800 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
4801 }
4802 }
4803
4804 function isPatchable(vnode) {
4805 while (vnode.componentInstance) {
4806 vnode = vnode.componentInstance._vnode;
4807 }
4808 return isDef(vnode.tag);
4809 }
4810
4811 function invokeCreateHooks(vnode, insertedVnodeQueue) {
4812 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
4813 cbs.create[i$1](emptyNode, vnode);
4814 }
4815 i = vnode.data.hook; // Reuse variable
4816 if (isDef(i)) {
4817 if (isDef(i.create)) {
4818 i.create(emptyNode, vnode);
4819 }
4820 if (isDef(i.insert)) {
4821 insertedVnodeQueue.push(vnode);
4822 }
4823 }
4824 }
4825
4826 // set scope id attribute for scoped CSS.
4827 // this is implemented as a special case to avoid the overhead
4828 // of going through the normal attribute patching process.
4829 function setScope(vnode) {
4830 var i;
4831 var ancestor = vnode;
4832 while (ancestor) {
4833 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
4834 nodeOps.setAttribute(vnode.elm, i, '');
4835 }
4836 ancestor = ancestor.parent;
4837 }
4838 // for slot content they should also get the scopeId from the host instance.
4839 if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) {
4840 nodeOps.setAttribute(vnode.elm, i, '');
4841 }
4842 }
4843
4844 function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
4845 for (; startIdx <= endIdx; ++startIdx) {
4846 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
4847 }
4848 }
4849
4850 function invokeDestroyHook(vnode) {
4851 var i, j;
4852 var data = vnode.data;
4853 if (isDef(data)) {
4854 if (isDef(i = data.hook) && isDef(i = i.destroy)) {
4855 i(vnode);
4856 }
4857 for (i = 0; i < cbs.destroy.length; ++i) {
4858 cbs.destroy[i](vnode);
4859 }
4860 }
4861 if (isDef(i = vnode.children)) {
4862 for (j = 0; j < vnode.children.length; ++j) {
4863 invokeDestroyHook(vnode.children[j]);
4864 }
4865 }
4866 }
4867
4868 function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
4869 for (; startIdx <= endIdx; ++startIdx) {
4870 var ch = vnodes[startIdx];
4871 if (isDef(ch)) {
4872 if (isDef(ch.tag)) {
4873 removeAndInvokeRemoveHook(ch);
4874 invokeDestroyHook(ch);
4875 } else {
4876 // Text node
4877 removeNode(ch.elm);
4878 }
4879 }
4880 }
4881 }
4882
4883 function removeAndInvokeRemoveHook(vnode, rm) {
4884 if (isDef(rm) || isDef(vnode.data)) {
4885 var i;
4886 var listeners = cbs.remove.length + 1;
4887 if (isDef(rm)) {
4888 // we have a recursively passed down rm callback
4889 // increase the listeners count
4890 rm.listeners += listeners;
4891 } else {
4892 // directly removing
4893 rm = createRmCb(vnode.elm, listeners);
4894 }
4895 // recursively invoke hooks on child component root node
4896 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
4897 removeAndInvokeRemoveHook(i, rm);
4898 }
4899 for (i = 0; i < cbs.remove.length; ++i) {
4900 cbs.remove[i](vnode, rm);
4901 }
4902 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
4903 i(vnode, rm);
4904 } else {
4905 rm();
4906 }
4907 } else {
4908 removeNode(vnode.elm);
4909 }
4910 }
4911
4912 function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
4913 var oldStartIdx = 0;
4914 var newStartIdx = 0;
4915 var oldEndIdx = oldCh.length - 1;
4916 var oldStartVnode = oldCh[0];
4917 var oldEndVnode = oldCh[oldEndIdx];
4918 var newEndIdx = newCh.length - 1;
4919 var newStartVnode = newCh[0];
4920 var newEndVnode = newCh[newEndIdx];
4921 var oldKeyToIdx, idxInOld, elmToMove, refElm;
4922
4923 // removeOnly is a special flag used only by <transition-group>
4924 // to ensure removed elements stay in correct relative positions
4925 // during leaving transitions
4926 var canMove = !removeOnly;
4927
4928 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
4929 if (isUndef(oldStartVnode)) {
4930 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
4931 } else if (isUndef(oldEndVnode)) {
4932 oldEndVnode = oldCh[--oldEndIdx];
4933 } else if (sameVnode(oldStartVnode, newStartVnode)) {
4934 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
4935 oldStartVnode = oldCh[++oldStartIdx];
4936 newStartVnode = newCh[++newStartIdx];
4937 } else if (sameVnode(oldEndVnode, newEndVnode)) {
4938 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
4939 oldEndVnode = oldCh[--oldEndIdx];
4940 newEndVnode = newCh[--newEndIdx];
4941 } else if (sameVnode(oldStartVnode, newEndVnode)) {
4942 // Vnode moved right
4943 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
4944 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
4945 oldStartVnode = oldCh[++oldStartIdx];
4946 newEndVnode = newCh[--newEndIdx];
4947 } else if (sameVnode(oldEndVnode, newStartVnode)) {
4948 // Vnode moved left
4949 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
4950 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
4951 oldEndVnode = oldCh[--oldEndIdx];
4952 newStartVnode = newCh[++newStartIdx];
4953 } else {
4954 if (isUndef(oldKeyToIdx)) {
4955 oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
4956 }
4957 idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
4958 if (isUndef(idxInOld)) {
4959 // New element
4960 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
4961 newStartVnode = newCh[++newStartIdx];
4962 } else {
4963 elmToMove = oldCh[idxInOld];
4964 /* istanbul ignore if */
4965 if (process.env.NODE_ENV !== 'production' && !elmToMove) {
4966 warn('It seems there are duplicate keys that is causing an update error. ' + 'Make sure each v-for item has a unique key.');
4967 }
4968 if (sameVnode(elmToMove, newStartVnode)) {
4969 patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
4970 oldCh[idxInOld] = undefined;
4971 canMove && nodeOps.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);
4972 newStartVnode = newCh[++newStartIdx];
4973 } else {
4974 // same key but different element. treat as new element
4975 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
4976 newStartVnode = newCh[++newStartIdx];
4977 }
4978 }
4979 }
4980 }
4981 if (oldStartIdx > oldEndIdx) {
4982 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
4983 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
4984 } else if (newStartIdx > newEndIdx) {
4985 removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
4986 }
4987 }
4988
4989 function patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly) {
4990 if (oldVnode === vnode) {
4991 return;
4992 }
4993
4994 var elm = vnode.elm = oldVnode.elm;
4995
4996 if (isTrue(oldVnode.isAsyncPlaceholder)) {
4997 if (isDef(vnode.asyncFactory.resolved)) {
4998 hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
4999 } else {
5000 vnode.isAsyncPlaceholder = true;
5001 }
5002 return;
5003 }
5004
5005 // reuse element for static trees.
5006 // note we only do this if the vnode is cloned -
5007 // if the new node is not cloned it means the render functions have been
5008 // reset by the hot-reload-api and we need to do a proper re-render.
5009 if (isTrue(vnode.isStatic) && isTrue(oldVnode.isStatic) && vnode.key === oldVnode.key && (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
5010 vnode.componentInstance = oldVnode.componentInstance;
5011 return;
5012 }
5013
5014 var i;
5015 var data = vnode.data;
5016 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
5017 i(oldVnode, vnode);
5018 }
5019
5020 var oldCh = oldVnode.children;
5021 var ch = vnode.children;
5022 if (isDef(data) && isPatchable(vnode)) {
5023 for (i = 0; i < cbs.update.length; ++i) {
5024 cbs.update[i](oldVnode, vnode);
5025 }
5026 if (isDef(i = data.hook) && isDef(i = i.update)) {
5027 i(oldVnode, vnode);
5028 }
5029 }
5030 if (isUndef(vnode.text)) {
5031 if (isDef(oldCh) && isDef(ch)) {
5032 if (oldCh !== ch) {
5033 updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
5034 }
5035 } else if (isDef(ch)) {
5036 if (isDef(oldVnode.text)) {
5037 nodeOps.setTextContent(elm, '');
5038 }
5039 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
5040 } else if (isDef(oldCh)) {
5041 removeVnodes(elm, oldCh, 0, oldCh.length - 1);
5042 } else if (isDef(oldVnode.text)) {
5043 nodeOps.setTextContent(elm, '');
5044 }
5045 } else if (oldVnode.text !== vnode.text) {
5046 nodeOps.setTextContent(elm, vnode.text);
5047 }
5048 if (isDef(data)) {
5049 if (isDef(i = data.hook) && isDef(i = i.postpatch)) {
5050 i(oldVnode, vnode);
5051 }
5052 }
5053 }
5054
5055 function invokeInsertHook(vnode, queue, initial) {
5056 // delay insert hooks for component root nodes, invoke them after the
5057 // element is really inserted
5058 if (isTrue(initial) && isDef(vnode.parent)) {
5059 vnode.parent.data.pendingInsert = queue;
5060 } else {
5061 for (var i = 0; i < queue.length; ++i) {
5062 queue[i].data.hook.insert(queue[i]);
5063 }
5064 }
5065 }
5066
5067 var bailed = false;
5068 // list of modules that can skip create hook during hydration because they
5069 // are already rendered on the client or has no need for initialization
5070 var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
5071
5072 // Note: this is a browser-only function so we can assume elms are DOM nodes.
5073 function hydrate(elm, vnode, insertedVnodeQueue) {
5074 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
5075 vnode.elm = elm;
5076 vnode.isAsyncPlaceholder = true;
5077 return true;
5078 }
5079 if (process.env.NODE_ENV !== 'production') {
5080 if (!assertNodeMatch(elm, vnode)) {
5081 return false;
5082 }
5083 }
5084 vnode.elm = elm;
5085 var tag = vnode.tag;
5086 var data = vnode.data;
5087 var children = vnode.children;
5088 if (isDef(data)) {
5089 if (isDef(i = data.hook) && isDef(i = i.init)) {
5090 i(vnode, true /* hydrating */);
5091 }
5092 if (isDef(i = vnode.componentInstance)) {
5093 // child component. it should have hydrated its own tree.
5094 initComponent(vnode, insertedVnodeQueue);
5095 return true;
5096 }
5097 }
5098 if (isDef(tag)) {
5099 if (isDef(children)) {
5100 // empty element, allow client to pick up and populate children
5101 if (!elm.hasChildNodes()) {
5102 createChildren(vnode, children, insertedVnodeQueue);
5103 } else {
5104 var childrenMatch = true;
5105 var childNode = elm.firstChild;
5106 for (var i$1 = 0; i$1 < children.length; i$1++) {
5107 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
5108 childrenMatch = false;
5109 break;
5110 }
5111 childNode = childNode.nextSibling;
5112 }
5113 // if childNode is not null, it means the actual childNodes list is
5114 // longer than the virtual children list.
5115 if (!childrenMatch || childNode) {
5116 if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined' && !bailed) {
5117 bailed = true;
5118 console.warn('Parent: ', elm);
5119 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
5120 }
5121 return false;
5122 }
5123 }
5124 }
5125 if (isDef(data)) {
5126 for (var key in data) {
5127 if (!isRenderedModule(key)) {
5128 invokeCreateHooks(vnode, insertedVnodeQueue);
5129 break;
5130 }
5131 }
5132 }
5133 } else if (elm.data !== vnode.text) {
5134 elm.data = vnode.text;
5135 }
5136 return true;
5137 }
5138
5139 function assertNodeMatch(node, vnode) {
5140 if (isDef(vnode.tag)) {
5141 return vnode.tag.indexOf('vue-component') === 0 || vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase());
5142 } else {
5143 return node.nodeType === (vnode.isComment ? 8 : 3);
5144 }
5145 }
5146
5147 return function patch(oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
5148 if (isUndef(vnode)) {
5149 if (isDef(oldVnode)) {
5150 invokeDestroyHook(oldVnode);
5151 }
5152 return;
5153 }
5154
5155 var isInitialPatch = false;
5156 var insertedVnodeQueue = [];
5157
5158 if (isUndef(oldVnode)) {
5159 // empty mount (likely as component), create new root element
5160 isInitialPatch = true;
5161 createElm(vnode, insertedVnodeQueue, parentElm, refElm);
5162 } else {
5163 var isRealElement = isDef(oldVnode.nodeType);
5164 if (!isRealElement && sameVnode(oldVnode, vnode)) {
5165 // patch existing root node
5166 patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
5167 } else {
5168 if (isRealElement) {
5169 // mounting to a real element
5170 // check if this is server-rendered content and if we can perform
5171 // a successful hydration.
5172 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
5173 oldVnode.removeAttribute(SSR_ATTR);
5174 hydrating = true;
5175 }
5176 if (isTrue(hydrating)) {
5177 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
5178 invokeInsertHook(vnode, insertedVnodeQueue, true);
5179 return oldVnode;
5180 } else if (process.env.NODE_ENV !== 'production') {
5181 warn('The client-side rendered virtual DOM tree is not matching ' + 'server-rendered content. This is likely caused by incorrect ' + 'HTML markup, for example nesting block-level elements inside ' + '<p>, or missing <tbody>. Bailing hydration and performing ' + 'full client-side render.');
5182 }
5183 }
5184 // either not server-rendered, or hydration failed.
5185 // create an empty node and replace it
5186 oldVnode = emptyNodeAt(oldVnode);
5187 }
5188 // replacing existing element
5189 var oldElm = oldVnode.elm;
5190 var parentElm$1 = nodeOps.parentNode(oldElm);
5191 createElm(vnode, insertedVnodeQueue,
5192 // extremely rare edge case: do not insert if old element is in a
5193 // leaving transition. Only happens when combining transition +
5194 // keep-alive + HOCs. (#4590)
5195 oldElm._leaveCb ? null : parentElm$1, nodeOps.nextSibling(oldElm));
5196
5197 if (isDef(vnode.parent)) {
5198 // component root element replaced.
5199 // update parent placeholder node element, recursively
5200 var ancestor = vnode.parent;
5201 while (ancestor) {
5202 ancestor.elm = vnode.elm;
5203 ancestor = ancestor.parent;
5204 }
5205 if (isPatchable(vnode)) {
5206 for (var i = 0; i < cbs.create.length; ++i) {
5207 cbs.create[i](emptyNode, vnode.parent);
5208 }
5209 }
5210 }
5211
5212 if (isDef(parentElm$1)) {
5213 removeVnodes(parentElm$1, [oldVnode], 0, 0);
5214 } else if (isDef(oldVnode.tag)) {
5215 invokeDestroyHook(oldVnode);
5216 }
5217 }
5218 }
5219
5220 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
5221 return vnode.elm;
5222 };
5223 }
5224
5225 /* */
5226
5227 var directives = {
5228 create: updateDirectives,
5229 update: updateDirectives,
5230 destroy: function unbindDirectives(vnode) {
5231 updateDirectives(vnode, emptyNode);
5232 }
5233 };
5234
5235 function updateDirectives(oldVnode, vnode) {
5236 if (oldVnode.data.directives || vnode.data.directives) {
5237 _update(oldVnode, vnode);
5238 }
5239 }
5240
5241 function _update(oldVnode, vnode) {
5242 var isCreate = oldVnode === emptyNode;
5243 var isDestroy = vnode === emptyNode;
5244 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
5245 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
5246
5247 var dirsWithInsert = [];
5248 var dirsWithPostpatch = [];
5249
5250 var key, oldDir, dir;
5251 for (key in newDirs) {
5252 oldDir = oldDirs[key];
5253 dir = newDirs[key];
5254 if (!oldDir) {
5255 // new directive, bind
5256 callHook$1(dir, 'bind', vnode, oldVnode);
5257 if (dir.def && dir.def.inserted) {
5258 dirsWithInsert.push(dir);
5259 }
5260 } else {
5261 // existing directive, update
5262 dir.oldValue = oldDir.value;
5263 callHook$1(dir, 'update', vnode, oldVnode);
5264 if (dir.def && dir.def.componentUpdated) {
5265 dirsWithPostpatch.push(dir);
5266 }
5267 }
5268 }
5269
5270 if (dirsWithInsert.length) {
5271 var callInsert = function () {
5272 for (var i = 0; i < dirsWithInsert.length; i++) {
5273 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
5274 }
5275 };
5276 if (isCreate) {
5277 mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert);
5278 } else {
5279 callInsert();
5280 }
5281 }
5282
5283 if (dirsWithPostpatch.length) {
5284 mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
5285 for (var i = 0; i < dirsWithPostpatch.length; i++) {
5286 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
5287 }
5288 });
5289 }
5290
5291 if (!isCreate) {
5292 for (key in oldDirs) {
5293 if (!newDirs[key]) {
5294 // no longer present, unbind
5295 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
5296 }
5297 }
5298 }
5299 }
5300
5301 var emptyModifiers = Object.create(null);
5302
5303 function normalizeDirectives$1(dirs, vm) {
5304 var res = Object.create(null);
5305 if (!dirs) {
5306 return res;
5307 }
5308 var i, dir;
5309 for (i = 0; i < dirs.length; i++) {
5310 dir = dirs[i];
5311 if (!dir.modifiers) {
5312 dir.modifiers = emptyModifiers;
5313 }
5314 res[getRawDirName(dir)] = dir;
5315 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
5316 }
5317 return res;
5318 }
5319
5320 function getRawDirName(dir) {
5321 return dir.rawName || dir.name + "." + Object.keys(dir.modifiers || {}).join('.');
5322 }
5323
5324 function callHook$1(dir, hook, vnode, oldVnode, isDestroy) {
5325 var fn = dir.def && dir.def[hook];
5326 if (fn) {
5327 try {
5328 fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
5329 } catch (e) {
5330 handleError(e, vnode.context, "directive " + dir.name + " " + hook + " hook");
5331 }
5332 }
5333 }
5334
5335 var baseModules = [ref, directives];
5336
5337 /* */
5338
5339 function updateAttrs(oldVnode, vnode) {
5340 var opts = vnode.componentOptions;
5341 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
5342 return;
5343 }
5344 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
5345 return;
5346 }
5347 var key, cur, old;
5348 var elm = vnode.elm;
5349 var oldAttrs = oldVnode.data.attrs || {};
5350 var attrs = vnode.data.attrs || {};
5351 // clone observed objects, as the user probably wants to mutate it
5352 if (isDef(attrs.__ob__)) {
5353 attrs = vnode.data.attrs = extend({}, attrs);
5354 }
5355
5356 for (key in attrs) {
5357 cur = attrs[key];
5358 old = oldAttrs[key];
5359 if (old !== cur) {
5360 setAttr(elm, key, cur);
5361 }
5362 }
5363 // #4391: in IE9, setting type can reset value for input[type=radio]
5364 /* istanbul ignore if */
5365 if (isIE9 && attrs.value !== oldAttrs.value) {
5366 setAttr(elm, 'value', attrs.value);
5367 }
5368 for (key in oldAttrs) {
5369 if (isUndef(attrs[key])) {
5370 if (isXlink(key)) {
5371 elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
5372 } else if (!isEnumeratedAttr(key)) {
5373 elm.removeAttribute(key);
5374 }
5375 }
5376 }
5377 }
5378
5379 function setAttr(el, key, value) {
5380 if (isBooleanAttr(key)) {
5381 // set attribute for blank value
5382 // e.g. <option disabled>Select one</option>
5383 if (isFalsyAttrValue(value)) {
5384 el.removeAttribute(key);
5385 } else {
5386 el.setAttribute(key, key);
5387 }
5388 } else if (isEnumeratedAttr(key)) {
5389 el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
5390 } else if (isXlink(key)) {
5391 if (isFalsyAttrValue(value)) {
5392 el.removeAttributeNS(xlinkNS, getXlinkProp(key));
5393 } else {
5394 el.setAttributeNS(xlinkNS, key, value);
5395 }
5396 } else {
5397 if (isFalsyAttrValue(value)) {
5398 el.removeAttribute(key);
5399 } else {
5400 el.setAttribute(key, value);
5401 }
5402 }
5403 }
5404
5405 var attrs = {
5406 create: updateAttrs,
5407 update: updateAttrs
5408 };
5409
5410 /* */
5411
5412 function updateClass(oldVnode, vnode) {
5413 var el = vnode.elm;
5414 var data = vnode.data;
5415 var oldData = oldVnode.data;
5416 if (isUndef(data.staticClass) && isUndef(data.class) && (isUndef(oldData) || isUndef(oldData.staticClass) && isUndef(oldData.class))) {
5417 return;
5418 }
5419
5420 var cls = genClassForVnode(vnode);
5421
5422 // handle transition classes
5423 var transitionClass = el._transitionClasses;
5424 if (isDef(transitionClass)) {
5425 cls = concat(cls, stringifyClass(transitionClass));
5426 }
5427
5428 // set the class
5429 if (cls !== el._prevClass) {
5430 el.setAttribute('class', cls);
5431 el._prevClass = cls;
5432 }
5433 }
5434
5435 var klass = {
5436 create: updateClass,
5437 update: updateClass
5438 };
5439
5440 /* */
5441
5442 var validDivisionCharRE = /[\w).+\-_$\]]/;
5443
5444 function parseFilters(exp) {
5445 var inSingle = false;
5446 var inDouble = false;
5447 var inTemplateString = false;
5448 var inRegex = false;
5449 var curly = 0;
5450 var square = 0;
5451 var paren = 0;
5452 var lastFilterIndex = 0;
5453 var c, prev, i, expression, filters;
5454
5455 for (i = 0; i < exp.length; i++) {
5456 prev = c;
5457 c = exp.charCodeAt(i);
5458 if (inSingle) {
5459 if (c === 0x27 && prev !== 0x5C) {
5460 inSingle = false;
5461 }
5462 } else if (inDouble) {
5463 if (c === 0x22 && prev !== 0x5C) {
5464 inDouble = false;
5465 }
5466 } else if (inTemplateString) {
5467 if (c === 0x60 && prev !== 0x5C) {
5468 inTemplateString = false;
5469 }
5470 } else if (inRegex) {
5471 if (c === 0x2f && prev !== 0x5C) {
5472 inRegex = false;
5473 }
5474 } else if (c === 0x7C && // pipe
5475 exp.charCodeAt(i + 1) !== 0x7C && exp.charCodeAt(i - 1) !== 0x7C && !curly && !square && !paren) {
5476 if (expression === undefined) {
5477 // first filter, end of expression
5478 lastFilterIndex = i + 1;
5479 expression = exp.slice(0, i).trim();
5480 } else {
5481 pushFilter();
5482 }
5483 } else {
5484 switch (c) {
5485 case 0x22:
5486 inDouble = true;break; // "
5487 case 0x27:
5488 inSingle = true;break; // '
5489 case 0x60:
5490 inTemplateString = true;break; // `
5491 case 0x28:
5492 paren++;break; // (
5493 case 0x29:
5494 paren--;break; // )
5495 case 0x5B:
5496 square++;break; // [
5497 case 0x5D:
5498 square--;break; // ]
5499 case 0x7B:
5500 curly++;break; // {
5501 case 0x7D:
5502 curly--;break; // }
5503 }
5504 if (c === 0x2f) {
5505 // /
5506 var j = i - 1;
5507 var p = void 0;
5508 // find first non-whitespace prev char
5509 for (; j >= 0; j--) {
5510 p = exp.charAt(j);
5511 if (p !== ' ') {
5512 break;
5513 }
5514 }
5515 if (!p || !validDivisionCharRE.test(p)) {
5516 inRegex = true;
5517 }
5518 }
5519 }
5520 }
5521
5522 if (expression === undefined) {
5523 expression = exp.slice(0, i).trim();
5524 } else if (lastFilterIndex !== 0) {
5525 pushFilter();
5526 }
5527
5528 function pushFilter() {
5529 (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
5530 lastFilterIndex = i + 1;
5531 }
5532
5533 if (filters) {
5534 for (i = 0; i < filters.length; i++) {
5535 expression = wrapFilter(expression, filters[i]);
5536 }
5537 }
5538
5539 return expression;
5540 }
5541
5542 function wrapFilter(exp, filter) {
5543 var i = filter.indexOf('(');
5544 if (i < 0) {
5545 // _f: resolveFilter
5546 return "_f(\"" + filter + "\")(" + exp + ")";
5547 } else {
5548 var name = filter.slice(0, i);
5549 var args = filter.slice(i + 1);
5550 return "_f(\"" + name + "\")(" + exp + "," + args;
5551 }
5552 }
5553
5554 /* */
5555
5556 function baseWarn(msg) {
5557 console.error("[Vue compiler]: " + msg);
5558 }
5559
5560 function pluckModuleFunction(modules, key) {
5561 return modules ? modules.map(function (m) {
5562 return m[key];
5563 }).filter(function (_) {
5564 return _;
5565 }) : [];
5566 }
5567
5568 function addProp(el, name, value) {
5569 (el.props || (el.props = [])).push({ name: name, value: value });
5570 }
5571
5572 function addAttr(el, name, value) {
5573 (el.attrs || (el.attrs = [])).push({ name: name, value: value });
5574 }
5575
5576 function addDirective(el, name, rawName, value, arg, modifiers) {
5577 (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
5578 }
5579
5580 function addHandler(el, name, value, modifiers, important, warn) {
5581 // warn prevent and passive modifier
5582 /* istanbul ignore if */
5583 if (process.env.NODE_ENV !== 'production' && warn && modifiers && modifiers.prevent && modifiers.passive) {
5584 warn('passive and prevent can\'t be used together. ' + 'Passive handler can\'t prevent default event.');
5585 }
5586 // check capture modifier
5587 if (modifiers && modifiers.capture) {
5588 delete modifiers.capture;
5589 name = '!' + name; // mark the event as captured
5590 }
5591 if (modifiers && modifiers.once) {
5592 delete modifiers.once;
5593 name = '~' + name; // mark the event as once
5594 }
5595 /* istanbul ignore if */
5596 if (modifiers && modifiers.passive) {
5597 delete modifiers.passive;
5598 name = '&' + name; // mark the event as passive
5599 }
5600 var events;
5601 if (modifiers && modifiers.native) {
5602 delete modifiers.native;
5603 events = el.nativeEvents || (el.nativeEvents = {});
5604 } else {
5605 events = el.events || (el.events = {});
5606 }
5607 var newHandler = { value: value, modifiers: modifiers };
5608 var handlers = events[name];
5609 /* istanbul ignore if */
5610 if (Array.isArray(handlers)) {
5611 important ? handlers.unshift(newHandler) : handlers.push(newHandler);
5612 } else if (handlers) {
5613 events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
5614 } else {
5615 events[name] = newHandler;
5616 }
5617 }
5618
5619 function getBindingAttr(el, name, getStatic) {
5620 var dynamicValue = getAndRemoveAttr(el, ':' + name) || getAndRemoveAttr(el, 'v-bind:' + name);
5621 if (dynamicValue != null) {
5622 return parseFilters(dynamicValue);
5623 } else if (getStatic !== false) {
5624 var staticValue = getAndRemoveAttr(el, name);
5625 if (staticValue != null) {
5626 return JSON.stringify(staticValue);
5627 }
5628 }
5629 }
5630
5631 function getAndRemoveAttr(el, name) {
5632 var val;
5633 if ((val = el.attrsMap[name]) != null) {
5634 var list = el.attrsList;
5635 for (var i = 0, l = list.length; i < l; i++) {
5636 if (list[i].name === name) {
5637 list.splice(i, 1);
5638 break;
5639 }
5640 }
5641 }
5642 return val;
5643 }
5644
5645 /* */
5646
5647 /**
5648 * Cross-platform code generation for component v-model
5649 */
5650 function genComponentModel(el, value, modifiers) {
5651 var ref = modifiers || {};
5652 var number = ref.number;
5653 var trim = ref.trim;
5654
5655 var baseValueExpression = '$$v';
5656 var valueExpression = baseValueExpression;
5657 if (trim) {
5658 valueExpression = "(typeof " + baseValueExpression + " === 'string'" + "? " + baseValueExpression + ".trim()" + ": " + baseValueExpression + ")";
5659 }
5660 if (number) {
5661 valueExpression = "_n(" + valueExpression + ")";
5662 }
5663 var assignment = genAssignmentCode(value, valueExpression);
5664
5665 el.model = {
5666 value: "(" + value + ")",
5667 expression: "\"" + value + "\"",
5668 callback: "function (" + baseValueExpression + ") {" + assignment + "}"
5669 };
5670 }
5671
5672 /**
5673 * Cross-platform codegen helper for generating v-model value assignment code.
5674 */
5675 function genAssignmentCode(value, assignment) {
5676 var modelRs = parseModel(value);
5677 if (modelRs.idx === null) {
5678 return value + "=" + assignment;
5679 } else {
5680 return "$set(" + modelRs.exp + ", " + modelRs.idx + ", " + assignment + ")";
5681 }
5682 }
5683
5684 /**
5685 * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
5686 *
5687 * for loop possible cases:
5688 *
5689 * - test
5690 * - test[idx]
5691 * - test[test1[idx]]
5692 * - test["a"][idx]
5693 * - xxx.test[a[a].test1[idx]]
5694 * - test.xxx.a["asa"][test1[idx]]
5695 *
5696 */
5697
5698 var len;
5699 var str;
5700 var chr;
5701 var index$1;
5702 var expressionPos;
5703 var expressionEndPos;
5704
5705 function parseModel(val) {
5706 str = val;
5707 len = str.length;
5708 index$1 = expressionPos = expressionEndPos = 0;
5709
5710 if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
5711 return {
5712 exp: val,
5713 idx: null
5714 };
5715 }
5716
5717 while (!eof()) {
5718 chr = next();
5719 /* istanbul ignore if */
5720 if (isStringStart(chr)) {
5721 parseString(chr);
5722 } else if (chr === 0x5B) {
5723 parseBracket(chr);
5724 }
5725 }
5726
5727 return {
5728 exp: val.substring(0, expressionPos),
5729 idx: val.substring(expressionPos + 1, expressionEndPos)
5730 };
5731 }
5732
5733 function next() {
5734 return str.charCodeAt(++index$1);
5735 }
5736
5737 function eof() {
5738 return index$1 >= len;
5739 }
5740
5741 function isStringStart(chr) {
5742 return chr === 0x22 || chr === 0x27;
5743 }
5744
5745 function parseBracket(chr) {
5746 var inBracket = 1;
5747 expressionPos = index$1;
5748 while (!eof()) {
5749 chr = next();
5750 if (isStringStart(chr)) {
5751 parseString(chr);
5752 continue;
5753 }
5754 if (chr === 0x5B) {
5755 inBracket++;
5756 }
5757 if (chr === 0x5D) {
5758 inBracket--;
5759 }
5760 if (inBracket === 0) {
5761 expressionEndPos = index$1;
5762 break;
5763 }
5764 }
5765 }
5766
5767 function parseString(chr) {
5768 var stringQuote = chr;
5769 while (!eof()) {
5770 chr = next();
5771 if (chr === stringQuote) {
5772 break;
5773 }
5774 }
5775 }
5776
5777 /* */
5778
5779 var warn$1;
5780
5781 // in some cases, the event used has to be determined at runtime
5782 // so we used some reserved tokens during compile.
5783 var RANGE_TOKEN = '__r';
5784 var CHECKBOX_RADIO_TOKEN = '__c';
5785
5786 function model(el, dir, _warn) {
5787 warn$1 = _warn;
5788 var value = dir.value;
5789 var modifiers = dir.modifiers;
5790 var tag = el.tag;
5791 var type = el.attrsMap.type;
5792
5793 if (process.env.NODE_ENV !== 'production') {
5794 var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
5795 if (tag === 'input' && dynamicType) {
5796 warn$1("<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" + "v-model does not support dynamic input types. Use v-if branches instead.");
5797 }
5798 // inputs with type="file" are read only and setting the input's
5799 // value will throw an error.
5800 if (tag === 'input' && type === 'file') {
5801 warn$1("<" + el.tag + " v-model=\"" + value + "\" type=\"file\">:\n" + "File inputs are read only. Use a v-on:change listener instead.");
5802 }
5803 }
5804
5805 if (el.component) {
5806 genComponentModel(el, value, modifiers);
5807 // component v-model doesn't need extra runtime
5808 return false;
5809 } else if (tag === 'select') {
5810 genSelect(el, value, modifiers);
5811 } else if (tag === 'input' && type === 'checkbox') {
5812 genCheckboxModel(el, value, modifiers);
5813 } else if (tag === 'input' && type === 'radio') {
5814 genRadioModel(el, value, modifiers);
5815 } else if (tag === 'input' || tag === 'textarea') {
5816 genDefaultModel(el, value, modifiers);
5817 } else if (!config.isReservedTag(tag)) {
5818 genComponentModel(el, value, modifiers);
5819 // component v-model doesn't need extra runtime
5820 return false;
5821 } else if (process.env.NODE_ENV !== 'production') {
5822 warn$1("<" + el.tag + " v-model=\"" + value + "\">: " + "v-model is not supported on this element type. " + 'If you are working with contenteditable, it\'s recommended to ' + 'wrap a library dedicated for that purpose inside a custom component.');
5823 }
5824
5825 // ensure runtime directive metadata
5826 return true;
5827 }
5828
5829 function genCheckboxModel(el, value, modifiers) {
5830 var number = modifiers && modifiers.number;
5831 var valueBinding = getBindingAttr(el, 'value') || 'null';
5832 var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
5833 var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
5834 addProp(el, 'checked', "Array.isArray(" + value + ")" + "?_i(" + value + "," + valueBinding + ")>-1" + (trueValueBinding === 'true' ? ":(" + value + ")" : ":_q(" + value + "," + trueValueBinding + ")"));
5835 addHandler(el, CHECKBOX_RADIO_TOKEN, "var $$a=" + value + "," + '$$el=$event.target,' + "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + 'if(Array.isArray($$a)){' + "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + '$$i=_i($$a,$$v);' + "if($$el.checked){$$i<0&&(" + value + "=$$a.concat($$v))}" + "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" + "}else{" + genAssignmentCode(value, '$$c') + "}", null, true);
5836 }
5837
5838 function genRadioModel(el, value, modifiers) {
5839 var number = modifiers && modifiers.number;
5840 var valueBinding = getBindingAttr(el, 'value') || 'null';
5841 valueBinding = number ? "_n(" + valueBinding + ")" : valueBinding;
5842 addProp(el, 'checked', "_q(" + value + "," + valueBinding + ")");
5843 addHandler(el, CHECKBOX_RADIO_TOKEN, genAssignmentCode(value, valueBinding), null, true);
5844 }
5845
5846 function genSelect(el, value, modifiers) {
5847 var number = modifiers && modifiers.number;
5848 var selectedVal = "Array.prototype.filter" + ".call($event.target.options,function(o){return o.selected})" + ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + "return " + (number ? '_n(val)' : 'val') + "})";
5849
5850 var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
5851 var code = "var $$selectedVal = " + selectedVal + ";";
5852 code = code + " " + genAssignmentCode(value, assignment);
5853 addHandler(el, 'change', code, null, true);
5854 }
5855
5856 function genDefaultModel(el, value, modifiers) {
5857 var type = el.attrsMap.type;
5858 var ref = modifiers || {};
5859 var lazy = ref.lazy;
5860 var number = ref.number;
5861 var trim = ref.trim;
5862 var needCompositionGuard = !lazy && type !== 'range';
5863 var event = lazy ? 'change' : type === 'range' ? RANGE_TOKEN : 'input';
5864
5865 var valueExpression = '$event.target.value';
5866 if (trim) {
5867 valueExpression = "$event.target.value.trim()";
5868 }
5869 if (number) {
5870 valueExpression = "_n(" + valueExpression + ")";
5871 }
5872
5873 var code = genAssignmentCode(value, valueExpression);
5874 if (needCompositionGuard) {
5875 code = "if($event.target.composing)return;" + code;
5876 }
5877
5878 addProp(el, 'value', "(" + value + ")");
5879 addHandler(el, event, code, null, true);
5880 if (trim || number) {
5881 addHandler(el, 'blur', '$forceUpdate()');
5882 }
5883 }
5884
5885 /* */
5886
5887 // normalize v-model event tokens that can only be determined at runtime.
5888 // it's important to place the event as the first in the array because
5889 // the whole point is ensuring the v-model callback gets called before
5890 // user-attached handlers.
5891 function normalizeEvents(on) {
5892 var event;
5893 /* istanbul ignore if */
5894 if (isDef(on[RANGE_TOKEN])) {
5895 // IE input[type=range] only supports `change` event
5896 event = isIE ? 'change' : 'input';
5897 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
5898 delete on[RANGE_TOKEN];
5899 }
5900 if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
5901 // Chrome fires microtasks in between click/change, leads to #4521
5902 event = isChrome ? 'click' : 'change';
5903 on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || []);
5904 delete on[CHECKBOX_RADIO_TOKEN];
5905 }
5906 }
5907
5908 var target$1;
5909
5910 function add$1(event, handler, once$$1, capture, passive) {
5911 if (once$$1) {
5912 var oldHandler = handler;
5913 var _target = target$1; // save current target element in closure
5914 handler = function (ev) {
5915 var res = arguments.length === 1 ? oldHandler(ev) : oldHandler.apply(null, arguments);
5916 if (res !== null) {
5917 remove$2(event, handler, capture, _target);
5918 }
5919 };
5920 }
5921 target$1.addEventListener(event, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
5922 }
5923
5924 function remove$2(event, handler, capture, _target) {
5925 (_target || target$1).removeEventListener(event, handler, capture);
5926 }
5927
5928 function updateDOMListeners(oldVnode, vnode) {
5929 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
5930 return;
5931 }
5932 var on = vnode.data.on || {};
5933 var oldOn = oldVnode.data.on || {};
5934 target$1 = vnode.elm;
5935 normalizeEvents(on);
5936 updateListeners(on, oldOn, add$1, remove$2, vnode.context);
5937 }
5938
5939 var events = {
5940 create: updateDOMListeners,
5941 update: updateDOMListeners
5942 };
5943
5944 /* */
5945
5946 function updateDOMProps(oldVnode, vnode) {
5947 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
5948 return;
5949 }
5950 var key, cur;
5951 var elm = vnode.elm;
5952 var oldProps = oldVnode.data.domProps || {};
5953 var props = vnode.data.domProps || {};
5954 // clone observed objects, as the user probably wants to mutate it
5955 if (isDef(props.__ob__)) {
5956 props = vnode.data.domProps = extend({}, props);
5957 }
5958
5959 for (key in oldProps) {
5960 if (isUndef(props[key])) {
5961 elm[key] = '';
5962 }
5963 }
5964 for (key in props) {
5965 cur = props[key];
5966 // ignore children if the node has textContent or innerHTML,
5967 // as these will throw away existing DOM nodes and cause removal errors
5968 // on subsequent patches (#3360)
5969 if (key === 'textContent' || key === 'innerHTML') {
5970 if (vnode.children) {
5971 vnode.children.length = 0;
5972 }
5973 if (cur === oldProps[key]) {
5974 continue;
5975 }
5976 }
5977
5978 if (key === 'value') {
5979 // store value as _value as well since
5980 // non-string values will be stringified
5981 elm._value = cur;
5982 // avoid resetting cursor position when value is the same
5983 var strCur = isUndef(cur) ? '' : String(cur);
5984 if (shouldUpdateValue(elm, vnode, strCur)) {
5985 elm.value = strCur;
5986 }
5987 } else {
5988 elm[key] = cur;
5989 }
5990 }
5991 }
5992
5993 // check platforms/web/util/attrs.js acceptValue
5994
5995
5996 function shouldUpdateValue(elm, vnode, checkVal) {
5997 return !elm.composing && (vnode.tag === 'option' || isDirty(elm, checkVal) || isInputChanged(elm, checkVal));
5998 }
5999
6000 function isDirty(elm, checkVal) {
6001 // return true when textbox (.number and .trim) loses focus and its value is
6002 // not equal to the updated value
6003 var notInFocus = true;
6004 // #6157
6005 // work around IE bug when accessing document.activeElement in an iframe
6006 try {
6007 notInFocus = document.activeElement !== elm;
6008 } catch (e) {}
6009 return notInFocus && elm.value !== checkVal;
6010 }
6011
6012 function isInputChanged(elm, newVal) {
6013 var value = elm.value;
6014 var modifiers = elm._vModifiers; // injected by v-model runtime
6015 if (isDef(modifiers) && modifiers.number) {
6016 return toNumber(value) !== toNumber(newVal);
6017 }
6018 if (isDef(modifiers) && modifiers.trim) {
6019 return value.trim() !== newVal.trim();
6020 }
6021 return value !== newVal;
6022 }
6023
6024 var domProps = {
6025 create: updateDOMProps,
6026 update: updateDOMProps
6027 };
6028
6029 /* */
6030
6031 var parseStyleText = cached(function (cssText) {
6032 var res = {};
6033 var listDelimiter = /;(?![^(]*\))/g;
6034 var propertyDelimiter = /:(.+)/;
6035 cssText.split(listDelimiter).forEach(function (item) {
6036 if (item) {
6037 var tmp = item.split(propertyDelimiter);
6038 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
6039 }
6040 });
6041 return res;
6042 });
6043
6044 // merge static and dynamic style data on the same vnode
6045 function normalizeStyleData(data) {
6046 var style = normalizeStyleBinding(data.style);
6047 // static style is pre-processed into an object during compilation
6048 // and is always a fresh object, so it's safe to merge into it
6049 return data.staticStyle ? extend(data.staticStyle, style) : style;
6050 }
6051
6052 // normalize possible array / string values into Object
6053 function normalizeStyleBinding(bindingStyle) {
6054 if (Array.isArray(bindingStyle)) {
6055 return toObject(bindingStyle);
6056 }
6057 if (typeof bindingStyle === 'string') {
6058 return parseStyleText(bindingStyle);
6059 }
6060 return bindingStyle;
6061 }
6062
6063 /**
6064 * parent component style should be after child's
6065 * so that parent component's style could override it
6066 */
6067 function getStyle(vnode, checkChild) {
6068 var res = {};
6069 var styleData;
6070
6071 if (checkChild) {
6072 var childNode = vnode;
6073 while (childNode.componentInstance) {
6074 childNode = childNode.componentInstance._vnode;
6075 if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
6076 extend(res, styleData);
6077 }
6078 }
6079 }
6080
6081 if (styleData = normalizeStyleData(vnode.data)) {
6082 extend(res, styleData);
6083 }
6084
6085 var parentNode = vnode;
6086 while (parentNode = parentNode.parent) {
6087 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
6088 extend(res, styleData);
6089 }
6090 }
6091 return res;
6092 }
6093
6094 /* */
6095
6096 var cssVarRE = /^--/;
6097 var importantRE = /\s*!important$/;
6098 var setProp = function (el, name, val) {
6099 /* istanbul ignore if */
6100 if (cssVarRE.test(name)) {
6101 el.style.setProperty(name, val);
6102 } else if (importantRE.test(val)) {
6103 el.style.setProperty(name, val.replace(importantRE, ''), 'important');
6104 } else {
6105 var normalizedName = normalize(name);
6106 if (Array.isArray(val)) {
6107 // Support values array created by autoprefixer, e.g.
6108 // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
6109 // Set them one by one, and the browser will only set those it can recognize
6110 for (var i = 0, len = val.length; i < len; i++) {
6111 el.style[normalizedName] = val[i];
6112 }
6113 } else {
6114 el.style[normalizedName] = val;
6115 }
6116 }
6117 };
6118
6119 var vendorNames = ['Webkit', 'Moz', 'ms'];
6120
6121 var emptyStyle;
6122 var normalize = cached(function (prop) {
6123 emptyStyle = emptyStyle || document.createElement('div').style;
6124 prop = camelize(prop);
6125 if (prop !== 'filter' && prop in emptyStyle) {
6126 return prop;
6127 }
6128 var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
6129 for (var i = 0; i < vendorNames.length; i++) {
6130 var name = vendorNames[i] + capName;
6131 if (name in emptyStyle) {
6132 return name;
6133 }
6134 }
6135 });
6136
6137 function updateStyle(oldVnode, vnode) {
6138 var data = vnode.data;
6139 var oldData = oldVnode.data;
6140
6141 if (isUndef(data.staticStyle) && isUndef(data.style) && isUndef(oldData.staticStyle) && isUndef(oldData.style)) {
6142 return;
6143 }
6144
6145 var cur, name;
6146 var el = vnode.elm;
6147 var oldStaticStyle = oldData.staticStyle;
6148 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
6149
6150 // if static style exists, stylebinding already merged into it when doing normalizeStyleData
6151 var oldStyle = oldStaticStyle || oldStyleBinding;
6152
6153 var style = normalizeStyleBinding(vnode.data.style) || {};
6154
6155 // store normalized style under a different key for next diff
6156 // make sure to clone it if it's reactive, since the user likley wants
6157 // to mutate it.
6158 vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
6159
6160 var newStyle = getStyle(vnode, true);
6161
6162 for (name in oldStyle) {
6163 if (isUndef(newStyle[name])) {
6164 setProp(el, name, '');
6165 }
6166 }
6167 for (name in newStyle) {
6168 cur = newStyle[name];
6169 if (cur !== oldStyle[name]) {
6170 // ie9 setting to null has no effect, must use empty string
6171 setProp(el, name, cur == null ? '' : cur);
6172 }
6173 }
6174 }
6175
6176 var style = {
6177 create: updateStyle,
6178 update: updateStyle
6179 };
6180
6181 /* */
6182
6183 /**
6184 * Add class with compatibility for SVG since classList is not supported on
6185 * SVG elements in IE
6186 */
6187 function addClass(el, cls) {
6188 /* istanbul ignore if */
6189 if (!cls || !(cls = cls.trim())) {
6190 return;
6191 }
6192
6193 /* istanbul ignore else */
6194 if (el.classList) {
6195 if (cls.indexOf(' ') > -1) {
6196 cls.split(/\s+/).forEach(function (c) {
6197 return el.classList.add(c);
6198 });
6199 } else {
6200 el.classList.add(cls);
6201 }
6202 } else {
6203 var cur = " " + (el.getAttribute('class') || '') + " ";
6204 if (cur.indexOf(' ' + cls + ' ') < 0) {
6205 el.setAttribute('class', (cur + cls).trim());
6206 }
6207 }
6208 }
6209
6210 /**
6211 * Remove class with compatibility for SVG since classList is not supported on
6212 * SVG elements in IE
6213 */
6214 function removeClass(el, cls) {
6215 /* istanbul ignore if */
6216 if (!cls || !(cls = cls.trim())) {
6217 return;
6218 }
6219
6220 /* istanbul ignore else */
6221 if (el.classList) {
6222 if (cls.indexOf(' ') > -1) {
6223 cls.split(/\s+/).forEach(function (c) {
6224 return el.classList.remove(c);
6225 });
6226 } else {
6227 el.classList.remove(cls);
6228 }
6229 if (!el.classList.length) {
6230 el.removeAttribute('class');
6231 }
6232 } else {
6233 var cur = " " + (el.getAttribute('class') || '') + " ";
6234 var tar = ' ' + cls + ' ';
6235 while (cur.indexOf(tar) >= 0) {
6236 cur = cur.replace(tar, ' ');
6237 }
6238 cur = cur.trim();
6239 if (cur) {
6240 el.setAttribute('class', cur);
6241 } else {
6242 el.removeAttribute('class');
6243 }
6244 }
6245 }
6246
6247 /* */
6248
6249 function resolveTransition(def$$1) {
6250 if (!def$$1) {
6251 return;
6252 }
6253 /* istanbul ignore else */
6254 if (typeof def$$1 === 'object') {
6255 var res = {};
6256 if (def$$1.css !== false) {
6257 extend(res, autoCssTransition(def$$1.name || 'v'));
6258 }
6259 extend(res, def$$1);
6260 return res;
6261 } else if (typeof def$$1 === 'string') {
6262 return autoCssTransition(def$$1);
6263 }
6264 }
6265
6266 var autoCssTransition = cached(function (name) {
6267 return {
6268 enterClass: name + "-enter",
6269 enterToClass: name + "-enter-to",
6270 enterActiveClass: name + "-enter-active",
6271 leaveClass: name + "-leave",
6272 leaveToClass: name + "-leave-to",
6273 leaveActiveClass: name + "-leave-active"
6274 };
6275 });
6276
6277 var hasTransition = inBrowser && !isIE9;
6278 var TRANSITION = 'transition';
6279 var ANIMATION = 'animation';
6280
6281 // Transition property/event sniffing
6282 var transitionProp = 'transition';
6283 var transitionEndEvent = 'transitionend';
6284 var animationProp = 'animation';
6285 var animationEndEvent = 'animationend';
6286 if (hasTransition) {
6287 /* istanbul ignore if */
6288 if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {
6289 transitionProp = 'WebkitTransition';
6290 transitionEndEvent = 'webkitTransitionEnd';
6291 }
6292 if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {
6293 animationProp = 'WebkitAnimation';
6294 animationEndEvent = 'webkitAnimationEnd';
6295 }
6296 }
6297
6298 // binding to window is necessary to make hot reload work in IE in strict mode
6299 var raf = inBrowser && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout;
6300
6301 function nextFrame(fn) {
6302 raf(function () {
6303 raf(fn);
6304 });
6305 }
6306
6307 function addTransitionClass(el, cls) {
6308 var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
6309 if (transitionClasses.indexOf(cls) < 0) {
6310 transitionClasses.push(cls);
6311 addClass(el, cls);
6312 }
6313 }
6314
6315 function removeTransitionClass(el, cls) {
6316 if (el._transitionClasses) {
6317 remove(el._transitionClasses, cls);
6318 }
6319 removeClass(el, cls);
6320 }
6321
6322 function whenTransitionEnds(el, expectedType, cb) {
6323 var ref = getTransitionInfo(el, expectedType);
6324 var type = ref.type;
6325 var timeout = ref.timeout;
6326 var propCount = ref.propCount;
6327 if (!type) {
6328 return cb();
6329 }
6330 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
6331 var ended = 0;
6332 var end = function () {
6333 el.removeEventListener(event, onEnd);
6334 cb();
6335 };
6336 var onEnd = function (e) {
6337 if (e.target === el) {
6338 if (++ended >= propCount) {
6339 end();
6340 }
6341 }
6342 };
6343 setTimeout(function () {
6344 if (ended < propCount) {
6345 end();
6346 }
6347 }, timeout + 1);
6348 el.addEventListener(event, onEnd);
6349 }
6350
6351 var transformRE = /\b(transform|all)(,|$)/;
6352
6353 function getTransitionInfo(el, expectedType) {
6354 var styles = window.getComputedStyle(el);
6355 var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
6356 var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
6357 var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
6358 var animationDelays = styles[animationProp + 'Delay'].split(', ');
6359 var animationDurations = styles[animationProp + 'Duration'].split(', ');
6360 var animationTimeout = getTimeout(animationDelays, animationDurations);
6361
6362 var type;
6363 var timeout = 0;
6364 var propCount = 0;
6365 /* istanbul ignore if */
6366 if (expectedType === TRANSITION) {
6367 if (transitionTimeout > 0) {
6368 type = TRANSITION;
6369 timeout = transitionTimeout;
6370 propCount = transitionDurations.length;
6371 }
6372 } else if (expectedType === ANIMATION) {
6373 if (animationTimeout > 0) {
6374 type = ANIMATION;
6375 timeout = animationTimeout;
6376 propCount = animationDurations.length;
6377 }
6378 } else {
6379 timeout = Math.max(transitionTimeout, animationTimeout);
6380 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
6381 propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
6382 }
6383 var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
6384 return {
6385 type: type,
6386 timeout: timeout,
6387 propCount: propCount,
6388 hasTransform: hasTransform
6389 };
6390 }
6391
6392 function getTimeout(delays, durations) {
6393 /* istanbul ignore next */
6394 while (delays.length < durations.length) {
6395 delays = delays.concat(delays);
6396 }
6397
6398 return Math.max.apply(null, durations.map(function (d, i) {
6399 return toMs(d) + toMs(delays[i]);
6400 }));
6401 }
6402
6403 function toMs(s) {
6404 return Number(s.slice(0, -1)) * 1000;
6405 }
6406
6407 /* */
6408
6409 function enter(vnode, toggleDisplay) {
6410 var el = vnode.elm;
6411
6412 // call leave callback now
6413 if (isDef(el._leaveCb)) {
6414 el._leaveCb.cancelled = true;
6415 el._leaveCb();
6416 }
6417
6418 var data = resolveTransition(vnode.data.transition);
6419 if (isUndef(data)) {
6420 return;
6421 }
6422
6423 /* istanbul ignore if */
6424 if (isDef(el._enterCb) || el.nodeType !== 1) {
6425 return;
6426 }
6427
6428 var css = data.css;
6429 var type = data.type;
6430 var enterClass = data.enterClass;
6431 var enterToClass = data.enterToClass;
6432 var enterActiveClass = data.enterActiveClass;
6433 var appearClass = data.appearClass;
6434 var appearToClass = data.appearToClass;
6435 var appearActiveClass = data.appearActiveClass;
6436 var beforeEnter = data.beforeEnter;
6437 var enter = data.enter;
6438 var afterEnter = data.afterEnter;
6439 var enterCancelled = data.enterCancelled;
6440 var beforeAppear = data.beforeAppear;
6441 var appear = data.appear;
6442 var afterAppear = data.afterAppear;
6443 var appearCancelled = data.appearCancelled;
6444 var duration = data.duration;
6445
6446 // activeInstance will always be the <transition> component managing this
6447 // transition. One edge case to check is when the <transition> is placed
6448 // as the root node of a child component. In that case we need to check
6449 // <transition>'s parent for appear check.
6450 var context = activeInstance;
6451 var transitionNode = activeInstance.$vnode;
6452 while (transitionNode && transitionNode.parent) {
6453 transitionNode = transitionNode.parent;
6454 context = transitionNode.context;
6455 }
6456
6457 var isAppear = !context._isMounted || !vnode.isRootInsert;
6458
6459 if (isAppear && !appear && appear !== '') {
6460 return;
6461 }
6462
6463 var startClass = isAppear && appearClass ? appearClass : enterClass;
6464 var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
6465 var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
6466
6467 var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
6468 var enterHook = isAppear ? typeof appear === 'function' ? appear : enter : enter;
6469 var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
6470 var enterCancelledHook = isAppear ? appearCancelled || enterCancelled : enterCancelled;
6471
6472 var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
6473
6474 if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
6475 checkDuration(explicitEnterDuration, 'enter', vnode);
6476 }
6477
6478 var expectsCSS = css !== false && !isIE9;
6479 var userWantsControl = getHookArgumentsLength(enterHook);
6480
6481 var cb = el._enterCb = once(function () {
6482 if (expectsCSS) {
6483 removeTransitionClass(el, toClass);
6484 removeTransitionClass(el, activeClass);
6485 }
6486 if (cb.cancelled) {
6487 if (expectsCSS) {
6488 removeTransitionClass(el, startClass);
6489 }
6490 enterCancelledHook && enterCancelledHook(el);
6491 } else {
6492 afterEnterHook && afterEnterHook(el);
6493 }
6494 el._enterCb = null;
6495 });
6496
6497 if (!vnode.data.show) {
6498 // remove pending leave element on enter by injecting an insert hook
6499 mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
6500 var parent = el.parentNode;
6501 var pendingNode = parent && parent._pending && parent._pending[vnode.key];
6502 if (pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) {
6503 pendingNode.elm._leaveCb();
6504 }
6505 enterHook && enterHook(el, cb);
6506 });
6507 }
6508
6509 // start enter transition
6510 beforeEnterHook && beforeEnterHook(el);
6511 if (expectsCSS) {
6512 addTransitionClass(el, startClass);
6513 addTransitionClass(el, activeClass);
6514 nextFrame(function () {
6515 addTransitionClass(el, toClass);
6516 removeTransitionClass(el, startClass);
6517 if (!cb.cancelled && !userWantsControl) {
6518 if (isValidDuration(explicitEnterDuration)) {
6519 setTimeout(cb, explicitEnterDuration);
6520 } else {
6521 whenTransitionEnds(el, type, cb);
6522 }
6523 }
6524 });
6525 }
6526
6527 if (vnode.data.show) {
6528 toggleDisplay && toggleDisplay();
6529 enterHook && enterHook(el, cb);
6530 }
6531
6532 if (!expectsCSS && !userWantsControl) {
6533 cb();
6534 }
6535 }
6536
6537 function leave(vnode, rm) {
6538 var el = vnode.elm;
6539
6540 // call enter callback now
6541 if (isDef(el._enterCb)) {
6542 el._enterCb.cancelled = true;
6543 el._enterCb();
6544 }
6545
6546 var data = resolveTransition(vnode.data.transition);
6547 if (isUndef(data)) {
6548 return rm();
6549 }
6550
6551 /* istanbul ignore if */
6552 if (isDef(el._leaveCb) || el.nodeType !== 1) {
6553 return;
6554 }
6555
6556 var css = data.css;
6557 var type = data.type;
6558 var leaveClass = data.leaveClass;
6559 var leaveToClass = data.leaveToClass;
6560 var leaveActiveClass = data.leaveActiveClass;
6561 var beforeLeave = data.beforeLeave;
6562 var leave = data.leave;
6563 var afterLeave = data.afterLeave;
6564 var leaveCancelled = data.leaveCancelled;
6565 var delayLeave = data.delayLeave;
6566 var duration = data.duration;
6567
6568 var expectsCSS = css !== false && !isIE9;
6569 var userWantsControl = getHookArgumentsLength(leave);
6570
6571 var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
6572
6573 if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {
6574 checkDuration(explicitLeaveDuration, 'leave', vnode);
6575 }
6576
6577 var cb = el._leaveCb = once(function () {
6578 if (el.parentNode && el.parentNode._pending) {
6579 el.parentNode._pending[vnode.key] = null;
6580 }
6581 if (expectsCSS) {
6582 removeTransitionClass(el, leaveToClass);
6583 removeTransitionClass(el, leaveActiveClass);
6584 }
6585 if (cb.cancelled) {
6586 if (expectsCSS) {
6587 removeTransitionClass(el, leaveClass);
6588 }
6589 leaveCancelled && leaveCancelled(el);
6590 } else {
6591 rm();
6592 afterLeave && afterLeave(el);
6593 }
6594 el._leaveCb = null;
6595 });
6596
6597 if (delayLeave) {
6598 delayLeave(performLeave);
6599 } else {
6600 performLeave();
6601 }
6602
6603 function performLeave() {
6604 // the delayed leave may have already been cancelled
6605 if (cb.cancelled) {
6606 return;
6607 }
6608 // record leaving element
6609 if (!vnode.data.show) {
6610 (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
6611 }
6612 beforeLeave && beforeLeave(el);
6613 if (expectsCSS) {
6614 addTransitionClass(el, leaveClass);
6615 addTransitionClass(el, leaveActiveClass);
6616 nextFrame(function () {
6617 addTransitionClass(el, leaveToClass);
6618 removeTransitionClass(el, leaveClass);
6619 if (!cb.cancelled && !userWantsControl) {
6620 if (isValidDuration(explicitLeaveDuration)) {
6621 setTimeout(cb, explicitLeaveDuration);
6622 } else {
6623 whenTransitionEnds(el, type, cb);
6624 }
6625 }
6626 });
6627 }
6628 leave && leave(el, cb);
6629 if (!expectsCSS && !userWantsControl) {
6630 cb();
6631 }
6632 }
6633 }
6634
6635 // only used in dev mode
6636 function checkDuration(val, name, vnode) {
6637 if (typeof val !== 'number') {
6638 warn("<transition> explicit " + name + " duration is not a valid number - " + "got " + JSON.stringify(val) + ".", vnode.context);
6639 } else if (isNaN(val)) {
6640 warn("<transition> explicit " + name + " duration is NaN - " + 'the duration expression might be incorrect.', vnode.context);
6641 }
6642 }
6643
6644 function isValidDuration(val) {
6645 return typeof val === 'number' && !isNaN(val);
6646 }
6647
6648 /**
6649 * Normalize a transition hook's argument length. The hook may be:
6650 * - a merged hook (invoker) with the original in .fns
6651 * - a wrapped component method (check ._length)
6652 * - a plain function (.length)
6653 */
6654 function getHookArgumentsLength(fn) {
6655 if (isUndef(fn)) {
6656 return false;
6657 }
6658 var invokerFns = fn.fns;
6659 if (isDef(invokerFns)) {
6660 // invoker
6661 return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
6662 } else {
6663 return (fn._length || fn.length) > 1;
6664 }
6665 }
6666
6667 function _enter(_, vnode) {
6668 if (vnode.data.show !== true) {
6669 enter(vnode);
6670 }
6671 }
6672
6673 var transition = inBrowser ? {
6674 create: _enter,
6675 activate: _enter,
6676 remove: function remove$$1(vnode, rm) {
6677 /* istanbul ignore else */
6678 if (vnode.data.show !== true) {
6679 leave(vnode, rm);
6680 } else {
6681 rm();
6682 }
6683 }
6684 } : {};
6685
6686 var platformModules = [attrs, klass, events, domProps, style, transition];
6687
6688 /* */
6689
6690 // the directive module should be applied last, after all
6691 // built-in modules have been applied.
6692 var modules = platformModules.concat(baseModules);
6693
6694 var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
6695
6696 /**
6697 * Not type checking this file because flow doesn't like attaching
6698 * properties to Elements.
6699 */
6700
6701 var isTextInputType = makeMap('text,number,password,search,email,tel,url');
6702
6703 /* istanbul ignore if */
6704 if (isIE9) {
6705 // http://www.matts411.com/post/internet-explorer-9-oninput/
6706 document.addEventListener('selectionchange', function () {
6707 var el = document.activeElement;
6708 if (el && el.vmodel) {
6709 trigger(el, 'input');
6710 }
6711 });
6712 }
6713
6714 var model$1 = {
6715 inserted: function inserted(el, binding, vnode) {
6716 if (vnode.tag === 'select') {
6717 var cb = function () {
6718 setSelected(el, binding, vnode.context);
6719 };
6720 cb();
6721 /* istanbul ignore if */
6722 if (isIE || isEdge) {
6723 setTimeout(cb, 0);
6724 }
6725 el._vOptions = [].map.call(el.options, getValue);
6726 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
6727 el._vModifiers = binding.modifiers;
6728 if (!binding.modifiers.lazy) {
6729 // Safari < 10.2 & UIWebView doesn't fire compositionend when
6730 // switching focus before confirming composition choice
6731 // this also fixes the issue where some browsers e.g. iOS Chrome
6732 // fires "change" instead of "input" on autocomplete.
6733 el.addEventListener('change', onCompositionEnd);
6734 if (!isAndroid) {
6735 el.addEventListener('compositionstart', onCompositionStart);
6736 el.addEventListener('compositionend', onCompositionEnd);
6737 }
6738 /* istanbul ignore if */
6739 if (isIE9) {
6740 el.vmodel = true;
6741 }
6742 }
6743 }
6744 },
6745 componentUpdated: function componentUpdated(el, binding, vnode) {
6746 if (vnode.tag === 'select') {
6747 setSelected(el, binding, vnode.context);
6748 // in case the options rendered by v-for have changed,
6749 // it's possible that the value is out-of-sync with the rendered options.
6750 // detect such cases and filter out values that no longer has a matching
6751 // option in the DOM.
6752 var prevOptions = el._vOptions;
6753 var curOptions = el._vOptions = [].map.call(el.options, getValue);
6754 if (curOptions.some(function (o, i) {
6755 return !looseEqual(o, prevOptions[i]);
6756 })) {
6757 trigger(el, 'change');
6758 }
6759 }
6760 }
6761 };
6762
6763 function setSelected(el, binding, vm) {
6764 var value = binding.value;
6765 var isMultiple = el.multiple;
6766 if (isMultiple && !Array.isArray(value)) {
6767 process.env.NODE_ENV !== 'production' && warn("<select multiple v-model=\"" + binding.expression + "\"> " + "expects an Array value for its binding, but got " + Object.prototype.toString.call(value).slice(8, -1), vm);
6768 return;
6769 }
6770 var selected, option;
6771 for (var i = 0, l = el.options.length; i < l; i++) {
6772 option = el.options[i];
6773 if (isMultiple) {
6774 selected = looseIndexOf(value, getValue(option)) > -1;
6775 if (option.selected !== selected) {
6776 option.selected = selected;
6777 }
6778 } else {
6779 if (looseEqual(getValue(option), value)) {
6780 if (el.selectedIndex !== i) {
6781 el.selectedIndex = i;
6782 }
6783 return;
6784 }
6785 }
6786 }
6787 if (!isMultiple) {
6788 el.selectedIndex = -1;
6789 }
6790 }
6791
6792 function getValue(option) {
6793 return '_value' in option ? option._value : option.value;
6794 }
6795
6796 function onCompositionStart(e) {
6797 e.target.composing = true;
6798 }
6799
6800 function onCompositionEnd(e) {
6801 // prevent triggering an input event for no reason
6802 if (!e.target.composing) {
6803 return;
6804 }
6805 e.target.composing = false;
6806 trigger(e.target, 'input');
6807 }
6808
6809 function trigger(el, type) {
6810 var e = document.createEvent('HTMLEvents');
6811 e.initEvent(type, true, true);
6812 el.dispatchEvent(e);
6813 }
6814
6815 /* */
6816
6817 // recursively search for possible transition defined inside the component root
6818 function locateNode(vnode) {
6819 return vnode.componentInstance && (!vnode.data || !vnode.data.transition) ? locateNode(vnode.componentInstance._vnode) : vnode;
6820 }
6821
6822 var show = {
6823 bind: function bind(el, ref, vnode) {
6824 var value = ref.value;
6825
6826 vnode = locateNode(vnode);
6827 var transition$$1 = vnode.data && vnode.data.transition;
6828 var originalDisplay = el.__vOriginalDisplay = el.style.display === 'none' ? '' : el.style.display;
6829 if (value && transition$$1) {
6830 vnode.data.show = true;
6831 enter(vnode, function () {
6832 el.style.display = originalDisplay;
6833 });
6834 } else {
6835 el.style.display = value ? originalDisplay : 'none';
6836 }
6837 },
6838
6839 update: function update(el, ref, vnode) {
6840 var value = ref.value;
6841 var oldValue = ref.oldValue;
6842
6843 /* istanbul ignore if */
6844 if (value === oldValue) {
6845 return;
6846 }
6847 vnode = locateNode(vnode);
6848 var transition$$1 = vnode.data && vnode.data.transition;
6849 if (transition$$1) {
6850 vnode.data.show = true;
6851 if (value) {
6852 enter(vnode, function () {
6853 el.style.display = el.__vOriginalDisplay;
6854 });
6855 } else {
6856 leave(vnode, function () {
6857 el.style.display = 'none';
6858 });
6859 }
6860 } else {
6861 el.style.display = value ? el.__vOriginalDisplay : 'none';
6862 }
6863 },
6864
6865 unbind: function unbind(el, binding, vnode, oldVnode, isDestroy) {
6866 if (!isDestroy) {
6867 el.style.display = el.__vOriginalDisplay;
6868 }
6869 }
6870 };
6871
6872 var platformDirectives = {
6873 model: model$1,
6874 show: show
6875 };
6876
6877 /* */
6878
6879 // Provides transition support for a single element/component.
6880 // supports transition mode (out-in / in-out)
6881
6882 var transitionProps = {
6883 name: String,
6884 appear: Boolean,
6885 css: Boolean,
6886 mode: String,
6887 type: String,
6888 enterClass: String,
6889 leaveClass: String,
6890 enterToClass: String,
6891 leaveToClass: String,
6892 enterActiveClass: String,
6893 leaveActiveClass: String,
6894 appearClass: String,
6895 appearActiveClass: String,
6896 appearToClass: String,
6897 duration: [Number, String, Object]
6898 };
6899
6900 // in case the child is also an abstract component, e.g. <keep-alive>
6901 // we want to recursively retrieve the real component to be rendered
6902 function getRealChild(vnode) {
6903 var compOptions = vnode && vnode.componentOptions;
6904 if (compOptions && compOptions.Ctor.options.abstract) {
6905 return getRealChild(getFirstComponentChild(compOptions.children));
6906 } else {
6907 return vnode;
6908 }
6909 }
6910
6911 function extractTransitionData(comp) {
6912 var data = {};
6913 var options = comp.$options;
6914 // props
6915 for (var key in options.propsData) {
6916 data[key] = comp[key];
6917 }
6918 // events.
6919 // extract listeners and pass them directly to the transition methods
6920 var listeners = options._parentListeners;
6921 for (var key$1 in listeners) {
6922 data[camelize(key$1)] = listeners[key$1];
6923 }
6924 return data;
6925 }
6926
6927 function placeholder(h, rawChild) {
6928 if (/\d-keep-alive$/.test(rawChild.tag)) {
6929 return h('keep-alive', {
6930 props: rawChild.componentOptions.propsData
6931 });
6932 }
6933 }
6934
6935 function hasParentTransition(vnode) {
6936 while (vnode = vnode.parent) {
6937 if (vnode.data.transition) {
6938 return true;
6939 }
6940 }
6941 }
6942
6943 function isSameChild(child, oldChild) {
6944 return oldChild.key === child.key && oldChild.tag === child.tag;
6945 }
6946
6947 function isAsyncPlaceholder(node) {
6948 return node.isComment && node.asyncFactory;
6949 }
6950
6951 var Transition = {
6952 name: 'transition',
6953 props: transitionProps,
6954 abstract: true,
6955
6956 render: function render(h) {
6957 var this$1 = this;
6958
6959 var children = this.$options._renderChildren;
6960 if (!children) {
6961 return;
6962 }
6963
6964 // filter out text nodes (possible whitespaces)
6965 children = children.filter(function (c) {
6966 return c.tag || isAsyncPlaceholder(c);
6967 });
6968 /* istanbul ignore if */
6969 if (!children.length) {
6970 return;
6971 }
6972
6973 // warn multiple elements
6974 if (process.env.NODE_ENV !== 'production' && children.length > 1) {
6975 warn('<transition> can only be used on a single element. Use ' + '<transition-group> for lists.', this.$parent);
6976 }
6977
6978 var mode = this.mode;
6979
6980 // warn invalid mode
6981 if (process.env.NODE_ENV !== 'production' && mode && mode !== 'in-out' && mode !== 'out-in') {
6982 warn('invalid <transition> mode: ' + mode, this.$parent);
6983 }
6984
6985 var rawChild = children[0];
6986
6987 // if this is a component root node and the component's
6988 // parent container node also has transition, skip.
6989 if (hasParentTransition(this.$vnode)) {
6990 return rawChild;
6991 }
6992
6993 // apply transition data to child
6994 // use getRealChild() to ignore abstract components e.g. keep-alive
6995 var child = getRealChild(rawChild);
6996 /* istanbul ignore if */
6997 if (!child) {
6998 return rawChild;
6999 }
7000
7001 if (this._leaving) {
7002 return placeholder(h, rawChild);
7003 }
7004
7005 // ensure a key that is unique to the vnode type and to this transition
7006 // component instance. This key will be used to remove pending leaving nodes
7007 // during entering.
7008 var id = "__transition-" + this._uid + "-";
7009 child.key = child.key == null ? child.isComment ? id + 'comment' : id + child.tag : isPrimitive(child.key) ? String(child.key).indexOf(id) === 0 ? child.key : id + child.key : child.key;
7010
7011 var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
7012 var oldRawChild = this._vnode;
7013 var oldChild = getRealChild(oldRawChild);
7014
7015 // mark v-show
7016 // so that the transition module can hand over the control to the directive
7017 if (child.data.directives && child.data.directives.some(function (d) {
7018 return d.name === 'show';
7019 })) {
7020 child.data.show = true;
7021 }
7022
7023 if (oldChild && oldChild.data && !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild)) {
7024 // replace old child transition data with fresh one
7025 // important for dynamic transitions!
7026 var oldData = oldChild && (oldChild.data.transition = extend({}, data));
7027 // handle transition mode
7028 if (mode === 'out-in') {
7029 // return placeholder node and queue update when leave finishes
7030 this._leaving = true;
7031 mergeVNodeHook(oldData, 'afterLeave', function () {
7032 this$1._leaving = false;
7033 this$1.$forceUpdate();
7034 });
7035 return placeholder(h, rawChild);
7036 } else if (mode === 'in-out') {
7037 if (isAsyncPlaceholder(child)) {
7038 return oldRawChild;
7039 }
7040 var delayedLeave;
7041 var performLeave = function () {
7042 delayedLeave();
7043 };
7044 mergeVNodeHook(data, 'afterEnter', performLeave);
7045 mergeVNodeHook(data, 'enterCancelled', performLeave);
7046 mergeVNodeHook(oldData, 'delayLeave', function (leave) {
7047 delayedLeave = leave;
7048 });
7049 }
7050 }
7051
7052 return rawChild;
7053 }
7054 };
7055
7056 /* */
7057
7058 // Provides transition support for list items.
7059 // supports move transitions using the FLIP technique.
7060
7061 // Because the vdom's children update algorithm is "unstable" - i.e.
7062 // it doesn't guarantee the relative positioning of removed elements,
7063 // we force transition-group to update its children into two passes:
7064 // in the first pass, we remove all nodes that need to be removed,
7065 // triggering their leaving transition; in the second pass, we insert/move
7066 // into the final desired state. This way in the second pass removed
7067 // nodes will remain where they should be.
7068
7069 var props = extend({
7070 tag: String,
7071 moveClass: String
7072 }, transitionProps);
7073
7074 delete props.mode;
7075
7076 var TransitionGroup = {
7077 props: props,
7078
7079 render: function render(h) {
7080 var tag = this.tag || this.$vnode.data.tag || 'span';
7081 var map = Object.create(null);
7082 var prevChildren = this.prevChildren = this.children;
7083 var rawChildren = this.$slots.default || [];
7084 var children = this.children = [];
7085 var transitionData = extractTransitionData(this);
7086
7087 for (var i = 0; i < rawChildren.length; i++) {
7088 var c = rawChildren[i];
7089 if (c.tag) {
7090 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
7091 children.push(c);
7092 map[c.key] = c;(c.data || (c.data = {})).transition = transitionData;
7093 } else if (process.env.NODE_ENV !== 'production') {
7094 var opts = c.componentOptions;
7095 var name = opts ? opts.Ctor.options.name || opts.tag || '' : c.tag;
7096 warn("<transition-group> children must be keyed: <" + name + ">");
7097 }
7098 }
7099 }
7100
7101 if (prevChildren) {
7102 var kept = [];
7103 var removed = [];
7104 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
7105 var c$1 = prevChildren[i$1];
7106 c$1.data.transition = transitionData;
7107 c$1.data.pos = c$1.elm.getBoundingClientRect();
7108 if (map[c$1.key]) {
7109 kept.push(c$1);
7110 } else {
7111 removed.push(c$1);
7112 }
7113 }
7114 this.kept = h(tag, null, kept);
7115 this.removed = removed;
7116 }
7117
7118 return h(tag, null, children);
7119 },
7120
7121 beforeUpdate: function beforeUpdate() {
7122 // force removing pass
7123 this.__patch__(this._vnode, this.kept, false, // hydrating
7124 true // removeOnly (!important, avoids unnecessary moves)
7125 );
7126 this._vnode = this.kept;
7127 },
7128
7129 updated: function updated() {
7130 var children = this.prevChildren;
7131 var moveClass = this.moveClass || (this.name || 'v') + '-move';
7132 if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
7133 return;
7134 }
7135
7136 // we divide the work into three loops to avoid mixing DOM reads and writes
7137 // in each iteration - which helps prevent layout thrashing.
7138 children.forEach(callPendingCbs);
7139 children.forEach(recordPosition);
7140 children.forEach(applyTranslation);
7141
7142 // force reflow to put everything in position
7143 var body = document.body;
7144 var f = body.offsetHeight; // eslint-disable-line
7145
7146 children.forEach(function (c) {
7147 if (c.data.moved) {
7148 var el = c.elm;
7149 var s = el.style;
7150 addTransitionClass(el, moveClass);
7151 s.transform = s.WebkitTransform = s.transitionDuration = '';
7152 el.addEventListener(transitionEndEvent, el._moveCb = function cb(e) {
7153 if (!e || /transform$/.test(e.propertyName)) {
7154 el.removeEventListener(transitionEndEvent, cb);
7155 el._moveCb = null;
7156 removeTransitionClass(el, moveClass);
7157 }
7158 });
7159 }
7160 });
7161 },
7162
7163 methods: {
7164 hasMove: function hasMove(el, moveClass) {
7165 /* istanbul ignore if */
7166 if (!hasTransition) {
7167 return false;
7168 }
7169 /* istanbul ignore if */
7170 if (this._hasMove) {
7171 return this._hasMove;
7172 }
7173 // Detect whether an element with the move class applied has
7174 // CSS transitions. Since the element may be inside an entering
7175 // transition at this very moment, we make a clone of it and remove
7176 // all other transition classes applied to ensure only the move class
7177 // is applied.
7178 var clone = el.cloneNode();
7179 if (el._transitionClasses) {
7180 el._transitionClasses.forEach(function (cls) {
7181 removeClass(clone, cls);
7182 });
7183 }
7184 addClass(clone, moveClass);
7185 clone.style.display = 'none';
7186 this.$el.appendChild(clone);
7187 var info = getTransitionInfo(clone);
7188 this.$el.removeChild(clone);
7189 return this._hasMove = info.hasTransform;
7190 }
7191 }
7192 };
7193
7194 function callPendingCbs(c) {
7195 /* istanbul ignore if */
7196 if (c.elm._moveCb) {
7197 c.elm._moveCb();
7198 }
7199 /* istanbul ignore if */
7200 if (c.elm._enterCb) {
7201 c.elm._enterCb();
7202 }
7203 }
7204
7205 function recordPosition(c) {
7206 c.data.newPos = c.elm.getBoundingClientRect();
7207 }
7208
7209 function applyTranslation(c) {
7210 var oldPos = c.data.pos;
7211 var newPos = c.data.newPos;
7212 var dx = oldPos.left - newPos.left;
7213 var dy = oldPos.top - newPos.top;
7214 if (dx || dy) {
7215 c.data.moved = true;
7216 var s = c.elm.style;
7217 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
7218 s.transitionDuration = '0s';
7219 }
7220 }
7221
7222 var platformComponents = {
7223 Transition: Transition,
7224 TransitionGroup: TransitionGroup
7225 };
7226
7227 /* */
7228
7229 // install platform specific utils
7230 Vue$3.config.mustUseProp = mustUseProp;
7231 Vue$3.config.isReservedTag = isReservedTag;
7232 Vue$3.config.isReservedAttr = isReservedAttr;
7233 Vue$3.config.getTagNamespace = getTagNamespace;
7234 Vue$3.config.isUnknownElement = isUnknownElement;
7235
7236 // install platform runtime directives & components
7237 extend(Vue$3.options.directives, platformDirectives);
7238 extend(Vue$3.options.components, platformComponents);
7239
7240 // install platform patch function
7241 Vue$3.prototype.__patch__ = inBrowser ? patch : noop;
7242
7243 // public mount method
7244 Vue$3.prototype.$mount = function (el, hydrating) {
7245 el = el && inBrowser ? query(el) : undefined;
7246 return mountComponent(this, el, hydrating);
7247 };
7248
7249 // devtools global hook
7250 /* istanbul ignore next */
7251 setTimeout(function () {
7252 if (config.devtools) {
7253 if (devtools) {
7254 devtools.emit('init', Vue$3);
7255 } else if (process.env.NODE_ENV !== 'production' && isChrome) {
7256 console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' + 'https://github.com/vuejs/vue-devtools');
7257 }
7258 }
7259 if (process.env.NODE_ENV !== 'production' && config.productionTip !== false && inBrowser && typeof console !== 'undefined') {
7260 console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" + "Make sure to turn on production mode when deploying for production.\n" + "See more tips at https://vuejs.org/guide/deployment.html");
7261 }
7262 }, 0);
7263
7264 /* */
7265
7266 // check whether current browser encodes a char inside attribute values
7267 function shouldDecode(content, encoded) {
7268 var div = document.createElement('div');
7269 div.innerHTML = "<div a=\"" + content + "\"/>";
7270 return div.innerHTML.indexOf(encoded) > 0;
7271 }
7272
7273 // #3663
7274 // IE encodes newlines inside attribute values while other browsers don't
7275 var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', '&#10;') : false;
7276
7277 /* */
7278
7279 var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
7280 var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
7281
7282 var buildRegex = cached(function (delimiters) {
7283 var open = delimiters[0].replace(regexEscapeRE, '\\$&');
7284 var close = delimiters[1].replace(regexEscapeRE, '\\$&');
7285 return new RegExp(open + '((?:.|\\n)+?)' + close, 'g');
7286 });
7287
7288 function parseText(text, delimiters) {
7289 var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
7290 if (!tagRE.test(text)) {
7291 return;
7292 }
7293 var tokens = [];
7294 var lastIndex = tagRE.lastIndex = 0;
7295 var match, index;
7296 while (match = tagRE.exec(text)) {
7297 index = match.index;
7298 // push text token
7299 if (index > lastIndex) {
7300 tokens.push(JSON.stringify(text.slice(lastIndex, index)));
7301 }
7302 // tag token
7303 var exp = parseFilters(match[1].trim());
7304 tokens.push("_s(" + exp + ")");
7305 lastIndex = index + match[0].length;
7306 }
7307 if (lastIndex < text.length) {
7308 tokens.push(JSON.stringify(text.slice(lastIndex)));
7309 }
7310 return tokens.join('+');
7311 }
7312
7313 /* */
7314
7315 function transformNode(el, options) {
7316 var warn = options.warn || baseWarn;
7317 var staticClass = getAndRemoveAttr(el, 'class');
7318 if (process.env.NODE_ENV !== 'production' && staticClass) {
7319 var expression = parseText(staticClass, options.delimiters);
7320 if (expression) {
7321 warn("class=\"" + staticClass + "\": " + 'Interpolation inside attributes has been removed. ' + 'Use v-bind or the colon shorthand instead. For example, ' + 'instead of <div class="{{ val }}">, use <div :class="val">.');
7322 }
7323 }
7324 if (staticClass) {
7325 el.staticClass = JSON.stringify(staticClass);
7326 }
7327 var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
7328 if (classBinding) {
7329 el.classBinding = classBinding;
7330 }
7331 }
7332
7333 function genData(el) {
7334 var data = '';
7335 if (el.staticClass) {
7336 data += "staticClass:" + el.staticClass + ",";
7337 }
7338 if (el.classBinding) {
7339 data += "class:" + el.classBinding + ",";
7340 }
7341 return data;
7342 }
7343
7344 var klass$1 = {
7345 staticKeys: ['staticClass'],
7346 transformNode: transformNode,
7347 genData: genData
7348 };
7349
7350 /* */
7351
7352 function transformNode$1(el, options) {
7353 var warn = options.warn || baseWarn;
7354 var staticStyle = getAndRemoveAttr(el, 'style');
7355 if (staticStyle) {
7356 /* istanbul ignore if */
7357 if (process.env.NODE_ENV !== 'production') {
7358 var expression = parseText(staticStyle, options.delimiters);
7359 if (expression) {
7360 warn("style=\"" + staticStyle + "\": " + 'Interpolation inside attributes has been removed. ' + 'Use v-bind or the colon shorthand instead. For example, ' + 'instead of <div style="{{ val }}">, use <div :style="val">.');
7361 }
7362 }
7363 el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
7364 }
7365
7366 var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
7367 if (styleBinding) {
7368 el.styleBinding = styleBinding;
7369 }
7370 }
7371
7372 function genData$1(el) {
7373 var data = '';
7374 if (el.staticStyle) {
7375 data += "staticStyle:" + el.staticStyle + ",";
7376 }
7377 if (el.styleBinding) {
7378 data += "style:(" + el.styleBinding + "),";
7379 }
7380 return data;
7381 }
7382
7383 var style$1 = {
7384 staticKeys: ['staticStyle'],
7385 transformNode: transformNode$1,
7386 genData: genData$1
7387 };
7388
7389 var modules$1 = [klass$1, style$1];
7390
7391 /* */
7392
7393 function text(el, dir) {
7394 if (dir.value) {
7395 addProp(el, 'textContent', "_s(" + dir.value + ")");
7396 }
7397 }
7398
7399 /* */
7400
7401 function html(el, dir) {
7402 if (dir.value) {
7403 addProp(el, 'innerHTML', "_s(" + dir.value + ")");
7404 }
7405 }
7406
7407 var directives$1 = {
7408 model: model,
7409 text: text,
7410 html: html
7411 };
7412
7413 /* */
7414
7415 var isUnaryTag = makeMap('area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + 'link,meta,param,source,track,wbr');
7416
7417 // Elements that you can, intentionally, leave open
7418 // (and which close themselves)
7419 var canBeLeftOpenTag = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source');
7420
7421 // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
7422 // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
7423 var isNonPhrasingTag = makeMap('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');
7424
7425 /* */
7426
7427 var baseOptions = {
7428 expectHTML: true,
7429 modules: modules$1,
7430 directives: directives$1,
7431 isPreTag: isPreTag,
7432 isUnaryTag: isUnaryTag,
7433 mustUseProp: mustUseProp,
7434 canBeLeftOpenTag: canBeLeftOpenTag,
7435 isReservedTag: isReservedTag,
7436 getTagNamespace: getTagNamespace,
7437 staticKeys: genStaticKeys(modules$1)
7438 };
7439
7440 /* */
7441
7442 var decoder;
7443
7444 var he = {
7445 decode: function decode(html) {
7446 decoder = decoder || document.createElement('div');
7447 decoder.innerHTML = html;
7448 return decoder.textContent;
7449 }
7450 };
7451
7452 /**
7453 * Not type-checking this file because it's mostly vendor code.
7454 */
7455
7456 /*!
7457 * HTML Parser By John Resig (ejohn.org)
7458 * Modified by Juriy "kangax" Zaytsev
7459 * Original code by Erik Arvidsson, Mozilla Public License
7460 * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
7461 */
7462
7463 // Regular Expressions for parsing tags and attributes
7464 var singleAttrIdentifier = /([^\s"'<>/=]+)/;
7465 var singleAttrAssign = /(?:=)/;
7466 var singleAttrValues = [
7467 // attr value double quotes
7468 /"([^"]*)"+/.source,
7469 // attr value, single quotes
7470 /'([^']*)'+/.source,
7471 // attr value, no quotes
7472 /([^\s"'=<>`]+)/.source];
7473 var attribute = new RegExp('^\\s*' + singleAttrIdentifier.source + '(?:\\s*(' + singleAttrAssign.source + ')' + '\\s*(?:' + singleAttrValues.join('|') + '))?');
7474
7475 // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
7476 // but for Vue templates we can enforce a simple charset
7477 var ncname = '[a-zA-Z_][\\w\\-\\.]*';
7478 var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
7479 var startTagOpen = new RegExp('^<' + qnameCapture);
7480 var startTagClose = /^\s*(\/?)>/;
7481 var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
7482 var doctype = /^<!DOCTYPE [^>]+>/i;
7483 var comment = /^<!--/;
7484 var conditionalComment = /^<!\[/;
7485
7486 var IS_REGEX_CAPTURING_BROKEN = false;
7487 'x'.replace(/x(.)?/g, function (m, g) {
7488 IS_REGEX_CAPTURING_BROKEN = g === '';
7489 });
7490
7491 // Special Elements (can contain anything)
7492 var isPlainTextElement = makeMap('script,style,textarea', true);
7493 var reCache = {};
7494
7495 var decodingMap = {
7496 '&lt;': '<',
7497 '&gt;': '>',
7498 '&quot;': '"',
7499 '&amp;': '&',
7500 '&#10;': '\n'
7501 };
7502 var encodedAttr = /&(?:lt|gt|quot|amp);/g;
7503 var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g;
7504
7505 // #5992
7506 var isIgnoreNewlineTag = makeMap('pre,textarea', true);
7507 var shouldIgnoreFirstNewline = function (tag, html) {
7508 return tag && isIgnoreNewlineTag(tag) && html[0] === '\n';
7509 };
7510
7511 function decodeAttr(value, shouldDecodeNewlines) {
7512 var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
7513 return value.replace(re, function (match) {
7514 return decodingMap[match];
7515 });
7516 }
7517
7518 function parseHTML(html, options) {
7519 var stack = [];
7520 var expectHTML = options.expectHTML;
7521 var isUnaryTag$$1 = options.isUnaryTag || no;
7522 var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
7523 var index = 0;
7524 var last, lastTag;
7525 while (html) {
7526 last = html;
7527 // Make sure we're not in a plaintext content element like script/style
7528 if (!lastTag || !isPlainTextElement(lastTag)) {
7529 var textEnd = html.indexOf('<');
7530 if (textEnd === 0) {
7531 // Comment:
7532 if (comment.test(html)) {
7533 var commentEnd = html.indexOf('-->');
7534
7535 if (commentEnd >= 0) {
7536 if (options.shouldKeepComment) {
7537 options.comment(html.substring(4, commentEnd));
7538 }
7539 advance(commentEnd + 3);
7540 continue;
7541 }
7542 }
7543
7544 // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
7545 if (conditionalComment.test(html)) {
7546 var conditionalEnd = html.indexOf(']>');
7547
7548 if (conditionalEnd >= 0) {
7549 advance(conditionalEnd + 2);
7550 continue;
7551 }
7552 }
7553
7554 // Doctype:
7555 var doctypeMatch = html.match(doctype);
7556 if (doctypeMatch) {
7557 advance(doctypeMatch[0].length);
7558 continue;
7559 }
7560
7561 // End tag:
7562 var endTagMatch = html.match(endTag);
7563 if (endTagMatch) {
7564 var curIndex = index;
7565 advance(endTagMatch[0].length);
7566 parseEndTag(endTagMatch[1], curIndex, index);
7567 continue;
7568 }
7569
7570 // Start tag:
7571 var startTagMatch = parseStartTag();
7572 if (startTagMatch) {
7573 handleStartTag(startTagMatch);
7574 if (shouldIgnoreFirstNewline(lastTag, html)) {
7575 advance(1);
7576 }
7577 continue;
7578 }
7579 }
7580
7581 var text = void 0,
7582 rest = void 0,
7583 next = void 0;
7584 if (textEnd >= 0) {
7585 rest = html.slice(textEnd);
7586 while (!endTag.test(rest) && !startTagOpen.test(rest) && !comment.test(rest) && !conditionalComment.test(rest)) {
7587 // < in plain text, be forgiving and treat it as text
7588 next = rest.indexOf('<', 1);
7589 if (next < 0) {
7590 break;
7591 }
7592 textEnd += next;
7593 rest = html.slice(textEnd);
7594 }
7595 text = html.substring(0, textEnd);
7596 advance(textEnd);
7597 }
7598
7599 if (textEnd < 0) {
7600 text = html;
7601 html = '';
7602 }
7603
7604 if (options.chars && text) {
7605 options.chars(text);
7606 }
7607 } else {
7608 var endTagLength = 0;
7609 var stackedTag = lastTag.toLowerCase();
7610 var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
7611 var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
7612 endTagLength = endTag.length;
7613 if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
7614 text = text.replace(/<!--([\s\S]*?)-->/g, '$1').replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
7615 }
7616 if (shouldIgnoreFirstNewline(stackedTag, text)) {
7617 text = text.slice(1);
7618 }
7619 if (options.chars) {
7620 options.chars(text);
7621 }
7622 return '';
7623 });
7624 index += html.length - rest$1.length;
7625 html = rest$1;
7626 parseEndTag(stackedTag, index - endTagLength, index);
7627 }
7628
7629 if (html === last) {
7630 options.chars && options.chars(html);
7631 if (process.env.NODE_ENV !== 'production' && !stack.length && options.warn) {
7632 options.warn("Mal-formatted tag at end of template: \"" + html + "\"");
7633 }
7634 break;
7635 }
7636 }
7637
7638 // Clean up any remaining tags
7639 parseEndTag();
7640
7641 function advance(n) {
7642 index += n;
7643 html = html.substring(n);
7644 }
7645
7646 function parseStartTag() {
7647 var start = html.match(startTagOpen);
7648 if (start) {
7649 var match = {
7650 tagName: start[1],
7651 attrs: [],
7652 start: index
7653 };
7654 advance(start[0].length);
7655 var end, attr;
7656 while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
7657 advance(attr[0].length);
7658 match.attrs.push(attr);
7659 }
7660 if (end) {
7661 match.unarySlash = end[1];
7662 advance(end[0].length);
7663 match.end = index;
7664 return match;
7665 }
7666 }
7667 }
7668
7669 function handleStartTag(match) {
7670 var tagName = match.tagName;
7671 var unarySlash = match.unarySlash;
7672
7673 if (expectHTML) {
7674 if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
7675 parseEndTag(lastTag);
7676 }
7677 if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
7678 parseEndTag(tagName);
7679 }
7680 }
7681
7682 var unary = isUnaryTag$$1(tagName) || !!unarySlash;
7683
7684 var l = match.attrs.length;
7685 var attrs = new Array(l);
7686 for (var i = 0; i < l; i++) {
7687 var args = match.attrs[i];
7688 // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
7689 if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
7690 if (args[3] === '') {
7691 delete args[3];
7692 }
7693 if (args[4] === '') {
7694 delete args[4];
7695 }
7696 if (args[5] === '') {
7697 delete args[5];
7698 }
7699 }
7700 var value = args[3] || args[4] || args[5] || '';
7701 attrs[i] = {
7702 name: args[1],
7703 value: decodeAttr(value, options.shouldDecodeNewlines)
7704 };
7705 }
7706
7707 if (!unary) {
7708 stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
7709 lastTag = tagName;
7710 }
7711
7712 if (options.start) {
7713 options.start(tagName, attrs, unary, match.start, match.end);
7714 }
7715 }
7716
7717 function parseEndTag(tagName, start, end) {
7718 var pos, lowerCasedTagName;
7719 if (start == null) {
7720 start = index;
7721 }
7722 if (end == null) {
7723 end = index;
7724 }
7725
7726 if (tagName) {
7727 lowerCasedTagName = tagName.toLowerCase();
7728 }
7729
7730 // Find the closest opened tag of the same type
7731 if (tagName) {
7732 for (pos = stack.length - 1; pos >= 0; pos--) {
7733 if (stack[pos].lowerCasedTag === lowerCasedTagName) {
7734 break;
7735 }
7736 }
7737 } else {
7738 // If no tag name is provided, clean shop
7739 pos = 0;
7740 }
7741
7742 if (pos >= 0) {
7743 // Close all the open elements, up the stack
7744 for (var i = stack.length - 1; i >= pos; i--) {
7745 if (process.env.NODE_ENV !== 'production' && (i > pos || !tagName) && options.warn) {
7746 options.warn("tag <" + stack[i].tag + "> has no matching end tag.");
7747 }
7748 if (options.end) {
7749 options.end(stack[i].tag, start, end);
7750 }
7751 }
7752
7753 // Remove the open elements from the stack
7754 stack.length = pos;
7755 lastTag = pos && stack[pos - 1].tag;
7756 } else if (lowerCasedTagName === 'br') {
7757 if (options.start) {
7758 options.start(tagName, [], true, start, end);
7759 }
7760 } else if (lowerCasedTagName === 'p') {
7761 if (options.start) {
7762 options.start(tagName, [], false, start, end);
7763 }
7764 if (options.end) {
7765 options.end(tagName, start, end);
7766 }
7767 }
7768 }
7769 }
7770
7771 /* */
7772
7773 var onRE = /^@|^v-on:/;
7774 var dirRE = /^v-|^@|^:/;
7775 var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
7776 var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
7777
7778 var argRE = /:(.*)$/;
7779 var bindRE = /^:|^v-bind:/;
7780 var modifierRE = /\.[^.]+/g;
7781
7782 var decodeHTMLCached = cached(he.decode);
7783
7784 // configurable state
7785 var warn$2;
7786 var delimiters;
7787 var transforms;
7788 var preTransforms;
7789 var postTransforms;
7790 var platformIsPreTag;
7791 var platformMustUseProp;
7792 var platformGetTagNamespace;
7793
7794 /**
7795 * Convert HTML string to AST.
7796 */
7797 function parse(template, options) {
7798 warn$2 = options.warn || baseWarn;
7799
7800 platformIsPreTag = options.isPreTag || no;
7801 platformMustUseProp = options.mustUseProp || no;
7802 platformGetTagNamespace = options.getTagNamespace || no;
7803
7804 transforms = pluckModuleFunction(options.modules, 'transformNode');
7805 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
7806 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
7807
7808 delimiters = options.delimiters;
7809
7810 var stack = [];
7811 var preserveWhitespace = options.preserveWhitespace !== false;
7812 var root;
7813 var currentParent;
7814 var inVPre = false;
7815 var inPre = false;
7816 var warned = false;
7817
7818 function warnOnce(msg) {
7819 if (!warned) {
7820 warned = true;
7821 warn$2(msg);
7822 }
7823 }
7824
7825 function endPre(element) {
7826 // check pre state
7827 if (element.pre) {
7828 inVPre = false;
7829 }
7830 if (platformIsPreTag(element.tag)) {
7831 inPre = false;
7832 }
7833 }
7834
7835 parseHTML(template, {
7836 warn: warn$2,
7837 expectHTML: options.expectHTML,
7838 isUnaryTag: options.isUnaryTag,
7839 canBeLeftOpenTag: options.canBeLeftOpenTag,
7840 shouldDecodeNewlines: options.shouldDecodeNewlines,
7841 shouldKeepComment: options.comments,
7842 start: function start(tag, attrs, unary) {
7843 // check namespace.
7844 // inherit parent ns if there is one
7845 var ns = currentParent && currentParent.ns || platformGetTagNamespace(tag);
7846
7847 // handle IE svg bug
7848 /* istanbul ignore if */
7849 if (isIE && ns === 'svg') {
7850 attrs = guardIESVGBug(attrs);
7851 }
7852
7853 var element = {
7854 type: 1,
7855 tag: tag,
7856 attrsList: attrs,
7857 attrsMap: makeAttrsMap(attrs),
7858 parent: currentParent,
7859 children: []
7860 };
7861 if (ns) {
7862 element.ns = ns;
7863 }
7864
7865 if (isForbiddenTag(element) && !isServerRendering()) {
7866 element.forbidden = true;
7867 process.env.NODE_ENV !== 'production' && warn$2('Templates should only be responsible for mapping the state to the ' + 'UI. Avoid placing tags with side-effects in your templates, such as ' + "<" + tag + ">" + ', as they will not be parsed.');
7868 }
7869
7870 // apply pre-transforms
7871 for (var i = 0; i < preTransforms.length; i++) {
7872 preTransforms[i](element, options);
7873 }
7874
7875 if (!inVPre) {
7876 processPre(element);
7877 if (element.pre) {
7878 inVPre = true;
7879 }
7880 }
7881 if (platformIsPreTag(element.tag)) {
7882 inPre = true;
7883 }
7884 if (inVPre) {
7885 processRawAttrs(element);
7886 } else {
7887 processFor(element);
7888 processIf(element);
7889 processOnce(element);
7890 processKey(element);
7891
7892 // determine whether this is a plain element after
7893 // removing structural attributes
7894 element.plain = !element.key && !attrs.length;
7895
7896 processRef(element);
7897 processSlot(element);
7898 processComponent(element);
7899 for (var i$1 = 0; i$1 < transforms.length; i$1++) {
7900 transforms[i$1](element, options);
7901 }
7902 processAttrs(element);
7903 }
7904
7905 function checkRootConstraints(el) {
7906 if (process.env.NODE_ENV !== 'production') {
7907 if (el.tag === 'slot' || el.tag === 'template') {
7908 warnOnce("Cannot use <" + el.tag + "> as component root element because it may " + 'contain multiple nodes.');
7909 }
7910 if (el.attrsMap.hasOwnProperty('v-for')) {
7911 warnOnce('Cannot use v-for on stateful component root element because ' + 'it renders multiple elements.');
7912 }
7913 }
7914 }
7915
7916 // tree management
7917 if (!root) {
7918 root = element;
7919 checkRootConstraints(root);
7920 } else if (!stack.length) {
7921 // allow root elements with v-if, v-else-if and v-else
7922 if (root.if && (element.elseif || element.else)) {
7923 checkRootConstraints(element);
7924 addIfCondition(root, {
7925 exp: element.elseif,
7926 block: element
7927 });
7928 } else if (process.env.NODE_ENV !== 'production') {
7929 warnOnce("Component template should contain exactly one root element. " + "If you are using v-if on multiple elements, " + "use v-else-if to chain them instead.");
7930 }
7931 }
7932 if (currentParent && !element.forbidden) {
7933 if (element.elseif || element.else) {
7934 processIfConditions(element, currentParent);
7935 } else if (element.slotScope) {
7936 // scoped slot
7937 currentParent.plain = false;
7938 var name = element.slotTarget || '"default"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
7939 } else {
7940 currentParent.children.push(element);
7941 element.parent = currentParent;
7942 }
7943 }
7944 if (!unary) {
7945 currentParent = element;
7946 stack.push(element);
7947 } else {
7948 endPre(element);
7949 }
7950 // apply post-transforms
7951 for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
7952 postTransforms[i$2](element, options);
7953 }
7954 },
7955
7956 end: function end() {
7957 // remove trailing whitespace
7958 var element = stack[stack.length - 1];
7959 var lastNode = element.children[element.children.length - 1];
7960 if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
7961 element.children.pop();
7962 }
7963 // pop stack
7964 stack.length -= 1;
7965 currentParent = stack[stack.length - 1];
7966 endPre(element);
7967 },
7968
7969 chars: function chars(text) {
7970 if (!currentParent) {
7971 if (process.env.NODE_ENV !== 'production') {
7972 if (text === template) {
7973 warnOnce('Component template requires a root element, rather than just text.');
7974 } else if (text = text.trim()) {
7975 warnOnce("text \"" + text + "\" outside root element will be ignored.");
7976 }
7977 }
7978 return;
7979 }
7980 // IE textarea placeholder bug
7981 /* istanbul ignore if */
7982 if (isIE && currentParent.tag === 'textarea' && currentParent.attrsMap.placeholder === text) {
7983 return;
7984 }
7985 var children = currentParent.children;
7986 text = inPre || text.trim() ? isTextTag(currentParent) ? text : decodeHTMLCached(text)
7987 // only preserve whitespace if its not right after a starting tag
7988 : preserveWhitespace && children.length ? ' ' : '';
7989 if (text) {
7990 var expression;
7991 if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
7992 children.push({
7993 type: 2,
7994 expression: expression,
7995 text: text
7996 });
7997 } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
7998 children.push({
7999 type: 3,
8000 text: text
8001 });
8002 }
8003 }
8004 },
8005 comment: function comment(text) {
8006 currentParent.children.push({
8007 type: 3,
8008 text: text,
8009 isComment: true
8010 });
8011 }
8012 });
8013 return root;
8014 }
8015
8016 function processPre(el) {
8017 if (getAndRemoveAttr(el, 'v-pre') != null) {
8018 el.pre = true;
8019 }
8020 }
8021
8022 function processRawAttrs(el) {
8023 var l = el.attrsList.length;
8024 if (l) {
8025 var attrs = el.attrs = new Array(l);
8026 for (var i = 0; i < l; i++) {
8027 attrs[i] = {
8028 name: el.attrsList[i].name,
8029 value: JSON.stringify(el.attrsList[i].value)
8030 };
8031 }
8032 } else if (!el.pre) {
8033 // non root node in pre blocks with no attributes
8034 el.plain = true;
8035 }
8036 }
8037
8038 function processKey(el) {
8039 var exp = getBindingAttr(el, 'key');
8040 if (exp) {
8041 if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
8042 warn$2("<template> cannot be keyed. Place the key on real elements instead.");
8043 }
8044 el.key = exp;
8045 }
8046 }
8047
8048 function processRef(el) {
8049 var ref = getBindingAttr(el, 'ref');
8050 if (ref) {
8051 el.ref = ref;
8052 el.refInFor = checkInFor(el);
8053 }
8054 }
8055
8056 function processFor(el) {
8057 var exp;
8058 if (exp = getAndRemoveAttr(el, 'v-for')) {
8059 var inMatch = exp.match(forAliasRE);
8060 if (!inMatch) {
8061 process.env.NODE_ENV !== 'production' && warn$2("Invalid v-for expression: " + exp);
8062 return;
8063 }
8064 el.for = inMatch[2].trim();
8065 var alias = inMatch[1].trim();
8066 var iteratorMatch = alias.match(forIteratorRE);
8067 if (iteratorMatch) {
8068 el.alias = iteratorMatch[1].trim();
8069 el.iterator1 = iteratorMatch[2].trim();
8070 if (iteratorMatch[3]) {
8071 el.iterator2 = iteratorMatch[3].trim();
8072 }
8073 } else {
8074 el.alias = alias;
8075 }
8076 }
8077 }
8078
8079 function processIf(el) {
8080 var exp = getAndRemoveAttr(el, 'v-if');
8081 if (exp) {
8082 el.if = exp;
8083 addIfCondition(el, {
8084 exp: exp,
8085 block: el
8086 });
8087 } else {
8088 if (getAndRemoveAttr(el, 'v-else') != null) {
8089 el.else = true;
8090 }
8091 var elseif = getAndRemoveAttr(el, 'v-else-if');
8092 if (elseif) {
8093 el.elseif = elseif;
8094 }
8095 }
8096 }
8097
8098 function processIfConditions(el, parent) {
8099 var prev = findPrevElement(parent.children);
8100 if (prev && prev.if) {
8101 addIfCondition(prev, {
8102 exp: el.elseif,
8103 block: el
8104 });
8105 } else if (process.env.NODE_ENV !== 'production') {
8106 warn$2("v-" + (el.elseif ? 'else-if="' + el.elseif + '"' : 'else') + " " + "used on element <" + el.tag + "> without corresponding v-if.");
8107 }
8108 }
8109
8110 function findPrevElement(children) {
8111 var i = children.length;
8112 while (i--) {
8113 if (children[i].type === 1) {
8114 return children[i];
8115 } else {
8116 if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
8117 warn$2("text \"" + children[i].text.trim() + "\" between v-if and v-else(-if) " + "will be ignored.");
8118 }
8119 children.pop();
8120 }
8121 }
8122 }
8123
8124 function addIfCondition(el, condition) {
8125 if (!el.ifConditions) {
8126 el.ifConditions = [];
8127 }
8128 el.ifConditions.push(condition);
8129 }
8130
8131 function processOnce(el) {
8132 var once$$1 = getAndRemoveAttr(el, 'v-once');
8133 if (once$$1 != null) {
8134 el.once = true;
8135 }
8136 }
8137
8138 function processSlot(el) {
8139 if (el.tag === 'slot') {
8140 el.slotName = getBindingAttr(el, 'name');
8141 if (process.env.NODE_ENV !== 'production' && el.key) {
8142 warn$2("`key` does not work on <slot> because slots are abstract outlets " + "and can possibly expand into multiple elements. " + "Use the key on a wrapping element instead.");
8143 }
8144 } else {
8145 var slotTarget = getBindingAttr(el, 'slot');
8146 if (slotTarget) {
8147 el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
8148 }
8149 if (el.tag === 'template') {
8150 el.slotScope = getAndRemoveAttr(el, 'scope');
8151 }
8152 }
8153 }
8154
8155 function processComponent(el) {
8156 var binding;
8157 if (binding = getBindingAttr(el, 'is')) {
8158 el.component = binding;
8159 }
8160 if (getAndRemoveAttr(el, 'inline-template') != null) {
8161 el.inlineTemplate = true;
8162 }
8163 }
8164
8165 function processAttrs(el) {
8166 var list = el.attrsList;
8167 var i, l, name, rawName, value, modifiers, isProp;
8168 for (i = 0, l = list.length; i < l; i++) {
8169 name = rawName = list[i].name;
8170 value = list[i].value;
8171 if (dirRE.test(name)) {
8172 // mark element as dynamic
8173 el.hasBindings = true;
8174 // modifiers
8175 modifiers = parseModifiers(name);
8176 if (modifiers) {
8177 name = name.replace(modifierRE, '');
8178 }
8179 if (bindRE.test(name)) {
8180 // v-bind
8181 name = name.replace(bindRE, '');
8182 value = parseFilters(value);
8183 isProp = false;
8184 if (modifiers) {
8185 if (modifiers.prop) {
8186 isProp = true;
8187 name = camelize(name);
8188 if (name === 'innerHtml') {
8189 name = 'innerHTML';
8190 }
8191 }
8192 if (modifiers.camel) {
8193 name = camelize(name);
8194 }
8195 if (modifiers.sync) {
8196 addHandler(el, "update:" + camelize(name), genAssignmentCode(value, "$event"));
8197 }
8198 }
8199 if (isProp || !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)) {
8200 addProp(el, name, value);
8201 } else {
8202 addAttr(el, name, value);
8203 }
8204 } else if (onRE.test(name)) {
8205 // v-on
8206 name = name.replace(onRE, '');
8207 addHandler(el, name, value, modifiers, false, warn$2);
8208 } else {
8209 // normal directives
8210 name = name.replace(dirRE, '');
8211 // parse arg
8212 var argMatch = name.match(argRE);
8213 var arg = argMatch && argMatch[1];
8214 if (arg) {
8215 name = name.slice(0, -(arg.length + 1));
8216 }
8217 addDirective(el, name, rawName, value, arg, modifiers);
8218 if (process.env.NODE_ENV !== 'production' && name === 'model') {
8219 checkForAliasModel(el, value);
8220 }
8221 }
8222 } else {
8223 // literal attribute
8224 if (process.env.NODE_ENV !== 'production') {
8225 var expression = parseText(value, delimiters);
8226 if (expression) {
8227 warn$2(name + "=\"" + value + "\": " + 'Interpolation inside attributes has been removed. ' + 'Use v-bind or the colon shorthand instead. For example, ' + 'instead of <div id="{{ val }}">, use <div :id="val">.');
8228 }
8229 }
8230 addAttr(el, name, JSON.stringify(value));
8231 }
8232 }
8233 }
8234
8235 function checkInFor(el) {
8236 var parent = el;
8237 while (parent) {
8238 if (parent.for !== undefined) {
8239 return true;
8240 }
8241 parent = parent.parent;
8242 }
8243 return false;
8244 }
8245
8246 function parseModifiers(name) {
8247 var match = name.match(modifierRE);
8248 if (match) {
8249 var ret = {};
8250 match.forEach(function (m) {
8251 ret[m.slice(1)] = true;
8252 });
8253 return ret;
8254 }
8255 }
8256
8257 function makeAttrsMap(attrs) {
8258 var map = {};
8259 for (var i = 0, l = attrs.length; i < l; i++) {
8260 if (process.env.NODE_ENV !== 'production' && map[attrs[i].name] && !isIE && !isEdge) {
8261 warn$2('duplicate attribute: ' + attrs[i].name);
8262 }
8263 map[attrs[i].name] = attrs[i].value;
8264 }
8265 return map;
8266 }
8267
8268 // for script (e.g. type="x/template") or style, do not decode content
8269 function isTextTag(el) {
8270 return el.tag === 'script' || el.tag === 'style';
8271 }
8272
8273 function isForbiddenTag(el) {
8274 return el.tag === 'style' || el.tag === 'script' && (!el.attrsMap.type || el.attrsMap.type === 'text/javascript');
8275 }
8276
8277 var ieNSBug = /^xmlns:NS\d+/;
8278 var ieNSPrefix = /^NS\d+:/;
8279
8280 /* istanbul ignore next */
8281 function guardIESVGBug(attrs) {
8282 var res = [];
8283 for (var i = 0; i < attrs.length; i++) {
8284 var attr = attrs[i];
8285 if (!ieNSBug.test(attr.name)) {
8286 attr.name = attr.name.replace(ieNSPrefix, '');
8287 res.push(attr);
8288 }
8289 }
8290 return res;
8291 }
8292
8293 function checkForAliasModel(el, value) {
8294 var _el = el;
8295 while (_el) {
8296 if (_el.for && _el.alias === value) {
8297 warn$2("<" + el.tag + " v-model=\"" + value + "\">: " + "You are binding v-model directly to a v-for iteration alias. " + "This will not be able to modify the v-for source array because " + "writing to the alias is like modifying a function local variable. " + "Consider using an array of objects and use v-model on an object property instead.");
8298 }
8299 _el = _el.parent;
8300 }
8301 }
8302
8303 /* */
8304
8305 var isStaticKey;
8306 var isPlatformReservedTag;
8307
8308 var genStaticKeysCached = cached(genStaticKeys$1);
8309
8310 /**
8311 * Goal of the optimizer: walk the generated template AST tree
8312 * and detect sub-trees that are purely static, i.e. parts of
8313 * the DOM that never needs to change.
8314 *
8315 * Once we detect these sub-trees, we can:
8316 *
8317 * 1. Hoist them into constants, so that we no longer need to
8318 * create fresh nodes for them on each re-render;
8319 * 2. Completely skip them in the patching process.
8320 */
8321 function optimize(root, options) {
8322 if (!root) {
8323 return;
8324 }
8325 isStaticKey = genStaticKeysCached(options.staticKeys || '');
8326 isPlatformReservedTag = options.isReservedTag || no;
8327 // first pass: mark all non-static nodes.
8328 markStatic$1(root);
8329 // second pass: mark static roots.
8330 markStaticRoots(root, false);
8331 }
8332
8333 function genStaticKeys$1(keys) {
8334 return makeMap('type,tag,attrsList,attrsMap,plain,parent,children,attrs' + (keys ? ',' + keys : ''));
8335 }
8336
8337 function markStatic$1(node) {
8338 node.static = isStatic(node);
8339 if (node.type === 1) {
8340 // do not make component slot content static. this avoids
8341 // 1. components not able to mutate slot nodes
8342 // 2. static slot content fails for hot-reloading
8343 if (!isPlatformReservedTag(node.tag) && node.tag !== 'slot' && node.attrsMap['inline-template'] == null) {
8344 return;
8345 }
8346 for (var i = 0, l = node.children.length; i < l; i++) {
8347 var child = node.children[i];
8348 markStatic$1(child);
8349 if (!child.static) {
8350 node.static = false;
8351 }
8352 }
8353 if (node.ifConditions) {
8354 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
8355 var block = node.ifConditions[i$1].block;
8356 markStatic$1(block);
8357 if (!block.static) {
8358 node.static = false;
8359 }
8360 }
8361 }
8362 }
8363 }
8364
8365 function markStaticRoots(node, isInFor) {
8366 if (node.type === 1) {
8367 if (node.static || node.once) {
8368 node.staticInFor = isInFor;
8369 }
8370 // For a node to qualify as a static root, it should have children that
8371 // are not just static text. Otherwise the cost of hoisting out will
8372 // outweigh the benefits and it's better off to just always render it fresh.
8373 if (node.static && node.children.length && !(node.children.length === 1 && node.children[0].type === 3)) {
8374 node.staticRoot = true;
8375 return;
8376 } else {
8377 node.staticRoot = false;
8378 }
8379 if (node.children) {
8380 for (var i = 0, l = node.children.length; i < l; i++) {
8381 markStaticRoots(node.children[i], isInFor || !!node.for);
8382 }
8383 }
8384 if (node.ifConditions) {
8385 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
8386 markStaticRoots(node.ifConditions[i$1].block, isInFor);
8387 }
8388 }
8389 }
8390 }
8391
8392 function isStatic(node) {
8393 if (node.type === 2) {
8394 // expression
8395 return false;
8396 }
8397 if (node.type === 3) {
8398 // text
8399 return true;
8400 }
8401 return !!(node.pre || !node.hasBindings && // no dynamic bindings
8402 !node.if && !node.for && // not v-if or v-for or v-else
8403 !isBuiltInTag(node.tag) && // not a built-in
8404 isPlatformReservedTag(node.tag) && // not a component
8405 !isDirectChildOfTemplateFor(node) && Object.keys(node).every(isStaticKey));
8406 }
8407
8408 function isDirectChildOfTemplateFor(node) {
8409 while (node.parent) {
8410 node = node.parent;
8411 if (node.tag !== 'template') {
8412 return false;
8413 }
8414 if (node.for) {
8415 return true;
8416 }
8417 }
8418 return false;
8419 }
8420
8421 /* */
8422
8423 var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
8424 var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
8425
8426 // keyCode aliases
8427 var keyCodes = {
8428 esc: 27,
8429 tab: 9,
8430 enter: 13,
8431 space: 32,
8432 up: 38,
8433 left: 37,
8434 right: 39,
8435 down: 40,
8436 'delete': [8, 46]
8437 };
8438
8439 // #4868: modifiers that prevent the execution of the listener
8440 // need to explicitly return null so that we can determine whether to remove
8441 // the listener for .once
8442 var genGuard = function (condition) {
8443 return "if(" + condition + ")return null;";
8444 };
8445
8446 var modifierCode = {
8447 stop: '$event.stopPropagation();',
8448 prevent: '$event.preventDefault();',
8449 self: genGuard("$event.target !== $event.currentTarget"),
8450 ctrl: genGuard("!$event.ctrlKey"),
8451 shift: genGuard("!$event.shiftKey"),
8452 alt: genGuard("!$event.altKey"),
8453 meta: genGuard("!$event.metaKey"),
8454 left: genGuard("'button' in $event && $event.button !== 0"),
8455 middle: genGuard("'button' in $event && $event.button !== 1"),
8456 right: genGuard("'button' in $event && $event.button !== 2")
8457 };
8458
8459 function genHandlers(events, isNative, warn) {
8460 var res = isNative ? 'nativeOn:{' : 'on:{';
8461 for (var name in events) {
8462 var handler = events[name];
8463 // #5330: warn click.right, since right clicks do not actually fire click events.
8464 if (process.env.NODE_ENV !== 'production' && name === 'click' && handler && handler.modifiers && handler.modifiers.right) {
8465 warn("Use \"contextmenu\" instead of \"click.right\" since right clicks " + "do not actually fire \"click\" events.");
8466 }
8467 res += "\"" + name + "\":" + genHandler(name, handler) + ",";
8468 }
8469 return res.slice(0, -1) + '}';
8470 }
8471
8472 function genHandler(name, handler) {
8473 if (!handler) {
8474 return 'function(){}';
8475 }
8476
8477 if (Array.isArray(handler)) {
8478 return "[" + handler.map(function (handler) {
8479 return genHandler(name, handler);
8480 }).join(',') + "]";
8481 }
8482
8483 var isMethodPath = simplePathRE.test(handler.value);
8484 var isFunctionExpression = fnExpRE.test(handler.value);
8485
8486 if (!handler.modifiers) {
8487 return isMethodPath || isFunctionExpression ? handler.value : "function($event){" + handler.value + "}"; // inline statement
8488 } else {
8489 var code = '';
8490 var genModifierCode = '';
8491 var keys = [];
8492 for (var key in handler.modifiers) {
8493 if (modifierCode[key]) {
8494 genModifierCode += modifierCode[key];
8495 // left/right
8496 if (keyCodes[key]) {
8497 keys.push(key);
8498 }
8499 } else {
8500 keys.push(key);
8501 }
8502 }
8503 if (keys.length) {
8504 code += genKeyFilter(keys);
8505 }
8506 // Make sure modifiers like prevent and stop get executed after key filtering
8507 if (genModifierCode) {
8508 code += genModifierCode;
8509 }
8510 var handlerCode = isMethodPath ? handler.value + '($event)' : isFunctionExpression ? "(" + handler.value + ")($event)" : handler.value;
8511 return "function($event){" + code + handlerCode + "}";
8512 }
8513 }
8514
8515 function genKeyFilter(keys) {
8516 return "if(!('button' in $event)&&" + keys.map(genFilterCode).join('&&') + ")return null;";
8517 }
8518
8519 function genFilterCode(key) {
8520 var keyVal = parseInt(key, 10);
8521 if (keyVal) {
8522 return "$event.keyCode!==" + keyVal;
8523 }
8524 var alias = keyCodes[key];
8525 return "_k($event.keyCode," + JSON.stringify(key) + (alias ? ',' + JSON.stringify(alias) : '') + ")";
8526 }
8527
8528 /* */
8529
8530 function on(el, dir) {
8531 if (process.env.NODE_ENV !== 'production' && dir.modifiers) {
8532 warn("v-on without argument does not support modifiers.");
8533 }
8534 el.wrapListeners = function (code) {
8535 return "_g(" + code + "," + dir.value + ")";
8536 };
8537 }
8538
8539 /* */
8540
8541 function bind$1(el, dir) {
8542 el.wrapData = function (code) {
8543 return "_b(" + code + ",'" + el.tag + "'," + dir.value + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")";
8544 };
8545 }
8546
8547 /* */
8548
8549 var baseDirectives = {
8550 on: on,
8551 bind: bind$1,
8552 cloak: noop
8553 };
8554
8555 /* */
8556
8557 var CodegenState = function CodegenState(options) {
8558 this.options = options;
8559 this.warn = options.warn || baseWarn;
8560 this.transforms = pluckModuleFunction(options.modules, 'transformCode');
8561 this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
8562 this.directives = extend(extend({}, baseDirectives), options.directives);
8563 var isReservedTag = options.isReservedTag || no;
8564 this.maybeComponent = function (el) {
8565 return !isReservedTag(el.tag);
8566 };
8567 this.onceId = 0;
8568 this.staticRenderFns = [];
8569 };
8570
8571 function generate(ast, options) {
8572 var state = new CodegenState(options);
8573 var code = ast ? genElement(ast, state) : '_c("div")';
8574 return {
8575 render: "with(this){return " + code + "}",
8576 staticRenderFns: state.staticRenderFns
8577 };
8578 }
8579
8580 function genElement(el, state) {
8581 if (el.staticRoot && !el.staticProcessed) {
8582 return genStatic(el, state);
8583 } else if (el.once && !el.onceProcessed) {
8584 return genOnce(el, state);
8585 } else if (el.for && !el.forProcessed) {
8586 return genFor(el, state);
8587 } else if (el.if && !el.ifProcessed) {
8588 return genIf(el, state);
8589 } else if (el.tag === 'template' && !el.slotTarget) {
8590 return genChildren(el, state) || 'void 0';
8591 } else if (el.tag === 'slot') {
8592 return genSlot(el, state);
8593 } else {
8594 // component or element
8595 var code;
8596 if (el.component) {
8597 code = genComponent(el.component, el, state);
8598 } else {
8599 var data = el.plain ? undefined : genData$2(el, state);
8600
8601 var children = el.inlineTemplate ? null : genChildren(el, state, true);
8602 code = "_c('" + el.tag + "'" + (data ? "," + data : '') + (children ? "," + children : '') + ")";
8603 }
8604 // module transforms
8605 for (var i = 0; i < state.transforms.length; i++) {
8606 code = state.transforms[i](el, code);
8607 }
8608 return code;
8609 }
8610 }
8611
8612 // hoist static sub-trees out
8613 function genStatic(el, state) {
8614 el.staticProcessed = true;
8615 state.staticRenderFns.push("with(this){return " + genElement(el, state) + "}");
8616 return "_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")";
8617 }
8618
8619 // v-once
8620 function genOnce(el, state) {
8621 el.onceProcessed = true;
8622 if (el.if && !el.ifProcessed) {
8623 return genIf(el, state);
8624 } else if (el.staticInFor) {
8625 var key = '';
8626 var parent = el.parent;
8627 while (parent) {
8628 if (parent.for) {
8629 key = parent.key;
8630 break;
8631 }
8632 parent = parent.parent;
8633 }
8634 if (!key) {
8635 process.env.NODE_ENV !== 'production' && state.warn("v-once can only be used inside v-for that is keyed. ");
8636 return genElement(el, state);
8637 }
8638 return "_o(" + genElement(el, state) + "," + state.onceId++ + (key ? "," + key : "") + ")";
8639 } else {
8640 return genStatic(el, state);
8641 }
8642 }
8643
8644 function genIf(el, state, altGen, altEmpty) {
8645 el.ifProcessed = true; // avoid recursion
8646 return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty);
8647 }
8648
8649 function genIfConditions(conditions, state, altGen, altEmpty) {
8650 if (!conditions.length) {
8651 return altEmpty || '_e()';
8652 }
8653
8654 var condition = conditions.shift();
8655 if (condition.exp) {
8656 return "(" + condition.exp + ")?" + genTernaryExp(condition.block) + ":" + genIfConditions(conditions, state, altGen, altEmpty);
8657 } else {
8658 return "" + genTernaryExp(condition.block);
8659 }
8660
8661 // v-if with v-once should generate code like (a)?_m(0):_m(1)
8662 function genTernaryExp(el) {
8663 return altGen ? altGen(el, state) : el.once ? genOnce(el, state) : genElement(el, state);
8664 }
8665 }
8666
8667 function genFor(el, state, altGen, altHelper) {
8668 var exp = el.for;
8669 var alias = el.alias;
8670 var iterator1 = el.iterator1 ? "," + el.iterator1 : '';
8671 var iterator2 = el.iterator2 ? "," + el.iterator2 : '';
8672
8673 if (process.env.NODE_ENV !== 'production' && state.maybeComponent(el) && el.tag !== 'slot' && el.tag !== 'template' && !el.key) {
8674 state.warn("<" + el.tag + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + "v-for should have explicit keys. " + "See https://vuejs.org/guide/list.html#key for more info.", true /* tip */
8675 );
8676 }
8677
8678 el.forProcessed = true; // avoid recursion
8679 return (altHelper || '_l') + "((" + exp + ")," + "function(" + alias + iterator1 + iterator2 + "){" + "return " + (altGen || genElement)(el, state) + '})';
8680 }
8681
8682 function genData$2(el, state) {
8683 var data = '{';
8684
8685 // directives first.
8686 // directives may mutate the el's other properties before they are generated.
8687 var dirs = genDirectives(el, state);
8688 if (dirs) {
8689 data += dirs + ',';
8690 }
8691
8692 // key
8693 if (el.key) {
8694 data += "key:" + el.key + ",";
8695 }
8696 // ref
8697 if (el.ref) {
8698 data += "ref:" + el.ref + ",";
8699 }
8700 if (el.refInFor) {
8701 data += "refInFor:true,";
8702 }
8703 // pre
8704 if (el.pre) {
8705 data += "pre:true,";
8706 }
8707 // record original tag name for components using "is" attribute
8708 if (el.component) {
8709 data += "tag:\"" + el.tag + "\",";
8710 }
8711 // module data generation functions
8712 for (var i = 0; i < state.dataGenFns.length; i++) {
8713 data += state.dataGenFns[i](el);
8714 }
8715 // attributes
8716 if (el.attrs) {
8717 data += "attrs:{" + genProps(el.attrs) + "},";
8718 }
8719 // DOM props
8720 if (el.props) {
8721 data += "domProps:{" + genProps(el.props) + "},";
8722 }
8723 // event handlers
8724 if (el.events) {
8725 data += genHandlers(el.events, false, state.warn) + ",";
8726 }
8727 if (el.nativeEvents) {
8728 data += genHandlers(el.nativeEvents, true, state.warn) + ",";
8729 }
8730 // slot target
8731 if (el.slotTarget) {
8732 data += "slot:" + el.slotTarget + ",";
8733 }
8734 // scoped slots
8735 if (el.scopedSlots) {
8736 data += genScopedSlots(el.scopedSlots, state) + ",";
8737 }
8738 // component v-model
8739 if (el.model) {
8740 data += "model:{value:" + el.model.value + ",callback:" + el.model.callback + ",expression:" + el.model.expression + "},";
8741 }
8742 // inline-template
8743 if (el.inlineTemplate) {
8744 var inlineTemplate = genInlineTemplate(el, state);
8745 if (inlineTemplate) {
8746 data += inlineTemplate + ",";
8747 }
8748 }
8749 data = data.replace(/,$/, '') + '}';
8750 // v-bind data wrap
8751 if (el.wrapData) {
8752 data = el.wrapData(data);
8753 }
8754 // v-on data wrap
8755 if (el.wrapListeners) {
8756 data = el.wrapListeners(data);
8757 }
8758 return data;
8759 }
8760
8761 function genDirectives(el, state) {
8762 var dirs = el.directives;
8763 if (!dirs) {
8764 return;
8765 }
8766 var res = 'directives:[';
8767 var hasRuntime = false;
8768 var i, l, dir, needRuntime;
8769 for (i = 0, l = dirs.length; i < l; i++) {
8770 dir = dirs[i];
8771 needRuntime = true;
8772 var gen = state.directives[dir.name];
8773 if (gen) {
8774 // compile-time directive that manipulates AST.
8775 // returns true if it also needs a runtime counterpart.
8776 needRuntime = !!gen(el, dir, state.warn);
8777 }
8778 if (needRuntime) {
8779 hasRuntime = true;
8780 res += "{name:\"" + dir.name + "\",rawName:\"" + dir.rawName + "\"" + (dir.value ? ",value:(" + dir.value + "),expression:" + JSON.stringify(dir.value) : '') + (dir.arg ? ",arg:\"" + dir.arg + "\"" : '') + (dir.modifiers ? ",modifiers:" + JSON.stringify(dir.modifiers) : '') + "},";
8781 }
8782 }
8783 if (hasRuntime) {
8784 return res.slice(0, -1) + ']';
8785 }
8786 }
8787
8788 function genInlineTemplate(el, state) {
8789 var ast = el.children[0];
8790 if (process.env.NODE_ENV !== 'production' && (el.children.length > 1 || ast.type !== 1)) {
8791 state.warn('Inline-template components must have exactly one child element.');
8792 }
8793 if (ast.type === 1) {
8794 var inlineRenderFns = generate(ast, state.options);
8795 return "inlineTemplate:{render:function(){" + inlineRenderFns.render + "},staticRenderFns:[" + inlineRenderFns.staticRenderFns.map(function (code) {
8796 return "function(){" + code + "}";
8797 }).join(',') + "]}";
8798 }
8799 }
8800
8801 function genScopedSlots(slots, state) {
8802 return "scopedSlots:_u([" + Object.keys(slots).map(function (key) {
8803 return genScopedSlot(key, slots[key], state);
8804 }).join(',') + "])";
8805 }
8806
8807 function genScopedSlot(key, el, state) {
8808 if (el.for && !el.forProcessed) {
8809 return genForScopedSlot(key, el, state);
8810 }
8811 return "{key:" + key + ",fn:function(" + String(el.attrsMap.scope) + "){" + "return " + (el.tag === 'template' ? genChildren(el, state) || 'void 0' : genElement(el, state)) + "}}";
8812 }
8813
8814 function genForScopedSlot(key, el, state) {
8815 var exp = el.for;
8816 var alias = el.alias;
8817 var iterator1 = el.iterator1 ? "," + el.iterator1 : '';
8818 var iterator2 = el.iterator2 ? "," + el.iterator2 : '';
8819 el.forProcessed = true; // avoid recursion
8820 return "_l((" + exp + ")," + "function(" + alias + iterator1 + iterator2 + "){" + "return " + genScopedSlot(key, el, state) + '})';
8821 }
8822
8823 function genChildren(el, state, checkSkip, altGenElement, altGenNode) {
8824 var children = el.children;
8825 if (children.length) {
8826 var el$1 = children[0];
8827 // optimize single v-for
8828 if (children.length === 1 && el$1.for && el$1.tag !== 'template' && el$1.tag !== 'slot') {
8829 return (altGenElement || genElement)(el$1, state);
8830 }
8831 var normalizationType = checkSkip ? getNormalizationType(children, state.maybeComponent) : 0;
8832 var gen = altGenNode || genNode;
8833 return "[" + children.map(function (c) {
8834 return gen(c, state);
8835 }).join(',') + "]" + (normalizationType ? "," + normalizationType : '');
8836 }
8837 }
8838
8839 // determine the normalization needed for the children array.
8840 // 0: no normalization needed
8841 // 1: simple normalization needed (possible 1-level deep nested array)
8842 // 2: full normalization needed
8843 function getNormalizationType(children, maybeComponent) {
8844 var res = 0;
8845 for (var i = 0; i < children.length; i++) {
8846 var el = children[i];
8847 if (el.type !== 1) {
8848 continue;
8849 }
8850 if (needsNormalization(el) || el.ifConditions && el.ifConditions.some(function (c) {
8851 return needsNormalization(c.block);
8852 })) {
8853 res = 2;
8854 break;
8855 }
8856 if (maybeComponent(el) || el.ifConditions && el.ifConditions.some(function (c) {
8857 return maybeComponent(c.block);
8858 })) {
8859 res = 1;
8860 }
8861 }
8862 return res;
8863 }
8864
8865 function needsNormalization(el) {
8866 return el.for !== undefined || el.tag === 'template' || el.tag === 'slot';
8867 }
8868
8869 function genNode(node, state) {
8870 if (node.type === 1) {
8871 return genElement(node, state);
8872 }if (node.type === 3 && node.isComment) {
8873 return genComment(node);
8874 } else {
8875 return genText(node);
8876 }
8877 }
8878
8879 function genText(text) {
8880 return "_v(" + (text.type === 2 ? text.expression // no need for () because already wrapped in _s()
8881 : transformSpecialNewlines(JSON.stringify(text.text))) + ")";
8882 }
8883
8884 function genComment(comment) {
8885 return "_e(" + JSON.stringify(comment.text) + ")";
8886 }
8887
8888 function genSlot(el, state) {
8889 var slotName = el.slotName || '"default"';
8890 var children = genChildren(el, state);
8891 var res = "_t(" + slotName + (children ? "," + children : '');
8892 var attrs = el.attrs && "{" + el.attrs.map(function (a) {
8893 return camelize(a.name) + ":" + a.value;
8894 }).join(',') + "}";
8895 var bind$$1 = el.attrsMap['v-bind'];
8896 if ((attrs || bind$$1) && !children) {
8897 res += ",null";
8898 }
8899 if (attrs) {
8900 res += "," + attrs;
8901 }
8902 if (bind$$1) {
8903 res += (attrs ? '' : ',null') + "," + bind$$1;
8904 }
8905 return res + ')';
8906 }
8907
8908 // componentName is el.component, take it as argument to shun flow's pessimistic refinement
8909 function genComponent(componentName, el, state) {
8910 var children = el.inlineTemplate ? null : genChildren(el, state, true);
8911 return "_c(" + componentName + "," + genData$2(el, state) + (children ? "," + children : '') + ")";
8912 }
8913
8914 function genProps(props) {
8915 var res = '';
8916 for (var i = 0; i < props.length; i++) {
8917 var prop = props[i];
8918 res += "\"" + prop.name + "\":" + transformSpecialNewlines(prop.value) + ",";
8919 }
8920 return res.slice(0, -1);
8921 }
8922
8923 // #3895, #4268
8924 function transformSpecialNewlines(text) {
8925 return text.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
8926 }
8927
8928 /* */
8929
8930 // these keywords should not appear inside expressions, but operators like
8931 // typeof, instanceof and in are allowed
8932 var prohibitedKeywordRE = new RegExp('\\b' + ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + 'super,throw,while,yield,delete,export,import,return,switch,default,' + 'extends,finally,continue,debugger,function,arguments').split(',').join('\\b|\\b') + '\\b');
8933
8934 // these unary operators should not be used as property/method names
8935 var unaryOperatorsRE = new RegExp('\\b' + 'delete,typeof,void'.split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
8936
8937 // check valid identifier for v-for
8938 var identRE = /[A-Za-z_$][\w$]*/;
8939
8940 // strip strings in expressions
8941 var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
8942
8943 // detect problematic expressions in a template
8944 function detectErrors(ast) {
8945 var errors = [];
8946 if (ast) {
8947 checkNode(ast, errors);
8948 }
8949 return errors;
8950 }
8951
8952 function checkNode(node, errors) {
8953 if (node.type === 1) {
8954 for (var name in node.attrsMap) {
8955 if (dirRE.test(name)) {
8956 var value = node.attrsMap[name];
8957 if (value) {
8958 if (name === 'v-for') {
8959 checkFor(node, "v-for=\"" + value + "\"", errors);
8960 } else if (onRE.test(name)) {
8961 checkEvent(value, name + "=\"" + value + "\"", errors);
8962 } else {
8963 checkExpression(value, name + "=\"" + value + "\"", errors);
8964 }
8965 }
8966 }
8967 }
8968 if (node.children) {
8969 for (var i = 0; i < node.children.length; i++) {
8970 checkNode(node.children[i], errors);
8971 }
8972 }
8973 } else if (node.type === 2) {
8974 checkExpression(node.expression, node.text, errors);
8975 }
8976 }
8977
8978 function checkEvent(exp, text, errors) {
8979 var stipped = exp.replace(stripStringRE, '');
8980 var keywordMatch = stipped.match(unaryOperatorsRE);
8981 if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
8982 errors.push("avoid using JavaScript unary operator as property name: " + "\"" + keywordMatch[0] + "\" in expression " + text.trim());
8983 }
8984 checkExpression(exp, text, errors);
8985 }
8986
8987 function checkFor(node, text, errors) {
8988 checkExpression(node.for || '', text, errors);
8989 checkIdentifier(node.alias, 'v-for alias', text, errors);
8990 checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
8991 checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
8992 }
8993
8994 function checkIdentifier(ident, type, text, errors) {
8995 if (typeof ident === 'string' && !identRE.test(ident)) {
8996 errors.push("invalid " + type + " \"" + ident + "\" in expression: " + text.trim());
8997 }
8998 }
8999
9000 function checkExpression(exp, text, errors) {
9001 try {
9002 new Function("return " + exp);
9003 } catch (e) {
9004 var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
9005 if (keywordMatch) {
9006 errors.push("avoid using JavaScript keyword as property name: " + "\"" + keywordMatch[0] + "\" in expression " + text.trim());
9007 } else {
9008 errors.push("invalid expression: " + text.trim());
9009 }
9010 }
9011 }
9012
9013 /* */
9014
9015 function createFunction(code, errors) {
9016 try {
9017 return new Function(code);
9018 } catch (err) {
9019 errors.push({ err: err, code: code });
9020 return noop;
9021 }
9022 }
9023
9024 function createCompileToFunctionFn(compile) {
9025 var cache = Object.create(null);
9026
9027 return function compileToFunctions(template, options, vm) {
9028 options = options || {};
9029
9030 /* istanbul ignore if */
9031 if (process.env.NODE_ENV !== 'production') {
9032 // detect possible CSP restriction
9033 try {
9034 new Function('return 1');
9035 } catch (e) {
9036 if (e.toString().match(/unsafe-eval|CSP/)) {
9037 warn('It seems you are using the standalone build of Vue.js in an ' + 'environment with Content Security Policy that prohibits unsafe-eval. ' + 'The template compiler cannot work in this environment. Consider ' + 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + 'templates into render functions.');
9038 }
9039 }
9040 }
9041
9042 // check cache
9043 var key = options.delimiters ? String(options.delimiters) + template : template;
9044 if (cache[key]) {
9045 return cache[key];
9046 }
9047
9048 // compile
9049 var compiled = compile(template, options);
9050
9051 // check compilation errors/tips
9052 if (process.env.NODE_ENV !== 'production') {
9053 if (compiled.errors && compiled.errors.length) {
9054 warn("Error compiling template:\n\n" + template + "\n\n" + compiled.errors.map(function (e) {
9055 return "- " + e;
9056 }).join('\n') + '\n', vm);
9057 }
9058 if (compiled.tips && compiled.tips.length) {
9059 compiled.tips.forEach(function (msg) {
9060 return tip(msg, vm);
9061 });
9062 }
9063 }
9064
9065 // turn code into functions
9066 var res = {};
9067 var fnGenErrors = [];
9068 res.render = createFunction(compiled.render, fnGenErrors);
9069 res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
9070 return createFunction(code, fnGenErrors);
9071 });
9072
9073 // check function generation errors.
9074 // this should only happen if there is a bug in the compiler itself.
9075 // mostly for codegen development use
9076 /* istanbul ignore if */
9077 if (process.env.NODE_ENV !== 'production') {
9078 if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
9079 warn("Failed to generate render function:\n\n" + fnGenErrors.map(function (ref) {
9080 var err = ref.err;
9081 var code = ref.code;
9082
9083 return err.toString() + " in\n\n" + code + "\n";
9084 }).join('\n'), vm);
9085 }
9086 }
9087
9088 return cache[key] = res;
9089 };
9090 }
9091
9092 /* */
9093
9094 function createCompilerCreator(baseCompile) {
9095 return function createCompiler(baseOptions) {
9096 function compile(template, options) {
9097 var finalOptions = Object.create(baseOptions);
9098 var errors = [];
9099 var tips = [];
9100 finalOptions.warn = function (msg, tip) {
9101 (tip ? tips : errors).push(msg);
9102 };
9103
9104 if (options) {
9105 // merge custom modules
9106 if (options.modules) {
9107 finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
9108 }
9109 // merge custom directives
9110 if (options.directives) {
9111 finalOptions.directives = extend(Object.create(baseOptions.directives), options.directives);
9112 }
9113 // copy other options
9114 for (var key in options) {
9115 if (key !== 'modules' && key !== 'directives') {
9116 finalOptions[key] = options[key];
9117 }
9118 }
9119 }
9120
9121 var compiled = baseCompile(template, finalOptions);
9122 if (process.env.NODE_ENV !== 'production') {
9123 errors.push.apply(errors, detectErrors(compiled.ast));
9124 }
9125 compiled.errors = errors;
9126 compiled.tips = tips;
9127 return compiled;
9128 }
9129
9130 return {
9131 compile: compile,
9132 compileToFunctions: createCompileToFunctionFn(compile)
9133 };
9134 };
9135 }
9136
9137 /* */
9138
9139 // `createCompilerCreator` allows creating compilers that use alternative
9140 // parser/optimizer/codegen, e.g the SSR optimizing compiler.
9141 // Here we just export a default compiler using the default parts.
9142 var createCompiler = createCompilerCreator(function baseCompile(template, options) {
9143 var ast = parse(template.trim(), options);
9144 optimize(ast, options);
9145 var code = generate(ast, options);
9146 return {
9147 ast: ast,
9148 render: code.render,
9149 staticRenderFns: code.staticRenderFns
9150 };
9151 });
9152
9153 /* */
9154
9155 var ref$1 = createCompiler(baseOptions);
9156 var compileToFunctions = ref$1.compileToFunctions;
9157
9158 /* */
9159
9160 var idToTemplate = cached(function (id) {
9161 var el = query(id);
9162 return el && el.innerHTML;
9163 });
9164
9165 var mount = Vue$3.prototype.$mount;
9166 Vue$3.prototype.$mount = function (el, hydrating) {
9167 el = el && query(el);
9168
9169 /* istanbul ignore if */
9170 if (el === document.body || el === document.documentElement) {
9171 process.env.NODE_ENV !== 'production' && warn("Do not mount Vue to <html> or <body> - mount to normal elements instead.");
9172 return this;
9173 }
9174
9175 var options = this.$options;
9176 // resolve template/el and convert to render function
9177 if (!options.render) {
9178 var template = options.template;
9179 if (template) {
9180 if (typeof template === 'string') {
9181 if (template.charAt(0) === '#') {
9182 template = idToTemplate(template);
9183 /* istanbul ignore if */
9184 if (process.env.NODE_ENV !== 'production' && !template) {
9185 warn("Template element not found or is empty: " + options.template, this);
9186 }
9187 }
9188 } else if (template.nodeType) {
9189 template = template.innerHTML;
9190 } else {
9191 if (process.env.NODE_ENV !== 'production') {
9192 warn('invalid template option:' + template, this);
9193 }
9194 return this;
9195 }
9196 } else if (el) {
9197 template = getOuterHTML(el);
9198 }
9199 if (template) {
9200 /* istanbul ignore if */
9201 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
9202 mark('compile');
9203 }
9204
9205 var ref = compileToFunctions(template, {
9206 shouldDecodeNewlines: shouldDecodeNewlines,
9207 delimiters: options.delimiters,
9208 comments: options.comments
9209 }, this);
9210 var render = ref.render;
9211 var staticRenderFns = ref.staticRenderFns;
9212 options.render = render;
9213 options.staticRenderFns = staticRenderFns;
9214
9215 /* istanbul ignore if */
9216 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
9217 mark('compile end');
9218 measure(this._name + " compile", 'compile', 'compile end');
9219 }
9220 }
9221 }
9222 return mount.call(this, el, hydrating);
9223 };
9224
9225 /**
9226 * Get outerHTML of elements, taking care
9227 * of SVG elements in IE as well.
9228 */
9229 function getOuterHTML(el) {
9230 if (el.outerHTML) {
9231 return el.outerHTML;
9232 } else {
9233 var container = document.createElement('div');
9234 container.appendChild(el.cloneNode(true));
9235 return container.innerHTML;
9236 }
9237 }
9238
9239 Vue$3.compile = compileToFunctions;
9240
9241 /* harmony default export */ __webpack_exports__["a"] = (Vue$3);
9242 /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3), __webpack_require__(4)))
9243
9244 /***/ }),
9245 /* 1 */
9246 /***/ (function(module, __webpack_exports__, __webpack_require__) {
9247
9248 "use strict";
9249
9250 const internals = {
9251 kSocketLocation: 'ws://localhost:1987',
9252
9253 data: {
9254 state: 0,
9255 runningAverages: {},
9256 winner: null
9257 },
9258
9259 initSocket() {
9260
9261 internals.socket = new WebSocket(internals.kSocketLocation);
9262 internals.socket.addEventListener('message', data => {
9263
9264 Object.assign(internals.data, JSON.parse(data.data));
9265 });
9266 }
9267 };
9268
9269 /* harmony default export */ __webpack_exports__["a"] = ({
9270 data() {
9271
9272 if (!internals.socket) {
9273 internals.initSocket();
9274 }
9275
9276 return internals.data;
9277 }
9278 });
9279
9280 /***/ }),
9281 /* 2 */
9282 /***/ (function(module, __webpack_exports__, __webpack_require__) {
9283
9284 "use strict";
9285 Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
9286 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
9287 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_wave_renderer__ = __webpack_require__(5);
9288 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_status__ = __webpack_require__(6);
9289
9290
9291
9292
9293
9294 /* global window */
9295
9296 const internals = {};
9297
9298 internals.SortingHat = {
9299
9300 start() {
9301
9302 this.vm = new __WEBPACK_IMPORTED_MODULE_0_vue__["a" /* default */]({
9303 el: '#sorting-hat',
9304 components: {
9305 waveRenderer: __WEBPACK_IMPORTED_MODULE_1__components_wave_renderer__["a" /* default */],
9306 status: __WEBPACK_IMPORTED_MODULE_2__components_status__["a" /* default */]
9307 }
9308 });
9309 }
9310 };
9311
9312 internals.run = function () {
9313
9314 internals.SortingHat.start();
9315 };
9316
9317 window.addEventListener('load', internals.run);
9318
9319 /***/ }),
9320 /* 3 */
9321 /***/ (function(module, exports) {
9322
9323 // shim for using process in browser
9324 var process = module.exports = {};
9325
9326 // cached from whatever global is present so that test runners that stub it
9327 // don't break things. But we need to wrap it in a try catch in case it is
9328 // wrapped in strict mode code which doesn't define any globals. It's inside a
9329 // function because try/catches deoptimize in certain engines.
9330
9331 var cachedSetTimeout;
9332 var cachedClearTimeout;
9333
9334 function defaultSetTimout() {
9335 throw new Error('setTimeout has not been defined');
9336 }
9337 function defaultClearTimeout() {
9338 throw new Error('clearTimeout has not been defined');
9339 }
9340 (function () {
9341 try {
9342 if (typeof setTimeout === 'function') {
9343 cachedSetTimeout = setTimeout;
9344 } else {
9345 cachedSetTimeout = defaultSetTimout;
9346 }
9347 } catch (e) {
9348 cachedSetTimeout = defaultSetTimout;
9349 }
9350 try {
9351 if (typeof clearTimeout === 'function') {
9352 cachedClearTimeout = clearTimeout;
9353 } else {
9354 cachedClearTimeout = defaultClearTimeout;
9355 }
9356 } catch (e) {
9357 cachedClearTimeout = defaultClearTimeout;
9358 }
9359 })();
9360 function runTimeout(fun) {
9361 if (cachedSetTimeout === setTimeout) {
9362 //normal enviroments in sane situations
9363 return setTimeout(fun, 0);
9364 }
9365 // if setTimeout wasn't available but was latter defined
9366 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
9367 cachedSetTimeout = setTimeout;
9368 return setTimeout(fun, 0);
9369 }
9370 try {
9371 // when when somebody has screwed with setTimeout but no I.E. maddness
9372 return cachedSetTimeout(fun, 0);
9373 } catch (e) {
9374 try {
9375 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
9376 return cachedSetTimeout.call(null, fun, 0);
9377 } catch (e) {
9378 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
9379 return cachedSetTimeout.call(this, fun, 0);
9380 }
9381 }
9382 }
9383 function runClearTimeout(marker) {
9384 if (cachedClearTimeout === clearTimeout) {
9385 //normal enviroments in sane situations
9386 return clearTimeout(marker);
9387 }
9388 // if clearTimeout wasn't available but was latter defined
9389 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
9390 cachedClearTimeout = clearTimeout;
9391 return clearTimeout(marker);
9392 }
9393 try {
9394 // when when somebody has screwed with setTimeout but no I.E. maddness
9395 return cachedClearTimeout(marker);
9396 } catch (e) {
9397 try {
9398 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
9399 return cachedClearTimeout.call(null, marker);
9400 } catch (e) {
9401 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
9402 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
9403 return cachedClearTimeout.call(this, marker);
9404 }
9405 }
9406 }
9407 var queue = [];
9408 var draining = false;
9409 var currentQueue;
9410 var queueIndex = -1;
9411
9412 function cleanUpNextTick() {
9413 if (!draining || !currentQueue) {
9414 return;
9415 }
9416 draining = false;
9417 if (currentQueue.length) {
9418 queue = currentQueue.concat(queue);
9419 } else {
9420 queueIndex = -1;
9421 }
9422 if (queue.length) {
9423 drainQueue();
9424 }
9425 }
9426
9427 function drainQueue() {
9428 if (draining) {
9429 return;
9430 }
9431 var timeout = runTimeout(cleanUpNextTick);
9432 draining = true;
9433
9434 var len = queue.length;
9435 while (len) {
9436 currentQueue = queue;
9437 queue = [];
9438 while (++queueIndex < len) {
9439 if (currentQueue) {
9440 currentQueue[queueIndex].run();
9441 }
9442 }
9443 queueIndex = -1;
9444 len = queue.length;
9445 }
9446 currentQueue = null;
9447 draining = false;
9448 runClearTimeout(timeout);
9449 }
9450
9451 process.nextTick = function (fun) {
9452 var args = new Array(arguments.length - 1);
9453 if (arguments.length > 1) {
9454 for (var i = 1; i < arguments.length; i++) {
9455 args[i - 1] = arguments[i];
9456 }
9457 }
9458 queue.push(new Item(fun, args));
9459 if (queue.length === 1 && !draining) {
9460 runTimeout(drainQueue);
9461 }
9462 };
9463
9464 // v8 likes predictible objects
9465 function Item(fun, array) {
9466 this.fun = fun;
9467 this.array = array;
9468 }
9469 Item.prototype.run = function () {
9470 this.fun.apply(null, this.array);
9471 };
9472 process.title = 'browser';
9473 process.browser = true;
9474 process.env = {};
9475 process.argv = [];
9476 process.version = ''; // empty string to avoid regexp issues
9477 process.versions = {};
9478
9479 function noop() {}
9480
9481 process.on = noop;
9482 process.addListener = noop;
9483 process.once = noop;
9484 process.off = noop;
9485 process.removeListener = noop;
9486 process.removeAllListeners = noop;
9487 process.emit = noop;
9488 process.prependListener = noop;
9489 process.prependOnceListener = noop;
9490
9491 process.listeners = function (name) {
9492 return [];
9493 };
9494
9495 process.binding = function (name) {
9496 throw new Error('process.binding is not supported');
9497 };
9498
9499 process.cwd = function () {
9500 return '/';
9501 };
9502 process.chdir = function (dir) {
9503 throw new Error('process.chdir is not supported');
9504 };
9505 process.umask = function () {
9506 return 0;
9507 };
9508
9509 /***/ }),
9510 /* 4 */
9511 /***/ (function(module, exports) {
9512
9513 var g;
9514
9515 // This works in non-strict mode
9516 g = function () {
9517 return this;
9518 }();
9519
9520 try {
9521 // This works if eval is allowed (see CSP)
9522 g = g || Function("return this")() || (1, eval)("this");
9523 } catch (e) {
9524 // This works if the window reference is available
9525 if (typeof window === "object") g = window;
9526 }
9527
9528 // g can still be undefined, but nothing to do about it...
9529 // We return undefined, instead of nothing here, so it's
9530 // easier to handle this case. if(!global) { ...}
9531
9532 module.exports = g;
9533
9534 /***/ }),
9535 /* 5 */
9536 /***/ (function(module, __webpack_exports__, __webpack_require__) {
9537
9538 "use strict";
9539 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
9540 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_data__ = __webpack_require__(1);
9541
9542
9543
9544 const internals = {
9545
9546 // Constants
9547
9548 kColors: {
9549 donatello: 'purple',
9550 leonardo: 'blue',
9551 michaelangelo: 'orange',
9552 raphael: 'red'
9553 },
9554 kFrequency: 100,
9555 kGradientFade: 0.1,
9556 kMinValue: 25,
9557 kMaxValue: 100,
9558 kRandomJitter: 10,
9559 kTargetFPS: 60,
9560
9561 // Utility functions
9562
9563 scale(value, min, max) {
9564
9565 return (value - min) / (max - min) * (internals.kMaxValue - internals.kMinValue) - internals.kMinValue;
9566 }
9567 };
9568
9569 /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_vue__["a" /* default */].component('posts', {
9570 template: '<transition name="fade">' + '<canvas v-show="state === 1" class="wave-renderer"></canvas>' + '</transition>',
9571
9572 data: __WEBPACK_IMPORTED_MODULE_1__services_data__["a" /* default */].data,
9573
9574 computed: {
9575
9576 // Convert from the min / max value in the measurement to a
9577 // predefined min value between 0 and 100 (see kMinValue and
9578 // kMaxValue for actual values)
9579
9580 scaledAverages() {
9581
9582 const keys = Object.keys(this.runningAverages);
9583
9584 const averages = keys.reduce((averages, averageCategory) => {
9585
9586 const runningAverage = this.runningAverages[averageCategory];
9587 averages[averageCategory] = runningAverage.average;
9588 return averages;
9589 }, {});
9590
9591 const max = Math.max(...Object.values(averages));
9592 const min = Math.min(...Object.values(averages));
9593
9594 const scaledAverages = Object.keys(averages).reduce((scaledAverages, averageCategory) => {
9595
9596 const value = averages[averageCategory];
9597 scaledAverages[averageCategory] = internals.scale(value, min, max);
9598 return scaledAverages;
9599 }, {});
9600
9601 return scaledAverages;
9602 }
9603 },
9604
9605 methods: {
9606 onResize() {
9607
9608 this.$el.width = window.innerWidth;
9609 this.$el.height = window.innerHeight;
9610 }
9611 },
9612
9613 // Initiates the animation loop
9614
9615 mounted() {
9616
9617 // Make sure we resize, do an initial sizing
9618
9619 window.addEventListener('resize', this.onResize.bind(this));
9620 this.onResize();
9621
9622 // Start the whole animation (Sorry it's a mess)
9623
9624 const canvas = this.$el;
9625
9626 const context = canvas.getContext('2d');
9627 const interval = 1000 / internals.kTargetFPS;
9628
9629 let lastTimestamp = 0;
9630
9631 const animationHandler = timestamp => {
9632
9633 window.requestAnimationFrame(animationHandler);
9634 const delta = timestamp - lastTimestamp;
9635
9636 if (delta > interval) {
9637
9638 const keys = Object.keys(this.scaledAverages);
9639 const values = Object.values(this.scaledAverages);
9640 const segments = keys.length;
9641 const period = canvas.width / segments;
9642
9643 const fillGradient = context.createLinearGradient(0, 0, canvas.width, 0);
9644 const gradientBandWidth = 1 / segments;
9645
9646 // Position the drawing cursor left-center of screen
9647
9648 context.clearRect(0, 0, canvas.width, canvas.height);
9649 context.beginPath();
9650 context.moveTo(0, canvas.height);
9651 context.lineTo(0, canvas.height / 2);
9652
9653 // Iterate over the segments
9654
9655 for (let currentSegment = 0; currentSegment < segments; ++currentSegment) {
9656 const segmentStart = currentSegment * period;
9657 const segmentEnd = currentSegment + period;
9658
9659 const category = keys[currentSegment];
9660 const magnitude = values[currentSegment];
9661 const segmentHeight = Math.round(Math.random() * internals.kRandomJitter + magnitude * (canvas.height / 2) / 100);
9662
9663 // Calculate the gradient using the correct color according to
9664 // scale
9665
9666 const color = internals.kColors[category] || 'black';
9667 let currentGradientPosition = currentSegment * gradientBandWidth + internals.kGradientFade;
9668 fillGradient.addColorStop(currentGradientPosition, color);
9669 currentGradientPosition = (currentSegment + 1) * gradientBandWidth - internals.kGradientFade;
9670 fillGradient.addColorStop(currentGradientPosition, color);
9671
9672 // This draws the sine wave
9673
9674 for (let angle = 0; angle < 180; ++angle) {
9675 const currentPixel = segmentStart + angle * period / 180;
9676 const currentAngle = angle + 180 * (currentSegment % 2);
9677 const currentRadians = currentAngle * Math.PI / 180;
9678 const currentHeight = segmentHeight * Math.sin(internals.kFrequency * currentRadians);
9679
9680 context.lineTo(currentPixel, currentHeight + canvas.height / 2);
9681 }
9682 }
9683
9684 context.lineTo(canvas.width, canvas.height / 2);
9685 context.lineTo(canvas.width, canvas.height);
9686 context.fillStyle = fillGradient;
9687 context.fill();
9688
9689 lastTimestamp = timestamp;
9690 }
9691 };
9692
9693 window.requestAnimationFrame(animationHandler);
9694 }
9695 }));
9696
9697 /***/ }),
9698 /* 6 */
9699 /***/ (function(module, __webpack_exports__, __webpack_require__) {
9700
9701 "use strict";
9702 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
9703 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_data__ = __webpack_require__(1);
9704
9705
9706
9707 const internals = {};
9708
9709 /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_vue__["a" /* default */].component('posts', {
9710 template: '<div class="status-widget">' + '<transition name="fade">' + '<div v-if="state === 0" class="waiting-message">Waiting</div>' + '<div v-if="state === 2 && !winner" class="no-winner">Could not read you</div>' + '<div v-if="state === 2 && winner" class="winner" v-bind:class="[winner]">{{winner}}</div>' + '</transition>' + '</div>',
9711
9712 data: __WEBPACK_IMPORTED_MODULE_1__services_data__["a" /* default */].data
9713 }));
9714
9715 /***/ })
9716 /******/ ]);
9717 });