or \n *\n * - dynamic:\n * \n */\n\n bind: function bind() {\n if (!this.el.__vue__) {\n // keep-alive cache\n this.keepAlive = this.params.keepAlive;\n if (this.keepAlive) {\n this.cache = {};\n }\n // check inline-template\n if (this.params.inlineTemplate) {\n // extract inline template as a DocumentFragment\n this.inlineTemplate = extractContent(this.el, true);\n }\n // component resolution related state\n this.pendingComponentCb = this.Component = null;\n // transition related state\n this.pendingRemovals = 0;\n this.pendingRemovalCb = null;\n // create a ref anchor\n this.anchor = createAnchor('v-component');\n replace(this.el, this.anchor);\n // remove is attribute.\n // this is removed during compilation, but because compilation is\n // cached, when the component is used elsewhere this attribute\n // will remain at link time.\n this.el.removeAttribute('is');\n this.el.removeAttribute(':is');\n // remove ref, same as above\n if (this.descriptor.ref) {\n this.el.removeAttribute('v-ref:' + hyphenate(this.descriptor.ref));\n }\n // if static, build right now.\n if (this.literal) {\n this.setComponent(this.expression);\n }\n } else {\n process.env.NODE_ENV !== 'production' && warn('cannot mount component \"' + this.expression + '\" ' + 'on already mounted element: ' + this.el);\n }\n },\n\n /**\n * Public update, called by the watcher in the dynamic\n * literal scenario, e.g. \n */\n\n update: function update(value) {\n if (!this.literal) {\n this.setComponent(value);\n }\n },\n\n /**\n * Switch dynamic components. May resolve the component\n * asynchronously, and perform transition based on\n * specified transition mode. Accepts a few additional\n * arguments specifically for vue-router.\n *\n * The callback is called when the full transition is\n * finished.\n *\n * @param {String} value\n * @param {Function} [cb]\n */\n\n setComponent: function setComponent(value, cb) {\n this.invalidatePending();\n if (!value) {\n // just remove current\n this.unbuild(true);\n this.remove(this.childVM, cb);\n this.childVM = null;\n } else {\n var self = this;\n this.resolveComponent(value, function () {\n self.mountComponent(cb);\n });\n }\n },\n\n /**\n * Resolve the component constructor to use when creating\n * the child vm.\n *\n * @param {String|Function} value\n * @param {Function} cb\n */\n\n resolveComponent: function resolveComponent(value, cb) {\n var self = this;\n this.pendingComponentCb = cancellable(function (Component) {\n self.ComponentName = Component.options.name || (typeof value === 'string' ? value : null);\n self.Component = Component;\n cb();\n });\n this.vm._resolveComponent(value, this.pendingComponentCb);\n },\n\n /**\n * Create a new instance using the current constructor and\n * replace the existing instance. This method doesn't care\n * whether the new component and the old one are actually\n * the same.\n *\n * @param {Function} [cb]\n */\n\n mountComponent: function mountComponent(cb) {\n // actual mount\n this.unbuild(true);\n var self = this;\n var activateHooks = this.Component.options.activate;\n var cached = this.getCached();\n var newComponent = this.build();\n if (activateHooks && !cached) {\n this.waitingFor = newComponent;\n callActivateHooks(activateHooks, newComponent, function () {\n if (self.waitingFor !== newComponent) {\n return;\n }\n self.waitingFor = null;\n self.transition(newComponent, cb);\n });\n } else {\n // update ref for kept-alive component\n if (cached) {\n newComponent._updateRef();\n }\n this.transition(newComponent, cb);\n }\n },\n\n /**\n * When the component changes or unbinds before an async\n * constructor is resolved, we need to invalidate its\n * pending callback.\n */\n\n invalidatePending: function invalidatePending() {\n if (this.pendingComponentCb) {\n this.pendingComponentCb.cancel();\n this.pendingComponentCb = null;\n }\n },\n\n /**\n * Instantiate/insert a new child vm.\n * If keep alive and has cached instance, insert that\n * instance; otherwise build a new one and cache it.\n *\n * @param {Object} [extraOptions]\n * @return {Vue} - the created instance\n */\n\n build: function build(extraOptions) {\n var cached = this.getCached();\n if (cached) {\n return cached;\n }\n if (this.Component) {\n // default options\n var options = {\n name: this.ComponentName,\n el: cloneNode(this.el),\n template: this.inlineTemplate,\n // make sure to add the child with correct parent\n // if this is a transcluded component, its parent\n // should be the transclusion host.\n parent: this._host || this.vm,\n // if no inline-template, then the compiled\n // linker can be cached for better performance.\n _linkerCachable: !this.inlineTemplate,\n _ref: this.descriptor.ref,\n _asComponent: true,\n _isRouterView: this._isRouterView,\n // if this is a transcluded component, context\n // will be the common parent vm of this instance\n // and its host.\n _context: this.vm,\n // if this is inside an inline v-for, the scope\n // will be the intermediate scope created for this\n // repeat fragment. this is used for linking props\n // and container directives.\n _scope: this._scope,\n // pass in the owner fragment of this component.\n // this is necessary so that the fragment can keep\n // track of its contained components in order to\n // call attach/detach hooks for them.\n _frag: this._frag\n };\n // extra options\n // in 1.0.0 this is used by vue-router only\n /* istanbul ignore if */\n if (extraOptions) {\n extend(options, extraOptions);\n }\n var child = new this.Component(options);\n if (this.keepAlive) {\n this.cache[this.Component.cid] = child;\n }\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && this.el.hasAttribute('transition') && child._isFragment) {\n warn('Transitions will not work on a fragment instance. ' + 'Template: ' + child.$options.template, child);\n }\n return child;\n }\n },\n\n /**\n * Try to get a cached instance of the current component.\n *\n * @return {Vue|undefined}\n */\n\n getCached: function getCached() {\n return this.keepAlive && this.cache[this.Component.cid];\n },\n\n /**\n * Teardown the current child, but defers cleanup so\n * that we can separate the destroy and removal steps.\n *\n * @param {Boolean} defer\n */\n\n unbuild: function unbuild(defer) {\n if (this.waitingFor) {\n if (!this.keepAlive) {\n this.waitingFor.$destroy();\n }\n this.waitingFor = null;\n }\n var child = this.childVM;\n if (!child || this.keepAlive) {\n if (child) {\n // remove ref\n child._inactive = true;\n child._updateRef(true);\n }\n return;\n }\n // the sole purpose of `deferCleanup` is so that we can\n // \"deactivate\" the vm right now and perform DOM removal\n // later.\n child.$destroy(false, defer);\n },\n\n /**\n * Remove current destroyed child and manually do\n * the cleanup after removal.\n *\n * @param {Function} cb\n */\n\n remove: function remove(child, cb) {\n var keepAlive = this.keepAlive;\n if (child) {\n // we may have a component switch when a previous\n // component is still being transitioned out.\n // we want to trigger only one lastest insertion cb\n // when the existing transition finishes. (#1119)\n this.pendingRemovals++;\n this.pendingRemovalCb = cb;\n var self = this;\n child.$remove(function () {\n self.pendingRemovals--;\n if (!keepAlive) child._cleanup();\n if (!self.pendingRemovals && self.pendingRemovalCb) {\n self.pendingRemovalCb();\n self.pendingRemovalCb = null;\n }\n });\n } else if (cb) {\n cb();\n }\n },\n\n /**\n * Actually swap the components, depending on the\n * transition mode. Defaults to simultaneous.\n *\n * @param {Vue} target\n * @param {Function} [cb]\n */\n\n transition: function transition(target, cb) {\n var self = this;\n var current = this.childVM;\n // for devtool inspection\n if (current) current._inactive = true;\n target._inactive = false;\n this.childVM = target;\n switch (self.params.transitionMode) {\n case 'in-out':\n target.$before(self.anchor, function () {\n self.remove(current, cb);\n });\n break;\n case 'out-in':\n self.remove(current, function () {\n target.$before(self.anchor, cb);\n });\n break;\n default:\n self.remove(current);\n target.$before(self.anchor, cb);\n }\n },\n\n /**\n * Unbind.\n */\n\n unbind: function unbind() {\n this.invalidatePending();\n // Do not defer cleanup when unbinding\n this.unbuild();\n // destroy all keep-alive cached instances\n if (this.cache) {\n for (var key in this.cache) {\n this.cache[key].$destroy();\n }\n this.cache = null;\n }\n }\n};\n\n/**\n * Call activate hooks in order (asynchronous)\n *\n * @param {Array} hooks\n * @param {Vue} vm\n * @param {Function} cb\n */\n\nfunction callActivateHooks(hooks, vm, cb) {\n var total = hooks.length;\n var called = 0;\n hooks[0].call(vm, next);\n function next() {\n if (++called >= total) {\n cb();\n } else {\n hooks[called].call(vm, next);\n }\n }\n}\n\nvar propBindingModes = config._propBindingModes;\nvar empty = {};\n\n// regexes\nvar identRE$1 = /^[$_a-zA-Z]+[\\w$]*$/;\nvar settablePathRE = /^[A-Za-z_$][\\w$]*(\\.[A-Za-z_$][\\w$]*|\\[[^\\[\\]]+\\])*$/;\n\n/**\n * Compile props on a root element and return\n * a props link function.\n *\n * @param {Element|DocumentFragment} el\n * @param {Array} propOptions\n * @param {Vue} vm\n * @return {Function} propsLinkFn\n */\n\nfunction compileProps(el, propOptions, vm) {\n var props = [];\n var names = Object.keys(propOptions);\n var i = names.length;\n var options, name, attr, value, path, parsed, prop;\n while (i--) {\n name = names[i];\n options = propOptions[name] || empty;\n\n if (process.env.NODE_ENV !== 'production' && name === '$data') {\n warn('Do not use $data as prop.', vm);\n continue;\n }\n\n // props could contain dashes, which will be\n // interpreted as minus calculations by the parser\n // so we need to camelize the path here\n path = camelize(name);\n if (!identRE$1.test(path)) {\n process.env.NODE_ENV !== 'production' && warn('Invalid prop key: \"' + name + '\". Prop keys ' + 'must be valid identifiers.', vm);\n continue;\n }\n\n prop = {\n name: name,\n path: path,\n options: options,\n mode: propBindingModes.ONE_WAY,\n raw: null\n };\n\n attr = hyphenate(name);\n // first check dynamic version\n if ((value = getBindAttr(el, attr)) === null) {\n if ((value = getBindAttr(el, attr + '.sync')) !== null) {\n prop.mode = propBindingModes.TWO_WAY;\n } else if ((value = getBindAttr(el, attr + '.once')) !== null) {\n prop.mode = propBindingModes.ONE_TIME;\n }\n }\n if (value !== null) {\n // has dynamic binding!\n prop.raw = value;\n parsed = parseDirective(value);\n value = parsed.expression;\n prop.filters = parsed.filters;\n // check binding type\n if (isLiteral(value) && !parsed.filters) {\n // for expressions containing literal numbers and\n // booleans, there's no need to setup a prop binding,\n // so we can optimize them as a one-time set.\n prop.optimizedLiteral = true;\n } else {\n prop.dynamic = true;\n // check non-settable path for two-way bindings\n if (process.env.NODE_ENV !== 'production' && prop.mode === propBindingModes.TWO_WAY && !settablePathRE.test(value)) {\n prop.mode = propBindingModes.ONE_WAY;\n warn('Cannot bind two-way prop with non-settable ' + 'parent path: ' + value, vm);\n }\n }\n prop.parentPath = value;\n\n // warn required two-way\n if (process.env.NODE_ENV !== 'production' && options.twoWay && prop.mode !== propBindingModes.TWO_WAY) {\n warn('Prop \"' + name + '\" expects a two-way binding type.', vm);\n }\n } else if ((value = getAttr(el, attr)) !== null) {\n // has literal binding!\n prop.raw = value;\n } else if (process.env.NODE_ENV !== 'production') {\n // check possible camelCase prop usage\n var lowerCaseName = path.toLowerCase();\n value = /[A-Z\\-]/.test(name) && (el.getAttribute(lowerCaseName) || el.getAttribute(':' + lowerCaseName) || el.getAttribute('v-bind:' + lowerCaseName) || el.getAttribute(':' + lowerCaseName + '.once') || el.getAttribute('v-bind:' + lowerCaseName + '.once') || el.getAttribute(':' + lowerCaseName + '.sync') || el.getAttribute('v-bind:' + lowerCaseName + '.sync'));\n if (value) {\n warn('Possible usage error for prop `' + lowerCaseName + '` - ' + 'did you mean `' + attr + '`? HTML is case-insensitive, remember to use ' + 'kebab-case for props in templates.', vm);\n } else if (options.required) {\n // warn missing required\n warn('Missing required prop: ' + name, vm);\n }\n }\n // push prop\n props.push(prop);\n }\n return makePropsLinkFn(props);\n}\n\n/**\n * Build a function that applies props to a vm.\n *\n * @param {Array} props\n * @return {Function} propsLinkFn\n */\n\nfunction makePropsLinkFn(props) {\n return function propsLinkFn(vm, scope) {\n // store resolved props info\n vm._props = {};\n var inlineProps = vm.$options.propsData;\n var i = props.length;\n var prop, path, options, value, raw;\n while (i--) {\n prop = props[i];\n raw = prop.raw;\n path = prop.path;\n options = prop.options;\n vm._props[path] = prop;\n if (inlineProps && hasOwn(inlineProps, path)) {\n initProp(vm, prop, inlineProps[path]);\n }if (raw === null) {\n // initialize absent prop\n initProp(vm, prop, undefined);\n } else if (prop.dynamic) {\n // dynamic prop\n if (prop.mode === propBindingModes.ONE_TIME) {\n // one time binding\n value = (scope || vm._context || vm).$get(prop.parentPath);\n initProp(vm, prop, value);\n } else {\n if (vm._context) {\n // dynamic binding\n vm._bindDir({\n name: 'prop',\n def: propDef,\n prop: prop\n }, null, null, scope); // el, host, scope\n } else {\n // root instance\n initProp(vm, prop, vm.$get(prop.parentPath));\n }\n }\n } else if (prop.optimizedLiteral) {\n // optimized literal, cast it and just set once\n var stripped = stripQuotes(raw);\n value = stripped === raw ? toBoolean(toNumber(raw)) : stripped;\n initProp(vm, prop, value);\n } else {\n // string literal, but we need to cater for\n // Boolean props with no value, or with same\n // literal value (e.g. disabled=\"disabled\")\n // see https://github.com/vuejs/vue-loader/issues/182\n value = options.type === Boolean && (raw === '' || raw === hyphenate(prop.name)) ? true : raw;\n initProp(vm, prop, value);\n }\n }\n };\n}\n\n/**\n * Process a prop with a rawValue, applying necessary coersions,\n * default values & assertions and call the given callback with\n * processed value.\n *\n * @param {Vue} vm\n * @param {Object} prop\n * @param {*} rawValue\n * @param {Function} fn\n */\n\nfunction processPropValue(vm, prop, rawValue, fn) {\n var isSimple = prop.dynamic && isSimplePath(prop.parentPath);\n var value = rawValue;\n if (value === undefined) {\n value = getPropDefaultValue(vm, prop);\n }\n value = coerceProp(prop, value);\n var coerced = value !== rawValue;\n if (!assertProp(prop, value, vm)) {\n value = undefined;\n }\n if (isSimple && !coerced) {\n withoutConversion(function () {\n fn(value);\n });\n } else {\n fn(value);\n }\n}\n\n/**\n * Set a prop's initial value on a vm and its data object.\n *\n * @param {Vue} vm\n * @param {Object} prop\n * @param {*} value\n */\n\nfunction initProp(vm, prop, value) {\n processPropValue(vm, prop, value, function (value) {\n defineReactive(vm, prop.path, value);\n });\n}\n\n/**\n * Update a prop's value on a vm.\n *\n * @param {Vue} vm\n * @param {Object} prop\n * @param {*} value\n */\n\nfunction updateProp(vm, prop, value) {\n processPropValue(vm, prop, value, function (value) {\n vm[prop.path] = value;\n });\n}\n\n/**\n * Get the default value of a prop.\n *\n * @param {Vue} vm\n * @param {Object} prop\n * @return {*}\n */\n\nfunction getPropDefaultValue(vm, prop) {\n // no default, return undefined\n var options = prop.options;\n if (!hasOwn(options, 'default')) {\n // absent boolean value defaults to false\n return options.type === Boolean ? false : undefined;\n }\n var def = options['default'];\n // warn against non-factory defaults for Object & Array\n if (isObject(def)) {\n process.env.NODE_ENV !== 'production' && warn('Invalid default value for prop \"' + prop.name + '\": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm);\n }\n // call factory function for non-Function types\n return typeof def === 'function' && options.type !== Function ? def.call(vm) : def;\n}\n\n/**\n * Assert whether a prop is valid.\n *\n * @param {Object} prop\n * @param {*} value\n * @param {Vue} vm\n */\n\nfunction assertProp(prop, value, vm) {\n if (!prop.options.required && ( // non-required\n prop.raw === null || // abscent\n value == null) // null or undefined\n ) {\n return true;\n }\n var options = prop.options;\n var type = options.type;\n var valid = !type;\n var expectedTypes = [];\n if (type) {\n if (!isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType);\n valid = assertedType.valid;\n }\n }\n if (!valid) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Invalid prop: type check failed for prop \"' + prop.name + '\".' + ' Expected ' + expectedTypes.map(formatType).join(', ') + ', got ' + formatValue(value) + '.', vm);\n }\n return false;\n }\n var validator = options.validator;\n if (validator) {\n if (!validator(value)) {\n process.env.NODE_ENV !== 'production' && warn('Invalid prop: custom validator check failed for prop \"' + prop.name + '\".', vm);\n return false;\n }\n }\n return true;\n}\n\n/**\n * Force parsing value with coerce option.\n *\n * @param {*} value\n * @param {Object} options\n * @return {*}\n */\n\nfunction coerceProp(prop, value) {\n var coerce = prop.options.coerce;\n if (!coerce) {\n return value;\n }\n // coerce is a function\n return coerce(value);\n}\n\n/**\n * Assert the type of a value\n *\n * @param {*} value\n * @param {Function} type\n * @return {Object}\n */\n\nfunction assertType(value, type) {\n var valid;\n var expectedType;\n if (type === String) {\n expectedType = 'string';\n valid = typeof value === expectedType;\n } else if (type === Number) {\n expectedType = 'number';\n valid = typeof value === expectedType;\n } else if (type === Boolean) {\n expectedType = 'boolean';\n valid = typeof value === expectedType;\n } else if (type === Function) {\n expectedType = 'function';\n valid = typeof value === expectedType;\n } else if (type === Object) {\n expectedType = 'object';\n valid = isPlainObject(value);\n } else if (type === Array) {\n expectedType = 'array';\n valid = isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n };\n}\n\n/**\n * Format type for output\n *\n * @param {String} type\n * @return {String}\n */\n\nfunction formatType(type) {\n return type ? type.charAt(0).toUpperCase() + type.slice(1) : 'custom type';\n}\n\n/**\n * Format value\n *\n * @param {*} value\n * @return {String}\n */\n\nfunction formatValue(val) {\n return Object.prototype.toString.call(val).slice(8, -1);\n}\n\nvar bindingModes = config._propBindingModes;\n\nvar propDef = {\n\n bind: function bind() {\n var child = this.vm;\n var parent = child._context;\n // passed in from compiler directly\n var prop = this.descriptor.prop;\n var childKey = prop.path;\n var parentKey = prop.parentPath;\n var twoWay = prop.mode === bindingModes.TWO_WAY;\n\n var parentWatcher = this.parentWatcher = new Watcher(parent, parentKey, function (val) {\n updateProp(child, prop, val);\n }, {\n twoWay: twoWay,\n filters: prop.filters,\n // important: props need to be observed on the\n // v-for scope if present\n scope: this._scope\n });\n\n // set the child initial value.\n initProp(child, prop, parentWatcher.value);\n\n // setup two-way binding\n if (twoWay) {\n // important: defer the child watcher creation until\n // the created hook (after data observation)\n var self = this;\n child.$once('pre-hook:created', function () {\n self.childWatcher = new Watcher(child, childKey, function (val) {\n parentWatcher.set(val);\n }, {\n // ensure sync upward before parent sync down.\n // this is necessary in cases e.g. the child\n // mutates a prop array, then replaces it. (#1683)\n sync: true\n });\n });\n }\n },\n\n unbind: function unbind() {\n this.parentWatcher.teardown();\n if (this.childWatcher) {\n this.childWatcher.teardown();\n }\n }\n};\n\nvar queue$1 = [];\nvar queued = false;\n\n/**\n * Push a job into the queue.\n *\n * @param {Function} job\n */\n\nfunction pushJob(job) {\n queue$1.push(job);\n if (!queued) {\n queued = true;\n nextTick(flush);\n }\n}\n\n/**\n * Flush the queue, and do one forced reflow before\n * triggering transitions.\n */\n\nfunction flush() {\n // Force layout\n var f = document.documentElement.offsetHeight;\n for (var i = 0; i < queue$1.length; i++) {\n queue$1[i]();\n }\n queue$1 = [];\n queued = false;\n // dummy return, so js linters don't complain about\n // unused variable f\n return f;\n}\n\nvar TYPE_TRANSITION = 'transition';\nvar TYPE_ANIMATION = 'animation';\nvar transDurationProp = transitionProp + 'Duration';\nvar animDurationProp = animationProp + 'Duration';\n\n/**\n * If a just-entered element is applied the\n * leave class while its enter transition hasn't started yet,\n * and the transitioned property has the same value for both\n * enter/leave, then the leave transition will be skipped and\n * the transitionend event never fires. This function ensures\n * its callback to be called after a transition has started\n * by waiting for double raf.\n *\n * It falls back to setTimeout on devices that support CSS\n * transitions but not raf (e.g. Android 4.2 browser) - since\n * these environments are usually slow, we are giving it a\n * relatively large timeout.\n */\n\nvar raf = inBrowser && window.requestAnimationFrame;\nvar waitForTransitionStart = raf\n/* istanbul ignore next */\n? function (fn) {\n raf(function () {\n raf(fn);\n });\n} : function (fn) {\n setTimeout(fn, 50);\n};\n\n/**\n * A Transition object that encapsulates the state and logic\n * of the transition.\n *\n * @param {Element} el\n * @param {String} id\n * @param {Object} hooks\n * @param {Vue} vm\n */\nfunction Transition(el, id, hooks, vm) {\n this.id = id;\n this.el = el;\n this.enterClass = hooks && hooks.enterClass || id + '-enter';\n this.leaveClass = hooks && hooks.leaveClass || id + '-leave';\n this.hooks = hooks;\n this.vm = vm;\n // async state\n this.pendingCssEvent = this.pendingCssCb = this.cancel = this.pendingJsCb = this.op = this.cb = null;\n this.justEntered = false;\n this.entered = this.left = false;\n this.typeCache = {};\n // check css transition type\n this.type = hooks && hooks.type;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production') {\n if (this.type && this.type !== TYPE_TRANSITION && this.type !== TYPE_ANIMATION) {\n warn('invalid CSS transition type for transition=\"' + this.id + '\": ' + this.type, vm);\n }\n }\n // bind\n var self = this;['enterNextTick', 'enterDone', 'leaveNextTick', 'leaveDone'].forEach(function (m) {\n self[m] = bind(self[m], self);\n });\n}\n\nvar p$1 = Transition.prototype;\n\n/**\n * Start an entering transition.\n *\n * 1. enter transition triggered\n * 2. call beforeEnter hook\n * 3. add enter class\n * 4. insert/show element\n * 5. call enter hook (with possible explicit js callback)\n * 6. reflow\n * 7. based on transition type:\n * - transition:\n * remove class now, wait for transitionend,\n * then done if there's no explicit js callback.\n * - animation:\n * wait for animationend, remove class,\n * then done if there's no explicit js callback.\n * - no css transition:\n * done now if there's no explicit js callback.\n * 8. wait for either done or js callback, then call\n * afterEnter hook.\n *\n * @param {Function} op - insert/show the element\n * @param {Function} [cb]\n */\n\np$1.enter = function (op, cb) {\n this.cancelPending();\n this.callHook('beforeEnter');\n this.cb = cb;\n addClass(this.el, this.enterClass);\n op();\n this.entered = false;\n this.callHookWithCb('enter');\n if (this.entered) {\n return; // user called done synchronously.\n }\n this.cancel = this.hooks && this.hooks.enterCancelled;\n pushJob(this.enterNextTick);\n};\n\n/**\n * The \"nextTick\" phase of an entering transition, which is\n * to be pushed into a queue and executed after a reflow so\n * that removing the class can trigger a CSS transition.\n */\n\np$1.enterNextTick = function () {\n var _this = this;\n\n // prevent transition skipping\n this.justEntered = true;\n waitForTransitionStart(function () {\n _this.justEntered = false;\n });\n var enterDone = this.enterDone;\n var type = this.getCssTransitionType(this.enterClass);\n if (!this.pendingJsCb) {\n if (type === TYPE_TRANSITION) {\n // trigger transition by removing enter class now\n removeClass(this.el, this.enterClass);\n this.setupCssCb(transitionEndEvent, enterDone);\n } else if (type === TYPE_ANIMATION) {\n this.setupCssCb(animationEndEvent, enterDone);\n } else {\n enterDone();\n }\n } else if (type === TYPE_TRANSITION) {\n removeClass(this.el, this.enterClass);\n }\n};\n\n/**\n * The \"cleanup\" phase of an entering transition.\n */\n\np$1.enterDone = function () {\n this.entered = true;\n this.cancel = this.pendingJsCb = null;\n removeClass(this.el, this.enterClass);\n this.callHook('afterEnter');\n if (this.cb) this.cb();\n};\n\n/**\n * Start a leaving transition.\n *\n * 1. leave transition triggered.\n * 2. call beforeLeave hook\n * 3. add leave class (trigger css transition)\n * 4. call leave hook (with possible explicit js callback)\n * 5. reflow if no explicit js callback is provided\n * 6. based on transition type:\n * - transition or animation:\n * wait for end event, remove class, then done if\n * there's no explicit js callback.\n * - no css transition:\n * done if there's no explicit js callback.\n * 7. wait for either done or js callback, then call\n * afterLeave hook.\n *\n * @param {Function} op - remove/hide the element\n * @param {Function} [cb]\n */\n\np$1.leave = function (op, cb) {\n this.cancelPending();\n this.callHook('beforeLeave');\n this.op = op;\n this.cb = cb;\n addClass(this.el, this.leaveClass);\n this.left = false;\n this.callHookWithCb('leave');\n if (this.left) {\n return; // user called done synchronously.\n }\n this.cancel = this.hooks && this.hooks.leaveCancelled;\n // only need to handle leaveDone if\n // 1. the transition is already done (synchronously called\n // by the user, which causes this.op set to null)\n // 2. there's no explicit js callback\n if (this.op && !this.pendingJsCb) {\n // if a CSS transition leaves immediately after enter,\n // the transitionend event never fires. therefore we\n // detect such cases and end the leave immediately.\n if (this.justEntered) {\n this.leaveDone();\n } else {\n pushJob(this.leaveNextTick);\n }\n }\n};\n\n/**\n * The \"nextTick\" phase of a leaving transition.\n */\n\np$1.leaveNextTick = function () {\n var type = this.getCssTransitionType(this.leaveClass);\n if (type) {\n var event = type === TYPE_TRANSITION ? transitionEndEvent : animationEndEvent;\n this.setupCssCb(event, this.leaveDone);\n } else {\n this.leaveDone();\n }\n};\n\n/**\n * The \"cleanup\" phase of a leaving transition.\n */\n\np$1.leaveDone = function () {\n this.left = true;\n this.cancel = this.pendingJsCb = null;\n this.op();\n removeClass(this.el, this.leaveClass);\n this.callHook('afterLeave');\n if (this.cb) this.cb();\n this.op = null;\n};\n\n/**\n * Cancel any pending callbacks from a previously running\n * but not finished transition.\n */\n\np$1.cancelPending = function () {\n this.op = this.cb = null;\n var hasPending = false;\n if (this.pendingCssCb) {\n hasPending = true;\n off(this.el, this.pendingCssEvent, this.pendingCssCb);\n this.pendingCssEvent = this.pendingCssCb = null;\n }\n if (this.pendingJsCb) {\n hasPending = true;\n this.pendingJsCb.cancel();\n this.pendingJsCb = null;\n }\n if (hasPending) {\n removeClass(this.el, this.enterClass);\n removeClass(this.el, this.leaveClass);\n }\n if (this.cancel) {\n this.cancel.call(this.vm, this.el);\n this.cancel = null;\n }\n};\n\n/**\n * Call a user-provided synchronous hook function.\n *\n * @param {String} type\n */\n\np$1.callHook = function (type) {\n if (this.hooks && this.hooks[type]) {\n this.hooks[type].call(this.vm, this.el);\n }\n};\n\n/**\n * Call a user-provided, potentially-async hook function.\n * We check for the length of arguments to see if the hook\n * expects a `done` callback. If true, the transition's end\n * will be determined by when the user calls that callback;\n * otherwise, the end is determined by the CSS transition or\n * animation.\n *\n * @param {String} type\n */\n\np$1.callHookWithCb = function (type) {\n var hook = this.hooks && this.hooks[type];\n if (hook) {\n if (hook.length > 1) {\n this.pendingJsCb = cancellable(this[type + 'Done']);\n }\n hook.call(this.vm, this.el, this.pendingJsCb);\n }\n};\n\n/**\n * Get an element's transition type based on the\n * calculated styles.\n *\n * @param {String} className\n * @return {Number}\n */\n\np$1.getCssTransitionType = function (className) {\n /* istanbul ignore if */\n if (!transitionEndEvent ||\n // skip CSS transitions if page is not visible -\n // this solves the issue of transitionend events not\n // firing until the page is visible again.\n // pageVisibility API is supported in IE10+, same as\n // CSS transitions.\n document.hidden ||\n // explicit js-only transition\n this.hooks && this.hooks.css === false ||\n // element is hidden\n isHidden(this.el)) {\n return;\n }\n var type = this.type || this.typeCache[className];\n if (type) return type;\n var inlineStyles = this.el.style;\n var computedStyles = window.getComputedStyle(this.el);\n var transDuration = inlineStyles[transDurationProp] || computedStyles[transDurationProp];\n if (transDuration && transDuration !== '0s') {\n type = TYPE_TRANSITION;\n } else {\n var animDuration = inlineStyles[animDurationProp] || computedStyles[animDurationProp];\n if (animDuration && animDuration !== '0s') {\n type = TYPE_ANIMATION;\n }\n }\n if (type) {\n this.typeCache[className] = type;\n }\n return type;\n};\n\n/**\n * Setup a CSS transitionend/animationend callback.\n *\n * @param {String} event\n * @param {Function} cb\n */\n\np$1.setupCssCb = function (event, cb) {\n this.pendingCssEvent = event;\n var self = this;\n var el = this.el;\n var onEnd = this.pendingCssCb = function (e) {\n if (e.target === el) {\n off(el, event, onEnd);\n self.pendingCssEvent = self.pendingCssCb = null;\n if (!self.pendingJsCb && cb) {\n cb();\n }\n }\n };\n on(el, event, onEnd);\n};\n\n/**\n * Check if an element is hidden - in that case we can just\n * skip the transition alltogether.\n *\n * @param {Element} el\n * @return {Boolean}\n */\n\nfunction isHidden(el) {\n if (/svg$/.test(el.namespaceURI)) {\n // SVG elements do not have offset(Width|Height)\n // so we need to check the client rect\n var rect = el.getBoundingClientRect();\n return !(rect.width || rect.height);\n } else {\n return !(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n }\n}\n\nvar transition$1 = {\n\n priority: TRANSITION,\n\n update: function update(id, oldId) {\n var el = this.el;\n // resolve on owner vm\n var hooks = resolveAsset(this.vm.$options, 'transitions', id);\n id = id || 'v';\n el.__v_trans = new Transition(el, id, hooks, this.vm);\n if (oldId) {\n removeClass(el, oldId + '-transition');\n }\n addClass(el, id + '-transition');\n }\n};\n\nvar internalDirectives = {\n style: style,\n 'class': vClass,\n component: component,\n prop: propDef,\n transition: transition$1\n};\n\n// special binding prefixes\nvar bindRE = /^v-bind:|^:/;\nvar onRE = /^v-on:|^@/;\nvar dirAttrRE = /^v-([^:]+)(?:$|:(.*)$)/;\nvar modifierRE = /\\.[^\\.]+/g;\nvar transitionRE = /^(v-bind:|:)?transition$/;\n\n// default directive priority\nvar DEFAULT_PRIORITY = 1000;\nvar DEFAULT_TERMINAL_PRIORITY = 2000;\n\n/**\n * Compile a template and return a reusable composite link\n * function, which recursively contains more link functions\n * inside. This top level compile function would normally\n * be called on instance root nodes, but can also be used\n * for partial compilation if the partial argument is true.\n *\n * The returned composite link function, when called, will\n * return an unlink function that tearsdown all directives\n * created during the linking phase.\n *\n * @param {Element|DocumentFragment} el\n * @param {Object} options\n * @param {Boolean} partial\n * @return {Function}\n */\n\nfunction compile(el, options, partial) {\n // link function for the node itself.\n var nodeLinkFn = partial || !options._asComponent ? compileNode(el, options) : null;\n // link function for the childNodes\n var childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && !isScript(el) && el.hasChildNodes() ? compileNodeList(el.childNodes, options) : null;\n\n /**\n * A composite linker function to be called on a already\n * compiled piece of DOM, which instantiates all directive\n * instances.\n *\n * @param {Vue} vm\n * @param {Element|DocumentFragment} el\n * @param {Vue} [host] - host vm of transcluded content\n * @param {Object} [scope] - v-for scope\n * @param {Fragment} [frag] - link context fragment\n * @return {Function|undefined}\n */\n\n return function compositeLinkFn(vm, el, host, scope, frag) {\n // cache childNodes before linking parent, fix #657\n var childNodes = toArray(el.childNodes);\n // link\n var dirs = linkAndCapture(function compositeLinkCapturer() {\n if (nodeLinkFn) nodeLinkFn(vm, el, host, scope, frag);\n if (childLinkFn) childLinkFn(vm, childNodes, host, scope, frag);\n }, vm);\n return makeUnlinkFn(vm, dirs);\n };\n}\n\n/**\n * Apply a linker to a vm/element pair and capture the\n * directives created during the process.\n *\n * @param {Function} linker\n * @param {Vue} vm\n */\n\nfunction linkAndCapture(linker, vm) {\n /* istanbul ignore if */\n if (process.env.NODE_ENV === 'production') {\n // reset directives before every capture in production\n // mode, so that when unlinking we don't need to splice\n // them out (which turns out to be a perf hit).\n // they are kept in development mode because they are\n // useful for Vue's own tests.\n vm._directives = [];\n }\n var originalDirCount = vm._directives.length;\n linker();\n var dirs = vm._directives.slice(originalDirCount);\n dirs.sort(directiveComparator);\n for (var i = 0, l = dirs.length; i < l; i++) {\n dirs[i]._bind();\n }\n return dirs;\n}\n\n/**\n * Directive priority sort comparator\n *\n * @param {Object} a\n * @param {Object} b\n */\n\nfunction directiveComparator(a, b) {\n a = a.descriptor.def.priority || DEFAULT_PRIORITY;\n b = b.descriptor.def.priority || DEFAULT_PRIORITY;\n return a > b ? -1 : a === b ? 0 : 1;\n}\n\n/**\n * Linker functions return an unlink function that\n * tearsdown all directives instances generated during\n * the process.\n *\n * We create unlink functions with only the necessary\n * information to avoid retaining additional closures.\n *\n * @param {Vue} vm\n * @param {Array} dirs\n * @param {Vue} [context]\n * @param {Array} [contextDirs]\n * @return {Function}\n */\n\nfunction makeUnlinkFn(vm, dirs, context, contextDirs) {\n function unlink(destroying) {\n teardownDirs(vm, dirs, destroying);\n if (context && contextDirs) {\n teardownDirs(context, contextDirs);\n }\n }\n // expose linked directives\n unlink.dirs = dirs;\n return unlink;\n}\n\n/**\n * Teardown partial linked directives.\n *\n * @param {Vue} vm\n * @param {Array} dirs\n * @param {Boolean} destroying\n */\n\nfunction teardownDirs(vm, dirs, destroying) {\n var i = dirs.length;\n while (i--) {\n dirs[i]._teardown();\n if (process.env.NODE_ENV !== 'production' && !destroying) {\n vm._directives.$remove(dirs[i]);\n }\n }\n}\n\n/**\n * Compile link props on an instance.\n *\n * @param {Vue} vm\n * @param {Element} el\n * @param {Object} props\n * @param {Object} [scope]\n * @return {Function}\n */\n\nfunction compileAndLinkProps(vm, el, props, scope) {\n var propsLinkFn = compileProps(el, props, vm);\n var propDirs = linkAndCapture(function () {\n propsLinkFn(vm, scope);\n }, vm);\n return makeUnlinkFn(vm, propDirs);\n}\n\n/**\n * Compile the root element of an instance.\n *\n * 1. attrs on context container (context scope)\n * 2. attrs on the component template root node, if\n * replace:true (child scope)\n *\n * If this is a fragment instance, we only need to compile 1.\n *\n * @param {Element} el\n * @param {Object} options\n * @param {Object} contextOptions\n * @return {Function}\n */\n\nfunction compileRoot(el, options, contextOptions) {\n var containerAttrs = options._containerAttrs;\n var replacerAttrs = options._replacerAttrs;\n var contextLinkFn, replacerLinkFn;\n\n // only need to compile other attributes for\n // non-fragment instances\n if (el.nodeType !== 11) {\n // for components, container and replacer need to be\n // compiled separately and linked in different scopes.\n if (options._asComponent) {\n // 2. container attributes\n if (containerAttrs && contextOptions) {\n contextLinkFn = compileDirectives(containerAttrs, contextOptions);\n }\n if (replacerAttrs) {\n // 3. replacer attributes\n replacerLinkFn = compileDirectives(replacerAttrs, options);\n }\n } else {\n // non-component, just compile as a normal element.\n replacerLinkFn = compileDirectives(el.attributes, options);\n }\n } else if (process.env.NODE_ENV !== 'production' && containerAttrs) {\n // warn container directives for fragment instances\n var names = containerAttrs.filter(function (attr) {\n // allow vue-loader/vueify scoped css attributes\n return attr.name.indexOf('_v-') < 0 &&\n // allow event listeners\n !onRE.test(attr.name) &&\n // allow slots\n attr.name !== 'slot';\n }).map(function (attr) {\n return '\"' + attr.name + '\"';\n });\n if (names.length) {\n var plural = names.length > 1;\n warn('Attribute' + (plural ? 's ' : ' ') + names.join(', ') + (plural ? ' are' : ' is') + ' ignored on component ' + '<' + options.el.tagName.toLowerCase() + '> because ' + 'the component is a fragment instance: ' + 'http://vuejs.org/guide/components.html#Fragment-Instance');\n }\n }\n\n options._containerAttrs = options._replacerAttrs = null;\n return function rootLinkFn(vm, el, scope) {\n // link context scope dirs\n var context = vm._context;\n var contextDirs;\n if (context && contextLinkFn) {\n contextDirs = linkAndCapture(function () {\n contextLinkFn(context, el, null, scope);\n }, context);\n }\n\n // link self\n var selfDirs = linkAndCapture(function () {\n if (replacerLinkFn) replacerLinkFn(vm, el);\n }, vm);\n\n // return the unlink function that tearsdown context\n // container directives.\n return makeUnlinkFn(vm, selfDirs, context, contextDirs);\n };\n}\n\n/**\n * Compile a node and return a nodeLinkFn based on the\n * node type.\n *\n * @param {Node} node\n * @param {Object} options\n * @return {Function|null}\n */\n\nfunction compileNode(node, options) {\n var type = node.nodeType;\n if (type === 1 && !isScript(node)) {\n return compileElement(node, options);\n } else if (type === 3 && node.data.trim()) {\n return compileTextNode(node, options);\n } else {\n return null;\n }\n}\n\n/**\n * Compile an element and return a nodeLinkFn.\n *\n * @param {Element} el\n * @param {Object} options\n * @return {Function|null}\n */\n\nfunction compileElement(el, options) {\n // preprocess textareas.\n // textarea treats its text content as the initial value.\n // just bind it as an attr directive for value.\n if (el.tagName === 'TEXTAREA') {\n var tokens = parseText(el.value);\n if (tokens) {\n el.setAttribute(':value', tokensToExp(tokens));\n el.value = '';\n }\n }\n var linkFn;\n var hasAttrs = el.hasAttributes();\n var attrs = hasAttrs && toArray(el.attributes);\n // check terminal directives (for & if)\n if (hasAttrs) {\n linkFn = checkTerminalDirectives(el, attrs, options);\n }\n // check element directives\n if (!linkFn) {\n linkFn = checkElementDirectives(el, options);\n }\n // check component\n if (!linkFn) {\n linkFn = checkComponent(el, options);\n }\n // normal directives\n if (!linkFn && hasAttrs) {\n linkFn = compileDirectives(attrs, options);\n }\n return linkFn;\n}\n\n/**\n * Compile a textNode and return a nodeLinkFn.\n *\n * @param {TextNode} node\n * @param {Object} options\n * @return {Function|null} textNodeLinkFn\n */\n\nfunction compileTextNode(node, options) {\n // skip marked text nodes\n if (node._skip) {\n return removeText;\n }\n\n var tokens = parseText(node.wholeText);\n if (!tokens) {\n return null;\n }\n\n // mark adjacent text nodes as skipped,\n // because we are using node.wholeText to compile\n // all adjacent text nodes together. This fixes\n // issues in IE where sometimes it splits up a single\n // text node into multiple ones.\n var next = node.nextSibling;\n while (next && next.nodeType === 3) {\n next._skip = true;\n next = next.nextSibling;\n }\n\n var frag = document.createDocumentFragment();\n var el, token;\n for (var i = 0, l = tokens.length; i < l; i++) {\n token = tokens[i];\n el = token.tag ? processTextToken(token, options) : document.createTextNode(token.value);\n frag.appendChild(el);\n }\n return makeTextNodeLinkFn(tokens, frag, options);\n}\n\n/**\n * Linker for an skipped text node.\n *\n * @param {Vue} vm\n * @param {Text} node\n */\n\nfunction removeText(vm, node) {\n remove(node);\n}\n\n/**\n * Process a single text token.\n *\n * @param {Object} token\n * @param {Object} options\n * @return {Node}\n */\n\nfunction processTextToken(token, options) {\n var el;\n if (token.oneTime) {\n el = document.createTextNode(token.value);\n } else {\n if (token.html) {\n el = document.createComment('v-html');\n setTokenType('html');\n } else {\n // IE will clean up empty textNodes during\n // frag.cloneNode(true), so we have to give it\n // something here...\n el = document.createTextNode(' ');\n setTokenType('text');\n }\n }\n function setTokenType(type) {\n if (token.descriptor) return;\n var parsed = parseDirective(token.value);\n token.descriptor = {\n name: type,\n def: directives[type],\n expression: parsed.expression,\n filters: parsed.filters\n };\n }\n return el;\n}\n\n/**\n * Build a function that processes a textNode.\n *\n * @param {Array