From 6441eac4c69de438b630a5ffbb8591dbdc6356f8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 6 Feb 2019 16:52:03 -0500 Subject: [PATCH] build: build 2.6.3 --- dist/vue.common.dev.js | 4166 +++++++++--------- dist/vue.common.prod.js | 4 +- dist/vue.esm.browser.js | 4180 +++++++++--------- dist/vue.esm.browser.min.js | 4 +- dist/vue.esm.js | 4184 ++++++++++--------- dist/vue.js | 4166 +++++++++--------- dist/vue.min.js | 4 +- dist/vue.runtime.common.dev.js | 4109 +++++++++--------- dist/vue.runtime.common.prod.js | 4 +- dist/vue.runtime.esm.js | 4145 +++++++++--------- dist/vue.runtime.js | 4109 +++++++++--------- dist/vue.runtime.min.js | 4 +- packages/vue-server-renderer/basic.js | 1516 +++---- packages/vue-server-renderer/build.dev.js | 1516 +++---- packages/vue-server-renderer/build.prod.js | 2 +- packages/vue-server-renderer/package.json | 2 +- packages/vue-template-compiler/browser.js | 52 +- packages/vue-template-compiler/build.js | 52 +- packages/vue-template-compiler/package.json | 2 +- 19 files changed, 16295 insertions(+), 15926 deletions(-) diff --git a/dist/vue.common.dev.js b/dist/vue.common.dev.js index 619ed40d..36780a61 100644 --- a/dist/vue.common.dev.js +++ b/dist/vue.common.dev.js @@ -1,5 +1,5 @@ /*! - * Vue.js v2.6.2 + * Vue.js v2.6.3 * (c) 2014-2019 Evan You * Released under the MIT License. */ @@ -534,6 +534,7 @@ var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android' var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; var isPhantomJS = UA && /phantomjs/.test(UA); +var isFF = UA && UA.match(/firefox\/(\d+)/); // Firefox has a "watch" function on Object.prototype... var nativeWatch = ({}).watch; @@ -2404,2437 +2405,2439 @@ function normalizeArrayChildren (children, nestedIndex) { /* */ -function ensureCtor (comp, base) { - if ( - comp.__esModule || - (hasSymbol && comp[Symbol.toStringTag] === 'Module') - ) { - comp = comp.default; +function initProvide (vm) { + var provide = vm.$options.provide; + if (provide) { + vm._provided = typeof provide === 'function' + ? provide.call(vm) + : provide; } - return isObject(comp) - ? base.extend(comp) - : comp -} - -function createAsyncPlaceholder ( - factory, - data, - context, - children, - tag -) { - var node = createEmptyVNode(); - node.asyncFactory = factory; - node.asyncMeta = { data: data, context: context, children: children, tag: tag }; - return node } -function resolveAsyncComponent ( - factory, - baseCtor, - context -) { - if (isTrue(factory.error) && isDef(factory.errorComp)) { - return factory.errorComp - } - - if (isDef(factory.resolved)) { - return factory.resolved - } - - if (isTrue(factory.loading) && isDef(factory.loadingComp)) { - return factory.loadingComp - } - - if (isDef(factory.contexts)) { - // already pending - factory.contexts.push(context); - } else { - var contexts = factory.contexts = [context]; - var sync = true; - - var forceRender = function (renderCompleted) { - for (var i = 0, l = contexts.length; i < l; i++) { - contexts[i].$forceUpdate(); - } - - if (renderCompleted) { - contexts.length = 0; - } - }; - - var resolve = once(function (res) { - // cache resolved - factory.resolved = ensureCtor(res, baseCtor); - // invoke callbacks only if this is not a synchronous resolve - // (async resolves are shimmed as synchronous during SSR) - if (!sync) { - forceRender(true); - } else { - contexts.length = 0; - } - }); - - var reject = once(function (reason) { - warn( - "Failed to resolve async component: " + (String(factory)) + - (reason ? ("\nReason: " + reason) : '') - ); - if (isDef(factory.errorComp)) { - factory.error = true; - forceRender(true); +function initInjections (vm) { + var result = resolveInject(vm.$options.inject, vm); + if (result) { + toggleObserving(false); + Object.keys(result).forEach(function (key) { + /* istanbul ignore else */ + { + defineReactive$$1(vm, key, result[key], function () { + warn( + "Avoid mutating an injected value directly since the changes will be " + + "overwritten whenever the provided component re-renders. " + + "injection being mutated: \"" + key + "\"", + vm + ); + }); } }); + toggleObserving(true); + } +} - var res = factory(resolve, reject); - - if (isObject(res)) { - if (isPromise(res)) { - // () => Promise - if (isUndef(factory.resolved)) { - res.then(resolve, reject); - } - } else if (isPromise(res.component)) { - res.component.then(resolve, reject); - - if (isDef(res.error)) { - factory.errorComp = ensureCtor(res.error, baseCtor); - } +function resolveInject (inject, vm) { + if (inject) { + // inject is :any because flow is not smart enough to figure out cached + var result = Object.create(null); + var keys = hasSymbol + ? Reflect.ownKeys(inject) + : Object.keys(inject); - if (isDef(res.loading)) { - factory.loadingComp = ensureCtor(res.loading, baseCtor); - if (res.delay === 0) { - factory.loading = true; - } else { - setTimeout(function () { - if (isUndef(factory.resolved) && isUndef(factory.error)) { - factory.loading = true; - forceRender(false); - } - }, res.delay || 200); - } + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + // #6574 in case the inject object is observed... + if (key === '__ob__') { continue } + var provideKey = inject[key].from; + var source = vm; + while (source) { + if (source._provided && hasOwn(source._provided, provideKey)) { + result[key] = source._provided[provideKey]; + break } - - if (isDef(res.timeout)) { - setTimeout(function () { - if (isUndef(factory.resolved)) { - reject( - "timeout (" + (res.timeout) + "ms)" - ); - } - }, res.timeout); + source = source.$parent; + } + if (!source) { + if ('default' in inject[key]) { + var provideDefault = inject[key].default; + result[key] = typeof provideDefault === 'function' + ? provideDefault.call(vm) + : provideDefault; + } else { + warn(("Injection \"" + key + "\" not found"), vm); } } } - - sync = false; - // return in case resolved synchronously - return factory.loading - ? factory.loadingComp - : factory.resolved + return result } } /* */ -function isAsyncPlaceholder (node) { - return node.isComment && node.asyncFactory -} -/* */ -function getFirstComponentChild (children) { - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - var c = children[i]; - if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { - return c +/** + * Runtime helper for resolving raw children VNodes into a slot object. + */ +function resolveSlots ( + children, + context +) { + if (!children || !children.length) { + return {} + } + var slots = {}; + for (var i = 0, l = children.length; i < l; i++) { + var child = children[i]; + var data = child.data; + // remove slot attribute if the node is resolved as a Vue slot node + if (data && data.attrs && data.attrs.slot) { + delete data.attrs.slot; + } + // named slots should only be respected if the vnode was rendered in the + // same context. + if ((child.context === context || child.fnContext === context) && + data && data.slot != null + ) { + var name = data.slot; + var slot = (slots[name] || (slots[name] = [])); + if (child.tag === 'template') { + slot.push.apply(slot, child.children || []); + } else { + slot.push(child); } + } else { + (slots.default || (slots.default = [])).push(child); + } + } + // ignore slots that contains only whitespace + for (var name$1 in slots) { + if (slots[name$1].every(isWhitespace)) { + delete slots[name$1]; } } + return slots } -/* */ +function isWhitespace (node) { + return (node.isComment && !node.asyncFactory) || node.text === ' ' +} /* */ -function initEvents (vm) { - vm._events = Object.create(null); - vm._hasHookEvent = false; - // init parent attached events - var listeners = vm.$options._parentListeners; - if (listeners) { - updateComponentListeners(vm, listeners); +function normalizeScopedSlots ( + slots, + normalSlots +) { + var res; + if (!slots) { + res = {}; + } else if (slots._normalized) { + return slots + } else { + res = {}; + for (var key in slots) { + if (slots[key] && key[0] !== '$') { + res[key] = normalizeScopedSlot(slots[key]); + } + } + } + // expose normal slots on scopedSlots + for (var key$1 in normalSlots) { + if (!(key$1 in res)) { + res[key$1] = proxyNormalSlot(normalSlots, key$1); + } } + def(res, '_normalized', true); + def(res, '$stable', slots ? !!slots.$stable : true); + return res } -var target; - -function add (event, fn) { - target.$on(event, fn); +function normalizeScopedSlot(fn) { + return function (scope) { + var res = fn(scope); + return res && typeof res === 'object' && !Array.isArray(res) + ? [res] // single vnode + : normalizeChildren(res) + } } -function remove$1 (event, fn) { - target.$off(event, fn); +function proxyNormalSlot(slots, key) { + return function () { return slots[key]; } } -function createOnceHandler (event, fn) { - var _target = target; - return function onceHandler () { - var res = fn.apply(null, arguments); - if (res !== null) { - _target.$off(event, onceHandler); - } - } -} +/* */ -function updateComponentListeners ( - vm, - listeners, - oldListeners +/** + * Runtime helper for rendering v-for lists. + */ +function renderList ( + val, + render ) { - target = vm; - updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); - target = undefined; -} - -function eventsMixin (Vue) { - var hookRE = /^hook:/; - Vue.prototype.$on = function (event, fn) { - var vm = this; - if (Array.isArray(event)) { - for (var i = 0, l = event.length; i < l; i++) { - vm.$on(event[i], fn); - } - } else { - (vm._events[event] || (vm._events[event] = [])).push(fn); - // optimize hook:event cost by using a boolean flag marked at registration - // instead of a hash lookup - if (hookRE.test(event)) { - vm._hasHookEvent = true; - } - } - return vm - }; - - Vue.prototype.$once = function (event, fn) { - var vm = this; - function on () { - vm.$off(event, on); - fn.apply(vm, arguments); - } - on.fn = fn; - vm.$on(event, on); - return vm - }; - - Vue.prototype.$off = function (event, fn) { - var vm = this; - // all - if (!arguments.length) { - vm._events = Object.create(null); - return vm - } - // array of events - if (Array.isArray(event)) { - for (var i$1 = 0, l = event.length; i$1 < l; i$1++) { - vm.$off(event[i$1], fn); - } - return vm - } - // specific event - var cbs = vm._events[event]; - if (!cbs) { - return vm - } - if (!fn) { - vm._events[event] = null; - return vm + var ret, i, l, keys, key; + if (Array.isArray(val) || typeof val === 'string') { + ret = new Array(val.length); + for (i = 0, l = val.length; i < l; i++) { + ret[i] = render(val[i], i); } - // specific handler - var cb; - var i = cbs.length; - while (i--) { - cb = cbs[i]; - if (cb === fn || cb.fn === fn) { - cbs.splice(i, 1); - break - } + } else if (typeof val === 'number') { + ret = new Array(val); + for (i = 0; i < val; i++) { + ret[i] = render(i + 1, i); } - return vm - }; - - Vue.prototype.$emit = function (event) { - var vm = this; - { - var lowerCaseEvent = event.toLowerCase(); - if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { - 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 + "\"." - ); + } else if (isObject(val)) { + if (hasSymbol && val[Symbol.iterator]) { + ret = []; + var iterator = val[Symbol.iterator](); + var result = iterator.next(); + while (!result.done) { + ret.push(render(result.value, ret.length)); + result = iterator.next(); } - } - var cbs = vm._events[event]; - if (cbs) { - cbs = cbs.length > 1 ? toArray(cbs) : cbs; - var args = toArray(arguments, 1); - var info = "event handler for \"" + event + "\""; - for (var i = 0, l = cbs.length; i < l; i++) { - invokeWithErrorHandling(cbs[i], vm, args, vm, info); + } else { + keys = Object.keys(val); + ret = new Array(keys.length); + for (i = 0, l = keys.length; i < l; i++) { + key = keys[i]; + ret[i] = render(val[key], key, i); } } - return vm - }; + } + if (!isDef(ret)) { + ret = []; + } + (ret)._isVList = true; + return ret } /* */ - - /** - * Runtime helper for resolving raw children VNodes into a slot object. + * Runtime helper for rendering */ -function resolveSlots ( - children, - context +function renderSlot ( + name, + fallback, + props, + bindObject ) { - if (!children || !children.length) { - return {} - } - var slots = {}; - for (var i = 0, l = children.length; i < l; i++) { - var child = children[i]; - var data = child.data; - // remove slot attribute if the node is resolved as a Vue slot node - if (data && data.attrs && data.attrs.slot) { - delete data.attrs.slot; - } - // named slots should only be respected if the vnode was rendered in the - // same context. - if ((child.context === context || child.fnContext === context) && - data && data.slot != null - ) { - var name = data.slot; - var slot = (slots[name] || (slots[name] = [])); - if (child.tag === 'template') { - slot.push.apply(slot, child.children || []); - } else { - slot.push(child); + var scopedSlotFn = this.$scopedSlots[name]; + var nodes; + if (scopedSlotFn) { // scoped slot + props = props || {}; + if (bindObject) { + if (!isObject(bindObject)) { + warn( + 'slot v-bind without argument expects an Object', + this + ); } - } else { - (slots.default || (slots.default = [])).push(child); - } - } - // ignore slots that contains only whitespace - for (var name$1 in slots) { - if (slots[name$1].every(isWhitespace)) { - delete slots[name$1]; + props = extend(extend({}, bindObject), props); } + nodes = scopedSlotFn(props) || fallback; + } else { + nodes = this.$slots[name] || fallback; } - return slots -} - -function isWhitespace (node) { - return (node.isComment && !node.asyncFactory) || node.text === ' ' -} -function resolveScopedSlots ( - fns, // see flow/vnode - hasDynamicKeys, - res -) { - res = res || { $stable: !hasDynamicKeys }; - for (var i = 0; i < fns.length; i++) { - var slot = fns[i]; - if (Array.isArray(slot)) { - resolveScopedSlots(slot, hasDynamicKeys, res); - } else if (slot) { - res[slot.key] = slot.fn; - } + var target = props && props.slot; + if (target) { + return this.$createElement('template', { slot: target }, nodes) + } else { + return nodes } - return res } /* */ -var activeInstance = null; -var isUpdatingChildComponent = false; - -function setActiveInstance(vm) { - var prevActiveInstance = activeInstance; - activeInstance = vm; - return function () { - activeInstance = prevActiveInstance; - } +/** + * Runtime helper for resolving filters + */ +function resolveFilter (id) { + return resolveAsset(this.$options, 'filters', id, true) || identity } -function initLifecycle (vm) { - var options = vm.$options; +/* */ - // locate first non-abstract parent - var parent = options.parent; - if (parent && !options.abstract) { - while (parent.$options.abstract && parent.$parent) { - parent = parent.$parent; - } - parent.$children.push(vm); +function isKeyNotMatch (expect, actual) { + if (Array.isArray(expect)) { + return expect.indexOf(actual) === -1 + } else { + return expect !== actual } +} - vm.$parent = parent; - vm.$root = parent ? parent.$root : vm; - - vm.$children = []; - vm.$refs = {}; - - vm._watcher = null; - vm._inactive = null; - vm._directInactive = false; - vm._isMounted = false; - vm._isDestroyed = false; - vm._isBeingDestroyed = false; +/** + * Runtime helper for checking keyCodes from config. + * exposed as Vue.prototype._k + * passing in eventKeyName as last argument separately for backwards compat + */ +function checkKeyCodes ( + eventKeyCode, + key, + builtInKeyCode, + eventKeyName, + builtInKeyName +) { + var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; + if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { + return isKeyNotMatch(builtInKeyName, eventKeyName) + } else if (mappedKeyCode) { + return isKeyNotMatch(mappedKeyCode, eventKeyCode) + } else if (eventKeyName) { + return hyphenate(eventKeyName) !== key + } } -function lifecycleMixin (Vue) { - Vue.prototype._update = function (vnode, hydrating) { - var vm = this; - var prevEl = vm.$el; - var prevVnode = vm._vnode; - var restoreActiveInstance = setActiveInstance(vm); - vm._vnode = vnode; - // Vue.prototype.__patch__ is injected in entry points - // based on the rendering backend used. - if (!prevVnode) { - // initial render - vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */); +/* */ + +/** + * Runtime helper for merging v-bind="object" into a VNode's data. + */ +function bindObjectProps ( + data, + tag, + value, + asProp, + isSync +) { + if (value) { + if (!isObject(value)) { + warn( + 'v-bind without argument expects an Object or Array value', + this + ); } else { - // updates - vm.$el = vm.__patch__(prevVnode, vnode); - } - restoreActiveInstance(); - // update __vue__ reference - if (prevEl) { - prevEl.__vue__ = null; - } - if (vm.$el) { - vm.$el.__vue__ = vm; - } - // if parent is an HOC, update its $el as well - if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { - vm.$parent.$el = vm.$el; - } - // updated hook is called by the scheduler to ensure that children are - // updated in a parent's updated hook. - }; + if (Array.isArray(value)) { + value = toObject(value); + } + var hash; + var loop = function ( key ) { + if ( + key === 'class' || + key === 'style' || + isReservedAttribute(key) + ) { + hash = data; + } else { + var type = data.attrs && data.attrs.type; + hash = asProp || config.mustUseProp(tag, type, key) + ? data.domProps || (data.domProps = {}) + : data.attrs || (data.attrs = {}); + } + var camelizedKey = camelize(key); + if (!(key in hash) && !(camelizedKey in hash)) { + hash[key] = value[key]; - Vue.prototype.$forceUpdate = function () { - var vm = this; - if (vm._watcher) { - vm._watcher.update(); - } - }; + if (isSync) { + var on = data.on || (data.on = {}); + on[("update:" + camelizedKey)] = function ($event) { + value[key] = $event; + }; + } + } + }; - Vue.prototype.$destroy = function () { - var vm = this; - if (vm._isBeingDestroyed) { - return - } - callHook(vm, 'beforeDestroy'); - vm._isBeingDestroyed = true; - // remove self from parent - var parent = vm.$parent; - if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { - remove(parent.$children, vm); - } - // teardown watchers - if (vm._watcher) { - vm._watcher.teardown(); - } - var i = vm._watchers.length; - while (i--) { - vm._watchers[i].teardown(); - } - // remove reference from data ob - // frozen object may not have observer. - if (vm._data.__ob__) { - vm._data.__ob__.vmCount--; - } - // call the last hook... - vm._isDestroyed = true; - // invoke destroy hooks on current rendered tree - vm.__patch__(vm._vnode, null); - // fire destroyed hook - callHook(vm, 'destroyed'); - // turn off all instance listeners. - vm.$off(); - // remove __vue__ reference - if (vm.$el) { - vm.$el.__vue__ = null; - } - // release circular reference (#6759) - if (vm.$vnode) { - vm.$vnode.parent = null; + for (var key in value) loop( key ); } - }; + } + return data } -function mountComponent ( - vm, - el, - hydrating +/* */ + +/** + * Runtime helper for rendering static trees. + */ +function renderStatic ( + index, + isInFor ) { - vm.$el = el; - if (!vm.$options.render) { - vm.$options.render = createEmptyVNode; - { - /* istanbul ignore if */ - if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || - vm.$options.el || el) { - 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 - ); - } else { - warn( - 'Failed to mount component: template or render function not defined.', - vm - ); - } - } + var cached = this._staticTrees || (this._staticTrees = []); + var tree = cached[index]; + // if has already-rendered static tree and not inside v-for, + // we can reuse the same tree. + if (tree && !isInFor) { + return tree } - callHook(vm, 'beforeMount'); - - var updateComponent; - /* istanbul ignore if */ - if (config.performance && mark) { - updateComponent = function () { - var name = vm._name; - var id = vm._uid; - var startTag = "vue-perf-start:" + id; - var endTag = "vue-perf-end:" + id; + // otherwise, render a fresh tree. + tree = cached[index] = this.$options.staticRenderFns[index].call( + this._renderProxy, + null, + this // for render fns generated for functional component templates + ); + markStatic(tree, ("__static__" + index), false); + return tree +} - mark(startTag); - var vnode = vm._render(); - mark(endTag); - measure(("vue " + name + " render"), startTag, endTag); +/** + * Runtime helper for v-once. + * Effectively it means marking the node as static with a unique key. + */ +function markOnce ( + tree, + index, + key +) { + markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); + return tree +} - mark(startTag); - vm._update(vnode, hydrating); - mark(endTag); - measure(("vue " + name + " patch"), startTag, endTag); - }; +function markStatic ( + tree, + key, + isOnce +) { + if (Array.isArray(tree)) { + for (var i = 0; i < tree.length; i++) { + if (tree[i] && typeof tree[i] !== 'string') { + markStaticNode(tree[i], (key + "_" + i), isOnce); + } + } } else { - updateComponent = function () { - vm._update(vm._render(), hydrating); - }; + markStaticNode(tree, key, isOnce); } +} - // we set this to vm._watcher inside the watcher's constructor - // since the watcher's initial patch may call $forceUpdate (e.g. inside child - // component's mounted hook), which relies on vm._watcher being already defined - new Watcher(vm, updateComponent, noop, { - before: function before () { - if (vm._isMounted && !vm._isDestroyed) { - callHook(vm, 'beforeUpdate'); +function markStaticNode (node, key, isOnce) { + node.isStatic = true; + node.key = key; + node.isOnce = isOnce; +} + +/* */ + +function bindObjectListeners (data, value) { + if (value) { + if (!isPlainObject(value)) { + warn( + 'v-on without argument expects an Object value', + this + ); + } else { + var on = data.on = data.on ? extend({}, data.on) : {}; + for (var key in value) { + var existing = on[key]; + var ours = value[key]; + on[key] = existing ? [].concat(existing, ours) : ours; } } - }, true /* isRenderWatcher */); - hydrating = false; - - // manually mounted instance, call mounted on self - // mounted is called for render-created child components in its inserted hook - if (vm.$vnode == null) { - vm._isMounted = true; - callHook(vm, 'mounted'); } - return vm + return data } -function updateChildComponent ( - vm, - propsData, - listeners, - parentVnode, - renderChildren +/* */ + +function resolveScopedSlots ( + fns, // see flow/vnode + hasDynamicKeys, + res ) { - { - isUpdatingChildComponent = true; + res = res || { $stable: !hasDynamicKeys }; + for (var i = 0; i < fns.length; i++) { + var slot = fns[i]; + if (Array.isArray(slot)) { + resolveScopedSlots(slot, hasDynamicKeys, res); + } else if (slot) { + res[slot.key] = slot.fn; + } } + return res +} - // determine whether component has slot children - // we need to do this before overwriting $options._renderChildren. +/* */ - // check if there are dynamic scopedSlots (hand-written or compiled but with - // dynamic slot names). Static scoped slots compiled from template has the - // "$stable" marker. - var hasDynamicScopedSlot = !!( - (parentVnode.data.scopedSlots && !parentVnode.data.scopedSlots.$stable) || - (vm.$scopedSlots !== emptyObject && !vm.$scopedSlots.$stable) - ); - // Any static slot children from the parent may have changed during parent's - // update. Dynamic scoped slots may also have changed. In such cases, a forced - // update is necessary to ensure correctness. - var needsForceUpdate = !!( - renderChildren || // has new static slots - vm.$options._renderChildren || // has old static slots - hasDynamicScopedSlot - ); +function bindDynamicKeys (baseObj, values) { + for (var i = 0; i < values.length; i += 2) { + var key = values[i]; + if (typeof key === 'string' && key) { + baseObj[values[i]] = values[i + 1]; + } else if (key !== '' && key !== null) { + // null is a speical value for explicitly removing a binding + warn( + ("Invalid value for dynamic directive argument (expected string or null): " + key), + this + ); + } + } + return baseObj +} - vm.$options._parentVnode = parentVnode; - vm.$vnode = parentVnode; // update vm's placeholder node without re-render +// helper to dynamically append modifier runtime markers to event names. +// ensure only append when value is already string, otherwise it will be cast +// to string and cause the type check to miss. +function prependModifier (value, symbol) { + return typeof value === 'string' ? symbol + value : value +} - if (vm._vnode) { // update child tree's parent - vm._vnode.parent = parentVnode; - } - vm.$options._renderChildren = renderChildren; +/* */ - // update $attrs and $listeners hash - // these are also reactive so they may trigger child update if the child - // used them during render - vm.$attrs = parentVnode.data.attrs || emptyObject; - vm.$listeners = listeners || emptyObject; +function installRenderHelpers (target) { + target._o = markOnce; + target._n = toNumber; + target._s = toString; + target._l = renderList; + target._t = renderSlot; + target._q = looseEqual; + target._i = looseIndexOf; + target._m = renderStatic; + target._f = resolveFilter; + target._k = checkKeyCodes; + target._b = bindObjectProps; + target._v = createTextVNode; + target._e = createEmptyVNode; + target._u = resolveScopedSlots; + target._g = bindObjectListeners; + target._d = bindDynamicKeys; + target._p = prependModifier; +} - // update props - if (propsData && vm.$options.props) { - toggleObserving(false); - var props = vm._props; - var propKeys = vm.$options._propKeys || []; - for (var i = 0; i < propKeys.length; i++) { - var key = propKeys[i]; - var propOptions = vm.$options.props; // wtf flow? - props[key] = validateProp(key, propOptions, propsData, vm); - } - toggleObserving(true); - // keep a copy of raw propsData - vm.$options.propsData = propsData; +/* */ + +function FunctionalRenderContext ( + data, + props, + children, + parent, + Ctor +) { + var options = Ctor.options; + // ensure the createElement function in functional components + // gets a unique context - this is necessary for correct named slot check + var contextVm; + if (hasOwn(parent, '_uid')) { + contextVm = Object.create(parent); + // $flow-disable-line + contextVm._original = parent; + } else { + // the context vm passed in is a functional context as well. + // in this case we want to make sure we are able to get a hold to the + // real context instance. + contextVm = parent; + // $flow-disable-line + parent = parent._original; } + var isCompiled = isTrue(options._compiled); + var needNormalization = !isCompiled; - // update listeners - listeners = listeners || emptyObject; - var oldListeners = vm.$options._parentListeners; - vm.$options._parentListeners = listeners; - updateComponentListeners(vm, listeners, oldListeners); + this.data = data; + this.props = props; + this.children = children; + this.parent = parent; + this.listeners = data.on || emptyObject; + this.injections = resolveInject(options.inject, parent); + this.slots = function () { return resolveSlots(children, parent); }; - // resolve slots + force update if has children - if (needsForceUpdate) { - vm.$slots = resolveSlots(renderChildren, parentVnode.context); - vm.$forceUpdate(); - } + Object.defineProperty(this, 'scopedSlots', ({ + enumerable: true, + get: function get () { + return normalizeScopedSlots(data.scopedSlots, this.slots()) + } + })); - { - isUpdatingChildComponent = false; + // support for compiled functional template + if (isCompiled) { + // exposing $options for renderStatic() + this.$options = options; + // pre-resolve slots for renderSlot() + this.$slots = this.slots(); + this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots); } -} -function isInInactiveTree (vm) { - while (vm && (vm = vm.$parent)) { - if (vm._inactive) { return true } + if (options._scopeId) { + this._c = function (a, b, c, d) { + var vnode = createElement(contextVm, a, b, c, d, needNormalization); + if (vnode && !Array.isArray(vnode)) { + vnode.fnScopeId = options._scopeId; + vnode.fnContext = parent; + } + return vnode + }; + } else { + this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; } - return false } -function activateChildComponent (vm, direct) { - if (direct) { - vm._directInactive = false; - if (isInInactiveTree(vm)) { - return +installRenderHelpers(FunctionalRenderContext.prototype); + +function createFunctionalComponent ( + Ctor, + propsData, + data, + contextVm, + children +) { + var options = Ctor.options; + var props = {}; + var propOptions = options.props; + if (isDef(propOptions)) { + for (var key in propOptions) { + props[key] = validateProp(key, propOptions, propsData || emptyObject); } - } else if (vm._directInactive) { - return + } else { + if (isDef(data.attrs)) { mergeProps(props, data.attrs); } + if (isDef(data.props)) { mergeProps(props, data.props); } } - if (vm._inactive || vm._inactive === null) { - vm._inactive = false; - for (var i = 0; i < vm.$children.length; i++) { - activateChildComponent(vm.$children[i]); + + var renderContext = new FunctionalRenderContext( + data, + props, + children, + contextVm, + Ctor + ); + + var vnode = options.render.call(null, renderContext._c, renderContext); + + if (vnode instanceof VNode) { + return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) + } else if (Array.isArray(vnode)) { + var vnodes = normalizeChildren(vnode) || []; + var res = new Array(vnodes.length); + for (var i = 0; i < vnodes.length; i++) { + res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); } - callHook(vm, 'activated'); + return res } } -function deactivateChildComponent (vm, direct) { - if (direct) { - vm._directInactive = true; - if (isInInactiveTree(vm)) { - return - } +function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { + // #7817 clone node before setting fnContext, otherwise if the node is reused + // (e.g. it was from a cached normal slot) the fnContext causes named slots + // that should not be matched to match. + var clone = cloneVNode(vnode); + clone.fnContext = contextVm; + clone.fnOptions = options; + { + (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; } - if (!vm._inactive) { - vm._inactive = true; - for (var i = 0; i < vm.$children.length; i++) { - deactivateChildComponent(vm.$children[i]); - } - callHook(vm, 'deactivated'); + if (data.slot) { + (clone.data || (clone.data = {})).slot = data.slot; } + return clone } -function callHook (vm, hook) { - // #7573 disable dep collection when invoking lifecycle hooks - pushTarget(); - var handlers = vm.$options[hook]; - var info = hook + " hook"; - if (handlers) { - for (var i = 0, j = handlers.length; i < j; i++) { - invokeWithErrorHandling(handlers[i], vm, null, vm, info); - } - } - if (vm._hasHookEvent) { - vm.$emit('hook:' + hook); +function mergeProps (to, from) { + for (var key in from) { + to[camelize(key)] = from[key]; } - popTarget(); } /* */ -var MAX_UPDATE_COUNT = 100; +/* */ -var queue = []; -var activatedChildren = []; -var has = {}; -var circular = {}; -var waiting = false; -var flushing = false; -var index = 0; +/* */ -/** - * Reset the scheduler's state. - */ -function resetSchedulerState () { - index = queue.length = activatedChildren.length = 0; - has = {}; - { - circular = {}; - } - waiting = flushing = false; -} +/* */ -// Async edge case #6566 requires saving the timestamp when event listeners are -// attached. However, calling performance.now() has a perf overhead especially -// if the page has thousands of event listeners. Instead, we take a timestamp -// every time the scheduler flushes and use that for all event listeners -// attached during that flush. -var currentFlushTimestamp = 0; +// inline hooks to be invoked on component VNodes during patch +var componentVNodeHooks = { + init: function init (vnode, hydrating) { + if ( + vnode.componentInstance && + !vnode.componentInstance._isDestroyed && + vnode.data.keepAlive + ) { + // kept-alive components, treat as a patch + var mountedNode = vnode; // work around flow + componentVNodeHooks.prepatch(mountedNode, mountedNode); + } else { + var child = vnode.componentInstance = createComponentInstanceForVnode( + vnode, + activeInstance + ); + child.$mount(hydrating ? vnode.elm : undefined, hydrating); + } + }, -// Async edge case fix requires storing an event listener's attach timestamp. -var getNow = Date.now; + prepatch: function prepatch (oldVnode, vnode) { + var options = vnode.componentOptions; + var child = vnode.componentInstance = oldVnode.componentInstance; + updateChildComponent( + child, + options.propsData, // updated props + options.listeners, // updated listeners + vnode, // new parent vnode + options.children // new children + ); + }, -// Determine what event timestamp the browser is using. Annoyingly, the -// timestamp can either be hi-res ( relative to poge load) or low-res -// (relative to UNIX epoch), so in order to compare time we have to use the -// same timestamp type when saving the flush timestamp. -if (inBrowser && getNow() > document.createEvent('Event').timeStamp) { - // if the low-res timestamp which is bigger than the event timestamp - // (which is evaluated AFTER) it means the event is using a hi-res timestamp, - // and we need to use the hi-res version for event listeners as well. - getNow = function () { return performance.now(); }; -} + insert: function insert (vnode) { + var context = vnode.context; + var componentInstance = vnode.componentInstance; + if (!componentInstance._isMounted) { + componentInstance._isMounted = true; + callHook(componentInstance, 'mounted'); + } + if (vnode.data.keepAlive) { + if (context._isMounted) { + // vue-router#1212 + // During updates, a kept-alive component's child components may + // change, so directly walking the tree here may call activated hooks + // on incorrect children. Instead we push them into a queue which will + // be processed after the whole patch process ended. + queueActivatedComponent(componentInstance); + } else { + activateChildComponent(componentInstance, true /* direct */); + } + } + }, -/** - * Flush both queues and run the watchers. - */ -function flushSchedulerQueue () { - currentFlushTimestamp = getNow(); - flushing = true; - var watcher, id; + destroy: function destroy (vnode) { + var componentInstance = vnode.componentInstance; + if (!componentInstance._isDestroyed) { + if (!vnode.data.keepAlive) { + componentInstance.$destroy(); + } else { + deactivateChildComponent(componentInstance, true /* direct */); + } + } + } +}; - // Sort queue before flush. - // This ensures that: - // 1. Components are updated from parent to child. (because parent is always - // created before the child) - // 2. A component's user watchers are run before its render watcher (because - // user watchers are created before the render watcher) - // 3. If a component is destroyed during a parent component's watcher run, - // its watchers can be skipped. - queue.sort(function (a, b) { return a.id - b.id; }); +var hooksToMerge = Object.keys(componentVNodeHooks); - // do not cache length because more watchers might be pushed - // as we run existing watchers - for (index = 0; index < queue.length; index++) { - watcher = queue[index]; - if (watcher.before) { - watcher.before(); +function createComponent ( + Ctor, + data, + context, + children, + tag +) { + if (isUndef(Ctor)) { + return + } + + var baseCtor = context.$options._base; + + // plain options object: turn it into a constructor + if (isObject(Ctor)) { + Ctor = baseCtor.extend(Ctor); + } + + // if at this stage it's not a constructor or an async component factory, + // reject. + if (typeof Ctor !== 'function') { + { + warn(("Invalid Component definition: " + (String(Ctor))), context); } - id = watcher.id; - has[id] = null; - watcher.run(); - // in dev build, check and stop circular updates. - if (has[id] != null) { - circular[id] = (circular[id] || 0) + 1; - if (circular[id] > MAX_UPDATE_COUNT) { - warn( - 'You may have an infinite update loop ' + ( - watcher.user - ? ("in watcher with expression \"" + (watcher.expression) + "\"") - : "in a component render function." - ), - watcher.vm - ); - break - } + return + } + + // async component + var asyncFactory; + if (isUndef(Ctor.cid)) { + asyncFactory = Ctor; + Ctor = resolveAsyncComponent(asyncFactory, baseCtor); + if (Ctor === undefined) { + // return a placeholder node for async component, which is rendered + // as a comment node but preserves all the raw information for the node. + // the information will be used for async server-rendering and hydration. + return createAsyncPlaceholder( + asyncFactory, + data, + context, + children, + tag + ) } } - // keep copies of post queues before resetting state - var activatedQueue = activatedChildren.slice(); - var updatedQueue = queue.slice(); + data = data || {}; - resetSchedulerState(); + // resolve constructor options in case global mixins are applied after + // component constructor creation + resolveConstructorOptions(Ctor); - // call component updated and activated hooks - callActivatedHooks(activatedQueue); - callUpdatedHooks(updatedQueue); + // transform component v-model data into props & events + if (isDef(data.model)) { + transformModel(Ctor.options, data); + } - // devtool hook - /* istanbul ignore if */ - if (devtools && config.devtools) { - devtools.emit('flush'); + // extract props + var propsData = extractPropsFromVNodeData(data, Ctor, tag); + + // functional component + if (isTrue(Ctor.options.functional)) { + return createFunctionalComponent(Ctor, propsData, data, context, children) } -} -function callUpdatedHooks (queue) { - var i = queue.length; - while (i--) { - var watcher = queue[i]; - var vm = watcher.vm; - if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { - callHook(vm, 'updated'); + // extract listeners, since these needs to be treated as + // child component listeners instead of DOM listeners + var listeners = data.on; + // replace with listeners with .native modifier + // so it gets processed during parent component patch. + data.on = data.nativeOn; + + if (isTrue(Ctor.options.abstract)) { + // abstract components do not keep anything + // other than props & listeners & slot + + // work around flow + var slot = data.slot; + data = {}; + if (slot) { + data.slot = slot; } } -} -/** - * Queue a kept-alive component that was activated during patch. - * The queue will be processed after the entire tree has been patched. - */ -function queueActivatedComponent (vm) { - // setting _inactive to false here so that a render function can - // rely on checking whether it's in an inactive tree (e.g. router-view) - vm._inactive = false; - activatedChildren.push(vm); + // install component management hooks onto the placeholder node + installComponentHooks(data); + + // return a placeholder vnode + var name = Ctor.options.name || tag; + 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 + ); + + return vnode } -function callActivatedHooks (queue) { - for (var i = 0; i < queue.length; i++) { - queue[i]._inactive = true; - activateChildComponent(queue[i], true /* true */); +function createComponentInstanceForVnode ( + vnode, // we know it's MountedComponentVNode but flow doesn't + parent // activeInstance in lifecycle state +) { + var options = { + _isComponent: true, + _parentVnode: vnode, + parent: parent + }; + // check inline-template render functions + var inlineTemplate = vnode.data.inlineTemplate; + if (isDef(inlineTemplate)) { + options.render = inlineTemplate.render; + options.staticRenderFns = inlineTemplate.staticRenderFns; } + return new vnode.componentOptions.Ctor(options) } -/** - * Push a watcher into the watcher queue. - * Jobs with duplicate IDs will be skipped unless it's - * pushed when the queue is being flushed. - */ -function queueWatcher (watcher) { - var id = watcher.id; - if (has[id] == null) { - has[id] = true; - if (!flushing) { - queue.push(watcher); - } else { - // if already flushing, splice the watcher based on its id - // if already past its id, it will be run next immediately. - var i = queue.length - 1; - while (i > index && queue[i].id > watcher.id) { - i--; - } - queue.splice(i + 1, 0, watcher); +function installComponentHooks (data) { + var hooks = data.hook || (data.hook = {}); + for (var i = 0; i < hooksToMerge.length; i++) { + var key = hooksToMerge[i]; + var existing = hooks[key]; + var toMerge = componentVNodeHooks[key]; + if (existing !== toMerge && !(existing && existing._merged)) { + hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge; } - // queue the flush - if (!waiting) { - waiting = true; + } +} - if (!config.async) { - flushSchedulerQueue(); - return - } - nextTick(flushSchedulerQueue); +function mergeHook$1 (f1, f2) { + var merged = function (a, b) { + // flow complains about extra args which is why we use any + f1(a, b); + f2(a, b); + }; + merged._merged = true; + return merged +} + +// transform component v-model info (value and callback) into +// prop and event handler respectively. +function transformModel (options, data) { + var prop = (options.model && options.model.prop) || 'value'; + var event = (options.model && options.model.event) || 'input' + ;(data.attrs || (data.attrs = {}))[prop] = data.model.value; + var on = data.on || (data.on = {}); + var existing = on[event]; + var callback = data.model.callback; + if (isDef(existing)) { + if ( + Array.isArray(existing) + ? existing.indexOf(callback) === -1 + : existing !== callback + ) { + on[event] = [callback].concat(existing); } + } else { + on[event] = callback; } } /* */ +var SIMPLE_NORMALIZE = 1; +var ALWAYS_NORMALIZE = 2; +// wrapper function for providing a more flexible interface +// without getting yelled at by flow +function createElement ( + context, + tag, + data, + children, + normalizationType, + alwaysNormalize +) { + if (Array.isArray(data) || isPrimitive(data)) { + normalizationType = children; + children = data; + data = undefined; + } + if (isTrue(alwaysNormalize)) { + normalizationType = ALWAYS_NORMALIZE; + } + return _createElement(context, tag, data, children, normalizationType) +} -var uid$1 = 0; - -/** - * A watcher parses an expression, collects dependencies, - * and fires callback when the expression value changes. - * This is used for both the $watch() api and directives. - */ -var Watcher = function Watcher ( - vm, - expOrFn, - cb, - options, - isRenderWatcher +function _createElement ( + context, + tag, + data, + children, + normalizationType ) { - this.vm = vm; - if (isRenderWatcher) { - vm._watcher = this; + if (isDef(data) && isDef((data).__ob__)) { + warn( + "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + + 'Always create fresh vnode data objects in each render!', + context + ); + return createEmptyVNode() } - vm._watchers.push(this); - // options - if (options) { - this.deep = !!options.deep; - this.user = !!options.user; - this.lazy = !!options.lazy; - this.sync = !!options.sync; - this.before = options.before; + // object syntax in v-bind + if (isDef(data) && isDef(data.is)) { + tag = data.is; + } + if (!tag) { + // in case of component :is set to falsy value + return createEmptyVNode() + } + // warn against non-primitive key + if (isDef(data) && isDef(data.key) && !isPrimitive(data.key) + ) { + { + warn( + 'Avoid using non-primitive value as key, ' + + 'use string/number value instead.', + context + ); + } + } + // support single function children as default scoped slot + if (Array.isArray(children) && + typeof children[0] === 'function' + ) { + data = data || {}; + data.scopedSlots = { default: children[0] }; + children.length = 0; + } + if (normalizationType === ALWAYS_NORMALIZE) { + children = normalizeChildren(children); + } else if (normalizationType === SIMPLE_NORMALIZE) { + children = simpleNormalizeChildren(children); + } + var vnode, ns; + if (typeof tag === 'string') { + var Ctor; + ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); + if (config.isReservedTag(tag)) { + // platform built-in elements + vnode = new VNode( + config.parsePlatformTagName(tag), data, children, + undefined, undefined, context + ); + } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { + // component + vnode = createComponent(Ctor, data, context, children, tag); + } else { + // unknown or unlisted namespaced elements + // check at runtime because it may get assigned a namespace when its + // parent normalizes children + vnode = new VNode( + tag, data, children, + undefined, undefined, context + ); + } } else { - this.deep = this.user = this.lazy = this.sync = false; + // direct component options / constructor + vnode = createComponent(tag, data, context, children); } - this.cb = cb; - this.id = ++uid$1; // uid for batching - this.active = true; - this.dirty = this.lazy; // for lazy watchers - this.deps = []; - this.newDeps = []; - this.depIds = new _Set(); - this.newDepIds = new _Set(); - this.expression = expOrFn.toString(); - // parse expression for getter - if (typeof expOrFn === 'function') { - this.getter = expOrFn; + if (Array.isArray(vnode)) { + return vnode + } else if (isDef(vnode)) { + if (isDef(ns)) { applyNS(vnode, ns); } + if (isDef(data)) { registerDeepBindings(data); } + return vnode } else { - this.getter = parsePath(expOrFn); - if (!this.getter) { - this.getter = noop; - warn( - "Failed watching path: \"" + expOrFn + "\" " + - 'Watcher only accepts simple dot-delimited paths. ' + - 'For full control, use a function instead.', - vm - ); - } + return createEmptyVNode() } - this.value = this.lazy - ? undefined - : this.get(); -}; +} -/** - * Evaluate the getter, and re-collect dependencies. - */ -Watcher.prototype.get = function get () { - pushTarget(this); - var value; - var vm = this.vm; - try { - value = this.getter.call(vm, vm); - } catch (e) { - if (this.user) { - handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); - } else { - throw e - } - } finally { - // "touch" every property so they are all tracked as - // dependencies for deep watching - if (this.deep) { - traverse(value); - } - popTarget(); - this.cleanupDeps(); +function applyNS (vnode, ns, force) { + vnode.ns = ns; + if (vnode.tag === 'foreignObject') { + // use default namespace inside foreignObject + ns = undefined; + force = true; } - return value -}; - -/** - * Add a dependency to this directive. - */ -Watcher.prototype.addDep = function addDep (dep) { - var id = dep.id; - if (!this.newDepIds.has(id)) { - this.newDepIds.add(id); - this.newDeps.push(dep); - if (!this.depIds.has(id)) { - dep.addSub(this); + if (isDef(vnode.children)) { + for (var i = 0, l = vnode.children.length; i < l; i++) { + var child = vnode.children[i]; + if (isDef(child.tag) && ( + isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { + applyNS(child, ns, force); + } } } -}; +} -/** - * Clean up for dependency collection. - */ -Watcher.prototype.cleanupDeps = function cleanupDeps () { - var i = this.deps.length; - while (i--) { - var dep = this.deps[i]; - if (!this.newDepIds.has(dep.id)) { - dep.removeSub(this); - } +// ref #5318 +// necessary to ensure parent re-render when deep bindings like :style and +// :class are used on slot nodes +function registerDeepBindings (data) { + if (isObject(data.style)) { + traverse(data.style); } - var tmp = this.depIds; - this.depIds = this.newDepIds; - this.newDepIds = tmp; - this.newDepIds.clear(); - tmp = this.deps; - this.deps = this.newDeps; - this.newDeps = tmp; - this.newDeps.length = 0; -}; + if (isObject(data.class)) { + traverse(data.class); + } +} + +/* */ + +function initRender (vm) { + vm._vnode = null; // the root of the child tree + vm._staticTrees = null; // v-once cached trees + var options = vm.$options; + var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree + var renderContext = parentVnode && parentVnode.context; + vm.$slots = resolveSlots(options._renderChildren, renderContext); + vm.$scopedSlots = emptyObject; + // bind the createElement fn to this instance + // so that we get proper render context inside it. + // args order: tag, data, children, normalizationType, alwaysNormalize + // internal version is used by render functions compiled from templates + vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; + // normalization is always applied for the public version, used in + // user-written render functions. + vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; + + // $attrs & $listeners are exposed for easier HOC creation. + // they need to be reactive so that HOCs using them are always updated + var parentData = parentVnode && parentVnode.data; -/** - * Subscriber interface. - * Will be called when a dependency changes. - */ -Watcher.prototype.update = function update () { /* istanbul ignore else */ - if (this.lazy) { - this.dirty = true; - } else if (this.sync) { - this.run(); - } else { - queueWatcher(this); + { + defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { + !isUpdatingChildComponent && warn("$attrs is readonly.", vm); + }, true); + defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { + !isUpdatingChildComponent && warn("$listeners is readonly.", vm); + }, true); } -}; +} -/** - * Scheduler job interface. - * Will be called by the scheduler. - */ -Watcher.prototype.run = function run () { - if (this.active) { - var value = this.get(); - if ( - value !== this.value || - // Deep watchers and watchers on Object/Arrays should fire even - // when the value is the same, because the value may - // have mutated. - isObject(value) || - this.deep - ) { - // set new value - var oldValue = this.value; - this.value = value; - if (this.user) { - try { - this.cb.call(this.vm, value, oldValue); - } catch (e) { - handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\"")); - } - } else { - this.cb.call(this.vm, value, oldValue); - } - } - } -}; +var currentRenderingInstance = null; -/** - * Evaluate the value of the watcher. - * This only gets called for lazy watchers. - */ -Watcher.prototype.evaluate = function evaluate () { - this.value = this.get(); - this.dirty = false; -}; +function renderMixin (Vue) { + // install runtime convenience helpers + installRenderHelpers(Vue.prototype); -/** - * Depend on all deps collected by this watcher. - */ -Watcher.prototype.depend = function depend () { - var i = this.deps.length; - while (i--) { - this.deps[i].depend(); - } -}; + Vue.prototype.$nextTick = function (fn) { + return nextTick(fn, this) + }; -/** - * Remove self from all dependencies' subscriber list. - */ -Watcher.prototype.teardown = function teardown () { - if (this.active) { - // remove self from vm's watcher list - // this is a somewhat expensive operation so we skip it - // if the vm is being destroyed. - if (!this.vm._isBeingDestroyed) { - remove(this.vm._watchers, this); + Vue.prototype._render = function () { + var vm = this; + var ref = vm.$options; + var render = ref.render; + var _parentVnode = ref._parentVnode; + + if (_parentVnode) { + vm.$scopedSlots = normalizeScopedSlots( + _parentVnode.data.scopedSlots, + vm.$slots + ); + } + + // set parent vnode. this allows render functions to have access + // to the data on the placeholder node. + vm.$vnode = _parentVnode; + // render self + var vnode; + try { + // There's no need to maintain a stack becaues all render fns are called + // separately from one another. Nested component's render fns are called + // when parent component is patched. + currentRenderingInstance = vm; + vnode = render.call(vm._renderProxy, vm.$createElement); + } catch (e) { + handleError(e, vm, "render"); + // return error render result, + // or previous vnode to prevent render error causing blank component + /* istanbul ignore else */ + if (vm.$options.renderError) { + try { + vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); + } catch (e) { + handleError(e, vm, "renderError"); + vnode = vm._vnode; + } + } else { + vnode = vm._vnode; + } + } finally { + currentRenderingInstance = null; } - var i = this.deps.length; - while (i--) { - this.deps[i].removeSub(this); + // if the returned array contains only a single node, allow it + if (Array.isArray(vnode) && vnode.length === 1) { + vnode = vnode[0]; } - this.active = false; - } -}; + // return empty vnode in case the render function errored out + if (!(vnode instanceof VNode)) { + if (Array.isArray(vnode)) { + warn( + 'Multiple root nodes returned from render function. Render function ' + + 'should return a single root node.', + vm + ); + } + vnode = createEmptyVNode(); + } + // set parent + vnode.parent = _parentVnode; + return vnode + }; +} /* */ -var sharedPropertyDefinition = { - enumerable: true, - configurable: true, - get: noop, - set: noop -}; +function ensureCtor (comp, base) { + if ( + comp.__esModule || + (hasSymbol && comp[Symbol.toStringTag] === 'Module') + ) { + comp = comp.default; + } + return isObject(comp) + ? base.extend(comp) + : comp +} -function proxy (target, sourceKey, key) { - sharedPropertyDefinition.get = function proxyGetter () { - return this[sourceKey][key] - }; - sharedPropertyDefinition.set = function proxySetter (val) { - this[sourceKey][key] = val; - }; - Object.defineProperty(target, key, sharedPropertyDefinition); +function createAsyncPlaceholder ( + factory, + data, + context, + children, + tag +) { + var node = createEmptyVNode(); + node.asyncFactory = factory; + node.asyncMeta = { data: data, context: context, children: children, tag: tag }; + return node } -function initState (vm) { - vm._watchers = []; - var opts = vm.$options; - if (opts.props) { initProps(vm, opts.props); } - if (opts.methods) { initMethods(vm, opts.methods); } - if (opts.data) { - initData(vm); - } else { - observe(vm._data = {}, true /* asRootData */); +function resolveAsyncComponent ( + factory, + baseCtor +) { + if (isTrue(factory.error) && isDef(factory.errorComp)) { + return factory.errorComp } - if (opts.computed) { initComputed(vm, opts.computed); } - if (opts.watch && opts.watch !== nativeWatch) { - initWatch(vm, opts.watch); + + if (isDef(factory.resolved)) { + return factory.resolved } -} -function initProps (vm, propsOptions) { - var propsData = vm.$options.propsData || {}; - var props = vm._props = {}; - // cache prop keys so that future props updates can iterate using Array - // instead of dynamic object key enumeration. - var keys = vm.$options._propKeys = []; - var isRoot = !vm.$parent; - // root instance props should be converted - if (!isRoot) { - toggleObserving(false); + if (isTrue(factory.loading) && isDef(factory.loadingComp)) { + return factory.loadingComp } - var loop = function ( key ) { - keys.push(key); - var value = validateProp(key, propsOptions, propsData, vm); - /* istanbul ignore else */ - { - var hyphenatedKey = hyphenate(key); - if (isReservedAttribute(hyphenatedKey) || - config.isReservedAttr(hyphenatedKey)) { - warn( - ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), - vm - ); + + var owner = currentRenderingInstance; + if (isDef(factory.owners)) { + // already pending + factory.owners.push(owner); + } else { + var owners = factory.owners = [owner]; + var sync = true; + + var forceRender = function (renderCompleted) { + for (var i = 0, l = owners.length; i < l; i++) { + (owners[i]).$forceUpdate(); } - defineReactive$$1(props, key, value, function () { - if (!isRoot && !isUpdatingChildComponent) { - 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 - ); - } - }); - } - // static props are already proxied on the component's prototype - // during Vue.extend(). We only need to proxy props defined at - // instantiation here. - if (!(key in vm)) { - proxy(vm, "_props", key); - } - }; - for (var key in propsOptions) loop( key ); - toggleObserving(true); -} + if (renderCompleted) { + owners.length = 0; + } + }; -function initData (vm) { - var data = vm.$options.data; - data = vm._data = typeof data === 'function' - ? getData(data, vm) - : data || {}; - if (!isPlainObject(data)) { - data = {}; - warn( - 'data functions should return an object:\n' + - 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', - vm - ); - } - // proxy data on instance - var keys = Object.keys(data); - var props = vm.$options.props; - var methods = vm.$options.methods; - var i = keys.length; - while (i--) { - var key = keys[i]; - { - if (methods && hasOwn(methods, key)) { - warn( - ("Method \"" + key + "\" has already been defined as a data property."), - vm - ); + var resolve = once(function (res) { + // cache resolved + factory.resolved = ensureCtor(res, baseCtor); + // invoke callbacks only if this is not a synchronous resolve + // (async resolves are shimmed as synchronous during SSR) + if (!sync) { + forceRender(true); + } else { + owners.length = 0; } - } - if (props && hasOwn(props, key)) { + }); + + var reject = once(function (reason) { warn( - "The data property \"" + key + "\" is already declared as a prop. " + - "Use prop default value instead.", - vm + "Failed to resolve async component: " + (String(factory)) + + (reason ? ("\nReason: " + reason) : '') ); - } else if (!isReserved(key)) { - proxy(vm, "_data", key); + if (isDef(factory.errorComp)) { + factory.error = true; + forceRender(true); + } + }); + + var res = factory(resolve, reject); + + if (isObject(res)) { + if (isPromise(res)) { + // () => Promise + if (isUndef(factory.resolved)) { + res.then(resolve, reject); + } + } else if (isPromise(res.component)) { + res.component.then(resolve, reject); + + if (isDef(res.error)) { + factory.errorComp = ensureCtor(res.error, baseCtor); + } + + if (isDef(res.loading)) { + factory.loadingComp = ensureCtor(res.loading, baseCtor); + if (res.delay === 0) { + factory.loading = true; + } else { + setTimeout(function () { + if (isUndef(factory.resolved) && isUndef(factory.error)) { + factory.loading = true; + forceRender(false); + } + }, res.delay || 200); + } + } + + if (isDef(res.timeout)) { + setTimeout(function () { + if (isUndef(factory.resolved)) { + reject( + "timeout (" + (res.timeout) + "ms)" + ); + } + }, res.timeout); + } + } } - } - // observe data - observe(data, true /* asRootData */); -} -function getData (data, vm) { - // #7573 disable dep collection when invoking data getters - pushTarget(); - try { - return data.call(vm, vm) - } catch (e) { - handleError(e, vm, "data()"); - return {} - } finally { - popTarget(); + sync = false; + // return in case resolved synchronously + return factory.loading + ? factory.loadingComp + : factory.resolved } } -var computedWatcherOptions = { lazy: true }; - -function initComputed (vm, computed) { - // $flow-disable-line - var watchers = vm._computedWatchers = Object.create(null); - // computed properties are just getters during SSR - var isSSR = isServerRendering(); +/* */ - for (var key in computed) { - var userDef = computed[key]; - var getter = typeof userDef === 'function' ? userDef : userDef.get; - if (getter == null) { - warn( - ("Getter is missing for computed property \"" + key + "\"."), - vm - ); - } +function isAsyncPlaceholder (node) { + return node.isComment && node.asyncFactory +} - if (!isSSR) { - // create internal watcher for the computed property. - watchers[key] = new Watcher( - vm, - getter || noop, - noop, - computedWatcherOptions - ); - } +/* */ - // component-defined computed properties are already defined on the - // component prototype. We only need to define computed properties defined - // at instantiation here. - if (!(key in vm)) { - defineComputed(vm, key, userDef); - } else { - if (key in vm.$data) { - warn(("The computed property \"" + key + "\" is already defined in data."), vm); - } else if (vm.$options.props && key in vm.$options.props) { - warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); +function getFirstComponentChild (children) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + var c = children[i]; + if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { + return c } } } } -function defineComputed ( - target, - key, - userDef -) { - var shouldCache = !isServerRendering(); - if (typeof userDef === 'function') { - sharedPropertyDefinition.get = shouldCache - ? createComputedGetter(key) - : createGetterInvoker(userDef); - sharedPropertyDefinition.set = noop; - } else { - sharedPropertyDefinition.get = userDef.get - ? shouldCache && userDef.cache !== false - ? createComputedGetter(key) - : createGetterInvoker(userDef.get) - : noop; - sharedPropertyDefinition.set = userDef.set || noop; - } - if (sharedPropertyDefinition.set === noop) { - sharedPropertyDefinition.set = function () { - warn( - ("Computed property \"" + key + "\" was assigned to but it has no setter."), - this - ); - }; - } - Object.defineProperty(target, key, sharedPropertyDefinition); -} +/* */ -function createComputedGetter (key) { - return function computedGetter () { - var watcher = this._computedWatchers && this._computedWatchers[key]; - if (watcher) { - if (watcher.dirty) { - watcher.evaluate(); - } - if (Dep.target) { - watcher.depend(); - } - return watcher.value - } +/* */ + +function initEvents (vm) { + vm._events = Object.create(null); + vm._hasHookEvent = false; + // init parent attached events + var listeners = vm.$options._parentListeners; + if (listeners) { + updateComponentListeners(vm, listeners); } } -function createGetterInvoker(fn) { - return function computedGetter () { - return fn.call(this, this) - } +var target; + +function add (event, fn) { + target.$on(event, fn); } -function initMethods (vm, methods) { - var props = vm.$options.props; - for (var key in methods) { - { - if (typeof methods[key] !== 'function') { - warn( - "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + - "Did you reference the function correctly?", - vm - ); - } - if (props && hasOwn(props, key)) { - warn( - ("Method \"" + key + "\" has already been defined as a prop."), - vm - ); - } - if ((key in vm) && isReserved(key)) { - warn( - "Method \"" + key + "\" conflicts with an existing Vue instance method. " + - "Avoid defining component methods that start with _ or $." - ); - } - } - vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); - } +function remove$1 (event, fn) { + target.$off(event, fn); } -function initWatch (vm, watch) { - for (var key in watch) { - var handler = watch[key]; - if (Array.isArray(handler)) { - for (var i = 0; i < handler.length; i++) { - createWatcher(vm, key, handler[i]); - } - } else { - createWatcher(vm, key, handler); +function createOnceHandler (event, fn) { + var _target = target; + return function onceHandler () { + var res = fn.apply(null, arguments); + if (res !== null) { + _target.$off(event, onceHandler); } } } -function createWatcher ( +function updateComponentListeners ( vm, - expOrFn, - handler, - options + listeners, + oldListeners ) { - if (isPlainObject(handler)) { - options = handler; - handler = handler.handler; - } - if (typeof handler === 'string') { - handler = vm[handler]; - } - return vm.$watch(expOrFn, handler, options) + target = vm; + updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); + target = undefined; } -function stateMixin (Vue) { - // flow somehow has problems with directly declared definition object - // when using Object.defineProperty, so we have to procedurally build up - // the object here. - var dataDef = {}; - dataDef.get = function () { return this._data }; - var propsDef = {}; - propsDef.get = function () { return this._props }; - { - dataDef.set = function () { - warn( - 'Avoid replacing instance root $data. ' + - 'Use nested data properties instead.', - this - ); - }; - propsDef.set = function () { - warn("$props is readonly.", this); - }; - } - Object.defineProperty(Vue.prototype, '$data', dataDef); - Object.defineProperty(Vue.prototype, '$props', propsDef); +function eventsMixin (Vue) { + var hookRE = /^hook:/; + Vue.prototype.$on = function (event, fn) { + var vm = this; + if (Array.isArray(event)) { + for (var i = 0, l = event.length; i < l; i++) { + vm.$on(event[i], fn); + } + } else { + (vm._events[event] || (vm._events[event] = [])).push(fn); + // optimize hook:event cost by using a boolean flag marked at registration + // instead of a hash lookup + if (hookRE.test(event)) { + vm._hasHookEvent = true; + } + } + return vm + }; - Vue.prototype.$set = set; - Vue.prototype.$delete = del; + Vue.prototype.$once = function (event, fn) { + var vm = this; + function on () { + vm.$off(event, on); + fn.apply(vm, arguments); + } + on.fn = fn; + vm.$on(event, on); + return vm + }; + + Vue.prototype.$off = function (event, fn) { + var vm = this; + // all + if (!arguments.length) { + vm._events = Object.create(null); + return vm + } + // array of events + if (Array.isArray(event)) { + for (var i$1 = 0, l = event.length; i$1 < l; i$1++) { + vm.$off(event[i$1], fn); + } + return vm + } + // specific event + var cbs = vm._events[event]; + if (!cbs) { + return vm + } + if (!fn) { + vm._events[event] = null; + return vm + } + // specific handler + var cb; + var i = cbs.length; + while (i--) { + cb = cbs[i]; + if (cb === fn || cb.fn === fn) { + cbs.splice(i, 1); + break + } + } + return vm + }; - Vue.prototype.$watch = function ( - expOrFn, - cb, - options - ) { + Vue.prototype.$emit = function (event) { var vm = this; - if (isPlainObject(cb)) { - return createWatcher(vm, expOrFn, cb, options) - } - options = options || {}; - options.user = true; - var watcher = new Watcher(vm, expOrFn, cb, options); - if (options.immediate) { - try { - cb.call(vm, watcher.value); - } catch (error) { - handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\"")); + { + var lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { + 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 + "\"." + ); } } - return function unwatchFn () { - watcher.teardown(); + var cbs = vm._events[event]; + if (cbs) { + cbs = cbs.length > 1 ? toArray(cbs) : cbs; + var args = toArray(arguments, 1); + var info = "event handler for \"" + event + "\""; + for (var i = 0, l = cbs.length; i < l; i++) { + invokeWithErrorHandling(cbs[i], vm, args, vm, info); + } } + return vm }; } /* */ -function initProvide (vm) { - var provide = vm.$options.provide; - if (provide) { - vm._provided = typeof provide === 'function' - ? provide.call(vm) - : provide; - } -} +var activeInstance = null; +var isUpdatingChildComponent = false; -function initInjections (vm) { - var result = resolveInject(vm.$options.inject, vm); - if (result) { - toggleObserving(false); - Object.keys(result).forEach(function (key) { - /* istanbul ignore else */ - { - defineReactive$$1(vm, key, result[key], function () { - warn( - "Avoid mutating an injected value directly since the changes will be " + - "overwritten whenever the provided component re-renders. " + - "injection being mutated: \"" + key + "\"", - vm - ); - }); - } - }); - toggleObserving(true); +function setActiveInstance(vm) { + var prevActiveInstance = activeInstance; + activeInstance = vm; + return function () { + activeInstance = prevActiveInstance; } } -function resolveInject (inject, vm) { - if (inject) { - // inject is :any because flow is not smart enough to figure out cached - var result = Object.create(null); - var keys = hasSymbol - ? Reflect.ownKeys(inject) - : Object.keys(inject); +function initLifecycle (vm) { + var options = vm.$options; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - // #6574 in case the inject object is observed... - if (key === '__ob__') { continue } - var provideKey = inject[key].from; - var source = vm; - while (source) { - if (source._provided && hasOwn(source._provided, provideKey)) { - result[key] = source._provided[provideKey]; - break - } - source = source.$parent; - } - if (!source) { - if ('default' in inject[key]) { - var provideDefault = inject[key].default; - result[key] = typeof provideDefault === 'function' - ? provideDefault.call(vm) - : provideDefault; - } else { - warn(("Injection \"" + key + "\" not found"), vm); - } - } + // locate first non-abstract parent + var parent = options.parent; + if (parent && !options.abstract) { + while (parent.$options.abstract && parent.$parent) { + parent = parent.$parent; } - return result + parent.$children.push(vm); } -} - -/* */ -function normalizeScopedSlots ( - slots, - normalSlots -) { - var res; - if (!slots) { - res = {}; - } else if (slots._normalized) { - return slots - } else { - res = {}; - for (var key in slots) { - if (slots[key] && key[0] !== '$') { - res[key] = normalizeScopedSlot(normalSlots, key, slots[key]); - } - } - } - // expose normal slots on scopedSlots - for (var key$1 in normalSlots) { - if (!(key$1 in res)) { - res[key$1] = proxyNormalSlot(normalSlots, key$1); - } - } - res._normalized = true; - res.$stable = slots ? slots.$stable : true; - return res -} + vm.$parent = parent; + vm.$root = parent ? parent.$root : vm; -function normalizeScopedSlot(normalSlots, key, fn) { - var normalized = function (scope) { - if ( scope === void 0 ) scope = {}; + vm.$children = []; + vm.$refs = {}; - var res = fn(scope); - return res && typeof res === 'object' && !Array.isArray(res) - ? [res] // single vnode - : normalizeChildren(res) - }; - // proxy scoped slots on normal $slots - if (!hasOwn(normalSlots, key)) { - Object.defineProperty(normalSlots, key, { - get: normalized - }); - } - return normalized + vm._watcher = null; + vm._inactive = null; + vm._directInactive = false; + vm._isMounted = false; + vm._isDestroyed = false; + vm._isBeingDestroyed = false; } -function proxyNormalSlot(slots, key) { - return function () { return slots[key]; } -} +function lifecycleMixin (Vue) { + Vue.prototype._update = function (vnode, hydrating) { + var vm = this; + var prevEl = vm.$el; + var prevVnode = vm._vnode; + var restoreActiveInstance = setActiveInstance(vm); + vm._vnode = vnode; + // Vue.prototype.__patch__ is injected in entry points + // based on the rendering backend used. + if (!prevVnode) { + // initial render + vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */); + } else { + // updates + vm.$el = vm.__patch__(prevVnode, vnode); + } + restoreActiveInstance(); + // update __vue__ reference + if (prevEl) { + prevEl.__vue__ = null; + } + if (vm.$el) { + vm.$el.__vue__ = vm; + } + // if parent is an HOC, update its $el as well + if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { + vm.$parent.$el = vm.$el; + } + // updated hook is called by the scheduler to ensure that children are + // updated in a parent's updated hook. + }; -/* */ + Vue.prototype.$forceUpdate = function () { + var vm = this; + if (vm._watcher) { + vm._watcher.update(); + } + }; -/** - * Runtime helper for rendering v-for lists. - */ -function renderList ( - val, - render -) { - var ret, i, l, keys, key; - if (Array.isArray(val) || typeof val === 'string') { - ret = new Array(val.length); - for (i = 0, l = val.length; i < l; i++) { - ret[i] = render(val[i], i); + Vue.prototype.$destroy = function () { + var vm = this; + if (vm._isBeingDestroyed) { + return } - } else if (typeof val === 'number') { - ret = new Array(val); - for (i = 0; i < val; i++) { - ret[i] = render(i + 1, i); + callHook(vm, 'beforeDestroy'); + vm._isBeingDestroyed = true; + // remove self from parent + var parent = vm.$parent; + if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { + remove(parent.$children, vm); } - } else if (isObject(val)) { - if (hasSymbol && val[Symbol.iterator]) { - ret = []; - var iterator = val[Symbol.iterator](); - var result = iterator.next(); - while (!result.done) { - ret.push(render(result.value, ret.length)); - result = iterator.next(); - } - } else { - keys = Object.keys(val); - ret = new Array(keys.length); - for (i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - ret[i] = render(val[key], key, i); - } + // teardown watchers + if (vm._watcher) { + vm._watcher.teardown(); + } + var i = vm._watchers.length; + while (i--) { + vm._watchers[i].teardown(); + } + // remove reference from data ob + // frozen object may not have observer. + if (vm._data.__ob__) { + vm._data.__ob__.vmCount--; + } + // call the last hook... + vm._isDestroyed = true; + // invoke destroy hooks on current rendered tree + vm.__patch__(vm._vnode, null); + // fire destroyed hook + callHook(vm, 'destroyed'); + // turn off all instance listeners. + vm.$off(); + // remove __vue__ reference + if (vm.$el) { + vm.$el.__vue__ = null; } - } - if (!isDef(ret)) { - ret = []; - } - (ret)._isVList = true; - return ret + // release circular reference (#6759) + if (vm.$vnode) { + vm.$vnode.parent = null; + } + }; } -/* */ - -/** - * Runtime helper for rendering - */ -function renderSlot ( - name, - fallback, - props, - bindObject +function mountComponent ( + vm, + el, + hydrating ) { - var scopedSlotFn = this.$scopedSlots[name]; - var nodes; - if (scopedSlotFn) { // scoped slot - props = props || {}; - if (bindObject) { - if (!isObject(bindObject)) { + vm.$el = el; + if (!vm.$options.render) { + vm.$options.render = createEmptyVNode; + { + /* istanbul ignore if */ + if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || + vm.$options.el || el) { warn( - 'slot v-bind without argument expects an Object', - this + '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 + ); + } else { + warn( + 'Failed to mount component: template or render function not defined.', + vm ); } - props = extend(extend({}, bindObject), props); } - nodes = scopedSlotFn(props) || fallback; - } else { - nodes = this.$slots[name] || fallback; } + callHook(vm, 'beforeMount'); - var target = props && props.slot; - if (target) { - return this.$createElement('template', { slot: target }, nodes) - } else { - return nodes - } -} + var updateComponent; + /* istanbul ignore if */ + if (config.performance && mark) { + updateComponent = function () { + var name = vm._name; + var id = vm._uid; + var startTag = "vue-perf-start:" + id; + var endTag = "vue-perf-end:" + id; -/* */ + mark(startTag); + var vnode = vm._render(); + mark(endTag); + measure(("vue " + name + " render"), startTag, endTag); -/** - * Runtime helper for resolving filters - */ -function resolveFilter (id) { - return resolveAsset(this.$options, 'filters', id, true) || identity -} + mark(startTag); + vm._update(vnode, hydrating); + mark(endTag); + measure(("vue " + name + " patch"), startTag, endTag); + }; + } else { + updateComponent = function () { + vm._update(vm._render(), hydrating); + }; + } -/* */ + // we set this to vm._watcher inside the watcher's constructor + // since the watcher's initial patch may call $forceUpdate (e.g. inside child + // component's mounted hook), which relies on vm._watcher being already defined + new Watcher(vm, updateComponent, noop, { + before: function before () { + if (vm._isMounted && !vm._isDestroyed) { + callHook(vm, 'beforeUpdate'); + } + } + }, true /* isRenderWatcher */); + hydrating = false; -function isKeyNotMatch (expect, actual) { - if (Array.isArray(expect)) { - return expect.indexOf(actual) === -1 - } else { - return expect !== actual + // manually mounted instance, call mounted on self + // mounted is called for render-created child components in its inserted hook + if (vm.$vnode == null) { + vm._isMounted = true; + callHook(vm, 'mounted'); } + return vm } -/** - * Runtime helper for checking keyCodes from config. - * exposed as Vue.prototype._k - * passing in eventKeyName as last argument separately for backwards compat - */ -function checkKeyCodes ( - eventKeyCode, - key, - builtInKeyCode, - eventKeyName, - builtInKeyName +function updateChildComponent ( + vm, + propsData, + listeners, + parentVnode, + renderChildren ) { - var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; - if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { - return isKeyNotMatch(builtInKeyName, eventKeyName) - } else if (mappedKeyCode) { - return isKeyNotMatch(mappedKeyCode, eventKeyCode) - } else if (eventKeyName) { - return hyphenate(eventKeyName) !== key + { + isUpdatingChildComponent = true; } -} - -/* */ -/** - * Runtime helper for merging v-bind="object" into a VNode's data. - */ -function bindObjectProps ( - data, - tag, - value, - asProp, - isSync -) { - if (value) { - if (!isObject(value)) { - warn( - 'v-bind without argument expects an Object or Array value', - this - ); - } else { - if (Array.isArray(value)) { - value = toObject(value); - } - var hash; - var loop = function ( key ) { - if ( - key === 'class' || - key === 'style' || - isReservedAttribute(key) - ) { - hash = data; - } else { - var type = data.attrs && data.attrs.type; - hash = asProp || config.mustUseProp(tag, type, key) - ? data.domProps || (data.domProps = {}) - : data.attrs || (data.attrs = {}); - } - var camelizedKey = camelize(key); - if (!(key in hash) && !(camelizedKey in hash)) { - hash[key] = value[key]; + // determine whether component has slot children + // we need to do this before overwriting $options._renderChildren. - if (isSync) { - var on = data.on || (data.on = {}); - on[("update:" + camelizedKey)] = function ($event) { - value[key] = $event; - }; - } - } - }; + // check if there are dynamic scopedSlots (hand-written or compiled but with + // dynamic slot names). Static scoped slots compiled from template has the + // "$stable" marker. + var hasDynamicScopedSlot = !!( + (parentVnode.data.scopedSlots && !parentVnode.data.scopedSlots.$stable) || + (vm.$scopedSlots !== emptyObject && !vm.$scopedSlots.$stable) + ); - for (var key in value) loop( key ); - } - } - return data -} + // Any static slot children from the parent may have changed during parent's + // update. Dynamic scoped slots may also have changed. In such cases, a forced + // update is necessary to ensure correctness. + var needsForceUpdate = !!( + renderChildren || // has new static slots + vm.$options._renderChildren || // has old static slots + hasDynamicScopedSlot + ); -/* */ + vm.$options._parentVnode = parentVnode; + vm.$vnode = parentVnode; // update vm's placeholder node without re-render -/** - * Runtime helper for rendering static trees. - */ -function renderStatic ( - index, - isInFor -) { - var cached = this._staticTrees || (this._staticTrees = []); - var tree = cached[index]; - // if has already-rendered static tree and not inside v-for, - // we can reuse the same tree. - if (tree && !isInFor) { - return tree + if (vm._vnode) { // update child tree's parent + vm._vnode.parent = parentVnode; } - // otherwise, render a fresh tree. - tree = cached[index] = this.$options.staticRenderFns[index].call( - this._renderProxy, - null, - this // for render fns generated for functional component templates - ); - markStatic(tree, ("__static__" + index), false); - return tree -} + vm.$options._renderChildren = renderChildren; -/** - * Runtime helper for v-once. - * Effectively it means marking the node as static with a unique key. - */ -function markOnce ( - tree, - index, - key -) { - markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); - return tree -} + // update $attrs and $listeners hash + // these are also reactive so they may trigger child update if the child + // used them during render + vm.$attrs = parentVnode.data.attrs || emptyObject; + vm.$listeners = listeners || emptyObject; -function markStatic ( - tree, - key, - isOnce -) { - if (Array.isArray(tree)) { - for (var i = 0; i < tree.length; i++) { - if (tree[i] && typeof tree[i] !== 'string') { - markStaticNode(tree[i], (key + "_" + i), isOnce); - } + // update props + if (propsData && vm.$options.props) { + toggleObserving(false); + var props = vm._props; + var propKeys = vm.$options._propKeys || []; + for (var i = 0; i < propKeys.length; i++) { + var key = propKeys[i]; + var propOptions = vm.$options.props; // wtf flow? + props[key] = validateProp(key, propOptions, propsData, vm); } - } else { - markStaticNode(tree, key, isOnce); + toggleObserving(true); + // keep a copy of raw propsData + vm.$options.propsData = propsData; } -} -function markStaticNode (node, key, isOnce) { - node.isStatic = true; - node.key = key; - node.isOnce = isOnce; + // update listeners + listeners = listeners || emptyObject; + var oldListeners = vm.$options._parentListeners; + vm.$options._parentListeners = listeners; + updateComponentListeners(vm, listeners, oldListeners); + + // resolve slots + force update if has children + if (needsForceUpdate) { + vm.$slots = resolveSlots(renderChildren, parentVnode.context); + vm.$forceUpdate(); + } + + { + isUpdatingChildComponent = false; + } } -/* */ +function isInInactiveTree (vm) { + while (vm && (vm = vm.$parent)) { + if (vm._inactive) { return true } + } + return false +} -function bindObjectListeners (data, value) { - if (value) { - if (!isPlainObject(value)) { - warn( - 'v-on without argument expects an Object value', - this - ); - } else { - var on = data.on = data.on ? extend({}, data.on) : {}; - for (var key in value) { - var existing = on[key]; - var ours = value[key]; - on[key] = existing ? [].concat(existing, ours) : ours; - } +function activateChildComponent (vm, direct) { + if (direct) { + vm._directInactive = false; + if (isInInactiveTree(vm)) { + return } + } else if (vm._directInactive) { + return + } + if (vm._inactive || vm._inactive === null) { + vm._inactive = false; + for (var i = 0; i < vm.$children.length; i++) { + activateChildComponent(vm.$children[i]); + } + callHook(vm, 'activated'); } - return data } -/* */ - -function bindDynamicKeys (baseObj, values) { - for (var i = 0; i < values.length; i += 2) { - var key = values[i]; - if (typeof key === 'string' && key) { - baseObj[values[i]] = values[i + 1]; - } else if (key !== '' && key !== null) { - // null is a speical value for explicitly removing a binding - warn( - ("Invalid value for dynamic directive argument (expected string or null): " + key), - this - ); +function deactivateChildComponent (vm, direct) { + if (direct) { + vm._directInactive = true; + if (isInInactiveTree(vm)) { + return } } - return baseObj + if (!vm._inactive) { + vm._inactive = true; + for (var i = 0; i < vm.$children.length; i++) { + deactivateChildComponent(vm.$children[i]); + } + callHook(vm, 'deactivated'); + } } -// helper to dynamically append modifier runtime markers to event names. -// ensure only append when value is already string, otherwise it will be cast -// to string and cause the type check to miss. -function prependModifier (value, symbol) { - return typeof value === 'string' ? symbol + value : value +function callHook (vm, hook) { + // #7573 disable dep collection when invoking lifecycle hooks + pushTarget(); + var handlers = vm.$options[hook]; + var info = hook + " hook"; + if (handlers) { + for (var i = 0, j = handlers.length; i < j; i++) { + invokeWithErrorHandling(handlers[i], vm, null, vm, info); + } + } + if (vm._hasHookEvent) { + vm.$emit('hook:' + hook); + } + popTarget(); } /* */ -function installRenderHelpers (target) { - target._o = markOnce; - target._n = toNumber; - target._s = toString; - target._l = renderList; - target._t = renderSlot; - target._q = looseEqual; - target._i = looseIndexOf; - target._m = renderStatic; - target._f = resolveFilter; - target._k = checkKeyCodes; - target._b = bindObjectProps; - target._v = createTextVNode; - target._e = createEmptyVNode; - target._u = resolveScopedSlots; - target._g = bindObjectListeners; - target._d = bindDynamicKeys; - target._p = prependModifier; -} +var MAX_UPDATE_COUNT = 100; -/* */ +var queue = []; +var activatedChildren = []; +var has = {}; +var circular = {}; +var waiting = false; +var flushing = false; +var index = 0; -function FunctionalRenderContext ( - data, - props, - children, - parent, - Ctor -) { - var options = Ctor.options; - // ensure the createElement function in functional components - // gets a unique context - this is necessary for correct named slot check - var contextVm; - if (hasOwn(parent, '_uid')) { - contextVm = Object.create(parent); - // $flow-disable-line - contextVm._original = parent; - } else { - // the context vm passed in is a functional context as well. - // in this case we want to make sure we are able to get a hold to the - // real context instance. - contextVm = parent; - // $flow-disable-line - parent = parent._original; +/** + * Reset the scheduler's state. + */ +function resetSchedulerState () { + index = queue.length = activatedChildren.length = 0; + has = {}; + { + circular = {}; } - var isCompiled = isTrue(options._compiled); - var needNormalization = !isCompiled; + waiting = flushing = false; +} - this.data = data; - this.props = props; - this.children = children; - this.parent = parent; - this.listeners = data.on || emptyObject; - this.injections = resolveInject(options.inject, parent); - this.slots = function () { return resolveSlots(children, parent); }; +// Async edge case #6566 requires saving the timestamp when event listeners are +// attached. However, calling performance.now() has a perf overhead especially +// if the page has thousands of event listeners. Instead, we take a timestamp +// every time the scheduler flushes and use that for all event listeners +// attached during that flush. +var currentFlushTimestamp = 0; - Object.defineProperty(this, 'scopedSlots', ({ - enumerable: true, - get: function get () { - return normalizeScopedSlots(data.scopedSlots, this.slots()) - } - })); +// Async edge case fix requires storing an event listener's attach timestamp. +var getNow = Date.now; - // support for compiled functional template - if (isCompiled) { - // exposing $options for renderStatic() - this.$options = options; - // pre-resolve slots for renderSlot() - this.$slots = this.slots(); - this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots); - } +// Determine what event timestamp the browser is using. Annoyingly, the +// timestamp can either be hi-res (relative to page load) or low-res +// (relative to UNIX epoch), so in order to compare time we have to use the +// same timestamp type when saving the flush timestamp. +if (inBrowser && getNow() > document.createEvent('Event').timeStamp) { + // if the low-res timestamp which is bigger than the event timestamp + // (which is evaluated AFTER) it means the event is using a hi-res timestamp, + // and we need to use the hi-res version for event listeners as well. + getNow = function () { return performance.now(); }; +} - if (options._scopeId) { - this._c = function (a, b, c, d) { - var vnode = createElement(contextVm, a, b, c, d, needNormalization); - if (vnode && !Array.isArray(vnode)) { - vnode.fnScopeId = options._scopeId; - vnode.fnContext = parent; +/** + * Flush both queues and run the watchers. + */ +function flushSchedulerQueue () { + currentFlushTimestamp = getNow(); + flushing = true; + var watcher, id; + + // Sort queue before flush. + // This ensures that: + // 1. Components are updated from parent to child. (because parent is always + // created before the child) + // 2. A component's user watchers are run before its render watcher (because + // user watchers are created before the render watcher) + // 3. If a component is destroyed during a parent component's watcher run, + // its watchers can be skipped. + queue.sort(function (a, b) { return a.id - b.id; }); + + // do not cache length because more watchers might be pushed + // as we run existing watchers + for (index = 0; index < queue.length; index++) { + watcher = queue[index]; + if (watcher.before) { + watcher.before(); + } + id = watcher.id; + has[id] = null; + watcher.run(); + // in dev build, check and stop circular updates. + if (has[id] != null) { + circular[id] = (circular[id] || 0) + 1; + if (circular[id] > MAX_UPDATE_COUNT) { + warn( + 'You may have an infinite update loop ' + ( + watcher.user + ? ("in watcher with expression \"" + (watcher.expression) + "\"") + : "in a component render function." + ), + watcher.vm + ); + break } - return vnode - }; - } else { - this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; + } } -} -installRenderHelpers(FunctionalRenderContext.prototype); + // keep copies of post queues before resetting state + var activatedQueue = activatedChildren.slice(); + var updatedQueue = queue.slice(); -function createFunctionalComponent ( - Ctor, - propsData, - data, - contextVm, - children -) { - var options = Ctor.options; - var props = {}; - var propOptions = options.props; - if (isDef(propOptions)) { - for (var key in propOptions) { - props[key] = validateProp(key, propOptions, propsData || emptyObject); - } - } else { - if (isDef(data.attrs)) { mergeProps(props, data.attrs); } - if (isDef(data.props)) { mergeProps(props, data.props); } - } + resetSchedulerState(); - var renderContext = new FunctionalRenderContext( - data, - props, - children, - contextVm, - Ctor - ); + // call component updated and activated hooks + callActivatedHooks(activatedQueue); + callUpdatedHooks(updatedQueue); - var vnode = options.render.call(null, renderContext._c, renderContext); + // devtool hook + /* istanbul ignore if */ + if (devtools && config.devtools) { + devtools.emit('flush'); + } +} - if (vnode instanceof VNode) { - return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) - } else if (Array.isArray(vnode)) { - var vnodes = normalizeChildren(vnode) || []; - var res = new Array(vnodes.length); - for (var i = 0; i < vnodes.length; i++) { - res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); +function callUpdatedHooks (queue) { + var i = queue.length; + while (i--) { + var watcher = queue[i]; + var vm = watcher.vm; + if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { + callHook(vm, 'updated'); } - return res } } -function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { - // #7817 clone node before setting fnContext, otherwise if the node is reused - // (e.g. it was from a cached normal slot) the fnContext causes named slots - // that should not be matched to match. - var clone = cloneVNode(vnode); - clone.fnContext = contextVm; - clone.fnOptions = options; - { - (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; - } - if (data.slot) { - (clone.data || (clone.data = {})).slot = data.slot; +/** + * Queue a kept-alive component that was activated during patch. + * The queue will be processed after the entire tree has been patched. + */ +function queueActivatedComponent (vm) { + // setting _inactive to false here so that a render function can + // rely on checking whether it's in an inactive tree (e.g. router-view) + vm._inactive = false; + activatedChildren.push(vm); +} + +function callActivatedHooks (queue) { + for (var i = 0; i < queue.length; i++) { + queue[i]._inactive = true; + activateChildComponent(queue[i], true /* true */); } - return clone } -function mergeProps (to, from) { - for (var key in from) { - to[camelize(key)] = from[key]; +/** + * Push a watcher into the watcher queue. + * Jobs with duplicate IDs will be skipped unless it's + * pushed when the queue is being flushed. + */ +function queueWatcher (watcher) { + var id = watcher.id; + if (has[id] == null) { + has[id] = true; + if (!flushing) { + queue.push(watcher); + } else { + // if already flushing, splice the watcher based on its id + // if already past its id, it will be run next immediately. + var i = queue.length - 1; + while (i > index && queue[i].id > watcher.id) { + i--; + } + queue.splice(i + 1, 0, watcher); + } + // queue the flush + if (!waiting) { + waiting = true; + + if (!config.async) { + flushSchedulerQueue(); + return + } + nextTick(flushSchedulerQueue); + } } } /* */ -/* */ -/* */ -/* */ +var uid$2 = 0; -// inline hooks to be invoked on component VNodes during patch -var componentVNodeHooks = { - init: function init (vnode, hydrating) { - if ( - vnode.componentInstance && - !vnode.componentInstance._isDestroyed && - vnode.data.keepAlive - ) { - // kept-alive components, treat as a patch - var mountedNode = vnode; // work around flow - componentVNodeHooks.prepatch(mountedNode, mountedNode); - } else { - var child = vnode.componentInstance = createComponentInstanceForVnode( - vnode, - activeInstance +/** + * A watcher parses an expression, collects dependencies, + * and fires callback when the expression value changes. + * This is used for both the $watch() api and directives. + */ +var Watcher = function Watcher ( + vm, + expOrFn, + cb, + options, + isRenderWatcher +) { + this.vm = vm; + if (isRenderWatcher) { + vm._watcher = this; + } + vm._watchers.push(this); + // options + if (options) { + this.deep = !!options.deep; + this.user = !!options.user; + this.lazy = !!options.lazy; + this.sync = !!options.sync; + this.before = options.before; + } else { + this.deep = this.user = this.lazy = this.sync = false; + } + this.cb = cb; + this.id = ++uid$2; // uid for batching + this.active = true; + this.dirty = this.lazy; // for lazy watchers + this.deps = []; + this.newDeps = []; + this.depIds = new _Set(); + this.newDepIds = new _Set(); + this.expression = expOrFn.toString(); + // parse expression for getter + if (typeof expOrFn === 'function') { + this.getter = expOrFn; + } else { + this.getter = parsePath(expOrFn); + if (!this.getter) { + this.getter = noop; + warn( + "Failed watching path: \"" + expOrFn + "\" " + + 'Watcher only accepts simple dot-delimited paths. ' + + 'For full control, use a function instead.', + vm ); - child.$mount(hydrating ? vnode.elm : undefined, hydrating); } - }, - - prepatch: function prepatch (oldVnode, vnode) { - var options = vnode.componentOptions; - var child = vnode.componentInstance = oldVnode.componentInstance; - updateChildComponent( - child, - options.propsData, // updated props - options.listeners, // updated listeners - vnode, // new parent vnode - options.children // new children - ); - }, + } + this.value = this.lazy + ? undefined + : this.get(); +}; - insert: function insert (vnode) { - var context = vnode.context; - var componentInstance = vnode.componentInstance; - if (!componentInstance._isMounted) { - componentInstance._isMounted = true; - callHook(componentInstance, 'mounted'); - } - if (vnode.data.keepAlive) { - if (context._isMounted) { - // vue-router#1212 - // During updates, a kept-alive component's child components may - // change, so directly walking the tree here may call activated hooks - // on incorrect children. Instead we push them into a queue which will - // be processed after the whole patch process ended. - queueActivatedComponent(componentInstance); - } else { - activateChildComponent(componentInstance, true /* direct */); - } +/** + * Evaluate the getter, and re-collect dependencies. + */ +Watcher.prototype.get = function get () { + pushTarget(this); + var value; + var vm = this.vm; + try { + value = this.getter.call(vm, vm); + } catch (e) { + if (this.user) { + handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); + } else { + throw e } - }, - - destroy: function destroy (vnode) { - var componentInstance = vnode.componentInstance; - if (!componentInstance._isDestroyed) { - if (!vnode.data.keepAlive) { - componentInstance.$destroy(); - } else { - deactivateChildComponent(componentInstance, true /* direct */); - } + } finally { + // "touch" every property so they are all tracked as + // dependencies for deep watching + if (this.deep) { + traverse(value); } + popTarget(); + this.cleanupDeps(); } + return value }; -var hooksToMerge = Object.keys(componentVNodeHooks); - -function createComponent ( - Ctor, - data, - context, - children, - tag -) { - if (isUndef(Ctor)) { - return - } - - var baseCtor = context.$options._base; - - // plain options object: turn it into a constructor - if (isObject(Ctor)) { - Ctor = baseCtor.extend(Ctor); - } - - // if at this stage it's not a constructor or an async component factory, - // reject. - if (typeof Ctor !== 'function') { - { - warn(("Invalid Component definition: " + (String(Ctor))), context); +/** + * Add a dependency to this directive. + */ +Watcher.prototype.addDep = function addDep (dep) { + var id = dep.id; + if (!this.newDepIds.has(id)) { + this.newDepIds.add(id); + this.newDeps.push(dep); + if (!this.depIds.has(id)) { + dep.addSub(this); } - return } +}; - // async component - var asyncFactory; - if (isUndef(Ctor.cid)) { - asyncFactory = Ctor; - Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context); - if (Ctor === undefined) { - // return a placeholder node for async component, which is rendered - // as a comment node but preserves all the raw information for the node. - // the information will be used for async server-rendering and hydration. - return createAsyncPlaceholder( - asyncFactory, - data, - context, - children, - tag - ) +/** + * Clean up for dependency collection. + */ +Watcher.prototype.cleanupDeps = function cleanupDeps () { + var i = this.deps.length; + while (i--) { + var dep = this.deps[i]; + if (!this.newDepIds.has(dep.id)) { + dep.removeSub(this); } } + var tmp = this.depIds; + this.depIds = this.newDepIds; + this.newDepIds = tmp; + this.newDepIds.clear(); + tmp = this.deps; + this.deps = this.newDeps; + this.newDeps = tmp; + this.newDeps.length = 0; +}; - data = data || {}; - - // resolve constructor options in case global mixins are applied after - // component constructor creation - resolveConstructorOptions(Ctor); - - // transform component v-model data into props & events - if (isDef(data.model)) { - transformModel(Ctor.options, data); - } - - // extract props - var propsData = extractPropsFromVNodeData(data, Ctor, tag); - - // functional component - if (isTrue(Ctor.options.functional)) { - return createFunctionalComponent(Ctor, propsData, data, context, children) +/** + * Subscriber interface. + * Will be called when a dependency changes. + */ +Watcher.prototype.update = function update () { + /* istanbul ignore else */ + if (this.lazy) { + this.dirty = true; + } else if (this.sync) { + this.run(); + } else { + queueWatcher(this); } +}; - // extract listeners, since these needs to be treated as - // child component listeners instead of DOM listeners - var listeners = data.on; - // replace with listeners with .native modifier - // so it gets processed during parent component patch. - data.on = data.nativeOn; - - if (isTrue(Ctor.options.abstract)) { - // abstract components do not keep anything - // other than props & listeners & slot - - // work around flow - var slot = data.slot; - data = {}; - if (slot) { - data.slot = slot; +/** + * Scheduler job interface. + * Will be called by the scheduler. + */ +Watcher.prototype.run = function run () { + if (this.active) { + var value = this.get(); + if ( + value !== this.value || + // Deep watchers and watchers on Object/Arrays should fire even + // when the value is the same, because the value may + // have mutated. + isObject(value) || + this.deep + ) { + // set new value + var oldValue = this.value; + this.value = value; + if (this.user) { + try { + this.cb.call(this.vm, value, oldValue); + } catch (e) { + handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\"")); + } + } else { + this.cb.call(this.vm, value, oldValue); + } } } +}; - // install component management hooks onto the placeholder node - installComponentHooks(data); - - // return a placeholder vnode - var name = Ctor.options.name || tag; - 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 - ); - - return vnode -} - -function createComponentInstanceForVnode ( - vnode, // we know it's MountedComponentVNode but flow doesn't - parent // activeInstance in lifecycle state -) { - var options = { - _isComponent: true, - _parentVnode: vnode, - parent: parent - }; - // check inline-template render functions - var inlineTemplate = vnode.data.inlineTemplate; - if (isDef(inlineTemplate)) { - options.render = inlineTemplate.render; - options.staticRenderFns = inlineTemplate.staticRenderFns; - } - return new vnode.componentOptions.Ctor(options) -} +/** + * Evaluate the value of the watcher. + * This only gets called for lazy watchers. + */ +Watcher.prototype.evaluate = function evaluate () { + this.value = this.get(); + this.dirty = false; +}; -function installComponentHooks (data) { - var hooks = data.hook || (data.hook = {}); - for (var i = 0; i < hooksToMerge.length; i++) { - var key = hooksToMerge[i]; - var existing = hooks[key]; - var toMerge = componentVNodeHooks[key]; - if (existing !== toMerge && !(existing && existing._merged)) { - hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge; - } +/** + * Depend on all deps collected by this watcher. + */ +Watcher.prototype.depend = function depend () { + var i = this.deps.length; + while (i--) { + this.deps[i].depend(); } -} - -function mergeHook$1 (f1, f2) { - var merged = function (a, b) { - // flow complains about extra args which is why we use any - f1(a, b); - f2(a, b); - }; - merged._merged = true; - return merged -} +}; -// transform component v-model info (value and callback) into -// prop and event handler respectively. -function transformModel (options, data) { - var prop = (options.model && options.model.prop) || 'value'; - var event = (options.model && options.model.event) || 'input' - ;(data.attrs || (data.attrs = {}))[prop] = data.model.value; - var on = data.on || (data.on = {}); - var existing = on[event]; - var callback = data.model.callback; - if (isDef(existing)) { - if ( - Array.isArray(existing) - ? existing.indexOf(callback) === -1 - : existing !== callback - ) { - on[event] = [callback].concat(existing); +/** + * Remove self from all dependencies' subscriber list. + */ +Watcher.prototype.teardown = function teardown () { + if (this.active) { + // remove self from vm's watcher list + // this is a somewhat expensive operation so we skip it + // if the vm is being destroyed. + if (!this.vm._isBeingDestroyed) { + remove(this.vm._watchers, this); } - } else { - on[event] = callback; + var i = this.deps.length; + while (i--) { + this.deps[i].removeSub(this); + } + this.active = false; } -} +}; /* */ -var SIMPLE_NORMALIZE = 1; -var ALWAYS_NORMALIZE = 2; +var sharedPropertyDefinition = { + enumerable: true, + configurable: true, + get: noop, + set: noop +}; -// wrapper function for providing a more flexible interface -// without getting yelled at by flow -function createElement ( - context, - tag, - data, - children, - normalizationType, - alwaysNormalize -) { - if (Array.isArray(data) || isPrimitive(data)) { - normalizationType = children; - children = data; - data = undefined; +function proxy (target, sourceKey, key) { + sharedPropertyDefinition.get = function proxyGetter () { + return this[sourceKey][key] + }; + sharedPropertyDefinition.set = function proxySetter (val) { + this[sourceKey][key] = val; + }; + Object.defineProperty(target, key, sharedPropertyDefinition); +} + +function initState (vm) { + vm._watchers = []; + var opts = vm.$options; + if (opts.props) { initProps(vm, opts.props); } + if (opts.methods) { initMethods(vm, opts.methods); } + if (opts.data) { + initData(vm); + } else { + observe(vm._data = {}, true /* asRootData */); } - if (isTrue(alwaysNormalize)) { - normalizationType = ALWAYS_NORMALIZE; + if (opts.computed) { initComputed(vm, opts.computed); } + if (opts.watch && opts.watch !== nativeWatch) { + initWatch(vm, opts.watch); } - return _createElement(context, tag, data, children, normalizationType) } -function _createElement ( - context, - tag, - data, - children, - normalizationType -) { - if (isDef(data) && isDef((data).__ob__)) { +function initProps (vm, propsOptions) { + var propsData = vm.$options.propsData || {}; + var props = vm._props = {}; + // cache prop keys so that future props updates can iterate using Array + // instead of dynamic object key enumeration. + var keys = vm.$options._propKeys = []; + var isRoot = !vm.$parent; + // root instance props should be converted + if (!isRoot) { + toggleObserving(false); + } + var loop = function ( key ) { + keys.push(key); + var value = validateProp(key, propsOptions, propsData, vm); + /* istanbul ignore else */ + { + var hyphenatedKey = hyphenate(key); + if (isReservedAttribute(hyphenatedKey) || + config.isReservedAttr(hyphenatedKey)) { + warn( + ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), + vm + ); + } + defineReactive$$1(props, key, value, function () { + if (!isRoot && !isUpdatingChildComponent) { + 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 + ); + } + }); + } + // static props are already proxied on the component's prototype + // during Vue.extend(). We only need to proxy props defined at + // instantiation here. + if (!(key in vm)) { + proxy(vm, "_props", key); + } + }; + + for (var key in propsOptions) loop( key ); + toggleObserving(true); +} + +function initData (vm) { + var data = vm.$options.data; + data = vm._data = typeof data === 'function' + ? getData(data, vm) + : data || {}; + if (!isPlainObject(data)) { + data = {}; warn( - "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + - 'Always create fresh vnode data objects in each render!', - context + 'data functions should return an object:\n' + + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', + vm ); - return createEmptyVNode() - } - // object syntax in v-bind - if (isDef(data) && isDef(data.is)) { - tag = data.is; - } - if (!tag) { - // in case of component :is set to falsy value - return createEmptyVNode() } - // warn against non-primitive key - if (isDef(data) && isDef(data.key) && !isPrimitive(data.key) - ) { + // proxy data on instance + var keys = Object.keys(data); + var props = vm.$options.props; + var methods = vm.$options.methods; + var i = keys.length; + while (i--) { + var key = keys[i]; { + if (methods && hasOwn(methods, key)) { + warn( + ("Method \"" + key + "\" has already been defined as a data property."), + vm + ); + } + } + if (props && hasOwn(props, key)) { warn( - 'Avoid using non-primitive value as key, ' + - 'use string/number value instead.', - context + "The data property \"" + key + "\" is already declared as a prop. " + + "Use prop default value instead.", + vm ); + } else if (!isReserved(key)) { + proxy(vm, "_data", key); } } - // support single function children as default scoped slot - if (Array.isArray(children) && - typeof children[0] === 'function' - ) { - data = data || {}; - data.scopedSlots = { default: children[0] }; - children.length = 0; - } - if (normalizationType === ALWAYS_NORMALIZE) { - children = normalizeChildren(children); - } else if (normalizationType === SIMPLE_NORMALIZE) { - children = simpleNormalizeChildren(children); + // observe data + observe(data, true /* asRootData */); +} + +function getData (data, vm) { + // #7573 disable dep collection when invoking data getters + pushTarget(); + try { + return data.call(vm, vm) + } catch (e) { + handleError(e, vm, "data()"); + return {} + } finally { + popTarget(); } - var vnode, ns; - if (typeof tag === 'string') { - var Ctor; - ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); - if (config.isReservedTag(tag)) { - // platform built-in elements - vnode = new VNode( - config.parsePlatformTagName(tag), data, children, - undefined, undefined, context +} + +var computedWatcherOptions = { lazy: true }; + +function initComputed (vm, computed) { + // $flow-disable-line + var watchers = vm._computedWatchers = Object.create(null); + // computed properties are just getters during SSR + var isSSR = isServerRendering(); + + for (var key in computed) { + var userDef = computed[key]; + var getter = typeof userDef === 'function' ? userDef : userDef.get; + if (getter == null) { + warn( + ("Getter is missing for computed property \"" + key + "\"."), + vm ); - } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { - // component - vnode = createComponent(Ctor, data, context, children, tag); - } else { - // unknown or unlisted namespaced elements - // check at runtime because it may get assigned a namespace when its - // parent normalizes children - vnode = new VNode( - tag, data, children, - undefined, undefined, context + } + + if (!isSSR) { + // create internal watcher for the computed property. + watchers[key] = new Watcher( + vm, + getter || noop, + noop, + computedWatcherOptions ); } + + // component-defined computed properties are already defined on the + // component prototype. We only need to define computed properties defined + // at instantiation here. + if (!(key in vm)) { + defineComputed(vm, key, userDef); + } else { + if (key in vm.$data) { + warn(("The computed property \"" + key + "\" is already defined in data."), vm); + } else if (vm.$options.props && key in vm.$options.props) { + warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); + } + } + } +} + +function defineComputed ( + target, + key, + userDef +) { + var shouldCache = !isServerRendering(); + if (typeof userDef === 'function') { + sharedPropertyDefinition.get = shouldCache + ? createComputedGetter(key) + : createGetterInvoker(userDef); + sharedPropertyDefinition.set = noop; } else { - // direct component options / constructor - vnode = createComponent(tag, data, context, children); + sharedPropertyDefinition.get = userDef.get + ? shouldCache && userDef.cache !== false + ? createComputedGetter(key) + : createGetterInvoker(userDef.get) + : noop; + sharedPropertyDefinition.set = userDef.set || noop; } - if (Array.isArray(vnode)) { - return vnode - } else if (isDef(vnode)) { - if (isDef(ns)) { applyNS(vnode, ns); } - if (isDef(data)) { registerDeepBindings(data); } - return vnode - } else { - return createEmptyVNode() + if (sharedPropertyDefinition.set === noop) { + sharedPropertyDefinition.set = function () { + warn( + ("Computed property \"" + key + "\" was assigned to but it has no setter."), + this + ); + }; } + Object.defineProperty(target, key, sharedPropertyDefinition); } -function applyNS (vnode, ns, force) { - vnode.ns = ns; - if (vnode.tag === 'foreignObject') { - // use default namespace inside foreignObject - ns = undefined; - force = true; - } - if (isDef(vnode.children)) { - for (var i = 0, l = vnode.children.length; i < l; i++) { - var child = vnode.children[i]; - if (isDef(child.tag) && ( - isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { - applyNS(child, ns, force); +function createComputedGetter (key) { + return function computedGetter () { + var watcher = this._computedWatchers && this._computedWatchers[key]; + if (watcher) { + if (watcher.dirty) { + watcher.evaluate(); } + if (Dep.target) { + watcher.depend(); + } + return watcher.value } } } -// ref #5318 -// necessary to ensure parent re-render when deep bindings like :style and -// :class are used on slot nodes -function registerDeepBindings (data) { - if (isObject(data.style)) { - traverse(data.style); - } - if (isObject(data.class)) { - traverse(data.class); +function createGetterInvoker(fn) { + return function computedGetter () { + return fn.call(this, this) } } -/* */ - -function initRender (vm) { - vm._vnode = null; // the root of the child tree - vm._staticTrees = null; // v-once cached trees - var options = vm.$options; - var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree - var renderContext = parentVnode && parentVnode.context; - vm.$slots = resolveSlots(options._renderChildren, renderContext); - vm.$scopedSlots = emptyObject; - // bind the createElement fn to this instance - // so that we get proper render context inside it. - // args order: tag, data, children, normalizationType, alwaysNormalize - // internal version is used by render functions compiled from templates - vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; - // normalization is always applied for the public version, used in - // user-written render functions. - vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; +function initMethods (vm, methods) { + var props = vm.$options.props; + for (var key in methods) { + { + if (typeof methods[key] !== 'function') { + warn( + "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + + "Did you reference the function correctly?", + vm + ); + } + if (props && hasOwn(props, key)) { + warn( + ("Method \"" + key + "\" has already been defined as a prop."), + vm + ); + } + if ((key in vm) && isReserved(key)) { + warn( + "Method \"" + key + "\" conflicts with an existing Vue instance method. " + + "Avoid defining component methods that start with _ or $." + ); + } + } + vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); + } +} - // $attrs & $listeners are exposed for easier HOC creation. - // they need to be reactive so that HOCs using them are always updated - var parentData = parentVnode && parentVnode.data; +function initWatch (vm, watch) { + for (var key in watch) { + var handler = watch[key]; + if (Array.isArray(handler)) { + for (var i = 0; i < handler.length; i++) { + createWatcher(vm, key, handler[i]); + } + } else { + createWatcher(vm, key, handler); + } + } +} - /* istanbul ignore else */ - { - defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { - !isUpdatingChildComponent && warn("$attrs is readonly.", vm); - }, true); - defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { - !isUpdatingChildComponent && warn("$listeners is readonly.", vm); - }, true); +function createWatcher ( + vm, + expOrFn, + handler, + options +) { + if (isPlainObject(handler)) { + options = handler; + handler = handler.handler; + } + if (typeof handler === 'string') { + handler = vm[handler]; } + return vm.$watch(expOrFn, handler, options) } -function renderMixin (Vue) { - // install runtime convenience helpers - installRenderHelpers(Vue.prototype); +function stateMixin (Vue) { + // flow somehow has problems with directly declared definition object + // when using Object.defineProperty, so we have to procedurally build up + // the object here. + var dataDef = {}; + dataDef.get = function () { return this._data }; + var propsDef = {}; + propsDef.get = function () { return this._props }; + { + dataDef.set = function () { + warn( + 'Avoid replacing instance root $data. ' + + 'Use nested data properties instead.', + this + ); + }; + propsDef.set = function () { + warn("$props is readonly.", this); + }; + } + Object.defineProperty(Vue.prototype, '$data', dataDef); + Object.defineProperty(Vue.prototype, '$props', propsDef); - Vue.prototype.$nextTick = function (fn) { - return nextTick(fn, this) - }; + Vue.prototype.$set = set; + Vue.prototype.$delete = del; - Vue.prototype._render = function () { + Vue.prototype.$watch = function ( + expOrFn, + cb, + options + ) { var vm = this; - var ref = vm.$options; - var render = ref.render; - var _parentVnode = ref._parentVnode; - - if (_parentVnode) { - vm.$scopedSlots = normalizeScopedSlots( - _parentVnode.data.scopedSlots, - vm.$slots - ); + if (isPlainObject(cb)) { + return createWatcher(vm, expOrFn, cb, options) } - - // set parent vnode. this allows render functions to have access - // to the data on the placeholder node. - vm.$vnode = _parentVnode; - // render self - var vnode; - try { - vnode = render.call(vm._renderProxy, vm.$createElement); - } catch (e) { - handleError(e, vm, "render"); - // return error render result, - // or previous vnode to prevent render error causing blank component - /* istanbul ignore else */ - if (vm.$options.renderError) { - try { - vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); - } catch (e) { - handleError(e, vm, "renderError"); - vnode = vm._vnode; - } - } else { - vnode = vm._vnode; + options = options || {}; + options.user = true; + var watcher = new Watcher(vm, expOrFn, cb, options); + if (options.immediate) { + try { + cb.call(vm, watcher.value); + } catch (error) { + handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\"")); } } - // if the returned array contains only a single node, allow it - if (Array.isArray(vnode) && vnode.length === 1) { - vnode = vnode[0]; - } - // return empty vnode in case the render function errored out - if (!(vnode instanceof VNode)) { - if (Array.isArray(vnode)) { - warn( - 'Multiple root nodes returned from render function. Render function ' + - 'should return a single root node.', - vm - ); - } - vnode = createEmptyVNode(); + return function unwatchFn () { + watcher.teardown(); } - // set parent - vnode.parent = _parentVnode; - return vnode }; } @@ -5328,7 +5331,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', { value: FunctionalRenderContext }); -Vue.version = '2.6.2'; +Vue.version = '2.6.3'; /* */ @@ -7392,6 +7395,11 @@ function createOnceHandler$1 (event, handler, capture) { } } +// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp +// implementation and does not fire microtasks in between event propagation, so +// safe to exclude. +var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53); + function add$1 ( name, handler, @@ -7404,11 +7412,16 @@ function add$1 ( // the solution is simple: we save the timestamp when a handler is attached, // and the handler would only fire if the event passed to it was fired // AFTER it was attached. - if (isUsingMicroTask) { + if (useMicrotaskFix) { var attachedTimestamp = currentFlushTimestamp; var original = handler; handler = original._wrapper = function (e) { - if (e.timeStamp >= attachedTimestamp) { + if ( + e.timeStamp >= attachedTimestamp || + // #9448 bail if event is fired in another document in a multi-page + // electron/nw.js app + e.target.ownerDocument !== document + ) { return original.apply(this, arguments) } }; @@ -9420,6 +9433,8 @@ var invalidAttributeRE = /[\s"'<>\/=]/; var decodeHTMLCached = cached(he.decode); +var emptySlotScopeToken = "_empty_"; + // configurable state var warn$2; var delimiters; @@ -10032,7 +10047,7 @@ function processSlotContent (el) { var dynamic = ref.dynamic; el.slotTarget = name; el.slotTargetDynamic = dynamic; - el.slotScope = slotBinding.value || "_"; // force it into a scoped slot for perf + el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf } } else { // v-slot on component, denotes default slot @@ -10067,8 +10082,13 @@ function processSlotContent (el) { var slotContainer = slots[name$1] = createASTElement('template', [], el); slotContainer.slotTarget = name$1; slotContainer.slotTargetDynamic = dynamic$1; - slotContainer.children = el.children.filter(function (c) { return !(c).slotScope; }); - slotContainer.slotScope = slotBinding$1.value || "_"; + slotContainer.children = el.children.filter(function (c) { + if (!c.slotScope) { + c.parent = slotContainer; + return true + } + }); + slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken; // remove children as they are returned from scopedSlots now el.children = []; // mark el non-plain so data gets generated @@ -10997,7 +11017,7 @@ function genData$2 (el, state) { } // scoped slots if (el.scopedSlots) { - data += (genScopedSlots(el.scopedSlots, state)) + ","; + data += (genScopedSlots(el, el.scopedSlots, state)) + ","; } // component v-model if (el.model) { @@ -11068,16 +11088,34 @@ function genInlineTemplate (el, state) { } function genScopedSlots ( + el, slots, state ) { - var hasDynamicKeys = Object.keys(slots).some(function (key) { + // by default scoped slots are considered "stable", this allows child + // components with only scoped slots to skip forced updates from parent. + // but in some cases we have to bail-out of this optimization + // for example if the slot contains dynamic names, has v-if or v-for on them... + var needsForceUpdate = Object.keys(slots).some(function (key) { var slot = slots[key]; return slot.slotTargetDynamic || slot.if || slot.for }); + // OR when it is inside another scoped slot (the reactivity is disconnected) + // #9438 + if (!needsForceUpdate) { + var parent = el.parent; + while (parent) { + if (parent.slotScope && parent.slotScope !== emptySlotScopeToken) { + needsForceUpdate = true; + break + } + parent = parent.parent; + } + } + return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) { return genScopedSlot(slots[key], state) - }).join(',')) + "]" + (hasDynamicKeys ? ",true" : "") + ")") + }).join(',')) + "]" + (needsForceUpdate ? ",true" : "") + ")") } function genScopedSlot ( @@ -11091,7 +11129,10 @@ function genScopedSlot ( if (el.for && !el.forProcessed) { return genFor(el, state, genScopedSlot) } - var fn = "function(" + (String(el.slotScope)) + "){" + + var slotScope = el.slotScope === emptySlotScopeToken + ? "" + : String(el.slotScope); + var fn = "function(" + slotScope + "){" + "return " + (el.tag === 'template' ? el.if && isLegacySyntax ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined") @@ -11184,7 +11225,14 @@ function genSlot (el, state) { var slotName = el.slotName || '"default"'; var children = genChildren(el, state); var res = "_t(" + slotName + (children ? ("," + children) : ''); - var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}"); + var attrs = el.attrs || el.dynamicAttrs + ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({ + // slot props are camelized + name: camelize(attr.name), + value: attr.value, + dynamic: attr.dynamic + }); })) + : null; var bind$$1 = el.attrsMap['v-bind']; if ((attrs || bind$$1) && !children) { res += ",null"; diff --git a/dist/vue.common.prod.js b/dist/vue.common.prod.js index 44e1c7f6..2c7c8c6b 100644 --- a/dist/vue.common.prod.js +++ b/dist/vue.common.prod.js @@ -1,6 +1,6 @@ /*! - * Vue.js v2.6.2 + * Vue.js v2.6.3 * (c) 2014-2019 Evan You * Released under the MIT License. */ -"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function A(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,W=K&&K.indexOf("edge/")>0,Z=(K&&K.indexOf("android"),K&&/iphone|ipad|ipod|ios/.test(K)||"ios"===V),G=(K&&/chrome\/\d+/.test(K),K&&/phantomjs/.test(K),{}.watch),X=!1;if(U)try{var Y={};Object.defineProperty(Y,"passive",{get:function(){X=!0}}),window.addEventListener("test-passive",null,Y)}catch(e){}var Q=function(){return void 0===H&&(H=!U&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),H},ee=U&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function te(e){return"function"==typeof e&&/native code/.test(e.toString())}var ne,re="undefined"!=typeof Symbol&&te(Symbol)&&"undefined"!=typeof Reflect&&te(Reflect.ownKeys);ne="undefined"!=typeof Set&&te(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ie=S,oe=0,ae=function(){this.id=oe++,this.subs=[]};ae.prototype.addSub=function(e){this.subs.push(e)},ae.prototype.removeSub=function(e){h(this.subs,e)},ae.prototype.depend=function(){ae.target&&ae.target.addDep(this)},ae.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=De(String,i.type);(c<0||s0&&(at((u=e(u,(a||"")+"_"+c))[0])&&at(f)&&(s[l]=de(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?at(f)?s[l]=de(f.text+u):""!==u&&s.push(de(u)):at(u)&&at(f)?s[l]=de(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function at(e){return n(e)&&n(e.text)&&!1===e.isComment}function st(e,t){return(e.__esModule||re&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function ct(e){return e.isComment&&e.asyncFactory}function ut(e){if(Array.isArray(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(Tt=function(){return performance.now()});var Nt=0,jt=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Nt,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ne,this.newDepIds=new ne,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!F.test(e)){var t=e.split(".");return function(e){for(var n=0;nOt&&wt[n].id>e.id;)n--;wt.splice(n+1,0,e)}else wt.push(e);At||(At=!0,Ge(Et))}}(this)},jt.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Pe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},jt.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},jt.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},jt.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Lt={enumerable:!0,configurable:!0,get:S,set:S};function Mt(e,t,n){Lt.get=function(){return this[t][n]},Lt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Lt)}function It(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&_e(!1);var o=function(o){i.push(o);var a=Le(o,t,n,e);we(r,o,a),o in e||Mt(e,"_props",o)};for(var a in t)o(a);_e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){ce();try{return e.call(t,t)}catch(e){return Pe(e,t,"data()"),{}}finally{ue()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Mt(e,"_data",o))}var a;$e(t,!0)}(e):$e(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Q();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new jt(e,a||S,S,Dt)),i in e||Pt(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function wn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=bn(a.componentOptions);s&&!t(s)&&Cn(n,o,r,i)}}}function Cn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=mn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(yn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&dt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=vt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return hn(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return hn(t,e,n,r,i,!0)};var o=r&&r.data;we(t,"$attrs",o&&o.attrs||e,null,!0),we(t,"$listeners",n._parentListeners||e,null,!0)}(n),$t(n,"beforeCreate"),function(e){var t=Bt(e.$options.inject,e);t&&(_e(!1),Object.keys(t).forEach(function(n){we(e,n,t[n])}),_e(!0))}(n),It(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),$t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(gn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ce,e.prototype.$delete=xe,e.prototype.$watch=function(e,t,n){if(s(t))return Ht(this,e,t,n);(n=n||{}).user=!0;var r=new jt(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Pe(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(gn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?A(t):t;for(var n=A(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&Cn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return P}};Object.defineProperty(e,"config",t),e.util={warn:ie,extend:k,mergeOptions:Ne,defineReactive:we},e.set=Ce,e.delete=xe,e.nextTick=Ge,e.observable=function(e){return $e(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,An),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=A(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),_n(e),function(e){I.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(gn),Object.defineProperty(gn.prototype,"$isServer",{get:Q}),Object.defineProperty(gn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(gn,"FunctionalRenderContext",{value:an}),gn.version="2.6.2";var kn=p("style,class"),On=p("input,textarea,option,select,progress"),Sn=function(e,t,n){return"value"===n&&On(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Tn=p("contenteditable,draggable,spellcheck"),En=p("events,caret,typing,plaintext-only"),Nn=function(e,t){return Dn(t)||"false"===t?"false":"contenteditable"===e&&En(t)?t:"true"},jn=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ln="http://www.w3.org/1999/xlink",Mn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},In=function(e){return Mn(e)?e.slice(6,e.length):""},Dn=function(e){return null==e||!1===e};function Pn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Rn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Rn(t,r.data));return function(e,t){if(n(e)||n(t))return Fn(e,Hn(t));return""}(t.staticClass,t.class)}function Rn(e,t){return{staticClass:Fn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Fn(e,t){return e?t?e+" "+t:e:t||""}function Hn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?fr(e,t,n):jn(t)?Dn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Tn(t)?e.setAttribute(t,Nn(t,n)):Mn(t)?Dn(n)?e.removeAttributeNS(Ln,In(t)):e.setAttributeNS(Ln,t,n):fr(e,t,n)}function fr(e,t,n){if(Dn(n))e.removeAttribute(t);else{if(J&&!q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var pr={create:ur,update:ur};function dr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Pn(r),c=i._transitionClasses;n(c)&&(s=Fn(s,Hn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var vr,hr,mr,yr,gr,_r,br={create:dr,update:dr},$r=/[\w).+\-_$\]]/;function wr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&$r.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,yr),key:'"'+e.slice(yr+1)+'"'}:{exp:e,key:null};hr=e,yr=gr=_r=0;for(;!Fr();)Hr(mr=Rr())?Ur(mr):91===mr&&Br(mr);return{exp:e.slice(0,gr),key:e.slice(gr+1,_r)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Rr(){return hr.charCodeAt(++yr)}function Fr(){return yr>=vr}function Hr(e){return 34===e||39===e}function Br(e){var t=1;for(gr=yr;!Fr();)if(Hr(e=Rr()))Ur(e);else if(91===e&&t++,93===e&&t--,0===t){_r=yr;break}}function Ur(e){for(var t=e;!Fr()&&(e=Rr())!==t;);}var zr,Vr="__r",Kr="__c";function Jr(e,t,n){var r=zr;return function i(){null!==t.apply(null,arguments)&&Wr(e,i,n,r)}}function qr(e,t,n,r){if(Ue){var i=St,o=t;t=o._wrapper=function(e){if(e.timeStamp>=i)return o.apply(this,arguments)}}zr.addEventListener(e,t,X?{capture:n,passive:r}:n)}function Wr(e,t,n,r){(r||zr).removeEventListener(e,t._wrapper||t,n)}function Zr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};zr=r.elm,function(e){if(n(e[Vr])){var t=J?"change":"input";e[t]=[].concat(e[Vr],e[t]||[]),delete e[Vr]}n(e[Kr])&&(e.change=[].concat(e[Kr],e.change||[]),delete e[Kr])}(i),nt(i,o,qr,Wr,Jr,r.context),zr=void 0}}var Gr,Xr={create:Zr,update:Zr};function Yr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i||o!==s[i])if("value"===i){a._value=o;var u=t(o)?"":String(o);Qr(a,u)&&(a.value=u)}else if("innerHTML"===i&&zn(a.tagName)&&t(a.innerHTML)){(Gr=Gr||document.createElement("div")).innerHTML=""+o+"";for(var l=Gr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else a[i]=o}}}function Qr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var ei={create:Yr,update:Yr},ti=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function ni(e){var t=ri(e.style);return e.staticStyle?k(e.staticStyle,t):t}function ri(e){return Array.isArray(e)?O(e):"string"==typeof e?ti(e):e}var ii,oi=/^--/,ai=/\s*!important$/,si=function(e,t,n){if(oi.test(t))e.style.setProperty(t,n);else if(ai.test(n))e.style.setProperty(C(t),n.replace(ai,""),"important");else{var r=ui(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(pi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function vi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(pi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function hi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,mi(e.name||"v")),k(t,e),t}return"string"==typeof e?mi(e):void 0}}var mi=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),yi=U&&!q,gi="transition",_i="animation",bi="transition",$i="transitionend",wi="animation",Ci="animationend";yi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(bi="WebkitTransition",$i="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(wi="WebkitAnimation",Ci="webkitAnimationEnd"));var xi=U?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ai(e){xi(function(){xi(e)})}function ki(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),di(e,t))}function Oi(e,t){e._transitionClasses&&h(e._transitionClasses,t),vi(e,t)}function Si(e,t,n){var r=Ei(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===gi?$i:Ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=gi,l=a,f=o.length):t===_i?u>0&&(n=_i,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?gi:_i:null)?n===gi?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===gi&&Ti.test(r[bi+"Property"])}}function Ni(e,t){for(;e.length1}function Pi(e,t){!0!==t.data.show&&Li(t)}var Ri=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function A(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(zi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Ui(e,t){return t.every(function(t){return!N(t,e)})}function zi(e){return"_value"in e?e._value:e.value}function Vi(e){e.target.composing=!0}function Ki(e){e.target.composing&&(e.target.composing=!1,Ji(e.target,"input"))}function Ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function qi(e){return!e.componentInstance||e.data&&e.data.transition?e:qi(e.componentInstance._vnode)}var Wi={model:Fi,show:{bind:function(e,t,n){var r=t.value,i=(n=qi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Li(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=qi(n)).data&&n.data.transition?(n.data.show=!0,r?Li(n,function(){e.style.display=e.__vOriginalDisplay}):Mi(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Zi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Gi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Gi(ut(t.children)):e}function Xi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function Yi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Qi=function(e){return e.tag||ct(e)},eo=function(e){return"show"===e.name},to={name:"transition",props:Zi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Qi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Gi(o);if(!a)return o;if(this._leaving)return Yi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Xi(this),u=this._vnode,l=Gi(u);if(a.data.directives&&a.data.directives.some(eo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!ct(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,rt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Yi(e,o);if("in-out"===r){if(ct(a))return u;var p,d=function(){p()};rt(c,"afterEnter",d),rt(c,"enterCancelled",d),rt(f,"delayLeave",function(e){p=e})}}return o}}},no=k({tag:String,moveClass:String},Zi);function ro(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function io(e){e.data.newPos=e.elm.getBoundingClientRect()}function oo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete no.mode;var ao={Transition:to,TransitionGroup:{props:no,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=gt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Xi(this),s=0;s-1?Jn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Jn[e]=/HTMLUnknownElement/.test(t.toString())},k(gn.options.directives,Wi),k(gn.options.components,ao),gn.prototype.__patch__=U?Ri:S,gn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=pe),$t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new jt(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&$t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,$t(e,"mounted")),e}(this,e=e&&U?Wn(e):void 0,t)},U&&setTimeout(function(){P.devtools&&ee&&ee.emit("init",gn)},0);var so=/\{\{((?:.|\r?\n)+?)\}\}/g,co=/[-.*+?^${}()|[\]\/\\]/g,uo=g(function(e){var t=e[0].replace(co,"\\$&"),n=e[1].replace(co,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var lo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Lr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=jr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var fo,po={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Lr(e,"style");n&&(e.staticStyle=JSON.stringify(ti(n)));var r=jr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},vo=function(e){return(fo=fo||document.createElement("div")).innerHTML=e,fo.textContent},ho=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),mo=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),yo=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),go=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,_o=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,bo="[a-zA-Z_][\\-\\.0-9_a-zA-Za-zA-Z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]*",$o="((?:"+bo+"\\:)?"+bo+")",wo=new RegExp("^<"+$o),Co=/^\s*(\/?)>/,xo=new RegExp("^<\\/"+$o+"[^>]*>"),Ao=/^]+>/i,ko=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},No=/&(?:lt|gt|quot|amp|#39);/g,jo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Lo=p("pre,textarea",!0),Mo=function(e,t){return e&&Lo(e)&&"\n"===t[0]};function Io(e,t){var n=t?jo:No;return e.replace(n,function(e){return Eo[e]})}var Do,Po,Ro,Fo,Ho,Bo,Uo,zo,Vo=/^@|^v-on:/,Ko=/^v-|^@|^:/,Jo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,qo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Wo=/^\(|\)$/g,Zo=/^\[.*\]$/,Go=/:(.*)$/,Xo=/^:|^\.|^v-bind:/,Yo=/\.[^.]+/g,Qo=/^v-slot(:|$)|^#/,ea=/[\r\n]/,ta=/\s+/g,na=g(vo);function ra(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:la(t),rawAttrsMap:{},parent:n,children:[]}}function ia(e,t){Do=t.warn||xr,Bo=t.isPreTag||T,Uo=t.mustUseProp||T,zo=t.getTagNamespace||T;t.isReservedTag;Ro=Ar(t.modules,"transformNode"),Fo=Ar(t.modules,"preTransformNode"),Ho=Ar(t.modules,"postTransformNode"),Po=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=oa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&sa(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&sa(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Bo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,So(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Mo(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,k(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(ko.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(Oo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Ao);if(m){C(m[0].length);continue}var y=e.match(xo);if(y){var g=c;C(y[0].length),k(y[1],g,c);continue}var _=x();if(_){A(_),Mo(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(xo.test($)||wo.test($)||ko.test($)||Oo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(wo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(Co))&&(r=e.match(_o)||e.match(go));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function A(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&yo(n)&&k(r),s(n)&&r===n&&k(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}k()}(e,{warn:Do,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l){var f=r&&r.ns||zo(e);J&&"svg"===f&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=wr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Nr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Pr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Pr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Pr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=jr(e,"value")||"null";kr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Nr(e,"change",Pr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Vr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Pr(t,l);c&&(f="if($event.target.composing)return;"+f),kr(e,"value","("+t+")"),Nr(e,u,f,null,!0),(s||a)&&Nr(e,"blur","$forceUpdate()")}(e,r,i);else if(!P.isReservedTag(o))return Dr(e,r,i),!1;return!0},text:function(e,t){t.value&&kr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&kr(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:ho,mustUseProp:Sn,canBeLeftOpenTag:mo,isReservedTag:Vn,getTagNamespace:Kn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(va)},ga=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function _a(e,t){e&&(ha=ga(t.staticKeys||""),ma=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!ma(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(ha)))}(t);if(1===t.type){if(!ma(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,$a=/\([^)]*?\);*$/,wa=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ca={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},xa={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Aa=function(e){return"if("+e+")return null;"},ka={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Aa("$event.target !== $event.currentTarget"),ctrl:Aa("!$event.ctrlKey"),shift:Aa("!$event.shiftKey"),alt:Aa("!$event.altKey"),meta:Aa("!$event.metaKey"),left:Aa("'button' in $event && $event.button !== 0"),middle:Aa("'button' in $event && $event.button !== 1"),right:Aa("'button' in $event && $event.button !== 2")};function Oa(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Sa(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Sa(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Sa(e)}).join(",")+"]";var t=wa.test(e.value),n=ba.test(e.value),r=wa.test(e.value.replace($a,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ka[s])o+=ka[s],Ca[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=Aa(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(('keyCode' in $event)&&"+e.map(Ta).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ta(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ca[e],r=xa[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ea={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Na=function(e){this.options=e,this.warn=e.warn||xr,this.transforms=Ar(e.modules,"transformCode"),this.dataGenFns=Ar(e.modules,"genData"),this.directives=k(k({},Ea),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ja(e,t){var n=new Na(t);return{render:"with(this){return "+(e?La(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function La(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ma(e,t);if(e.once&&!e.onceProcessed)return Ia(e,t);if(e.for&&!e.forProcessed)return Pa(e,t);if(e.if&&!e.ifProcessed)return Da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Ha(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return b(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Ha(t,n,!0);return"_c("+e+","+Ra(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Ra(e,t));var i=e.inlineTemplate?null:Ha(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
',Wa.innerHTML.indexOf(" ")>0}var Ya=!!U&&Xa(!1),Qa=!!U&&Xa(!0),es=g(function(e){var t=Wn(e);return t&&t.innerHTML}),ts=gn.prototype.$mount;gn.prototype.$mount=function(e,t){if((e=e&&Wn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=es(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=Ga(r,{outputSourceRange:!1,shouldDecodeNewlines:Ya,shouldDecodeNewlinesForHref:Qa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return ts.call(this,e,t)},gn.compile=Ga,module.exports=gn; \ No newline at end of file +"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function A(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,W=K&&K.indexOf("edge/")>0,Z=(K&&K.indexOf("android"),K&&/iphone|ipad|ipod|ios/.test(K)||"ios"===V),G=(K&&/chrome\/\d+/.test(K),K&&/phantomjs/.test(K),K&&K.match(/firefox\/(\d+)/)),X={}.watch,Y=!1;if(U)try{var Q={};Object.defineProperty(Q,"passive",{get:function(){Y=!0}}),window.addEventListener("test-passive",null,Q)}catch(e){}var ee=function(){return void 0===H&&(H=!U&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),H},te=U&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ne(e){return"function"==typeof e&&/native code/.test(e.toString())}var re,ie="undefined"!=typeof Symbol&&ne(Symbol)&&"undefined"!=typeof Reflect&&ne(Reflect.ownKeys);re="undefined"!=typeof Set&&ne(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var oe=S,ae=0,se=function(){this.id=ae++,this.subs=[]};se.prototype.addSub=function(e){this.subs.push(e)},se.prototype.removeSub=function(e){h(this.subs,e)},se.prototype.depend=function(){se.target&&se.target.addDep(this)},se.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Pe(String,i.type);(c<0||s0&&(at((u=e(u,(a||"")+"_"+c))[0])&&at(f)&&(s[l]=ve(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?at(f)?s[l]=ve(f.text+u):""!==u&&s.push(ve(u)):at(u)&&at(f)?s[l]=ve(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function at(e){return n(e)&&n(e.text)&&!1===e.isComment}function st(e,t){if(e){for(var n=Object.create(null),r=ie?Reflect.ownKeys(e):Object.keys(e),i=0;idocument.createEvent("Event").timeStamp&&(an=function(){return performance.now()});var cn=0,un=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++cn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new re,this.newDepIds=new re,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!F.test(e)){var t=e.split(".");return function(e){for(var n=0;nrn&&Yt[n].id>e.id;)n--;Yt.splice(n+1,0,e)}else Yt.push(e);tn||(tn=!0,Xe(sn))}}(this)},un.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},un.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},un.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},un.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var ln={enumerable:!0,configurable:!0,get:S,set:S};function fn(e,t,n){ln.get=function(){return this[t][n]},ln.set=function(e){this[t][n]=e},Object.defineProperty(e,n,ln)}function pn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&be(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);Ce(r,o,a),o in e||fn(e,"_props",o)};for(var a in t)o(a);be(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){ue();try{return e.call(t,t)}catch(e){return Re(e,t,"data()"),{}}finally{le()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&fn(e,"_data",o))}var a;we(t,!0)}(e):we(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=ee();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new un(e,a||S,S,dn)),i in e||vn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==X&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function xn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=wn(a.componentOptions);s&&!t(s)&&An(n,o,r,i)}}}function An(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=gn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=je(_n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Jt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ct(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;Ce(t,"$attrs",o&&o.attrs||e,null,!0),Ce(t,"$listeners",n._parentListeners||e,null,!0)}(n),Xt(n,"beforeCreate"),function(e){var t=st(e.$options.inject,e);t&&(be(!1),Object.keys(t).forEach(function(n){Ce(e,n,t[n])}),be(!0))}(n),pn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Xt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(bn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=xe,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return yn(this,e,t,n);(n=n||{}).user=!0;var r=new un(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(bn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?A(t):t;for(var n=A(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&An(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return P}};Object.defineProperty(e,"config",t),e.util={warn:oe,extend:k,mergeOptions:je,defineReactive:Ce},e.set=xe,e.delete=Ae,e.nextTick=Xe,e.observable=function(e){return we(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,On),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=A(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=je(this.options,e),this}}(e),$n(e),function(e){I.f