{"version":3,"names":[],"mappings":"","sources":["designer.js"],"sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o MyComponent\n * some_else => SomeElse\n * some/comp => SomeComp\n *\n * @param {String} str\n * @return {String}\n */\n\nvar classifyRE = /(?:^|[-_\\/])(\\w)/g;\n\nfunction classify(str) {\n return str.replace(classifyRE, toUpper);\n}\n\n/**\n * Simple bind, faster than native\n *\n * @param {Function} fn\n * @param {Object} ctx\n * @return {Function}\n */\n\nfunction bind(fn, ctx) {\n return function (a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n };\n}\n\n/**\n * Convert an Array-like object to a real Array.\n *\n * @param {Array-like} list\n * @param {Number} [start] - start index\n * @return {Array}\n */\n\nfunction toArray(list, start) {\n start = start || 0;\n var i = list.length - start;\n var ret = new Array(i);\n while (i--) {\n ret[i] = list[i + start];\n }\n return ret;\n}\n\n/**\n * Mix properties into target object.\n *\n * @param {Object} to\n * @param {Object} from\n */\n\nfunction extend(to, from) {\n var keys = Object.keys(from);\n var i = keys.length;\n while (i--) {\n to[keys[i]] = from[keys[i]];\n }\n return to;\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n *\n * @param {*} obj\n * @return {Boolean}\n */\n\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object';\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n *\n * @param {*} obj\n * @return {Boolean}\n */\n\nvar toString = Object.prototype.toString;\nvar OBJECT_STRING = '[object Object]';\n\nfunction isPlainObject(obj) {\n return toString.call(obj) === OBJECT_STRING;\n}\n\n/**\n * Array type check.\n *\n * @param {*} obj\n * @return {Boolean}\n */\n\nvar isArray = Array.isArray;\n\n/**\n * Define a property.\n *\n * @param {Object} obj\n * @param {String} key\n * @param {*} val\n * @param {Boolean} [enumerable]\n */\n\nfunction def(obj, key, val, enumerable) {\n Object.defineProperty(obj, key, {\n value: val,\n enumerable: !!enumerable,\n writable: true,\n configurable: true\n });\n}\n\n/**\n * Debounce a function so it only gets called after the\n * input stops arriving after the given wait period.\n *\n * @param {Function} func\n * @param {Number} wait\n * @return {Function} - the debounced function\n */\n\nfunction _debounce(func, wait) {\n var timeout, args, context, timestamp, result;\n var later = function later() {\n var last = Date.now() - timestamp;\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = Date.now();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n return result;\n };\n}\n\n/**\n * Manual indexOf because it's slightly faster than\n * native.\n *\n * @param {Array} arr\n * @param {*} obj\n */\n\nfunction indexOf(arr, obj) {\n var i = arr.length;\n while (i--) {\n if (arr[i] === obj) return i;\n }\n return -1;\n}\n\n/**\n * Make a cancellable version of an async callback.\n *\n * @param {Function} fn\n * @return {Function}\n */\n\nfunction cancellable(fn) {\n var cb = function cb() {\n if (!cb.cancelled) {\n return fn.apply(this, arguments);\n }\n };\n cb.cancel = function () {\n cb.cancelled = true;\n };\n return cb;\n}\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n *\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n */\n\nfunction looseEqual(a, b) {\n /* eslint-disable eqeqeq */\n return a == b || (isObject(a) && isObject(b) ? JSON.stringify(a) === JSON.stringify(b) : false);\n /* eslint-enable eqeqeq */\n}\n\nvar hasProto = ('__proto__' in {});\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined' && Object.prototype.toString.call(window) !== '[object Object]';\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n// UA sniffing for working around browser-specific quirks\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isAndroid = UA && UA.indexOf('android') > 0;\nvar isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA);\nvar isWechat = UA && UA.indexOf('micromessenger') > 0;\n\nvar transitionProp = undefined;\nvar transitionEndEvent = undefined;\nvar animationProp = undefined;\nvar animationEndEvent = undefined;\n\n// Transition property/event sniffing\nif (inBrowser && !isIE9) {\n var isWebkitTrans = window.ontransitionend === undefined && window.onwebkittransitionend !== undefined;\n var isWebkitAnim = window.onanimationend === undefined && window.onwebkitanimationend !== undefined;\n transitionProp = isWebkitTrans ? 'WebkitTransition' : 'transition';\n transitionEndEvent = isWebkitTrans ? 'webkitTransitionEnd' : 'transitionend';\n animationProp = isWebkitAnim ? 'WebkitAnimation' : 'animation';\n animationEndEvent = isWebkitAnim ? 'webkitAnimationEnd' : 'animationend';\n}\n\n/**\n * Defer a task to execute it asynchronously. Ideally this\n * should be executed as a microtask, so we leverage\n * MutationObserver if it's available, and fallback to\n * setTimeout(0).\n *\n * @param {Function} cb\n * @param {Object} ctx\n */\n\nvar nextTick = (function () {\n var callbacks = [];\n var pending = false;\n var timerFunc;\n function nextTickHandler() {\n pending = false;\n var copies = callbacks.slice(0);\n callbacks = [];\n for (var i = 0; i < copies.length; i++) {\n copies[i]();\n }\n }\n\n /* istanbul ignore if */\n if (typeof MutationObserver !== 'undefined' && !(isWechat && isIos)) {\n var counter = 1;\n var observer = new MutationObserver(nextTickHandler);\n var textNode = document.createTextNode(counter);\n observer.observe(textNode, {\n characterData: true\n });\n timerFunc = function () {\n counter = (counter + 1) % 2;\n textNode.data = counter;\n };\n } else {\n // webpack attempts to inject a shim for setImmediate\n // if it is used as a global, so we have to work around that to\n // avoid bundling unnecessary code.\n var context = inBrowser ? window : typeof global !== 'undefined' ? global : {};\n timerFunc = context.setImmediate || setTimeout;\n }\n return function (cb, ctx) {\n var func = ctx ? function () {\n cb.call(ctx);\n } : cb;\n callbacks.push(func);\n if (pending) return;\n pending = true;\n timerFunc(nextTickHandler, 0);\n };\n})();\n\nvar _Set = undefined;\n/* istanbul ignore if */\nif (typeof Set !== 'undefined' && Set.toString().match(/native code/)) {\n // use native Set when available.\n _Set = Set;\n} else {\n // a non-standard Set polyfill that only works with primitive keys.\n _Set = function () {\n this.set = Object.create(null);\n };\n _Set.prototype.has = function (key) {\n return this.set[key] !== undefined;\n };\n _Set.prototype.add = function (key) {\n this.set[key] = 1;\n };\n _Set.prototype.clear = function () {\n this.set = Object.create(null);\n };\n}\n\nfunction Cache(limit) {\n this.size = 0;\n this.limit = limit;\n this.head = this.tail = undefined;\n this._keymap = Object.create(null);\n}\n\nvar p = Cache.prototype;\n\n/**\n * Put into the cache associated with .\n * Returns the entry which was removed to make room for\n * the new entry. Otherwise undefined is returned.\n * (i.e. if there was enough room already).\n *\n * @param {String} key\n * @param {*} value\n * @return {Entry|undefined}\n */\n\np.put = function (key, value) {\n var removed;\n if (this.size === this.limit) {\n removed = this.shift();\n }\n\n var entry = this.get(key, true);\n if (!entry) {\n entry = {\n key: key\n };\n this._keymap[key] = entry;\n if (this.tail) {\n this.tail.newer = entry;\n entry.older = this.tail;\n } else {\n this.head = entry;\n }\n this.tail = entry;\n this.size++;\n }\n entry.value = value;\n\n return removed;\n};\n\n/**\n * Purge the least recently used (oldest) entry from the\n * cache. Returns the removed entry or undefined if the\n * cache was empty.\n */\n\np.shift = function () {\n var entry = this.head;\n if (entry) {\n this.head = this.head.newer;\n this.head.older = undefined;\n entry.newer = entry.older = undefined;\n this._keymap[entry.key] = undefined;\n this.size--;\n }\n return entry;\n};\n\n/**\n * Get and register recent use of . Returns the value\n * associated with or undefined if not in cache.\n *\n * @param {String} key\n * @param {Boolean} returnEntry\n * @return {Entry|*}\n */\n\np.get = function (key, returnEntry) {\n var entry = this._keymap[key];\n if (entry === undefined) return;\n if (entry === this.tail) {\n return returnEntry ? entry : entry.value;\n }\n // HEAD--------------TAIL\n // <.older .newer>\n // <--- add direction --\n // A B C E\n if (entry.newer) {\n if (entry === this.head) {\n this.head = entry.newer;\n }\n entry.newer.older = entry.older; // C <-- E.\n }\n if (entry.older) {\n entry.older.newer = entry.newer; // C. --> E\n }\n entry.newer = undefined; // D --x\n entry.older = this.tail; // D. --> E\n if (this.tail) {\n this.tail.newer = entry; // E. <-- D\n }\n this.tail = entry;\n return returnEntry ? entry : entry.value;\n};\n\nvar cache$1 = new Cache(1000);\nvar filterTokenRE = /[^\\s'\"]+|'[^']*'|\"[^\"]*\"/g;\nvar reservedArgRE = /^in$|^-?\\d+/;\n\n/**\n * Parser state\n */\n\nvar str;\nvar dir;\nvar c;\nvar prev;\nvar i;\nvar l;\nvar lastFilterIndex;\nvar inSingle;\nvar inDouble;\nvar curly;\nvar square;\nvar paren;\n/**\n * Push a filter to the current directive object\n */\n\nfunction pushFilter() {\n var exp = str.slice(lastFilterIndex, i).trim();\n var filter;\n if (exp) {\n filter = {};\n var tokens = exp.match(filterTokenRE);\n filter.name = tokens[0];\n if (tokens.length > 1) {\n filter.args = tokens.slice(1).map(processFilterArg);\n }\n }\n if (filter) {\n (dir.filters = dir.filters || []).push(filter);\n }\n lastFilterIndex = i + 1;\n}\n\n/**\n * Check if an argument is dynamic and strip quotes.\n *\n * @param {String} arg\n * @return {Object}\n */\n\nfunction processFilterArg(arg) {\n if (reservedArgRE.test(arg)) {\n return {\n value: toNumber(arg),\n dynamic: false\n };\n } else {\n var stripped = stripQuotes(arg);\n var dynamic = stripped === arg;\n return {\n value: dynamic ? arg : stripped,\n dynamic: dynamic\n };\n }\n}\n\n/**\n * Parse a directive value and extract the expression\n * and its filters into a descriptor.\n *\n * Example:\n *\n * \"a + 1 | uppercase\" will yield:\n * {\n * expression: 'a + 1',\n * filters: [\n * { name: 'uppercase', args: null }\n * ]\n * }\n *\n * @param {String} s\n * @return {Object}\n */\n\nfunction parseDirective(s) {\n var hit = cache$1.get(s);\n if (hit) {\n return hit;\n }\n\n // reset parser state\n str = s;\n inSingle = inDouble = false;\n curly = square = paren = 0;\n lastFilterIndex = 0;\n dir = {};\n\n for (i = 0, l = str.length; i < l; i++) {\n prev = c;\n c = str.charCodeAt(i);\n if (inSingle) {\n // check single quote\n if (c === 0x27 && prev !== 0x5C) inSingle = !inSingle;\n } else if (inDouble) {\n // check double quote\n if (c === 0x22 && prev !== 0x5C) inDouble = !inDouble;\n } else if (c === 0x7C && // pipe\n str.charCodeAt(i + 1) !== 0x7C && str.charCodeAt(i - 1) !== 0x7C) {\n if (dir.expression == null) {\n // first filter, end of expression\n lastFilterIndex = i + 1;\n dir.expression = str.slice(0, i).trim();\n } else {\n // already has filter\n pushFilter();\n }\n } else {\n switch (c) {\n case 0x22:\n inDouble = true;break; // \"\n case 0x27:\n inSingle = true;break; // '\n case 0x28:\n paren++;break; // (\n case 0x29:\n paren--;break; // )\n case 0x5B:\n square++;break; // [\n case 0x5D:\n square--;break; // ]\n case 0x7B:\n curly++;break; // {\n case 0x7D:\n curly--;break; // }\n }\n }\n }\n\n if (dir.expression == null) {\n dir.expression = str.slice(0, i).trim();\n } else if (lastFilterIndex !== 0) {\n pushFilter();\n }\n\n cache$1.put(s, dir);\n return dir;\n}\n\nvar directive = Object.freeze({\n parseDirective: parseDirective\n});\n\nvar regexEscapeRE = /[-.*+?^${}()|[\\]\\/\\\\]/g;\nvar cache = undefined;\nvar tagRE = undefined;\nvar htmlRE = undefined;\n/**\n * Escape a string so it can be used in a RegExp\n * constructor.\n *\n * @param {String} str\n */\n\nfunction escapeRegex(str) {\n return str.replace(regexEscapeRE, '\\\\$&');\n}\n\nfunction compileRegex() {\n var open = escapeRegex(config.delimiters[0]);\n var close = escapeRegex(config.delimiters[1]);\n var unsafeOpen = escapeRegex(config.unsafeDelimiters[0]);\n var unsafeClose = escapeRegex(config.unsafeDelimiters[1]);\n tagRE = new RegExp(unsafeOpen + '((?:.|\\\\n)+?)' + unsafeClose + '|' + open + '((?:.|\\\\n)+?)' + close, 'g');\n htmlRE = new RegExp('^' + unsafeOpen + '.*' + unsafeClose + '$');\n // reset cache\n cache = new Cache(1000);\n}\n\n/**\n * Parse a template text string into an array of tokens.\n *\n * @param {String} text\n * @return {Array | null}\n * - {String} type\n * - {String} value\n * - {Boolean} [html]\n * - {Boolean} [oneTime]\n */\n\nfunction parseText(text) {\n if (!cache) {\n compileRegex();\n }\n var hit = cache.get(text);\n if (hit) {\n return hit;\n }\n if (!tagRE.test(text)) {\n return null;\n }\n var tokens = [];\n var lastIndex = tagRE.lastIndex = 0;\n var match, index, html, value, first, oneTime;\n /* eslint-disable no-cond-assign */\n while (match = tagRE.exec(text)) {\n /* eslint-enable no-cond-assign */\n index = match.index;\n // push text token\n if (index > lastIndex) {\n tokens.push({\n value: text.slice(lastIndex, index)\n });\n }\n // tag token\n html = htmlRE.test(match[0]);\n value = html ? match[1] : match[2];\n first = value.charCodeAt(0);\n oneTime = first === 42; // *\n value = oneTime ? value.slice(1) : value;\n tokens.push({\n tag: true,\n value: value.trim(),\n html: html,\n oneTime: oneTime\n });\n lastIndex = index + match[0].length;\n }\n if (lastIndex < text.length) {\n tokens.push({\n value: text.slice(lastIndex)\n });\n }\n cache.put(text, tokens);\n return tokens;\n}\n\n/**\n * Format a list of tokens into an expression.\n * e.g. tokens parsed from 'a {{b}} c' can be serialized\n * into one single expression as '\"a \" + b + \" c\"'.\n *\n * @param {Array} tokens\n * @param {Vue} [vm]\n * @return {String}\n */\n\nfunction tokensToExp(tokens, vm) {\n if (tokens.length > 1) {\n return tokens.map(function (token) {\n return formatToken(token, vm);\n }).join('+');\n } else {\n return formatToken(tokens[0], vm, true);\n }\n}\n\n/**\n * Format a single token.\n *\n * @param {Object} token\n * @param {Vue} [vm]\n * @param {Boolean} [single]\n * @return {String}\n */\n\nfunction formatToken(token, vm, single) {\n return token.tag ? token.oneTime && vm ? '\"' + vm.$eval(token.value) + '\"' : inlineFilters(token.value, single) : '\"' + token.value + '\"';\n}\n\n/**\n * For an attribute with multiple interpolation tags,\n * e.g. attr=\"some-{{thing | filter}}\", in order to combine\n * the whole thing into a single watchable expression, we\n * have to inline those filters. This function does exactly\n * that. This is a bit hacky but it avoids heavy changes\n * to directive parser and watcher mechanism.\n *\n * @param {String} exp\n * @param {Boolean} single\n * @return {String}\n */\n\nvar filterRE = /[^|]\\|[^|]/;\nfunction inlineFilters(exp, single) {\n if (!filterRE.test(exp)) {\n return single ? exp : '(' + exp + ')';\n } else {\n var dir = parseDirective(exp);\n if (!dir.filters) {\n return '(' + exp + ')';\n } else {\n return 'this._applyFilters(' + dir.expression + // value\n ',null,' + // oldValue (null for read)\n JSON.stringify(dir.filters) + // filter descriptors\n ',false)'; // write?\n }\n }\n}\n\nvar text = Object.freeze({\n compileRegex: compileRegex,\n parseText: parseText,\n tokensToExp: tokensToExp\n});\n\nvar delimiters = ['{{', '}}'];\nvar unsafeDelimiters = ['{{{', '}}}'];\n\nvar config = Object.defineProperties({\n\n /**\n * Whether to print debug messages.\n * Also enables stack trace for warnings.\n *\n * @type {Boolean}\n */\n\n debug: false,\n\n /**\n * Whether to suppress warnings.\n *\n * @type {Boolean}\n */\n\n silent: false,\n\n /**\n * Whether to use async rendering.\n */\n\n async: true,\n\n /**\n * Whether to warn against errors caught when evaluating\n * expressions.\n */\n\n warnExpressionErrors: true,\n\n /**\n * Whether to allow devtools inspection.\n * Disabled by default in production builds.\n */\n\n devtools: process.env.NODE_ENV !== 'production',\n\n /**\n * Internal flag to indicate the delimiters have been\n * changed.\n *\n * @type {Boolean}\n */\n\n _delimitersChanged: true,\n\n /**\n * List of asset types that a component can own.\n *\n * @type {Array}\n */\n\n _assetTypes: ['component', 'directive', 'elementDirective', 'filter', 'transition', 'partial'],\n\n /**\n * prop binding modes\n */\n\n _propBindingModes: {\n ONE_WAY: 0,\n TWO_WAY: 1,\n ONE_TIME: 2\n },\n\n /**\n * Max circular updates allowed in a batcher flush cycle.\n */\n\n _maxUpdateCount: 100\n\n}, {\n delimiters: { /**\n * Interpolation delimiters. Changing these would trigger\n * the text parser to re-compile the regular expressions.\n *\n * @type {Array}\n */\n\n get: function get() {\n return delimiters;\n },\n set: function set(val) {\n delimiters = val;\n compileRegex();\n },\n configurable: true,\n enumerable: true\n },\n unsafeDelimiters: {\n get: function get() {\n return unsafeDelimiters;\n },\n set: function set(val) {\n unsafeDelimiters = val;\n compileRegex();\n },\n configurable: true,\n enumerable: true\n }\n});\n\nvar warn = undefined;\nvar formatComponentName = undefined;\n\nif (process.env.NODE_ENV !== 'production') {\n (function () {\n var hasConsole = typeof console !== 'undefined';\n\n warn = function (msg, vm) {\n if (hasConsole && !config.silent) {\n console.error('[Vue warn]: ' + msg + (vm ? formatComponentName(vm) : ''));\n }\n };\n\n formatComponentName = function (vm) {\n var name = vm._isVue ? vm.$options.name : vm.name;\n return name ? ' (found in component: <' + hyphenate(name) + '>)' : '';\n };\n })();\n}\n\n/**\n * Append with transition.\n *\n * @param {Element} el\n * @param {Element} target\n * @param {Vue} vm\n * @param {Function} [cb]\n */\n\nfunction appendWithTransition(el, target, vm, cb) {\n applyTransition(el, 1, function () {\n target.appendChild(el);\n }, vm, cb);\n}\n\n/**\n * InsertBefore with transition.\n *\n * @param {Element} el\n * @param {Element} target\n * @param {Vue} vm\n * @param {Function} [cb]\n */\n\nfunction beforeWithTransition(el, target, vm, cb) {\n applyTransition(el, 1, function () {\n before(el, target);\n }, vm, cb);\n}\n\n/**\n * Remove with transition.\n *\n * @param {Element} el\n * @param {Vue} vm\n * @param {Function} [cb]\n */\n\nfunction removeWithTransition(el, vm, cb) {\n applyTransition(el, -1, function () {\n remove(el);\n }, vm, cb);\n}\n\n/**\n * Apply transitions with an operation callback.\n *\n * @param {Element} el\n * @param {Number} direction\n * 1: enter\n * -1: leave\n * @param {Function} op - the actual DOM operation\n * @param {Vue} vm\n * @param {Function} [cb]\n */\n\nfunction applyTransition(el, direction, op, vm, cb) {\n var transition = el.__v_trans;\n if (!transition ||\n // skip if there are no js hooks and CSS transition is\n // not supported\n !transition.hooks && !transitionEndEvent ||\n // skip transitions for initial compile\n !vm._isCompiled ||\n // if the vm is being manipulated by a parent directive\n // during the parent's compilation phase, skip the\n // animation.\n vm.$parent && !vm.$parent._isCompiled) {\n op();\n if (cb) cb();\n return;\n }\n var action = direction > 0 ? 'enter' : 'leave';\n transition[action](op, cb);\n}\n\nvar transition = Object.freeze({\n appendWithTransition: appendWithTransition,\n beforeWithTransition: beforeWithTransition,\n removeWithTransition: removeWithTransition,\n applyTransition: applyTransition\n});\n\n/**\n * Query an element selector if it's not an element already.\n *\n * @param {String|Element} el\n * @return {Element}\n */\n\nfunction query(el) {\n if (typeof el === 'string') {\n var selector = el;\n el = document.querySelector(el);\n if (!el) {\n process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + selector);\n }\n }\n return el;\n}\n\n/**\n * Check if a node is in the document.\n * Note: document.documentElement.contains should work here\n * but always returns false for comment nodes in phantomjs,\n * making unit tests difficult. This is fixed by doing the\n * contains() check on the node's parentNode instead of\n * the node itself.\n *\n * @param {Node} node\n * @return {Boolean}\n */\n\nfunction inDoc(node) {\n if (!node) return false;\n var doc = node.ownerDocument.documentElement;\n var parent = node.parentNode;\n return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && doc.contains(parent));\n}\n\n/**\n * Get and remove an attribute from a node.\n *\n * @param {Node} node\n * @param {String} _attr\n */\n\nfunction getAttr(node, _attr) {\n var val = node.getAttribute(_attr);\n if (val !== null) {\n node.removeAttribute(_attr);\n }\n return val;\n}\n\n/**\n * Get an attribute with colon or v-bind: prefix.\n *\n * @param {Node} node\n * @param {String} name\n * @return {String|null}\n */\n\nfunction getBindAttr(node, name) {\n var val = getAttr(node, ':' + name);\n if (val === null) {\n val = getAttr(node, 'v-bind:' + name);\n }\n return val;\n}\n\n/**\n * Check the presence of a bind attribute.\n *\n * @param {Node} node\n * @param {String} name\n * @return {Boolean}\n */\n\nfunction hasBindAttr(node, name) {\n return node.hasAttribute(name) || node.hasAttribute(':' + name) || node.hasAttribute('v-bind:' + name);\n}\n\n/**\n * Insert el before target\n *\n * @param {Element} el\n * @param {Element} target\n */\n\nfunction before(el, target) {\n target.parentNode.insertBefore(el, target);\n}\n\n/**\n * Insert el after target\n *\n * @param {Element} el\n * @param {Element} target\n */\n\nfunction after(el, target) {\n if (target.nextSibling) {\n before(el, target.nextSibling);\n } else {\n target.parentNode.appendChild(el);\n }\n}\n\n/**\n * Remove el from DOM\n *\n * @param {Element} el\n */\n\nfunction remove(el) {\n el.parentNode.removeChild(el);\n}\n\n/**\n * Prepend el to target\n *\n * @param {Element} el\n * @param {Element} target\n */\n\nfunction prepend(el, target) {\n if (target.firstChild) {\n before(el, target.firstChild);\n } else {\n target.appendChild(el);\n }\n}\n\n/**\n * Replace target with el\n *\n * @param {Element} target\n * @param {Element} el\n */\n\nfunction replace(target, el) {\n var parent = target.parentNode;\n if (parent) {\n parent.replaceChild(el, target);\n }\n}\n\n/**\n * Add event listener shorthand.\n *\n * @param {Element} el\n * @param {String} event\n * @param {Function} cb\n * @param {Boolean} [useCapture]\n */\n\nfunction on(el, event, cb, useCapture) {\n el.addEventListener(event, cb, useCapture);\n}\n\n/**\n * Remove event listener shorthand.\n *\n * @param {Element} el\n * @param {String} event\n * @param {Function} cb\n */\n\nfunction off(el, event, cb) {\n el.removeEventListener(event, cb);\n}\n\n/**\n * For IE9 compat: when both class and :class are present\n * getAttribute('class') returns wrong value...\n *\n * @param {Element} el\n * @return {String}\n */\n\nfunction getClass(el) {\n var classname = el.className;\n if (typeof classname === 'object') {\n classname = classname.baseVal || '';\n }\n return classname;\n}\n\n/**\n * In IE9, setAttribute('class') will result in empty class\n * if the element also has the :class attribute; However in\n * PhantomJS, setting `className` does not work on SVG elements...\n * So we have to do a conditional check here.\n *\n * @param {Element} el\n * @param {String} cls\n */\n\nfunction setClass(el, cls) {\n /* istanbul ignore if */\n if (isIE9 && !/svg$/.test(el.namespaceURI)) {\n el.className = cls;\n } else {\n el.setAttribute('class', cls);\n }\n}\n\n/**\n * Add class with compatibility for IE & SVG\n *\n * @param {Element} el\n * @param {String} cls\n */\n\nfunction addClass(el, cls) {\n if (el.classList) {\n el.classList.add(cls);\n } else {\n var cur = ' ' + getClass(el) + ' ';\n if (cur.indexOf(' ' + cls + ' ') < 0) {\n setClass(el, (cur + cls).trim());\n }\n }\n}\n\n/**\n * Remove class with compatibility for IE & SVG\n *\n * @param {Element} el\n * @param {String} cls\n */\n\nfunction removeClass(el, cls) {\n if (el.classList) {\n el.classList.remove(cls);\n } else {\n var cur = ' ' + getClass(el) + ' ';\n var tar = ' ' + cls + ' ';\n while (cur.indexOf(tar) >= 0) {\n cur = cur.replace(tar, ' ');\n }\n setClass(el, cur.trim());\n }\n if (!el.className) {\n el.removeAttribute('class');\n }\n}\n\n/**\n * Extract raw content inside an element into a temporary\n * container div\n *\n * @param {Element} el\n * @param {Boolean} asFragment\n * @return {Element|DocumentFragment}\n */\n\nfunction extractContent(el, asFragment) {\n var child;\n var rawContent;\n /* istanbul ignore if */\n if (isTemplate(el) && isFragment(el.content)) {\n el = el.content;\n }\n if (el.hasChildNodes()) {\n trimNode(el);\n rawContent = asFragment ? document.createDocumentFragment() : document.createElement('div');\n /* eslint-disable no-cond-assign */\n while (child = el.firstChild) {\n /* eslint-enable no-cond-assign */\n rawContent.appendChild(child);\n }\n }\n return rawContent;\n}\n\n/**\n * Trim possible empty head/tail text and comment\n * nodes inside a parent.\n *\n * @param {Node} node\n */\n\nfunction trimNode(node) {\n var child;\n /* eslint-disable no-sequences */\n while ((child = node.firstChild, isTrimmable(child))) {\n node.removeChild(child);\n }\n while ((child = node.lastChild, isTrimmable(child))) {\n node.removeChild(child);\n }\n /* eslint-enable no-sequences */\n}\n\nfunction isTrimmable(node) {\n return node && (node.nodeType === 3 && !node.data.trim() || node.nodeType === 8);\n}\n\n/**\n * Check if an element is a template tag.\n * Note if the template appears inside an SVG its tagName\n * will be in lowercase.\n *\n * @param {Element} el\n */\n\nfunction isTemplate(el) {\n return el.tagName && el.tagName.toLowerCase() === 'template';\n}\n\n/**\n * Create an \"anchor\" for performing dom insertion/removals.\n * This is used in a number of scenarios:\n * - fragment instance\n * - v-html\n * - v-if\n * - v-for\n * - component\n *\n * @param {String} content\n * @param {Boolean} persist - IE trashes empty textNodes on\n * cloneNode(true), so in certain\n * cases the anchor needs to be\n * non-empty to be persisted in\n * templates.\n * @return {Comment|Text}\n */\n\nfunction createAnchor(content, persist) {\n var anchor = config.debug ? document.createComment(content) : document.createTextNode(persist ? ' ' : '');\n anchor.__v_anchor = true;\n return anchor;\n}\n\n/**\n * Find a component ref attribute that starts with $.\n *\n * @param {Element} node\n * @return {String|undefined}\n */\n\nvar refRE = /^v-ref:/;\n\nfunction findRef(node) {\n if (node.hasAttributes()) {\n var attrs = node.attributes;\n for (var i = 0, l = attrs.length; i < l; i++) {\n var name = attrs[i].name;\n if (refRE.test(name)) {\n return camelize(name.replace(refRE, ''));\n }\n }\n }\n}\n\n/**\n * Map a function to a range of nodes .\n *\n * @param {Node} node\n * @param {Node} end\n * @param {Function} op\n */\n\nfunction mapNodeRange(node, end, op) {\n var next;\n while (node !== end) {\n next = node.nextSibling;\n op(node);\n node = next;\n }\n op(end);\n}\n\n/**\n * Remove a range of nodes with transition, store\n * the nodes in a fragment with correct ordering,\n * and call callback when done.\n *\n * @param {Node} start\n * @param {Node} end\n * @param {Vue} vm\n * @param {DocumentFragment} frag\n * @param {Function} cb\n */\n\nfunction removeNodeRange(start, end, vm, frag, cb) {\n var done = false;\n var removed = 0;\n var nodes = [];\n mapNodeRange(start, end, function (node) {\n if (node === end) done = true;\n nodes.push(node);\n removeWithTransition(node, vm, onRemoved);\n });\n function onRemoved() {\n removed++;\n if (done && removed >= nodes.length) {\n for (var i = 0; i < nodes.length; i++) {\n frag.appendChild(nodes[i]);\n }\n cb && cb();\n }\n }\n}\n\n/**\n * Check if a node is a DocumentFragment.\n *\n * @param {Node} node\n * @return {Boolean}\n */\n\nfunction isFragment(node) {\n return node && node.nodeType === 11;\n}\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n *\n * @param {Element} el\n * @return {String}\n */\n\nfunction getOuterHTML(el) {\n if (el.outerHTML) {\n return el.outerHTML;\n } else {\n var container = document.createElement('div');\n container.appendChild(el.cloneNode(true));\n return container.innerHTML;\n }\n}\n\nvar commonTagRE = /^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/i;\nvar reservedTagRE = /^(slot|partial|component)$/i;\n\nvar isUnknownElement = undefined;\nif (process.env.NODE_ENV !== 'production') {\n isUnknownElement = function (el, tag) {\n if (tag.indexOf('-') > -1) {\n // http://stackoverflow.com/a/28210364/1070244\n return el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement;\n } else {\n return (/HTMLUnknownElement/.test(el.toString()) &&\n // Chrome returns unknown for several HTML5 elements.\n // https://code.google.com/p/chromium/issues/detail?id=540526\n !/^(data|time|rtc|rb)$/.test(tag)\n );\n }\n };\n}\n\n/**\n * Check if an element is a component, if yes return its\n * component id.\n *\n * @param {Element} el\n * @param {Object} options\n * @return {Object|undefined}\n */\n\nfunction checkComponentAttr(el, options) {\n var tag = el.tagName.toLowerCase();\n var hasAttrs = el.hasAttributes();\n if (!commonTagRE.test(tag) && !reservedTagRE.test(tag)) {\n if (resolveAsset(options, 'components', tag)) {\n return { id: tag };\n } else {\n var is = hasAttrs && getIsBinding(el, options);\n if (is) {\n return is;\n } else if (process.env.NODE_ENV !== 'production') {\n var expectedTag = options._componentNameMap && options._componentNameMap[tag];\n if (expectedTag) {\n warn('Unknown custom element: <' + tag + '> - ' + 'did you mean <' + expectedTag + '>? ' + 'HTML is case-insensitive, remember to use kebab-case in templates.');\n } else if (isUnknownElement(el, tag)) {\n warn('Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly? For recursive components, ' + 'make sure to provide the \"name\" option.');\n }\n }\n }\n } else if (hasAttrs) {\n return getIsBinding(el, options);\n }\n}\n\n/**\n * Get \"is\" binding from an element.\n *\n * @param {Element} el\n * @param {Object} options\n * @return {Object|undefined}\n */\n\nfunction getIsBinding(el, options) {\n // dynamic syntax\n var exp = el.getAttribute('is');\n if (exp != null) {\n if (resolveAsset(options, 'components', exp)) {\n el.removeAttribute('is');\n return { id: exp };\n }\n } else {\n exp = getBindAttr(el, 'is');\n if (exp != null) {\n return { id: exp, dynamic: true };\n }\n }\n}\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n *\n * All strategy functions follow the same signature:\n *\n * @param {*} parentVal\n * @param {*} childVal\n * @param {Vue} [vm]\n */\n\nvar strats = config.optionMergeStrategies = Object.create(null);\n\n/**\n * Helper that recursively merges two data objects together.\n */\n\nfunction mergeData(to, from) {\n var key, toVal, fromVal;\n for (key in from) {\n toVal = to[key];\n fromVal = from[key];\n if (!hasOwn(to, key)) {\n set(to, key, fromVal);\n } else if (isObject(toVal) && isObject(fromVal)) {\n mergeData(toVal, fromVal);\n }\n }\n return to;\n}\n\n/**\n * Data\n */\n\nstrats.data = function (parentVal, childVal, vm) {\n if (!vm) {\n // in a Vue.extend merge, both should be functions\n if (!childVal) {\n return parentVal;\n }\n if (typeof childVal !== 'function') {\n process.env.NODE_ENV !== 'production' && warn('The \"data\" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);\n return parentVal;\n }\n if (!parentVal) {\n return childVal;\n }\n // when parentVal & childVal are both present,\n // we need to return a function that returns the\n // merged result of both functions... no need to\n // check if parentVal is a function here because\n // it has to be a function to pass previous merges.\n return function mergedDataFn() {\n return mergeData(childVal.call(this), parentVal.call(this));\n };\n } else if (parentVal || childVal) {\n return function mergedInstanceDataFn() {\n // instance merge\n var instanceData = typeof childVal === 'function' ? childVal.call(vm) : childVal;\n var defaultData = typeof parentVal === 'function' ? parentVal.call(vm) : undefined;\n if (instanceData) {\n return mergeData(instanceData, defaultData);\n } else {\n return defaultData;\n }\n };\n }\n};\n\n/**\n * El\n */\n\nstrats.el = function (parentVal, childVal, vm) {\n if (!vm && childVal && typeof childVal !== 'function') {\n process.env.NODE_ENV !== 'production' && warn('The \"el\" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);\n return;\n }\n var ret = childVal || parentVal;\n // invoke the element factory if this is instance merge\n return vm && typeof ret === 'function' ? ret.call(vm) : ret;\n};\n\n/**\n * Hooks and param attributes are merged as arrays.\n */\n\nstrats.init = strats.created = strats.ready = strats.attached = strats.detached = strats.beforeCompile = strats.compiled = strats.beforeDestroy = strats.destroyed = strats.activate = function (parentVal, childVal) {\n return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;\n};\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\n\nfunction mergeAssets(parentVal, childVal) {\n var res = Object.create(parentVal || null);\n return childVal ? extend(res, guardArrayAssets(childVal)) : res;\n}\n\nconfig._assetTypes.forEach(function (type) {\n strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Events & Watchers.\n *\n * Events & watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\n\nstrats.watch = strats.events = function (parentVal, childVal) {\n if (!childVal) return parentVal;\n if (!parentVal) return childVal;\n var ret = {};\n extend(ret, parentVal);\n for (var key in childVal) {\n var parent = ret[key];\n var child = childVal[key];\n if (parent && !isArray(parent)) {\n parent = [parent];\n }\n ret[key] = parent ? parent.concat(child) : [child];\n }\n return ret;\n};\n\n/**\n * Other object hashes.\n */\n\nstrats.props = strats.methods = strats.computed = function (parentVal, childVal) {\n if (!childVal) return parentVal;\n if (!parentVal) return childVal;\n var ret = Object.create(null);\n extend(ret, parentVal);\n extend(ret, childVal);\n return ret;\n};\n\n/**\n * Default strategy.\n */\n\nvar defaultStrat = function defaultStrat(parentVal, childVal) {\n return childVal === undefined ? parentVal : childVal;\n};\n\n/**\n * Make sure component options get converted to actual\n * constructors.\n *\n * @param {Object} options\n */\n\nfunction guardComponents(options) {\n if (options.components) {\n var components = options.components = guardArrayAssets(options.components);\n var ids = Object.keys(components);\n var def;\n if (process.env.NODE_ENV !== 'production') {\n var map = options._componentNameMap = {};\n }\n for (var i = 0, l = ids.length; i < l; i++) {\n var key = ids[i];\n if (commonTagRE.test(key) || reservedTagRE.test(key)) {\n process.env.NODE_ENV !== 'production' && warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + key);\n continue;\n }\n // record a all lowercase <-> kebab-case mapping for\n // possible custom element case error warning\n if (process.env.NODE_ENV !== 'production') {\n map[key.replace(/-/g, '').toLowerCase()] = hyphenate(key);\n }\n def = components[key];\n if (isPlainObject(def)) {\n components[key] = Vue.extend(def);\n }\n }\n }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n *\n * @param {Object} options\n */\n\nfunction guardProps(options) {\n var props = options.props;\n var i, val;\n if (isArray(props)) {\n options.props = {};\n i = props.length;\n while (i--) {\n val = props[i];\n if (typeof val === 'string') {\n options.props[val] = null;\n } else if (val.name) {\n options.props[val.name] = val;\n }\n }\n } else if (isPlainObject(props)) {\n var keys = Object.keys(props);\n i = keys.length;\n while (i--) {\n val = props[keys[i]];\n if (typeof val === 'function') {\n props[keys[i]] = { type: val };\n }\n }\n }\n}\n\n/**\n * Guard an Array-format assets option and converted it\n * into the key-value Object format.\n *\n * @param {Object|Array} assets\n * @return {Object}\n */\n\nfunction guardArrayAssets(assets) {\n if (isArray(assets)) {\n var res = {};\n var i = assets.length;\n var asset;\n while (i--) {\n asset = assets[i];\n var id = typeof asset === 'function' ? asset.options && asset.options.name || asset.id : asset.name || asset.id;\n if (!id) {\n process.env.NODE_ENV !== 'production' && warn('Array-syntax assets must provide a \"name\" or \"id\" field.');\n } else {\n res[id] = asset;\n }\n }\n return res;\n }\n return assets;\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n *\n * @param {Object} parent\n * @param {Object} child\n * @param {Vue} [vm] - if vm is present, indicates this is\n * an instantiation merge.\n */\n\nfunction mergeOptions(parent, child, vm) {\n guardComponents(child);\n guardProps(child);\n if (process.env.NODE_ENV !== 'production') {\n if (child.propsData && !vm) {\n warn('propsData can only be used as an instantiation option.');\n }\n }\n var options = {};\n var key;\n if (child['extends']) {\n parent = typeof child['extends'] === 'function' ? mergeOptions(parent, child['extends'].options, vm) : mergeOptions(parent, child['extends'], vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField(key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options;\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n *\n * @param {Object} options\n * @param {String} type\n * @param {String} id\n * @param {Boolean} warnMissing\n * @return {Object|Function}\n */\n\nfunction resolveAsset(options, type, id, warnMissing) {\n /* istanbul ignore if */\n if (typeof id !== 'string') {\n return;\n }\n var assets = options[type];\n var camelizedId;\n var res = assets[id] ||\n // camelCase ID\n assets[camelizedId = camelize(id)] ||\n // Pascal Case ID\n assets[camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1)];\n if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {\n warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id, options);\n }\n return res;\n}\n\nvar uid$1 = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n *\n * @constructor\n */\nfunction Dep() {\n this.id = uid$1++;\n this.subs = [];\n}\n\n// the current target watcher being evaluated.\n// this is globally unique because there could be only one\n// watcher being evaluated at any time.\nDep.target = null;\n\n/**\n * Add a directive subscriber.\n *\n * @param {Directive} sub\n */\n\nDep.prototype.addSub = function (sub) {\n this.subs.push(sub);\n};\n\n/**\n * Remove a directive subscriber.\n *\n * @param {Directive} sub\n */\n\nDep.prototype.removeSub = function (sub) {\n this.subs.$remove(sub);\n};\n\n/**\n * Add self as a dependency to the target watcher.\n */\n\nDep.prototype.depend = function () {\n Dep.target.addDep(this);\n};\n\n/**\n * Notify all subscribers of a new value.\n */\n\nDep.prototype.notify = function () {\n // stablize the subscriber list first\n var subs = toArray(this.subs);\n for (var i = 0, l = subs.length; i < l; i++) {\n subs[i].update();\n }\n};\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto)\n\n/**\n * Intercept mutating methods and emit events\n */\n\n;['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'].forEach(function (method) {\n // cache original method\n var original = arrayProto[method];\n def(arrayMethods, method, function mutator() {\n // avoid leaking arguments:\n // http://jsperf.com/closure-with-arguments\n var i = arguments.length;\n var args = new Array(i);\n while (i--) {\n args[i] = arguments[i];\n }\n var result = original.apply(this, args);\n var ob = this.__ob__;\n var inserted;\n switch (method) {\n case 'push':\n inserted = args;\n break;\n case 'unshift':\n inserted = args;\n break;\n case 'splice':\n inserted = args.slice(2);\n break;\n }\n if (inserted) ob.observeArray(inserted);\n // notify change\n ob.dep.notify();\n return result;\n });\n});\n\n/**\n * Swap the element at the given index with a new value\n * and emits corresponding event.\n *\n * @param {Number} index\n * @param {*} val\n * @return {*} - replaced element\n */\n\ndef(arrayProto, '$set', function $set(index, val) {\n if (index >= this.length) {\n this.length = Number(index) + 1;\n }\n return this.splice(index, 1, val)[0];\n});\n\n/**\n * Convenience method to remove the element at given index or target element reference.\n *\n * @param {*} item\n */\n\ndef(arrayProto, '$remove', function $remove(item) {\n /* istanbul ignore if */\n if (!this.length) return;\n var index = indexOf(this, item);\n if (index > -1) {\n return this.splice(index, 1);\n }\n});\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * By default, when a reactive property is set, the new value is\n * also converted to become reactive. However in certain cases, e.g.\n * v-for scope alias and props, we don't want to force conversion\n * because the value may be a nested value under a frozen data structure.\n *\n * So whenever we want to set a reactive property without forcing\n * conversion on the new value, we wrap that call inside this function.\n */\n\nvar shouldConvert = true;\n\nfunction withoutConversion(fn) {\n shouldConvert = false;\n fn();\n shouldConvert = true;\n}\n\n/**\n * Observer class that are attached to each observed\n * object. Once attached, the observer converts target\n * object's property keys into getter/setters that\n * collect dependencies and dispatches updates.\n *\n * @param {Array|Object} value\n * @constructor\n */\n\nfunction Observer(value) {\n this.value = value;\n this.dep = new Dep();\n def(value, '__ob__', this);\n if (isArray(value)) {\n var augment = hasProto ? protoAugment : copyAugment;\n augment(value, arrayMethods, arrayKeys);\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n}\n\n// Instance methods\n\n/**\n * Walk through each property and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n *\n * @param {Object} obj\n */\n\nObserver.prototype.walk = function (obj) {\n var keys = Object.keys(obj);\n for (var i = 0, l = keys.length; i < l; i++) {\n this.convert(keys[i], obj[keys[i]]);\n }\n};\n\n/**\n * Observe a list of Array items.\n *\n * @param {Array} items\n */\n\nObserver.prototype.observeArray = function (items) {\n for (var i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n};\n\n/**\n * Convert a property into getter/setter so we can emit\n * the events when the property is accessed/changed.\n *\n * @param {String} key\n * @param {*} val\n */\n\nObserver.prototype.convert = function (key, val) {\n defineReactive(this.value, key, val);\n};\n\n/**\n * Add an owner vm, so that when $set/$delete mutations\n * happen we can notify owner vms to proxy the keys and\n * digest the watchers. This is only called when the object\n * is observed as an instance's root $data.\n *\n * @param {Vue} vm\n */\n\nObserver.prototype.addVm = function (vm) {\n (this.vms || (this.vms = [])).push(vm);\n};\n\n/**\n * Remove an owner vm. This is called when the object is\n * swapped out as an instance's $data object.\n *\n * @param {Vue} vm\n */\n\nObserver.prototype.removeVm = function (vm) {\n this.vms.$remove(vm);\n};\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n *\n * @param {Object|Array} target\n * @param {Object} src\n */\n\nfunction protoAugment(target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}\n\n/**\n * Augment an target Object or Array by defining\n * hidden properties.\n *\n * @param {Object|Array} target\n * @param {Object} proto\n */\n\nfunction copyAugment(target, src, keys) {\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n def(target, key, src[key]);\n }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n *\n * @param {*} value\n * @param {Vue} [vm]\n * @return {Observer|undefined}\n * @static\n */\n\nfunction observe(value, vm) {\n if (!value || typeof value !== 'object') {\n return;\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (shouldConvert && (isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n if (ob && vm) {\n ob.addVm(vm);\n }\n return ob;\n}\n\n/**\n * Define a reactive property on an Object.\n *\n * @param {Object} obj\n * @param {String} key\n * @param {*} val\n */\n\nfunction defineReactive(obj, key, val) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return;\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n\n var childOb = observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter() {\n var value = getter ? getter.call(obj) : val;\n if (Dep.target) {\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n }\n if (isArray(value)) {\n for (var e, i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n }\n }\n }\n return value;\n },\n set: function reactiveSetter(newVal) {\n var value = getter ? getter.call(obj) : val;\n if (newVal === value) {\n return;\n }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = observe(newVal);\n dep.notify();\n }\n });\n}\n\n\n\nvar util = Object.freeze({\n\tdefineReactive: defineReactive,\n\tset: set,\n\tdel: del,\n\thasOwn: hasOwn,\n\tisLiteral: isLiteral,\n\tisReserved: isReserved,\n\t_toString: _toString,\n\ttoNumber: toNumber,\n\ttoBoolean: toBoolean,\n\tstripQuotes: stripQuotes,\n\tcamelize: camelize,\n\thyphenate: hyphenate,\n\tclassify: classify,\n\tbind: bind,\n\ttoArray: toArray,\n\textend: extend,\n\tisObject: isObject,\n\tisPlainObject: isPlainObject,\n\tdef: def,\n\tdebounce: _debounce,\n\tindexOf: indexOf,\n\tcancellable: cancellable,\n\tlooseEqual: looseEqual,\n\tisArray: isArray,\n\thasProto: hasProto,\n\tinBrowser: inBrowser,\n\tdevtools: devtools,\n\tisIE9: isIE9,\n\tisAndroid: isAndroid,\n\tisIos: isIos,\n\tisWechat: isWechat,\n\tget transitionProp () { return transitionProp; },\n\tget transitionEndEvent () { return transitionEndEvent; },\n\tget animationProp () { return animationProp; },\n\tget animationEndEvent () { return animationEndEvent; },\n\tnextTick: nextTick,\n\tget _Set () { return _Set; },\n\tquery: query,\n\tinDoc: inDoc,\n\tgetAttr: getAttr,\n\tgetBindAttr: getBindAttr,\n\thasBindAttr: hasBindAttr,\n\tbefore: before,\n\tafter: after,\n\tremove: remove,\n\tprepend: prepend,\n\treplace: replace,\n\ton: on,\n\toff: off,\n\tsetClass: setClass,\n\taddClass: addClass,\n\tremoveClass: removeClass,\n\textractContent: extractContent,\n\ttrimNode: trimNode,\n\tisTemplate: isTemplate,\n\tcreateAnchor: createAnchor,\n\tfindRef: findRef,\n\tmapNodeRange: mapNodeRange,\n\tremoveNodeRange: removeNodeRange,\n\tisFragment: isFragment,\n\tgetOuterHTML: getOuterHTML,\n\tmergeOptions: mergeOptions,\n\tresolveAsset: resolveAsset,\n\tcheckComponentAttr: checkComponentAttr,\n\tcommonTagRE: commonTagRE,\n\treservedTagRE: reservedTagRE,\n\tget warn () { return warn; }\n});\n\nvar uid = 0;\n\nfunction initMixin (Vue) {\n /**\n * The main init sequence. This is called for every\n * instance, including ones that are created from extended\n * constructors.\n *\n * @param {Object} options - this options object should be\n * the result of merging class\n * options and the options passed\n * in to the constructor.\n */\n\n Vue.prototype._init = function (options) {\n options = options || {};\n\n this.$el = null;\n this.$parent = options.parent;\n this.$root = this.$parent ? this.$parent.$root : this;\n this.$children = [];\n this.$refs = {}; // child vm references\n this.$els = {}; // element references\n this._watchers = []; // all watchers as an array\n this._directives = []; // all directives\n\n // a uid\n this._uid = uid++;\n\n // a flag to avoid this being observed\n this._isVue = true;\n\n // events bookkeeping\n this._events = {}; // registered callbacks\n this._eventsCount = {}; // for $broadcast optimization\n\n // fragment instance properties\n this._isFragment = false;\n this._fragment = // @type {DocumentFragment}\n this._fragmentStart = // @type {Text|Comment}\n this._fragmentEnd = null; // @type {Text|Comment}\n\n // lifecycle state\n this._isCompiled = this._isDestroyed = this._isReady = this._isAttached = this._isBeingDestroyed = this._vForRemoving = false;\n this._unlinkFn = null;\n\n // context:\n // if this is a transcluded component, context\n // will be the common parent vm of this instance\n // and its host.\n this._context = options._context || this.$parent;\n\n // scope:\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 this._scope = options._scope;\n\n // fragment:\n // if this instance is compiled inside a Fragment, it\n // needs to reigster itself as a child of that fragment\n // for attach/detach to work properly.\n this._frag = options._frag;\n if (this._frag) {\n this._frag.children.push(this);\n }\n\n // push self into parent / transclusion host\n if (this.$parent) {\n this.$parent.$children.push(this);\n }\n\n // merge options.\n options = this.$options = mergeOptions(this.constructor.options, options, this);\n\n // set ref\n this._updateRef();\n\n // initialize data as empty object.\n // it will be filled up in _initData().\n this._data = {};\n\n // call init hook\n this._callHook('init');\n\n // initialize data observation and scope inheritance.\n this._initState();\n\n // setup event system and option events.\n this._initEvents();\n\n // call created hook\n this._callHook('created');\n\n // if `el` option is passed, start compilation.\n if (options.el) {\n this.$mount(options.el);\n }\n };\n}\n\nvar pathCache = new Cache(1000);\n\n// actions\nvar APPEND = 0;\nvar PUSH = 1;\nvar INC_SUB_PATH_DEPTH = 2;\nvar PUSH_SUB_PATH = 3;\n\n// states\nvar BEFORE_PATH = 0;\nvar IN_PATH = 1;\nvar BEFORE_IDENT = 2;\nvar IN_IDENT = 3;\nvar IN_SUB_PATH = 4;\nvar IN_SINGLE_QUOTE = 5;\nvar IN_DOUBLE_QUOTE = 6;\nvar AFTER_PATH = 7;\nvar ERROR = 8;\n\nvar pathStateMachine = [];\n\npathStateMachine[BEFORE_PATH] = {\n 'ws': [BEFORE_PATH],\n 'ident': [IN_IDENT, APPEND],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[IN_PATH] = {\n 'ws': [IN_PATH],\n '.': [BEFORE_IDENT],\n '[': [IN_SUB_PATH],\n 'eof': [AFTER_PATH]\n};\n\npathStateMachine[BEFORE_IDENT] = {\n 'ws': [BEFORE_IDENT],\n 'ident': [IN_IDENT, APPEND]\n};\n\npathStateMachine[IN_IDENT] = {\n 'ident': [IN_IDENT, APPEND],\n '0': [IN_IDENT, APPEND],\n 'number': [IN_IDENT, APPEND],\n 'ws': [IN_PATH, PUSH],\n '.': [BEFORE_IDENT, PUSH],\n '[': [IN_SUB_PATH, PUSH],\n 'eof': [AFTER_PATH, PUSH]\n};\n\npathStateMachine[IN_SUB_PATH] = {\n \"'\": [IN_SINGLE_QUOTE, APPEND],\n '\"': [IN_DOUBLE_QUOTE, APPEND],\n '[': [IN_SUB_PATH, INC_SUB_PATH_DEPTH],\n ']': [IN_PATH, PUSH_SUB_PATH],\n 'eof': ERROR,\n 'else': [IN_SUB_PATH, APPEND]\n};\n\npathStateMachine[IN_SINGLE_QUOTE] = {\n \"'\": [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_SINGLE_QUOTE, APPEND]\n};\n\npathStateMachine[IN_DOUBLE_QUOTE] = {\n '\"': [IN_SUB_PATH, APPEND],\n 'eof': ERROR,\n 'else': [IN_DOUBLE_QUOTE, APPEND]\n};\n\n/**\n * Determine the type of a character in a keypath.\n *\n * @param {Char} ch\n * @return {String} type\n */\n\nfunction getPathCharType(ch) {\n if (ch === undefined) {\n return 'eof';\n }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n case 0x30:\n // 0\n return ch;\n\n case 0x5F: // _\n case 0x24:\n // $\n return 'ident';\n\n case 0x20: // Space\n case 0x09: // Tab\n case 0x0A: // Newline\n case 0x0D: // Return\n case 0xA0: // No-break space\n case 0xFEFF: // Byte Order Mark\n case 0x2028: // Line Separator\n case 0x2029:\n // Paragraph Separator\n return 'ws';\n }\n\n // a-z, A-Z\n if (code >= 0x61 && code <= 0x7A || code >= 0x41 && code <= 0x5A) {\n return 'ident';\n }\n\n // 1-9\n if (code >= 0x31 && code <= 0x39) {\n return 'number';\n }\n\n return 'else';\n}\n\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n *\n * @param {String} path\n * @return {String}\n */\n\nfunction formatSubPath(path) {\n var trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) {\n return false;\n }\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed;\n}\n\n/**\n * Parse a string path into an array of segments\n *\n * @param {String} path\n * @return {Array|undefined}\n */\n\nfunction parse(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c, newChar, key, type, transition, action, typeMap;\n\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" || mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode != null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ? c : newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n keys.raw = path;\n return keys;\n }\n }\n}\n\n/**\n * External parse that check for a cache hit first\n *\n * @param {String} path\n * @return {Array|undefined}\n */\n\nfunction parsePath(path) {\n var hit = pathCache.get(path);\n if (!hit) {\n hit = parse(path);\n if (hit) {\n pathCache.put(path, hit);\n }\n }\n return hit;\n}\n\n/**\n * Get from an object from a path string\n *\n * @param {Object} obj\n * @param {String} path\n */\n\nfunction getPath(obj, path) {\n return parseExpression(path).get(obj);\n}\n\n/**\n * Warn against setting non-existent root path on a vm.\n */\n\nvar warnNonExistent;\nif (process.env.NODE_ENV !== 'production') {\n warnNonExistent = function (path, vm) {\n warn('You are setting a non-existent path \"' + path.raw + '\" ' + 'on a vm instance. Consider pre-initializing the property ' + 'with the \"data\" option for more reliable reactivity ' + 'and better performance.', vm);\n };\n}\n\n/**\n * Set on an object from a path\n *\n * @param {Object} obj\n * @param {String | Array} path\n * @param {*} val\n */\n\nfunction setPath(obj, path, val) {\n var original = obj;\n if (typeof path === 'string') {\n path = parse(path);\n }\n if (!path || !isObject(obj)) {\n return false;\n }\n var last, key;\n for (var i = 0, l = path.length; i < l; i++) {\n last = obj;\n key = path[i];\n if (key.charAt(0) === '*') {\n key = parseExpression(key.slice(1)).get.call(original, original);\n }\n if (i < l - 1) {\n obj = obj[key];\n if (!isObject(obj)) {\n obj = {};\n if (process.env.NODE_ENV !== 'production' && last._isVue) {\n warnNonExistent(path, last);\n }\n set(last, key, obj);\n }\n } else {\n if (isArray(obj)) {\n obj.$set(key, val);\n } else if (key in obj) {\n obj[key] = val;\n } else {\n if (process.env.NODE_ENV !== 'production' && obj._isVue) {\n warnNonExistent(path, obj);\n }\n set(obj, key, val);\n }\n }\n }\n return true;\n}\n\nvar path = Object.freeze({\n parsePath: parsePath,\n getPath: getPath,\n setPath: setPath\n});\n\nvar expressionCache = new Cache(1000);\n\nvar allowedKeywords = 'Math,Date,this,true,false,null,undefined,Infinity,NaN,' + 'isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,' + 'encodeURIComponent,parseInt,parseFloat';\nvar allowedKeywordsRE = new RegExp('^(' + allowedKeywords.replace(/,/g, '\\\\b|') + '\\\\b)');\n\n// keywords that don't make sense inside expressions\nvar improperKeywords = 'break,case,class,catch,const,continue,debugger,default,' + 'delete,do,else,export,extends,finally,for,function,if,' + 'import,in,instanceof,let,return,super,switch,throw,try,' + 'var,while,with,yield,enum,await,implements,package,' + 'protected,static,interface,private,public';\nvar improperKeywordsRE = new RegExp('^(' + improperKeywords.replace(/,/g, '\\\\b|') + '\\\\b)');\n\nvar wsRE = /\\s/g;\nvar newlineRE = /\\n/g;\nvar saveRE = /[\\{,]\\s*[\\w\\$_]+\\s*:|('(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`)|new |typeof |void /g;\nvar restoreRE = /\"(\\d+)\"/g;\nvar pathTestRE = /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?'\\]|\\[\".*?\"\\]|\\[\\d+\\]|\\[[A-Za-z_$][\\w$]*\\])*$/;\nvar identRE = /[^\\w$\\.](?:[A-Za-z_$][\\w$]*)/g;\nvar booleanLiteralRE = /^(?:true|false)$/;\n\n/**\n * Save / Rewrite / Restore\n *\n * When rewriting paths found in an expression, it is\n * possible for the same letter sequences to be found in\n * strings and Object literal property keys. Therefore we\n * remove and store these parts in a temporary array, and\n * restore them after the path rewrite.\n */\n\nvar saved = [];\n\n/**\n * Save replacer\n *\n * The save regex can match two possible cases:\n * 1. An opening object literal\n * 2. A string\n * If matched as a plain string, we need to escape its\n * newlines, since the string needs to be preserved when\n * generating the function body.\n *\n * @param {String} str\n * @param {String} isString - str if matched as a string\n * @return {String} - placeholder with index\n */\n\nfunction save(str, isString) {\n var i = saved.length;\n saved[i] = isString ? str.replace(newlineRE, '\\\\n') : str;\n return '\"' + i + '\"';\n}\n\n/**\n * Path rewrite replacer\n *\n * @param {String} raw\n * @return {String}\n */\n\nfunction rewrite(raw) {\n var c = raw.charAt(0);\n var path = raw.slice(1);\n if (allowedKeywordsRE.test(path)) {\n return raw;\n } else {\n path = path.indexOf('\"') > -1 ? path.replace(restoreRE, restore) : path;\n return c + 'scope.' + path;\n }\n}\n\n/**\n * Restore replacer\n *\n * @param {String} str\n * @param {String} i - matched save index\n * @return {String}\n */\n\nfunction restore(str, i) {\n return saved[i];\n}\n\n/**\n * Rewrite an expression, prefixing all path accessors with\n * `scope.` and generate getter/setter functions.\n *\n * @param {String} exp\n * @return {Function}\n */\n\nfunction compileGetter(exp) {\n if (improperKeywordsRE.test(exp)) {\n process.env.NODE_ENV !== 'production' && warn('Avoid using reserved keywords in expression: ' + exp);\n }\n // reset state\n saved.length = 0;\n // save strings and object literal keys\n var body = exp.replace(saveRE, save).replace(wsRE, '');\n // rewrite all paths\n // pad 1 space here becaue the regex matches 1 extra char\n body = (' ' + body).replace(identRE, rewrite).replace(restoreRE, restore);\n return makeGetterFn(body);\n}\n\n/**\n * Build a getter function. Requires eval.\n *\n * We isolate the try/catch so it doesn't affect the\n * optimization of the parse function when it is not called.\n *\n * @param {String} body\n * @return {Function|undefined}\n */\n\nfunction makeGetterFn(body) {\n try {\n /* eslint-disable no-new-func */\n return new Function('scope', 'return ' + body + ';');\n /* eslint-enable no-new-func */\n } catch (e) {\n process.env.NODE_ENV !== 'production' && warn('Invalid expression. ' + 'Generated function body: ' + body);\n }\n}\n\n/**\n * Compile a setter function for the expression.\n *\n * @param {String} exp\n * @return {Function|undefined}\n */\n\nfunction compileSetter(exp) {\n var path = parsePath(exp);\n if (path) {\n return function (scope, val) {\n setPath(scope, path, val);\n };\n } else {\n process.env.NODE_ENV !== 'production' && warn('Invalid setter expression: ' + exp);\n }\n}\n\n/**\n * Parse an expression into re-written getter/setters.\n *\n * @param {String} exp\n * @param {Boolean} needSet\n * @return {Function}\n */\n\nfunction parseExpression(exp, needSet) {\n exp = exp.trim();\n // try cache\n var hit = expressionCache.get(exp);\n if (hit) {\n if (needSet && !hit.set) {\n hit.set = compileSetter(hit.exp);\n }\n return hit;\n }\n var res = { exp: exp };\n res.get = isSimplePath(exp) && exp.indexOf('[') < 0\n // optimized super simple getter\n ? makeGetterFn('scope.' + exp)\n // dynamic getter\n : compileGetter(exp);\n if (needSet) {\n res.set = compileSetter(exp);\n }\n expressionCache.put(exp, res);\n return res;\n}\n\n/**\n * Check if an expression is a simple path.\n *\n * @param {String} exp\n * @return {Boolean}\n */\n\nfunction isSimplePath(exp) {\n return pathTestRE.test(exp) &&\n // don't treat true/false as paths\n !booleanLiteralRE.test(exp) &&\n // Math constants e.g. Math.PI, Math.E etc.\n exp.slice(0, 5) !== 'Math.';\n}\n\nvar expression = Object.freeze({\n parseExpression: parseExpression,\n isSimplePath: isSimplePath\n});\n\n// we have two separate queues: one for directive updates\n// and one for user watcher registered via $watch().\n// we want to guarantee directive updates to be called\n// before user watchers so that when user watchers are\n// triggered, the DOM would have already been in updated\n// state.\n\nvar queue = [];\nvar userQueue = [];\nvar has = {};\nvar circular = {};\nvar waiting = false;\n\n/**\n * Reset the batcher's state.\n */\n\nfunction resetBatcherState() {\n queue.length = 0;\n userQueue.length = 0;\n has = {};\n circular = {};\n waiting = false;\n}\n\n/**\n * Flush both queues and run the watchers.\n */\n\nfunction flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}\n\n/**\n * Run the watchers in a single queue.\n *\n * @param {Array} queue\n */\n\nfunction runBatcherQueue(queue) {\n // do not cache length because more watchers might be pushed\n // as we run existing watchers\n for (var i = 0; i < queue.length; i++) {\n var watcher = queue[i];\n var id = watcher.id;\n has[id] = null;\n watcher.run();\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production' && has[id] != null) {\n circular[id] = (circular[id] || 0) + 1;\n if (circular[id] > config._maxUpdateCount) {\n warn('You may have an infinite update loop for watcher ' + 'with expression \"' + watcher.expression + '\"', watcher.vm);\n break;\n }\n }\n }\n queue.length = 0;\n}\n\n/**\n * Push a watcher into the watcher queue.\n * Jobs with duplicate IDs will be skipped unless it's\n * pushed when the queue is being flushed.\n *\n * @param {Watcher} watcher\n * properties:\n * - {Number} id\n * - {Function} run\n */\n\nfunction pushWatcher(watcher) {\n var id = watcher.id;\n if (has[id] == null) {\n // push watcher into appropriate queue\n var q = watcher.user ? userQueue : queue;\n has[id] = q.length;\n q.push(watcher);\n // queue the flush\n if (!waiting) {\n waiting = true;\n nextTick(flushBatcherQueue);\n }\n }\n}\n\nvar uid$2 = 0;\n\n/**\n * A watcher parses an expression, collects dependencies,\n * and fires callback when the expression value changes.\n * This is used for both the $watch() api and directives.\n *\n * @param {Vue} vm\n * @param {String|Function} expOrFn\n * @param {Function} cb\n * @param {Object} options\n * - {Array} filters\n * - {Boolean} twoWay\n * - {Boolean} deep\n * - {Boolean} user\n * - {Boolean} sync\n * - {Boolean} lazy\n * - {Function} [preProcess]\n * - {Function} [postProcess]\n * @constructor\n */\nfunction Watcher(vm, expOrFn, cb, options) {\n // mix in options\n if (options) {\n extend(this, options);\n }\n var isFn = typeof expOrFn === 'function';\n this.vm = vm;\n vm._watchers.push(this);\n this.expression = expOrFn;\n this.cb = cb;\n this.id = ++uid$2; // uid for batching\n this.active = true;\n this.dirty = this.lazy; // for lazy watchers\n this.deps = [];\n this.newDeps = [];\n this.depIds = new _Set();\n this.newDepIds = new _Set();\n this.prevError = null; // for async error stacks\n // parse expression for getter/setter\n if (isFn) {\n this.getter = expOrFn;\n this.setter = undefined;\n } else {\n var res = parseExpression(expOrFn, this.twoWay);\n this.getter = res.get;\n this.setter = res.set;\n }\n this.value = this.lazy ? undefined : this.get();\n // state for avoiding false triggers for deep and Array\n // watchers during vm._digest()\n this.queued = this.shallow = false;\n}\n\n/**\n * Evaluate the getter, and re-collect dependencies.\n */\n\nWatcher.prototype.get = function () {\n this.beforeGet();\n var scope = this.scope || this.vm;\n var value;\n try {\n value = this.getter.call(scope, scope);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && config.warnExpressionErrors) {\n warn('Error when evaluating expression ' + '\"' + this.expression + '\": ' + e.toString(), this.vm);\n }\n }\n // \"touch\" every property so they are all tracked as\n // dependencies for deep watching\n if (this.deep) {\n traverse(value);\n }\n if (this.preProcess) {\n value = this.preProcess(value);\n }\n if (this.filters) {\n value = scope._applyFilters(value, null, this.filters, false);\n }\n if (this.postProcess) {\n value = this.postProcess(value);\n }\n this.afterGet();\n return value;\n};\n\n/**\n * Set the corresponding value with the setter.\n *\n * @param {*} value\n */\n\nWatcher.prototype.set = function (value) {\n var scope = this.scope || this.vm;\n if (this.filters) {\n value = scope._applyFilters(value, this.value, this.filters, true);\n }\n try {\n this.setter.call(scope, scope, value);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && config.warnExpressionErrors) {\n warn('Error when evaluating setter ' + '\"' + this.expression + '\": ' + e.toString(), this.vm);\n }\n }\n // two-way sync for v-for alias\n var forContext = scope.$forContext;\n if (forContext && forContext.alias === this.expression) {\n if (forContext.filters) {\n process.env.NODE_ENV !== 'production' && warn('It seems you are using two-way binding on ' + 'a v-for alias (' + this.expression + '), and the ' + 'v-for has filters. This will not work properly. ' + 'Either remove the filters or use an array of ' + 'objects and bind to object properties instead.', this.vm);\n return;\n }\n forContext._withLock(function () {\n if (scope.$key) {\n // original is an object\n forContext.rawValue[scope.$key] = value;\n } else {\n forContext.rawValue.$set(scope.$index, value);\n }\n });\n }\n};\n\n/**\n * Prepare for dependency collection.\n */\n\nWatcher.prototype.beforeGet = function () {\n Dep.target = this;\n};\n\n/**\n * Add a dependency to this directive.\n *\n * @param {Dep} dep\n */\n\nWatcher.prototype.addDep = function (dep) {\n var id = dep.id;\n if (!this.newDepIds.has(id)) {\n this.newDepIds.add(id);\n this.newDeps.push(dep);\n if (!this.depIds.has(id)) {\n dep.addSub(this);\n }\n }\n};\n\n/**\n * Clean up for dependency collection.\n */\n\nWatcher.prototype.afterGet = function () {\n Dep.target = null;\n var i = this.deps.length;\n while (i--) {\n var dep = this.deps[i];\n if (!this.newDepIds.has(dep.id)) {\n dep.removeSub(this);\n }\n }\n var tmp = this.depIds;\n this.depIds = this.newDepIds;\n this.newDepIds = tmp;\n this.newDepIds.clear();\n tmp = this.deps;\n this.deps = this.newDeps;\n this.newDeps = tmp;\n this.newDeps.length = 0;\n};\n\n/**\n * Subscriber interface.\n * Will be called when a dependency changes.\n *\n * @param {Boolean} shallow\n */\n\nWatcher.prototype.update = function (shallow) {\n if (this.lazy) {\n this.dirty = true;\n } else if (this.sync || !config.async) {\n this.run();\n } else {\n // if queued, only overwrite shallow with non-shallow,\n // but not the other way around.\n this.shallow = this.queued ? shallow ? this.shallow : false : !!shallow;\n this.queued = true;\n // record before-push error stack in debug mode\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && config.debug) {\n this.prevError = new Error('[vue] async stack trace');\n }\n pushWatcher(this);\n }\n};\n\n/**\n * Batcher job interface.\n * Will be called by the batcher.\n */\n\nWatcher.prototype.run = function () {\n if (this.active) {\n var value = this.get();\n if (value !== this.value ||\n // Deep watchers and watchers on Object/Arrays should fire even\n // when the value is the same, because the value may\n // have mutated; but only do so if this is a\n // non-shallow update (caused by a vm digest).\n (isObject(value) || this.deep) && !this.shallow) {\n // set new value\n var oldValue = this.value;\n this.value = value;\n // in debug + async mode, when a watcher callbacks\n // throws, we also throw the saved before-push error\n // so the full cross-tick stack trace is available.\n var prevError = this.prevError;\n /* istanbul ignore if */\n if (process.env.NODE_ENV !== 'production' && config.debug && prevError) {\n this.prevError = null;\n try {\n this.cb.call(this.vm, value, oldValue);\n } catch (e) {\n nextTick(function () {\n throw prevError;\n }, 0);\n throw e;\n }\n } else {\n this.cb.call(this.vm, value, oldValue);\n }\n }\n this.queued = this.shallow = false;\n }\n};\n\n/**\n * Evaluate the value of the watcher.\n * This only gets called for lazy watchers.\n */\n\nWatcher.prototype.evaluate = function () {\n // avoid overwriting another watcher that is being\n // collected.\n var current = Dep.target;\n this.value = this.get();\n this.dirty = false;\n Dep.target = current;\n};\n\n/**\n * Depend on all deps collected by this watcher.\n */\n\nWatcher.prototype.depend = function () {\n var i = this.deps.length;\n while (i--) {\n this.deps[i].depend();\n }\n};\n\n/**\n * Remove self from all dependencies' subcriber list.\n */\n\nWatcher.prototype.teardown = function () {\n if (this.active) {\n // remove self from vm's watcher list\n // this is a somewhat expensive operation so we skip it\n // if the vm is being destroyed or is performing a v-for\n // re-render (the watcher list is then filtered by v-for).\n if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {\n this.vm._watchers.$remove(this);\n }\n var i = this.deps.length;\n while (i--) {\n this.deps[i].removeSub(this);\n }\n this.active = false;\n this.vm = this.cb = this.value = null;\n }\n};\n\n/**\n * Recrusively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n *\n * @param {*} val\n */\n\nvar seenObjects = new _Set();\nfunction traverse(val, seen) {\n var i = undefined,\n keys = undefined;\n if (!seen) {\n seen = seenObjects;\n seen.clear();\n }\n var isA = isArray(val);\n var isO = isObject(val);\n if (isA || isO) {\n if (val.__ob__) {\n var depId = val.__ob__.dep.id;\n if (seen.has(depId)) {\n return;\n } else {\n seen.add(depId);\n }\n }\n if (isA) {\n i = val.length;\n while (i--) traverse(val[i], seen);\n } else if (isO) {\n keys = Object.keys(val);\n i = keys.length;\n while (i--) traverse(val[keys[i]], seen);\n }\n }\n}\n\nvar text$1 = {\n\n bind: function bind() {\n this.attr = this.el.nodeType === 3 ? 'data' : 'textContent';\n },\n\n update: function update(value) {\n this.el[this.attr] = _toString(value);\n }\n};\n\nvar templateCache = new Cache(1000);\nvar idSelectorCache = new Cache(1000);\n\nvar map = {\n efault: [0, '', ''],\n legend: [1, '
', '
'],\n tr: [2, '', '
'],\n col: [2, '', '
']\n};\n\nmap.td = map.th = [3, '', '
'];\n\nmap.option = map.optgroup = [1, ''];\n\nmap.thead = map.tbody = map.colgroup = map.caption = map.tfoot = [1, '', '
'];\n\nmap.g = map.defs = map.symbol = map.use = map.image = map.text = map.circle = map.ellipse = map.line = map.path = map.polygon = map.polyline = map.rect = [1, '', ''];\n\n/**\n * Check if a node is a supported template node with a\n * DocumentFragment content.\n *\n * @param {Node} node\n * @return {Boolean}\n */\n\nfunction isRealTemplate(node) {\n return isTemplate(node) && isFragment(node.content);\n}\n\nvar tagRE$1 = /<([\\w:-]+)/;\nvar entityRE = /&#?\\w+?;/;\n\n/**\n * Convert a string template to a DocumentFragment.\n * Determines correct wrapping by tag types. Wrapping\n * strategy found in jQuery & component/domify.\n *\n * @param {String} templateString\n * @param {Boolean} raw\n * @return {DocumentFragment}\n */\n\nfunction stringToFragment(templateString, raw) {\n // try a cache hit first\n var cacheKey = raw ? templateString : templateString.trim();\n var hit = templateCache.get(cacheKey);\n if (hit) {\n return hit;\n }\n\n var frag = document.createDocumentFragment();\n var tagMatch = templateString.match(tagRE$1);\n var entityMatch = entityRE.test(templateString);\n\n if (!tagMatch && !entityMatch) {\n // text only, return a single text node.\n frag.appendChild(document.createTextNode(templateString));\n } else {\n var tag = tagMatch && tagMatch[1];\n var wrap = map[tag] || map.efault;\n var depth = wrap[0];\n var prefix = wrap[1];\n var suffix = wrap[2];\n var node = document.createElement('div');\n\n node.innerHTML = prefix + templateString + suffix;\n while (depth--) {\n node = node.lastChild;\n }\n\n var child;\n /* eslint-disable no-cond-assign */\n while (child = node.firstChild) {\n /* eslint-enable no-cond-assign */\n frag.appendChild(child);\n }\n }\n if (!raw) {\n trimNode(frag);\n }\n templateCache.put(cacheKey, frag);\n return frag;\n}\n\n/**\n * Convert a template node to a DocumentFragment.\n *\n * @param {Node} node\n * @return {DocumentFragment}\n */\n\nfunction nodeToFragment(node) {\n // if its a template tag and the browser supports it,\n // its content is already a document fragment. However, iOS Safari has\n // bug when using directly cloned template content with touch\n // events and can cause crashes when the nodes are removed from DOM, so we\n // have to treat template elements as string templates. (#2805)\n /* istanbul ignore if */\n if (isRealTemplate(node)) {\n return stringToFragment(node.innerHTML);\n }\n // script template\n if (node.tagName === 'SCRIPT') {\n return stringToFragment(node.textContent);\n }\n // normal node, clone it to avoid mutating the original\n var clonedNode = cloneNode(node);\n var frag = document.createDocumentFragment();\n var child;\n /* eslint-disable no-cond-assign */\n while (child = clonedNode.firstChild) {\n /* eslint-enable no-cond-assign */\n frag.appendChild(child);\n }\n trimNode(frag);\n return frag;\n}\n\n// Test for the presence of the Safari template cloning bug\n// https://bugs.webkit.org/showug.cgi?id=137755\nvar hasBrokenTemplate = (function () {\n /* istanbul ignore else */\n if (inBrowser) {\n var a = document.createElement('div');\n a.innerHTML = '';\n return !a.cloneNode(true).firstChild.innerHTML;\n } else {\n return false;\n }\n})();\n\n// Test for IE10/11 textarea placeholder clone bug\nvar hasTextareaCloneBug = (function () {\n /* istanbul ignore else */\n if (inBrowser) {\n var t = document.createElement('textarea');\n t.placeholder = 't';\n return t.cloneNode(true).value === 't';\n } else {\n return false;\n }\n})();\n\n/**\n * 1. Deal with Safari cloning nested