[
  {
    "path": ".babelrc",
    "content": "{\n  \"env\": {\n    \"test\": {\n      \"presets\": [\n        [\"@babel/preset-env\", {\n          \"targets\": {\"node\": \"current\"},\n          \"modules\": \"commonjs\"\n        }],\n        \"@babel/preset-flow\"\n      ]\n    }\n  }\n}"
  },
  {
    "path": ".eslintignore",
    "content": "flow\ndist\npackages\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"root\": true,\n  \"parserOptions\": {\n    \"parser\": \"babel-eslint\",\n    \"ecmaVersion\": 2018,\n    \"sourceType\": \"module\"\n  },\n  \"env\": {\n    \"es6\": true,\n    \"node\": true,\n    \"browser\": true\n  },\n  \"plugins\": [\n    \"flowtype\",\n    \"prettier\"\n  ],\n  \"extends\": [\n    \"eslint:recommended\",\n    \"plugin:flowtype/recommended\",\n    \"plugin:prettier/recommended\"\n  ],\n  \"rules\": {\n    \"prettier/prettier\": [\"error\"],\n    \"no-console\": 0,\n    \"no-useless-escape\": 0,\n    \"no-empty\": 0,\n    \"semi\": [\"error\", \"never\"],\n    \"comma-dangle\": [\"error\", \"always-multiline\"]\n  },\n  \"globals\": {\n    \"__WEEX__\": true\n  }\n}"
  },
  {
    "path": ".flowconfig",
    "content": "[ignore]\n.*/__tests__/.*\n.*/node_modules/.*\n.*/examples/.*\n.*/packages/.*\n.*/scripts/.*\n\n[include]\n\n[libs]\nflow\n\n[options]\nunsafe.enable_getters_and_setters=true\nmodule.name_mapper='^compiler/\\(.*\\)$' -> '<PROJECT_ROOT>/src/compiler/\\1'\nmodule.name_mapper='^core/\\(.*\\)$' -> '<PROJECT_ROOT>/src/core/\\1'\nmodule.name_mapper='^shared/\\(.*\\)$' -> '<PROJECT_ROOT>/src/shared/\\1'\nmodule.name_mapper='^web/\\(.*\\)$' -> '<PROJECT_ROOT>/src/platforms/web/\\1'\nmodule.name_mapper='^weex/\\(.*\\)$' -> '<PROJECT_ROOT>/src/platforms/weex/\\1'\nmodule.name_mapper='^vue-native/\\(.*\\)$' -> '<PROJECT_ROOT>/src/platforms/vue-native/\\1'\nmodule.name_mapper='^server/\\(.*\\)$' -> '<PROJECT_ROOT>/src/server/\\1'\nmodule.name_mapper='^entries/\\(.*\\)$' -> '<PROJECT_ROOT>/src/entries/\\1'\nmodule.name_mapper='^sfc/\\(.*\\)$' -> '<PROJECT_ROOT>/src/sfc/\\1'\nsuppress_comment= \\\\(.\\\\|\\n\\\\)*\\\\$flow-disable-line\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: vue-native-core\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncustom: # Replace with a single custom sponsorship URL\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---bug-report.md",
    "content": "---\nname: \"\\U0001F41E Bug report\"\nabout: Spotted a bug in Vue Native?\ntitle: ''\nlabels: ''\n\n---\n\n**Description of the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**What I expected**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Did I use `vue-native-cli` to create the project?**\nYes/No\n\n**Am I using Expo?**\nYes/No\n- If you created your project with `vue-native init <projectName>` then yes\n- If you used `vue-native init <projectName> --no-expo`, then no\n\n**Development platform (please complete the following information):**\n - OS: [e.g. iOS]\n - Shell/terminal: [e.g. ZSH, PowerShell]\n\n**The device on which I run my Vue Native app**\n - Device: [e.g. iPhone6]\n - OS: [e.g. iOS8.1]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---issue-with-the-documentation-or-website.md",
    "content": "---\nname: \"\\U0001F4D6 Issue with the documentation or website\"\nabout: Spotted something incorrect or outdated in the docs? Website not rendering correctly?\ntitle: ''\nlabels: ''\n\n---\n\nThis repository only hosts the core packages of Vue Native.\n\nIf you have an issue with the docs or website, please create an issue in the [Vue Native Website repository](https://github.com/GeekyAnts/vue-native-website/issues).\n\nIssues opened here that are related to the documentation/website will be closed.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---issue-with-vue-native-router.md",
    "content": "---\nname: \"\\U0001F9ED Issue with Vue Native Router\"\nabout: Having trouble with Vue Native Router?\ntitle: ''\nlabels: ''\n\n---\n\nThis repository only hosts the core packages of Vue Native.\n\nIf you have an issue with Vue Native Router, please create an issue in the [Vue Native Router repository](https://github.com/GeekyAnts/vue-native-router/issues).\n\nIssues opened here that are related to Vue Native Router will be closed.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---questions-or-help-with-usage.md",
    "content": "---\nname: \"\\U0001F9D0 Questions or help with usage\"\nabout: Need help with code or Vue Native usage?\ntitle: 'Question: '\nlabels: ''\n\n---\n\nThe best place to find answers is the [documentation](https://www.vue-native.io/docs/installation.html)  📖\n\nIf you still haven't found what you are looking for or need more help, feel free to reach out on [Vue Native Slack](http://slack.vue-native.io/)\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n.vscode\n.idea\n\nnode_modules\n\n*.log\n\ndist/*.gz\ndist/*.map\ndist/vue.common.min.js\n\ncoverage\n\npackages/**/build.js\npackages/**/package-lock.json\npackages/**/.watchmanconfig\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"parser\": \"babel\",\n  \"semi\": false,\n  \"trailingComma\": \"all\",\n  \"singleQuote\": true\n}"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\nAll notable changes to this project will be documented in this file.\n\n## [ 0.0.1 ] - 2018-08-01\n### :zap: Improvements\n- Support for v-model in switch.\n- `render-prop` and `render-prop-fn` as API to provide a way to pass JSX as props (inline jsx props) or callback which      returns JSX thus avoiding the need to use JSX for components such as Flat List.\n- Named Slots support and Basic scoped slots support."
  },
  {
    "path": "COMPONENT.md",
    "content": "# Vue Component API\n> Vue component actually runs in the React runtime. It means, you can not access [VNode](https://vuejs.org/v2/api/#VNode-Interface), you can not use [Render](https://vuejs.org/v2/guide/render-function.html). Conversely, if your previous Vue component does not involve both things, it would most likely run directly in React. \n\n* web: [react-vue-loader](https://github.com/SmallComfort/react-vue-loader) ([demo](https://github.com/SmallComfort/react-vue-material-demo))\n* native: [vue-native-scripts](https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-scripts) ([demo](https://github.com/SmallComfort/HackerNews))\n\n## Supported API\n\n#### Global Config\n> Use the react-vue-loader options: [```vue```](https://github.com/SmallComfort/react-vue-loader#additional-options)\n* [silent](https://vuejs.org/v2/api/#silent)\n\n* [optionMergeStrategies](https://vuejs.org/v2/api/#optionMergeStrategies)\n* [errorHandler](https://vuejs.org/v2/api/#errorHandler)\n* [ignoredElements](https://vuejs.org/v2/api/#ignoredElements) (web only)\n* [keyCodes](https://vuejs.org/v2/api/#keyCodes) (web only)\n\n#### Global API\n> Use the react-vue-loader options: [```vue```](https://github.com/SmallComfort/react-vue-loader#additional-options)\n* [Vue.extend](https://vuejs.org/v2/api/#Vue-extend)\n\n* [Vue.nextTick](https://vuejs.org/v2/api/#Vue-nextTick)\n* [Vue.set](https://vuejs.org/v2/api/#Vue-set)\n* [Vue.delete](https://vuejs.org/v2/api/#Vue-delete)\n* [Vue.directive](https://vuejs.org/v2/api/#Vue-directive) (web only)\n  > [partial support](https://github.com/SmallComfort/react-vue/blob/dev/packages/react-vue/COMPONENT.md#options--assets)\n* [Vue.component](https://vuejs.org/v2/api/#Vue-component)\n* [Vue.use](https://vuejs.org/v2/api/#Vue-use)\n* [Vue.mixin](https://vuejs.org/v2/api/#Vue-mixin)\n* [Vue.version](https://vuejs.org/v2/api/#Vue-version)\n\n#### Options / Data\n* [data](https://vuejs.org/v2/api/#data)\n\n* [props](https://vuejs.org/v2/api/#props)\n* [computed](https://vuejs.org/v2/api/#computed)\n* [methods](https://vuejs.org/v2/api/#methods)\n* [watch](https://vuejs.org/v2/api/#watch)\n\n#### Options / Lifecycle Hooks\n* [beforeCreate](https://vuejs.org/v2/api/#beforeCreate)\n\n* [created](https://vuejs.org/v2/api/#created)\n* [beforeMount](https://vuejs.org/v2/api/#beforeMount)\n* [mounted](https://vuejs.org/v2/api/#mounted)\n* [beforeUpdate](https://vuejs.org/v2/api/#beforeUpdate)\n* [updated](https://vuejs.org/v2/api/#updated)\n* [beforeDestroy](https://vuejs.org/v2/api/#beforeDestroy)\n\n#### Options / Assets\n* [directives](https://vuejs.org/v2/api/#directives) (web only)\n  * [Hook-Functions](https://vuejs.org/v2/guide/custom-directive.html#Hook-Functions)\n    * bind\n    * update\n    * unbind\n  * [Directive-Hook-Arguments](https://vuejs.org/v2/guide/custom-directive.html#Directive-Hook-Arguments)\n    * el\n    * binding\n    * vnode (only one property ```context```)\n\n* [components](https://vuejs.org/v2/api/#components)\n\n#### Options / Composition\n* [mixins](https://vuejs.org/v2/api/#mixins)\n\n* [extends](https://vuejs.org/v2/api/#extends)\n\n  > Only options object is allowed\n\n#### Options / Misc\n* [name](https://vuejs.org/v2/api/#name)\n\n#### Instance Properties\n* [vm.$data](https://vuejs.org/v2/api/#vm-data)\n\n* [vm.$props](https://vuejs.org/v2/api/#vm-props)\n* [vm.$el](https://vuejs.org/v2/api/#vm-el)\n* [vm.$options](https://vuejs.org/v2/api/#vm-options)\n* [vm.$parent](https://vuejs.org/v2/api/#vm-parent)\n* [vm.$root](https://vuejs.org/v2/api/#vm-root)\n* [vm.$children](https://vuejs.org/v2/api/#vm-children)\n* [vm.$slots](https://vuejs.org/v2/api/#vm-slots)\n* [vm.$refs](https://vuejs.org/v2/api/#vm-refs)\n\n#### Instance Methods / Data\n* [vm.$watch](https://vuejs.org/v2/api/#vm-watch)\n\n* [vm.$set](https://vuejs.org/v2/api/#vm-set)\n* [vm.$delete](https://vuejs.org/v2/api/#vm-delete)\n\n#### Instance Methods / Events\n* [vm.$on](https://vuejs.org/v2/api/#vm-on)\n\n* [vm.$once](https://vuejs.org/v2/api/#vm-once)\n* [vm.$off](https://vuejs.org/v2/api/#vm-off)\n* [vm.$emit](https://vuejs.org/v2/api/#vm-emit)\n\n#### Instance Methods / Lifecycle\n* [vm.$forceUpdate](https://vuejs.org/v2/api/#vm-forceUpdate)\n\n* [vm.$nextTick](https://vuejs.org/v2/api/#vm-nextTick)\n\n#### Directives\n* [v-text](https://vuejs.org/v2/api/#v-text) (web only)\n\n* [v-html](https://vuejs.org/v2/api/#v-html) (web only)\n* [v-show](https://vuejs.org/v2/api/#v-show)\n* [v-if](https://vuejs.org/v2/api/#v-if)\n* [v-else](https://vuejs.org/v2/api/#v-else)\n* [v-else-if](https://vuejs.org/v2/api/#v-else-if)\n* [v-for](https://vuejs.org/v2/api/#v-for)\n* [v-on](https://vuejs.org/v2/api/#v-on) (web only)\n* [v-bind](https://vuejs.org/v2/api/#v-bind)\n* [v-model](https://vuejs.org/v2/api/#v-model) (web only)\n  > Unsupported features: [value bindings checkbox](https://vuejs.org/v2/guide/forms.html#Checkbox-1) & [value bindings select options](https://vuejs.org/v2/guide/forms.html#Select-Options)\n\n#### Special Attributes\n* [key](https://vuejs.org/v2/api/#key)\n\n* [ref](https://vuejs.org/v2/api/#ref)\n* [slot](https://vuejs.org/v2/api/#slot)\n* [is](https://vuejs.org/v2/api/#is)\n\n#### Built-In Components\n* [component](https://vuejs.org/v2/api/#component)\n\n* [transition](https://vuejs.org/v2/api/#transition) (web only)\n  > The \\<transition> would render an extra DOM element, you can configure ```tag``` attribute to custom the extra DOM element\n\n  > Unsupported features: [transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes)\n\n* [slot](https://vuejs.org/v2/api/#slot)\n\n#### Server-Side Rendering (web only)\n  > Use React Server Rendering\n\n## Unsupported API\n\n#### Global Config\n* ~~[performance](https://vuejs.org/v2/api/#performance)~~\n* ~~[devtools](https://vuejs.org/v2/api/#devtools)~~\n* ~~[productionTip](https://vuejs.org/v2/api/#productionTip)~~\n\n#### Global API\n* ~~[Vue.filter](https://vuejs.org/v2/api/#Vue-filter)~~\n\n* ~~[Vue.compile](https://vuejs.org/v2/api/#Vue-compile)~~\n\n#### Options / Data\n* ~~[propsData](https://vuejs.org/v2/api/#propsData)~~\n\n#### Options / DOM\n* ~~[el](https://vuejs.org/v2/api/#el)~~\n\n* ~~[template](https://vuejs.org/v2/api/#template)~~\n* ~~[render](https://vuejs.org/v2/api/#render)~~\n* ~~[renderError](https://vuejs.org/v2/api/#renderError)~~\n\n#### Options / Lifecycle Hooks\n* ~~[activated](https://vuejs.org/v2/api/#activated)~~\n\n* ~~[deactivated](https://vuejs.org/v2/api/#deactivated)~~\n* ~~[destroyed](https://vuejs.org/v2/api/#destroyed)~~\n\n#### Options / Assets\n* ~~[filters](https://vuejs.org/v2/api/#filters)~~\n\n#### Options / Misc\n* ~~[delimiters](https://vuejs.org/v2/api/#delimiters)~~\n\n* ~~[functional](https://vuejs.org/v2/api/#functional)~~\n* ~~[model](https://vuejs.org/v2/api/#model)~~\n\n#### Instance Properties\n* ~~[vm.$scopedSlots](https://vuejs.org/v2/api/#vm-scopedSlots)~~\n\n* ~~[vm.$isServer](https://vuejs.org/v2/api/#vm-isServer)~~\n\n#### Instance Methods / Lifecycle\n* ~~[vm.$mount](https://vuejs.org/v2/api/#vm-mount)~~\n\n* ~~[vm.$destroy](https://vuejs.org/v2/api/#vm-destroy)~~\n\n#### Directives\n* ~~[v-pre](https://vuejs.org/v2/api/#v-pre)~~\n\n* ~~[v-cloak](https://vuejs.org/v2/api/#v-cloak)~~\n* ~~[v-once](https://vuejs.org/v2/api/#v-once)~~\n\n#### Built-In Components\n* ~~[transition-group](https://vuejs.org/v2/api/#transition-group)~~\n* ~~[keep-alive](https://vuejs.org/v2/api/#keep-alive)~~\n\n#### ~~VNode Interface~~\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013-present, Yuxi (Evan) You\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "## ⚠️ This project has been deprecated and is no longer maintained ⚠️\n\n# Vue Native\n\n[![No Maintenance Intended](https://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\nVisit our website at [vue-native.io](https://vue-native.io) or read the official documentation [here](https://vue-native.io/docs/installation.html).\n\n## Build native mobile apps using Vue\n\nVue Native is a framework to build cross platform native mobile apps using JavaScript. It is a wrapper around the APIs of React Native. So, with Vue Native, you can do everything that you can do with React Native. With Vue Native, you get\n\n- **The simplicity of Vue.js.** Incrementally build user interfaces with the familiar syntax of HTML and CSS in single file components.\n- **Seamless interop with React Native.** Use core React Native components with Vue.js syntax out of the box to develop mobile apps on both iOS and Android.\n\n## Contents\n- [Documentation](#documentation)\n- [Installation](#installation)\n- [Project setup with Vue Native CLI](#project-setup-with-vue-native-cli)\n- [Using Vue Native with a pre-existing React Native or Expo project](#using-vue-native-in-a-react-native-project)\n- [Available React Native components](#available-react-native-components)\n- [Contributors](#contributors)\n- [License](#license)\n- [Special thanks](#credits-to-react-vue)\n\n## Documentation\n\nYou can find the full documentation for Vue Native [on this website](https://vue-native.io/docs/installation.html). It covers installation and setup, component basics, routing, testing, the internal API and more.\n\nThe source for the Vue Native documentation and website is hosted on a separate repo, [here](https://github.com/GeekyAnts/vue-native-website)\n\n\n## About Vue Native\n\n   Vue Native is developed and maintained by [GeekyAnts](https://geekyants.com?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core),\n   specialists in [cross-platform mobile development](https://geekyants.com/solution/universal-and-cross-platform-app-development-services?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core).\n\n   ### Why Choose Vue Native?\n\n   - Write Vue.js code, get native mobile apps\n   - Leverage existing Vue.js knowledge\n   - Access React Native's ecosystem\n\n   ### Professional Services\n\n   Looking to build a production app with Vue Native? Our\n   [mobile engineering team](https://geekyants.com/service/hire-mobile-app-development-services?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core)\n   can help you:\n\n   - Architect scalable mobile applications\n   - Migrate from other frameworks\n   - Optimize app performance\n\n   [Get in touch](https://geekyants.com/hire?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core)\n\n## Installation\n\nTo install Vue Native's official CLI, run\n```\n$ npm install vue-native-cli -g\n```\n\nTo use the CLI, you must have either [expo-cli](https://github.com/expo/expo-cli) or [react-native-cli](https://github.com/react-native-community/cli) installed globally.\n\n## Project setup with Vue Native CLI\n\nThe Vue Native CLI can be used to easily generate a fully configured Vue Native app. It wraps `expo-cli` and `react-native-cli` to generate a simple single page application (SPA) after installing and configuring dependencies from [vue-native-core](https://github.com/GeekyAnts/vue-native-core).\n\nYou should have either expo-cli or react-native-cli installed as a global dependency. Refer to the [installation guide](https://vue-native.io/docs/installation.html) for details on project setup. The GitHub repository for Vue Native CLI is hosted [here](https://github.com/GeekyAnts/vue-native-cli).\n\nWith the CLI, generating a Vue Native project is as easy as running the command\n```\n$ vue-native init <projectName>\n```\n\n## Using Vue Native in a React Native project\n\nIt is possible to integrate Vue Native into a pre-existing React Native project. You can find instructions to do this [here](converting-react-native-project.md).\n\nThese instructions can also be used to set up a Vue Native project from scratch.\n\n## Available React Native components\n\nAll the core components of React Native 0.63 onwards are globally registered and available to use in templates without the need to import and locally register.\n\n[The components and their React Native documentation can be found here.](https://reactnative.dev/docs/components-and-apis)\n\nAll other components that were previously available, but then deprecated from React Native can still be used by installing their respective packages.\n\nFor example, to use `WebView`, use the [react-native-webview](https://github.com/react-native-webview/react-native-webview) package.\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. \n<a href=\"https://github.com/GeekyAnts/vue-native-core/contributors\"><img src=\"https://opencollective.com/vue-native-core/contributors.svg?width=890&button=false\" /></a>\n\nMaintained by [GeekyAnts](https://geekyants.com?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core) -\n   [Cross-Platform Development Experts](https://geekyants.com/solution/universal-and-cross-platform-app-development-services?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core)\n\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\n## Credits to [react-vue](https://github.com/SmallComfort/react-vue)\n\nA huge thanks to the author of react-vue for most of the work on Vue Native.\n"
  },
  {
    "path": "__tests__/unit/features/instance/init.spec.js",
    "content": "import Vue from 'vue-native/index'\n\ndescribe('Initialization', () => {\n  function noop () {}\n\n  let asserted\n\n  function createCompareFn (spy) {\n    const hasWarned = msg => {\n      var count = spy.calls.count()\n      var args\n      while (count--) {\n        args = spy.calls.argsFor(count)\n        if (args.some(containsMsg)) {\n          return true\n        }\n      }\n\n      function containsMsg (arg) {\n        return arg.toString().indexOf(msg) > -1\n      }\n    }\n\n    return {\n      compare: msg => {\n        asserted = asserted.concat(msg)\n        var warned = Array.isArray(msg)\n          ? msg.some(hasWarned)\n          : hasWarned(msg)\n        return {\n          pass: warned,\n          message: warned\n            ? 'Expected message \"' + msg + '\" not to have been warned'\n            : 'Expected message \"' + msg + '\" to have been warned'\n        }\n      }\n    }\n  }\n\n  // define custom matcher for warnings\n  beforeEach(() => {\n    asserted = []\n    spyOn(console, 'warn')\n    spyOn(console, 'error')\n    jasmine.addMatchers({\n      toHaveBeenWarned: () => createCompareFn(console.error),\n      toHaveBeenTipped: () => createCompareFn(console.warn)\n    })\n  })\n\n  afterEach(done => {\n    const warned = msg => asserted.some(assertedMsg => msg.toString().indexOf(assertedMsg) > -1)\n    let count = console.error.calls.count()\n    let args\n    while (count--) {\n      args = console.error.calls.argsFor(count)\n      if (!warned(args[0])) {\n        done.fail(`Unexpected console.error message: ${args[0]}`)\n        return\n      }\n    }\n    done()\n  })\n\n  it('without new', () => {\n    try { Vue() } catch (e) {}\n    expect('Vue is a constructor and should be called with the `new` keyword').toHaveBeenWarned()\n  })\n\n  it('with new', () => {\n    expect(new Vue() instanceof Vue).toBe(true)\n  })\n})\n"
  },
  {
    "path": "converting-react-native-project.md",
    "content": "## Setting up a React Native project for Vue Native\n\n[Vue Native CLI](https://github.com/GeekyAnts/vue-native-cli) is the recommended way to setup a new Vue Native project. However, if you wish to setup a project from scratch, use the following steps after setting up a React Native / Expo project.\n\n### Step 1: Install\n\nThe following packages are required as runtime dependencies by Vue Native:\n- [vue-native-core](https://www.npmjs.com/package/vue-native-core)\n- [vue-native-helper](https://www.npmjs.com/package/vue-native-helper)\n\nDuring development, another package is required to transpile Vue Native component files (with `.vue` extensions) into JS:\n- [vue-native-scripts](https://www.npmjs.com/package/vue-native-scripts)\n\nTo install them, run the following commands in your project directory\n```\n$ npm install --save vue-native-core vue-native-helper\n$ npm install --save-dev vue-native-scripts\n```\n\n### Step 2: Configure the React Native bundler\n\nThe Metro bundler is used by React Native to generate app bundles. It can be configured using a `metro.config.js` file. Add the following to your `metro.config.js` (make one to your project's root if you don't have one already):\n\n```js\nconst { getDefaultConfig } = require(\"metro-config\");\n\nmodule.exports = (async () => {\n  const {\n    resolver: { sourceExts }\n  } = await getDefaultConfig();\n  return {\n    transformer: {\n      babelTransformerPath: require.resolve(\"./vueTransformerPlugin.js\"),\n      getTransformOptions: async () => ({\n        transform: {\n          experimentalImportSupport: false,\n          inlineRequires: false,\n        },\n      })\n    },\n    resolver: {\n      sourceExts: [...sourceExts, \"vue\"]\n    }\n  };\n})();\n```\n\n#### NOTE to Expo users:\n\nThe `app.json` file must be modified to allow `.vue` files to be recognised.\n\n```diff\n{\n  \"expo\": {\n    \"sdkVersion\": \"34.0.0\",\n    \"platforms\": [\n      \"ios\",\n      \"android\",\n      \"web\"\n    ],\n    ...\n    \"packagerOpts\": {\n+     \"sourceExts\": [\"js\", \"json\", \"ts\", \"tsx\", \"vue\"],\n      \"config\": \"metro.config.js\"\n    }\n  }\n}\n```\n\n\nThe `babelTransformPath` property above takes the path to the transformer you wish to use. In our case, we need to create a `vueTransformerPlugin.js` file to the project's root and specify supported extensions:\n\n```js\nconst vueNativeScripts = require(\"vue-native-scripts\");\n\nconst upstreamTransformer = require(\"metro-react-native-babel-transformer\");\n\nconst vueExtensions = [\"vue\"]; // <-- Add other extensions if needed.\n\nmodule.exports.transform = function ({ src, filename, options }) {\n  if (vueExtensions.some(ext => filename.endsWith(\".\" + ext))) {\n    return vueNativeScripts.transform({ src, filename, options });\n  }\n  return upstreamTransformer.transform({ src, filename, options });\n};\n```\n\nThis file conditionally transforms files based on their extensions. `vue-native-scripts` is used for `.vue` files, while the stock React Native Babel transformer is used for other (JS) files.\n\n## Using Vue Native components and `.vue` files\n\nIn the React Native application, you can simply `import` your Vue components as follows\n\n```\nimport VueComponent from './VueComponent.vue'\n```\n\nThere should be a file named `VueComponent.vue` in the corresponding folder; the transformer parses this file and sends it to the React Native bundler.\n"
  },
  {
    "path": "flow/compiler.js",
    "content": "declare type CompilerOptions = {\n  warn?: Function; // allow customizing warning in different environments; e.g. node\n  expectHTML?: boolean; // only false for non-web builds\n  modules?: Array<ModuleOptions>; // platform specific modules; e.g. style; class\n  staticKeys?: string; // a list of AST properties to be considered static; for optimization\n  directives?: { [key: string]: Function }; // platform specific directives\n  isUnaryTag?: (tag: string) => ?boolean; // check if a tag is unary for the platform\n  canBeLeftOpenTag?: (tag: string) => ?boolean; // check if a tag can be left opened\n  isReservedTag?: (tag: string) => ?boolean; // check if a tag is a native for the platform\n  mustUseProp?: (tag: string, type: ?string, name: string) => boolean; // check if an attribute should be bound as a property\n  isPreTag?: (attr: string) => ?boolean; // check if a tag needs to preserve whitespace\n  getTagNamespace?: (tag: string) => ?string; // check the namespace for a tag\n  transforms?: Array<Function>; // a list of transforms on parsed AST before codegen\n  preserveWhitespace?: boolean;\n  isFromDOM?: boolean;\n  shouldDecodeTags?: boolean;\n  shouldDecodeNewlines?: boolean;\n\n  // runtime user-configurable\n  delimiters?: [string, string]; // template delimiters\n}\n\ndeclare type CompiledResult = {\n  ast: ?ASTElement;\n  render: string;\n  staticRenderFns: Array<string>;\n  errors?: Array<string>;\n  tips?: Array<string>;\n}\n\ndeclare type CompiledFunctionResult = {\n  render: Function;\n  staticRenderFns: Array<Function>;\n}\n\ndeclare type ModuleOptions = {\n  preTransformNode: (el: ASTElement) => void;\n  transformNode: (el: ASTElement) => void; // transform an element's AST node\n  postTransformNode: (el: ASTElement) => void;\n  genData: (el: ASTElement) => string; // generate extra data string for an element\n  transformCode?: (el: ASTElement, code: string) => string; // further transform generated code for an element\n  staticKeys?: Array<string>; // AST properties to be considered static\n}\n\ndeclare type ASTModifiers = { [key: string]: boolean }\ndeclare type ASTIfConditions = Array<{ exp: ?string; block: ASTElement }>\n\ndeclare type ASTElementHandler = {\n  value: string;\n  modifiers: ?ASTModifiers;\n}\n\ndeclare type ASTElementHandlers = {\n  [key: string]: ASTElementHandler | Array<ASTElementHandler>;\n}\n\ndeclare type ASTDirective = {\n  name: string;\n  rawName: string;\n  value: string;\n  arg: ?string;\n  modifiers: ?ASTModifiers;\n}\n\ndeclare type ASTNode = ASTElement | ASTText | ASTExpression\n\ndeclare type ASTElement = {\n  type: 1;\n  tag: string;\n  attrsList: Array<{ name: string; value: string }>;\n  attrsMap: { [key: string]: string | null };\n  parent: ASTElement | void;\n  children: Array<ASTNode>;\n\n  static?: boolean;\n  staticRoot?: boolean;\n  staticInFor?: boolean;\n  staticProcessed?: boolean;\n  hasBindings?: boolean;\n\n  text?: string;\n  attrs?: Array<{ name: string; value: string }>;\n  props?: Array<{ name: string; value: string }>;\n  plain?: boolean;\n  pre?: true;\n  ns?: string;\n\n  component?: string;\n  inlineTemplate?: true;\n  transitionMode?: string | null;\n  slotName?: ?string;\n  slotTarget?: ?string;\n  slotScope?: ?string;\n  scopedSlots?: { [name: string]: ASTElement };\n\n  ref?: string;\n  refInFor?: boolean;\n\n  if?: string;\n  ifProcessed?: boolean;\n  elseif?: string;\n  else?: true;\n  ifConditions?: ASTIfConditions;\n\n  for?: string;\n  forProcessed?: boolean;\n  key?: string;\n  alias?: string;\n  iterator1?: string;\n  iterator2?: string;\n\n  staticClass?: string;\n  classBinding?: string;\n  staticStyle?: string;\n  styleBinding?: string;\n  events?: ASTElementHandlers;\n  nativeEvents?: ASTElementHandlers;\n\n  transition?: string | true;\n  transitionOnAppear?: boolean;\n\n  model?: {\n    value: string;\n    callback: string;\n    expression: string;\n  };\n\n  directives?: Array<ASTDirective>;\n\n  forbidden?: true;\n  once?: true;\n  onceProcessed?: boolean;\n  wrapData?: (code: string) => string;\n\n  // weex specific\n  appendAsTree?: boolean;\n}\n\ndeclare type ASTExpression = {\n  type: 2;\n  expression: string;\n  text: string;\n  static?: boolean;\n}\n\ndeclare type ASTText = {\n  type: 3;\n  text: string;\n  static?: boolean;\n}\n\n// SFC-parser related declarations\n\n// an object format describing a single-file component.\ndeclare type SFCDescriptor = {\n  template: ?SFCBlock;\n  script: ?SFCBlock;\n  styles: Array<SFCBlock>;\n  customBlocks: Array<SFCCustomBlock>;\n}\n\ndeclare type SFCCustomBlock = {\n  type: string;\n  content: string;\n  start?: number;\n  end?: number;\n  src?: string;\n  attrs: {[attribute:string]: string};\n}\n\ndeclare type SFCBlock = {\n  type: string;\n  content: string;\n  start?: number;\n  end?: number;\n  lang?: string;\n  src?: string;\n  scoped?: boolean;\n  module?: string | boolean;\n}\n"
  },
  {
    "path": "flow/component.js",
    "content": "import type { Config } from '../src/core/config'\nimport type VNode from '../src/core/vdom/vnode'\nimport type Watcher from '../src/core/observer/watcher'\n\ndeclare interface Component {\n  // constructor information\n  static cid: number;\n  static options: Object;\n  // extend\n  static extend: (options: Object) => Function;\n  static superOptions: Object;\n  static extendOptions: Object;\n  static sealedOptions: Object;\n  static super: Class<Component>;\n  // assets\n  static directive: (id: string, def?: Function | Object) => Function | Object | void;\n  static component: (id: string, def?: Class<Component> | Object) => Class<Component>;\n  static filter: (id: string, def?: Function) => Function | void;\n\n  // public properties\n  $el: any; // so that we can attach __vue__ to it\n  $data: Object;\n  $options: ComponentOptions;\n  $parent: Component | void;\n  $root: Component;\n  $children: Array<Component>;\n  $refs: { [key: string]: Component | Element | Array<Component | Element> | void };\n  $slots: { [key: string]: Array<VNode> };\n  $scopedSlots: { [key: string]: () => VNodeChildren };\n  $vnode: VNode; // the placeholder node for the component in parent's render tree\n  $isServer: boolean;\n  $props: Object;\n\n  // public methods\n  $mount: (el?: Element | string, hydrating?: boolean) => Component;\n  $forceUpdate: () => void;\n  $destroy: () => void;\n  $set: <T>(target: Object | Array<T>, key: string | number, val: T) => T;\n  $delete: <T>(target: Object | Array<T>, key: string | number) => void;\n  $watch: (expOrFn: string | Function, cb: Function, options?: Object) => Function;\n  $on: (event: string | Array<string>, fn: Function) => Component;\n  $once: (event: string, fn: Function) => Component;\n  $off: (event?: string | Array<string>, fn?: Function) => Component;\n  $emit: (event: string, ...args: Array<mixed>) => Component;\n  $nextTick: (fn: Function) => void;\n  $createElement: (tag?: string | Component, data?: Object, children?: VNodeChildren) => VNode;\n\n  // private properties\n  _uid: number;\n  _name: string; // this only exists in dev mode\n  _isVue: true;\n  _self: Component;\n  _renderProxy: Component;\n  _renderContext: ?Component;\n  _watcher: Watcher;\n  _watchers: Array<Watcher>;\n  _computedWatchers: { [key: string]: Watcher };\n  _data: Object;\n  _props: Object;\n  _events: Object;\n  _inactive: boolean | null;\n  _directInactive: boolean;\n  _isMounted: boolean;\n  _isDestroyed: boolean;\n  _isBeingDestroyed: boolean;\n  _vnode: ?VNode; // self root node\n  _staticTrees: ?Array<VNode>;\n  _hasHookEvent: boolean;\n  _provided: ?Object;\n\n  // private methods\n  // lifecycle\n  _init: Function;\n  _mount: (el?: Element | void, hydrating?: boolean) => Component;\n  _update: (vnode: VNode, hydrating?: boolean) => void;\n  // rendering\n  _render: () => VNode;\n  __patch__: (a: Element | VNode | void, b: VNode) => any;\n  // createElement\n  // _c is internal that accepts `normalizationType` optimization hint\n  _c: (vnode?: VNode, data?: VNodeData, children?: VNodeChildren, normalizationType?: number) => VNode | void;\n  // renderStatic\n  _m: (index: number, isInFor?: boolean) => VNode | VNodeChildren;\n  // markOnce\n  _o: (vnode: VNode | Array<VNode>, index: number, key: string) => VNode | VNodeChildren;\n  // toString\n  _s: (value: mixed) => string;\n  // text to VNode\n  _v: (value: string | number) => VNode;\n  // toNumber\n  _n: (value: string) => number | string;\n  // empty vnode\n  _e: () => VNode;\n  // loose equal\n  _q: (a: mixed, b: mixed) => boolean;\n  // loose indexOf\n  _i: (arr: Array<mixed>, val: mixed) => number;\n  // resolveFilter\n  _f: (id: string) => Function;\n  // renderList\n  _l: (val: mixed, render: Function) => ?Array<VNode>;\n  // renderSlot\n  _t: (name: string, fallback: ?Array<VNode>, props: ?Object) => ?Array<VNode>;\n  // apply v-bind object\n  _b: (data: any, value: any, asProp?: boolean) => VNodeData;\n  // check custom keyCode\n  _k: (eventKeyCode: number, key: string, builtInAlias: number | Array<number> | void) => boolean;\n  // resolve scoped slots\n  _u: (scopedSlots: Array<[string, Function]>) => { [key: string]: Function };\n\n  // allow dynamic method registration\n  [key: string]: any\n}\n"
  },
  {
    "path": "flow/global-api.js",
    "content": "declare interface GlobalAPI {\n  cid: number;\n  options: Object;\n  config: Config;\n  util: Object;\n\n  extend: (options: Object) => Function;\n  set: <T>(target: Object | Array<T>, key: string | number, value: T) => T;\n  delete: <T>(target: Object| Array<T>, key: string | number) => void;\n  nextTick: (fn: Function, context?: Object) => void;\n  use: (plugin: Function | Object) => void;\n  mixin: (mixin: Object) => void;\n  compile: (template: string) => { render: Function, staticRenderFns: Array<Function> };\n\n  directive: (id: string, def?: Function | Object) => Function | Object | void;\n  component: (id: string, def?: Class<Component> | Object) => Class<Component>;\n  filter: (id: string, def?: Function) => Function | void;\n\n  // allow dynamic method registration\n  [key: string]: any\n}\n"
  },
  {
    "path": "flow/modules.js",
    "content": "declare module 'he' {\n  declare function escape(html: string): string;\n  declare function decode(html: string): string;\n}\n\ndeclare module 'source-map' {\n  declare class SourceMapGenerator {\n    setSourceContent(filename: string, content: string): void;\n    addMapping(mapping: Object): void;\n    toString(): string;\n  }\n  declare class SourceMapConsumer {\n    originalPositionFor(position: { line: number; column: number; }): {\n      source: ?string;\n      line: ?number;\n      column: ?number;\n    };\n  }\n}\n\ndeclare module 'lru-cache' {\n  declare var exports: {\n    (): any\n  }\n}\n\ndeclare module 'de-indent' {\n  declare var exports: {\n    (input: string): string\n  }\n}\n\ndeclare module 'serialize-javascript' {\n  declare var exports: {\n    (input: string, options: { isJSON: boolean }): string\n  }\n}\n\ndeclare module 'lodash.template' {\n  declare var exports: {\n    (input: string, options: { interpolate: RegExp, escape: RegExp }): Function\n  }\n}\n\ndeclare module 'change-case' {\n  declare var exports: {\n    (): any\n  }\n}\n"
  },
  {
    "path": "flow/options.js",
    "content": "declare type InternalComponentOptions = {\n  _isComponent: true;\n  parent: Component;\n  propsData: ?Object;\n  _parentVnode: VNode;\n  _parentListeners: ?Object;\n  _renderChildren: ?Array<VNode>;\n  _componentTag: ?string;\n  _parentElm: ?Node;\n  _refElm: ?Node;\n  render?: Function;\n  staticRenderFns?: Array<Function>\n}\n\ndeclare type ComponentOptions = {\n  // data\n  data: Object | Function | void;\n  props?: { [key: string]: PropOptions };\n  propsData?: ?Object;\n  computed?: {\n    [key: string]: Function | {\n      get?: Function;\n      set?: Function;\n      cache?: boolean\n    }\n  };\n  methods?: { [key: string]: Function };\n  watch?: { [key: string]: Function | string };\n\n  // DOM\n  el?: string | Element;\n  template?: string;\n  render: (h: () => VNode) => VNode;\n  renderError?: (h: () => VNode, err: Error) => VNode;\n  staticRenderFns?: Array<() => VNode>;\n\n  // lifecycle\n  beforeCreate?: Function;\n  created?: Function;\n  beforeMount?: Function;\n  mounted?: Function;\n  beforeUpdate?: Function;\n  updated?: Function;\n  activated?: Function;\n  deactivated?: Function;\n  beforeDestroy?: Function;\n  destroyed?: Function;\n\n  // assets\n  directives?: { [key: string]: Object };\n  components?: { [key: string]: Class<Component> };\n  transitions?: { [key: string]: Object };\n  filters?: { [key: string]: Function };\n\n  // context\n  provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };\n  inject?: { [key: string]: string | Symbol } | Array<string>;\n\n  // component v-model customization\n  model?: {\n    prop?: string;\n    event?: string;\n  };\n\n  // misc\n  parent?: Component;\n  mixins?: Array<Object>;\n  name?: string;\n  extends?: Class<Component> | Object;\n  delimiters?: [string, string];\n\n  // private\n  _isComponent?: true;\n  _propKeys?: Array<string>;\n  _parentVnode?: VNode;\n  _parentListeners?: ?Object;\n  _renderChildren?: ?Array<VNode>;\n  _componentTag: ?string;\n  _scopeId: ?string;\n  _base: Class<Component>;\n  _parentElm: ?Node;\n  _refElm: ?Node;\n}\n\ndeclare type PropOptions = {\n  type: Function | Array<Function> | null;\n  default: any;\n  required: ?boolean;\n  validator: ?Function;\n}\n"
  },
  {
    "path": "flow/ssr.js",
    "content": "declare type ComponentWithCacheContext = {\n  type: 'ComponentWithCache';\n  bufferIndex: number;\n  buffer: Array<string>;\n  key: string;\n}\n\ndeclare type ElementContext = {\n  type: 'Element';\n  children: Array<VNode>;\n  rendered: number;\n  endTag: string;\n  total: number;\n}\n\ndeclare type ComponentContext = {\n  type: 'Component';\n  prevActive: Component;\n}\n\ndeclare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext\n"
  },
  {
    "path": "flow/vnode.js",
    "content": "declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string\n\ndeclare type VNodeComponentOptions = {\n  Ctor: Class<Component>;\n  propsData: ?Object;\n  listeners: ?Object;\n  children: ?Array<VNode>;\n  tag?: string;\n}\n\ndeclare type MountedComponentVNode = {\n  context: Component;\n  componentOptions: VNodeComponentOptions;\n  componentInstance: Component;\n  parent: VNode;\n  data: VNodeData;\n}\n\n// interface for vnodes in update modules\ndeclare type VNodeWithData = {\n  tag: string;\n  data: VNodeData;\n  children: ?Array<VNode>;\n  text: void;\n  elm: any;\n  ns: string | void;\n  context: Component;\n  key: string | number | void;\n  parent?: VNodeWithData;\n  componentInstance?: Component;\n  isRootInsert: boolean;\n}\n\ndeclare interface VNodeData {\n  key?: string | number;\n  slot?: string;\n  ref?: string;\n  pre?: boolean;\n  tag?: string;\n  staticClass?: string;\n  class?: any;\n  staticStyle?: { [key: string]: any };\n  style?: Array<Object> | Object;\n  normalizedStyle?: Object;\n  props?: { [key: string]: any };\n  attrs?: { [key: string]: string };\n  domProps?: { [key: string]: any };\n  hook?: { [key: string]: Function };\n  on?: ?{ [key: string]: Function | Array<Function> };\n  nativeOn?: { [key: string]: Function | Array<Function> };\n  transition?: Object;\n  show?: boolean; // marker for v-show\n  inlineTemplate?: {\n    render: Function;\n    staticRenderFns: Array<Function>;\n  };\n  directives?: Array<VNodeDirective>;\n  keepAlive?: boolean;\n  scopedSlots?: { [key: string]: Function };\n  model?: {\n    value: any;\n    callback: Function;\n  };\n}\n\ndeclare type VNodeDirective = {\n  name: string;\n  rawName: string;\n  value?: any;\n  oldValue?: any;\n  arg?: string;\n  modifiers?: ASTModifiers;\n  def?: Object;\n}\n"
  },
  {
    "path": "jest.config.json",
    "content": "{\n  \"verbose\": true,\n  \"testMatch\": [\n    \"<rootDir>/**/__tests__/**/*.(test|spec).js\"\n  ],\n  \"moduleDirectories\": [\n    \"node_modules\"\n  ],\n  \"moduleNameMapper\": {\n    \"^vue-native(.*)$\": \"<rootDir>/src/platforms/vue-native$1\",\n    \"^vue(.*)$\": \"<rootDir>/src/platforms/web/runtime-with-compiler$1\",\n    \"^compiler(.*)$\": \"<rootDir>/src/compiler$1\",\n    \"^core(.*)$\": \"<rootDir>/src/core$1\",\n    \"^shared(.*)$\": \"<rootDir>/src/shared$1\",\n    \"^web(.*)$\": \"<rootDir>/src/platforms/web$1\",\n    \"^sfc(.*)$\": \"<rootDir>/src/sfc$1\"\n  },\n  \"collectCoverage\": true,\n  \"collectCoverageFrom\": [\n    \"<rootDir>/src/platforms/vue-native/**/*.js\",\n    \"!**/node_modules/**\"\n  ],\n  \"coverageDirectory\": \"<rootDir>/coverage\",\n  \"testURL\": \"http://localhost\"\n}"
  },
  {
    "path": "jsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"moduleResolution\": \"node\",\n    \"baseUrl\": \"src\",\n    \"paths\": {\n      \"vue/*\": [\"platforms/web/runtime-with-compiler/*\"],\n      \"compiler/*\": [\"compiler/*\"],\n      \"core/*\": [\"core/*\"],\n      \"shared/*\": [\"shared/*\"],\n      \"web/*\": [\"platforms/web/*\"],\n      \"vue-native/*\": [\"platforms/vue-native/*\"],\n      \"sfc/*\": [\"sfc/*\"]\n    }\n  },\n  \"exclude\": [\"node_modules\", \"packages\"]\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"vue-native-core\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Create mobile apps using vuejs\",\n  \"main\": \"packages/vue-native-core/index.js\",\n  \"typings\": \"types/index.d.ts\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/GeekyAnts/vue-native-core.git\"\n  },\n  \"keywords\": [\n    \"vue\",\n    \"native\",\n    \"mobile\"\n  ],\n  \"engines\": {\n    \"node\": \"^4.5 || >=5.10\"\n  },\n  \"engineStrict\": true,\n  \"author\": \"Geekyants (https://geekyants.io/)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/GeekyAnts/vue-native-core/issues\"\n  },\n  \"files\": [\n    \"src\",\n    \"packages\",\n    \"types/*.d.ts\"\n  ],\n  \"scripts\": {\n    \"lint\": \"eslint src scripts\",\n    \"lint:fix\": \"eslint --fix src scripts\",\n    \"flow\": \"flow check\",\n    \"test:unit\": \"jest --config ./jest.config.json\",\n    \"test\": \"npm run lint && npm run flow && npm run test:unit\",\n    \"build\": \"node scripts/build.js\",\n    \"release\": \"bash scripts/release.sh\"\n  },\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"npm run lint:fix\"\n    }\n  },\n  \"homepage\": \"https://github.com/GeekyAnts/vue-native-core\",\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.5.5\",\n    \"@babel/preset-env\": \"^7.5.5\",\n    \"@babel/preset-flow\": \"^7.0.0\",\n    \"babel-core\": \"^6.9.0\",\n    \"babel-eslint\": \"^10.0.3\",\n    \"babel-helper-vue-jsx-merge-props\": \"^2.0.2\",\n    \"babel-jest\": \"^26.0.1\",\n    \"babel-plugin-syntax-dynamic-import\": \"^6.18.0\",\n    \"babel-plugin-syntax-jsx\": \"^6.18.0\",\n    \"babel-plugin-transform-decorators-legacy\": \"^1.3.4\",\n    \"babel-plugin-transform-vue-jsx\": \"^3.2.0\",\n    \"babel-preset-flow-vue\": \"^1.0.0\",\n    \"babel-preset-react\": \"^6.24.1\",\n    \"buble\": \"^0.19.8\",\n    \"change-case\": \"^3.0.1\",\n    \"cross-spawn\": \"^5.0.1\",\n    \"de-indent\": \"^1.0.2\",\n    \"eslint\": \"^6.5.1\",\n    \"eslint-config-prettier\": \"^6.5.0\",\n    \"eslint-plugin-flowtype\": \"^4.3.0\",\n    \"eslint-plugin-prettier\": \"^3.1.1\",\n    \"flow-bin\": \"^0.39.0\",\n    \"hash-sum\": \"^1.0.2\",\n    \"he\": \"^1.1.0\",\n    \"husky\": \"^3.0.8\",\n    \"jasmine\": \"^2.5.2\",\n    \"jasmine-core\": \"^2.5.2\",\n    \"jest\": \"^26.0.1\",\n    \"js-beautify\": \"^1.6.14\",\n    \"lodash\": \"^4.17.20\",\n    \"lodash.template\": \"^4.4.0\",\n    \"lru-cache\": \"^4.0.2\",\n    \"prettier\": \"^1.18.2\",\n    \"react\": \"16.8.6\",\n    \"resolve\": \"^1.2.0\",\n    \"rollup\": \"^1.17.0\",\n    \"rollup-plugin-alias\": \"^1.5.2\",\n    \"rollup-plugin-buble\": \"^0.19.8\",\n    \"rollup-plugin-flow-no-whitespace\": \"^1.0.0\",\n    \"rollup-plugin-prettier\": \"^0.6.0\",\n    \"rollup-plugin-replace\": \"^2.2.0\",\n    \"serialize-javascript\": \"^3.1.0\",\n    \"typescript\": \"^2.1.6\",\n    \"uglify-js\": \"^3.6.0\"\n  }\n}\n"
  },
  {
    "path": "packages/vue-native-core/README.md",
    "content": "# vue-native-core\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/index.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native).\n\nFind the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).\n\nFor the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.\n"
  },
  {
    "path": "packages/vue-native-core/index.js",
    "content": "module.exports = require('./build')"
  },
  {
    "path": "packages/vue-native-core/package.json",
    "content": "{\n  \"name\": \"vue-native-core\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Library with core functionalities to create Vue Native components\",\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/GeekyAnts/vue-native-core\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"vue\"\n  ],\n  \"author\": \"Geekyants (https://geekyants.io/)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/GeekyAnts/vue-native-core/issues\"\n  },\n  \"homepage\": \"https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-core\",\n  \"peerDependencies\": {\n    \"react\": \"^16.3.0\"\n  }\n}\n"
  },
  {
    "path": "packages/vue-native-helper/README.md",
    "content": "# vue-native-helper\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/runtime/helpers.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native/runtime).\n\nFind the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).\n\nFor the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.\n"
  },
  {
    "path": "packages/vue-native-helper/index.js",
    "content": "module.exports = require('./build')"
  },
  {
    "path": "packages/vue-native-helper/package.json",
    "content": "{\n  \"name\": \"vue-native-helper\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Helper library with utilities for vue-native-core\",\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/GeekyAnts/vue-native-core\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"vue\",\n    \"helper\"\n  ],\n  \"author\": \"Geekyants (https://geekyants.io/)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/GeekyAnts/vue-native-core/issues\"\n  },\n  \"homepage\": \"https://github.com/GeekyAnts/vue-native-core#readme\",\n  \"peerDependencies\": {\n    \"react\": \"^16.3.0\"\n  }\n}\n"
  },
  {
    "path": "packages/vue-native-scripts/.npmignore",
    "content": "node_modules\nnpm-debug.log\ntest/output\ndocs/_book\n.DS_Store\n.idea\n*.iml\n"
  },
  {
    "path": "packages/vue-native-scripts/README.md",
    "content": "# vue-native-scripts\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/scripts/index.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native/scripts).\n\nCompile and transform Vue components to React Native.\n\nFind the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).\n\nFor the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.\n\n## Usage\n\n[Vue Native CLI](https://github.com/GeekyAnts/vue-native-cli) is the recommended way to setup a new Vue Native project. However, if you wish to setup a project from scratch, use the following steps after setting up a React Native / Expo project.\n\n### Step 1: Install\n\nThe following packages are required as runtime dependencies by Vue Native:\n- [vue-native-core](https://www.npmjs.com/package/vue-native-core)\n- [vue-native-helper](https://www.npmjs.com/package/vue-native-helper)\n\nDuring development, another package is required to transpile Vue Native component files (with `.vue` extensions) into JS:\n- [vue-native-scripts](https://www.npmjs.com/package/vue-native-scripts)\n\nTo install them, run the following commands in your project directory\n```\n$ npm install --save vue-native-core vue-native-helper\n$ npm install --save-dev vue-native-scripts\n```\n\n### Step 2: Configure the React Native bundler\n\nThe Metro bundler is used by React Native to generate app bundles. It can be configured using a `metro.config.js` file. Add the following to your `metro.config.js` (make one to your project's root if you don't have one already):\n\n```js\nconst { getDefaultConfig } = require(\"metro-config\");\n\nmodule.exports = (async () => {\n  const {\n    resolver: { sourceExts }\n  } = await getDefaultConfig();\n  return {\n    transformer: {\n      babelTransformerPath: require.resolve(\"./vueTransformerPlugin.js\"),\n      getTransformOptions: async () => ({\n        transform: {\n          experimentalImportSupport: false,\n          inlineRequires: false,\n        },\n      })\n    },\n    resolver: {\n      sourceExts: [...sourceExts, \"vue\"]\n    }\n  };\n})();\n```\n\nThe `babelTransformPath` property above takes the path to the transformer you wish to use. In our case, we need to create a `vueTransformerPlugin.js` file to the project's root and specify supported extensions:\n\n```js\n// For React Native version 0.59 or later\nvar upstreamTransformer = require(\"metro-react-native-babel-transformer\");\n\n// You will need to use different transformers for different React Native versions\n// However, versions older than v0.59 are no longer supported by Vue Native\n\n// For React Native version 0.56 - 0.58\n// var upstreamTransformer = require(\"metro/src/reactNativeTransformer\");\n\n// For React Native version 0.52 - 0.55\n// var upstreamTransformer = require(\"metro/src/transformer\");\n\n// For React Native version 0.47 - 0.51\n// var upstreamTransformer = require(\"metro-bundler/src/transformer\");\n\n// For React Native version 0.46\n// var upstreamTransformer = require(\"metro-bundler/build/transformer\");\n\nvar vueNaiveScripts = require(\"vue-native-scripts\");\nvar vueExtensions = [\"vue\"]; // <-- Add other extensions if needed.\n\nmodule.exports.transform = function({ src, filename, options }) {\n  if (vueExtensions.some(ext => filename.endsWith(\".\" + ext))) {\n    return vueNaiveScripts.transform({ src, filename, options });\n  }\n  return upstreamTransformer.transform({ src, filename, options });\n};\n```\n\nThis file conditionally transforms files based on their extensions. `vue-native-scripts` is used for `.vue` files, while the stock React Native Babel transformer is used for other (JS) files.\n\n## Using Vue Native components and `.vue` files\n\nIn the React Native application, you can simply `import` your Vue components as follows\n\n```\nimport VueComponent from './VueComponent.vue'\n```\n\nThere should be a file named `VueComponent.vue` in the corresponding folder; the transformer parses this file and sends it to the React Native bundler.\n"
  },
  {
    "path": "packages/vue-native-scripts/bin/vue-native-script.js",
    "content": "#!/usr/bin/env node\n\nconst spawn = require('cross-spawn');\nconst script = process.argv[2];\nconst args = process.argv.slice(3);\nconst validCommands = ['compiler'];\n\nif(validCommands.indexOf(script) !== -1) {\n  const result = spawn.sync(\n    'node',\n    ['--no-deprecation', require.resolve('../scripts/' + script + '.js')].concat(args),\n    { stdio: 'inherit' }\n  );\n  process.exit(result.status);\n} else {\n  console.log(\n    `Invalid command '${script}'. Please check if you need to update react-native-scripts.`\n  );\n}\n"
  },
  {
    "path": "packages/vue-native-scripts/index.js",
    "content": "module.exports = require('./build.js')"
  },
  {
    "path": "packages/vue-native-scripts/package.json",
    "content": "{\n  \"name\": \"vue-native-scripts\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Compile Vue Native components to React Native\",\n  \"main\": \"index.js\",\n  \"scripts\": {},\n  \"bin\": {\n    \"vue-native-scripts\": \"./bin/vue-native-script.js\"\n  },\n  \"author\": \"Geekyants (https://geekyants.io/)\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"babel-core\": \"^6.25.0\",\n    \"babel-traverse\": \"^6.26.0\",\n    \"cross-spawn\": \"^5.1.0\",\n    \"css-parse\": \"^2.0.0\",\n    \"hash-sum\": \"^1.0.2\",\n    \"js-beautify\": \"^1.6.14\",\n    \"line-number\": \"^0.1.0\",\n    \"parse5\": \"^5.0.0\",\n    \"path\": \"^0.12.7\",\n    \"semver\": \"^6.2.0\",\n    \"source-map\": \"~0.6.0\",\n    \"vue-native-template-compiler\": \"^0.3.0\"\n  },\n  \"peerDependencies\": {\n    \"react-native\": \"^0.59.0\",\n    \"metro\": \"^0.51.0\",\n    \"metro-bundler\": \"*\",\n    \"metro-react-native-babel-transformer\": \"^0.51.0\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/GeekyAnts/vue-native-core/issues\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-scripts\"\n  }\n}\n"
  },
  {
    "path": "packages/vue-native-template-compiler/README.md",
    "content": "# vue-native-template-compiler\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/compiler/index.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native).\n\nFind the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).\n\nFor the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.\n"
  },
  {
    "path": "packages/vue-native-template-compiler/index.js",
    "content": "module.exports = require('./build')"
  },
  {
    "path": "packages/vue-native-template-compiler/package.json",
    "content": "{\n  \"name\": \"vue-native-template-compiler\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Vue Native template compiler, dependency of vue-native-scripts. It can also be used as a stand-alone compiler\",\n  \"main\": \"index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/GeekyAnts/vue-native-core\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"vue\",\n    \"template\",\n    \"compiler\"\n  ],\n  \"author\": \"Geekyants (https://geekyants.io/)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/GeekyAnts/vue-native-core/issues\"\n  },\n  \"homepage\": \"https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-template-compiler\",\n  \"dependencies\": {\n    \"he\": \"^1.1.0\",\n    \"de-indent\": \"^1.0.2\",\n    \"change-case\": \"^3.0.1\"\n  }\n}\n"
  },
  {
    "path": "scripts/.eslintrc",
    "content": "\n{\n  \"env\": {\n    \"es6\": true,\n  },\n  \"rules\": {\n    \"camelcase\": 0,\n  },\n}\n"
  },
  {
    "path": "scripts/alias.js",
    "content": "const path = require('path')\n\nmodule.exports = {\n  vue: path.resolve(__dirname, '../src/platforms/web/runtime-with-compiler'),\n  compiler: path.resolve(__dirname, '../src/compiler'),\n  core: path.resolve(__dirname, '../src/core'),\n  shared: path.resolve(__dirname, '../src/shared'),\n  web: path.resolve(__dirname, '../src/platforms/web'),\n  'vue-native': path.resolve(__dirname, '../src/platforms/vue-native'),\n  sfc: path.resolve(__dirname, '../src/sfc'),\n}\n"
  },
  {
    "path": "scripts/build.js",
    "content": "const fs = require('fs')\nconst path = require('path')\nconst zlib = require('zlib')\nconst rollup = require('rollup')\nconst uglify = require('uglify-js')\n\nif (!fs.existsSync('dist')) {\n  fs.mkdirSync('dist')\n}\n\nlet builds = require('./config').getAllBuilds()\n\n// filter builds via command line arg\nif (process.argv[2]) {\n  const filters = process.argv[2].split(',')\n  builds = builds.filter(b => {\n    return filters.some(f => b.dest.indexOf(f) > -1)\n  })\n}\n\nbuild(builds)\n\nfunction build(builds) {\n  let built = 0\n  const total = builds.length\n  const next = () => {\n    buildEntry(builds[built])\n      .then(() => {\n        built++\n        if (built < total) {\n          next()\n        }\n      })\n      .catch(logError)\n  }\n\n  next()\n}\n\nfunction buildEntry(config) {\n  const isProd = /min\\.js$/.test(config.dest)\n  const output = config.output\n  const { file, banner } = output\n  return rollup\n    .rollup(config)\n    .then(bundle => bundle.generate(output))\n    .then(({ output: [{ code }] }) => {\n      if (isProd) {\n        const minified =\n          (banner ? banner + '\\n' : '') +\n          uglify.minify(code, {\n            fromString: true,\n            output: {\n              screw_ie8: true,\n              ascii_only: true,\n            },\n            compress: {\n              pure_funcs: ['makeMap'],\n            },\n          }).code\n        return write(file, minified, true)\n      } else {\n        return write(file, code)\n      }\n    })\n}\n\nfunction write(dest, code, zip) {\n  return new Promise((resolve, reject) => {\n    function report(extra) {\n      console.log(\n        blue(path.relative(process.cwd(), dest)) +\n          ' ' +\n          getSize(code) +\n          (extra || ''),\n      )\n      resolve()\n    }\n\n    fs.writeFile(dest, code, err => {\n      if (err) return reject(err)\n      if (zip) {\n        zlib.gzip(code, (err, zipped) => {\n          if (err) return reject(err)\n          report(' (gzipped: ' + getSize(zipped) + ')')\n        })\n      } else {\n        report()\n      }\n    })\n  })\n}\n\nfunction getSize(code) {\n  return (code.length / 1024).toFixed(2) + 'kb'\n}\n\nfunction logError(e) {\n  console.log(e)\n}\n\nfunction blue(str) {\n  return '\\x1b[1m\\x1b[34m' + str + '\\x1b[39m\\x1b[22m'\n}\n"
  },
  {
    "path": "scripts/ci.sh",
    "content": "set -e\nnpm test\n\n# report coverage stats for non-PRs\nif [[ -z $CI_PULL_REQUEST ]]; then\n  cat ./coverage/lcov.info | ./node_modules/.bin/codecov\nfi\n"
  },
  {
    "path": "scripts/config.js",
    "content": "const path = require('path')\nconst buble = require('rollup-plugin-buble')\nconst alias = require('rollup-plugin-alias')\nconst replace = require('rollup-plugin-replace')\nconst flow = require('rollup-plugin-flow-no-whitespace')\nconst prettier = require('rollup-plugin-prettier')\n\nconst version = '2.2.6'\n\n// const banner =\n//   \"/*!\\n\" +\n//   \" * Vue Native v\" +\n//   version +\n//   \"\\n\" +\n//   \" * (c) 2018-\" +\n//   new Date().getFullYear() +\n//   \" GeekyAnts Software Pvt. Ltd.\\n\" +\n//   \" * Released under the MIT License.\\n\" +\n//   \" */\"\n\nconst aliases = require('./alias')\nconst resolve = p => {\n  const base = p.split('/')[0]\n  if (aliases[base]) {\n    return path.resolve(aliases[base], p.slice(base.length + 1))\n  } else {\n    return path.resolve(__dirname, '../', p)\n  }\n}\n\nconst builds = {\n  'vue-native-core': {\n    entry: resolve('vue-native/index.js'),\n    dest: resolve('packages/vue-native-core/build.js'),\n    format: 'cjs',\n    external: ['react'],\n  },\n  'vue-native-helper': {\n    entry: resolve('vue-native/runtime/helpers.js'),\n    dest: resolve('packages/vue-native-helper/build.js'),\n    format: 'cjs',\n  },\n  'vue-native-scripts': {\n    entry: resolve('vue-native/scripts/index.js'),\n    dest: resolve('packages/vue-native-scripts/build.js'),\n    format: 'cjs',\n    external: []\n      .concat(\n        Object.keys(\n          require('../packages/vue-native-scripts/package.json').dependencies,\n        ),\n      )\n      .concat(\n        Object.keys(\n          require('../packages/vue-native-scripts/package.json')\n            .peerDependencies,\n        ),\n      ),\n  },\n  'vue-native-template-compiler': {\n    entry: resolve('vue-native/compiler.js'),\n    dest: resolve('packages/vue-native-template-compiler/build.js'),\n    format: 'cjs',\n    external: ['change-case', 'he', 'de-indent', 'lodash'],\n  },\n}\n\nfunction genConfig(opts) {\n  const config = {\n    input: opts.entry,\n    output: {\n      file: opts.dest,\n      format: opts.format,\n      banner: opts.banner,\n      name: 'Vue',\n    },\n    external: opts.external,\n    plugins: [\n      replace({\n        __VERSION__: version,\n      }),\n      flow(),\n      buble(),\n      alias(Object.assign({}, aliases, opts.alias)),\n      prettier(),\n    ].concat(opts.plugins || []),\n    onwarn: (msg, warn) => {\n      if (!/Circular/.test(msg)) {\n        warn(msg)\n      }\n    },\n  }\n\n  if (opts.env) {\n    config.plugins.push(\n      replace({\n        'process.env.NODE_ENV': JSON.stringify(opts.env),\n      }),\n    )\n  }\n\n  return config\n}\n\nif (process.env.TARGET) {\n  module.exports = genConfig(builds[process.env.TARGET])\n} else {\n  exports.getBuild = name => genConfig(builds[name])\n  exports.getAllBuilds = () =>\n    Object.keys(builds).map(name => genConfig(builds[name]))\n}\n"
  },
  {
    "path": "scripts/git-hooks/pre-commit",
    "content": "#!/usr/bin/env bash\n\nfiles_to_lint=$(git diff --cached --name-only --diff-filter=ACM | grep '\\.js$')\n\nif [ -n \"$files_to_lint\" ]; then\n  NODE_ENV=production eslint --quiet $files_to_lint\nfi\n"
  },
  {
    "path": "scripts/release.sh",
    "content": "set -e\n\nCURRENT_BRANCH=$(git branch --show-current)\nif [ $CURRENT_BRANCH != \"master\" ]; then\n  echo \"This script can only be run in the master branch. Exiting...\"\n  exit 1\nfi\n\n# get the version number from the user\nread -e -p \"Enter the new Vue Native version: \" VERSION\nif [[ -z $VERSION ]]; then\n  echo \"No version entered. Exiting...\"\n  exit 0\nfi\n\n# Decide the NPM tag.\n# Tag should be set to 'next' for pre-release versions\n# and will be 'latest' by default\nread -p \"Is this a pre-release version? (y/n) \" -n 1 -r\necho\nif [[ $REPLY =~ ^[Yy]$ ]]; then\n  echo \"Using npm tag 'next' for this release.\"\n  TAG='next'\nelse\n  echo \"Using npm tag 'latest' for this release.\"\n  TAG='latest'\nfi\n\nread -p \"Releasing $VERSION with npm tag $TAG - are you sure? (y/n) \" -n 1 -r\necho\nif [[ $REPLY =~ ^[Yy]$ ]]; then\n  echo \"Releasing $VERSION (with npm tag $TAG)...\"\n\n  # bump package versions\n  # packages:\n  # - vue-native-core\n  # - vue-native-helper\n  # - vue-native-scripts\n  # - vue-native-template-compiler\n\n  cd packages/vue-native-core\n  npm version $VERSION\n  cd -\n\n  cd packages/vue-native-helper\n  npm version $VERSION\n  cd -\n\n  cd packages/vue-native-scripts\n  npm version $VERSION\n  cd -\n\n  cd packages/vue-native-template-compiler\n  npm version $VERSION\n  cd -\n\n  # build\n  # the build needs to be generated after the version bump\n  # because the Vue version comes from packages/vue-native-core/package.json\n  # refer to scripts/config.js\n  VERSION=$VERSION npm run build\n\n  # commit\n  git add -A\n  git commit -m \"[build] $VERSION\"\n\n  # publish packages\n  # vue-native-core has already been published by np\n  # packages:\n  # - vue-native-core\n  # - vue-native-helper\n  # - vue-native-scripts\n  # - vue-native-template-compiler\n\n  cd packages/vue-native-core\n  npm publish --tag $TAG\n  cd -\n\n  cd packages/vue-native-helper\n  npm publish --tag $TAG\n  cd -\n\n  cd packages/vue-native-scripts\n  npm publish --tag $TAG\n  cd -\n\n  cd packages/vue-native-template-compiler\n  npm publish --tag $TAG\n  cd -\n\n  # Update version in main package.json and commit\n  npm version $VERSION\n\n  # Push the tags and version update\n  git push origin v$VERSION\n  git push origin master\n\n  echo \"\\nPublished v$VERSION!\"\nfi\n"
  },
  {
    "path": "src/compiler/codegen/events.js",
    "content": "/* @flow */\n\nconst fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/\nconst simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/\n\n// keyCode aliases\nconst keyCodes: { [key: string]: number | Array<number> } = {\n  esc: 27,\n  tab: 9,\n  enter: 13,\n  space: 32,\n  up: 38,\n  left: 37,\n  right: 39,\n  down: 40,\n  delete: [8, 46],\n}\n\n// #4868: modifiers that prevent the execution of the listener\n// need to explicitly return null so that we can determine whether to remove\n// the listener for .once\nconst genGuard = condition => `if(${condition})return null;`\n\nconst modifierCode: { [key: string]: string } = {\n  stop: '$event.stopPropagation();',\n  prevent: '$event.preventDefault();',\n  self: genGuard(`$event.target !== $event.currentTarget`),\n  ctrl: genGuard(`!$event.ctrlKey`),\n  shift: genGuard(`!$event.shiftKey`),\n  alt: genGuard(`!$event.altKey`),\n  meta: genGuard(`!$event.metaKey`),\n  left: genGuard(`'button' in $event && $event.button !== 0`),\n  middle: genGuard(`'button' in $event && $event.button !== 1`),\n  right: genGuard(`'button' in $event && $event.button !== 2`),\n}\n\nexport function genHandlers(\n  events: ASTElementHandlers,\n  native: boolean,\n  warn: Function,\n): string {\n  let res = native ? 'nativeOn:{' : 'on:{'\n  for (const name in events) {\n    const handler = events[name]\n    // #5330: warn click.right, since right clicks do not actually fire click events.\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      name === 'click' &&\n      handler &&\n      handler.modifiers &&\n      handler.modifiers.right\n    ) {\n      warn(\n        `Use \"contextmenu\" instead of \"click.right\" since right clicks ` +\n          `do not actually fire \"click\" events.`,\n      )\n    }\n    res += `\"${name}\":${genHandler(name, handler)},`\n  }\n  return res.slice(0, -1) + '}'\n}\n\nfunction genHandler(\n  name: string,\n  handler: ASTElementHandler | Array<ASTElementHandler>,\n): string {\n  if (!handler) {\n    return 'function(){}'\n  }\n\n  if (Array.isArray(handler)) {\n    return `[${handler.map(handler => genHandler(name, handler)).join(',')}]`\n  }\n\n  const isMethodPath = simplePathRE.test(handler.value)\n  const isFunctionExpression = fnExpRE.test(handler.value)\n\n  if (!handler.modifiers) {\n    return isMethodPath || isFunctionExpression\n      ? handler.value\n      : `function($event){${handler.value}}` // inline statement\n  } else {\n    let code = ''\n    let genModifierCode = ''\n    const keys = []\n    for (const key in handler.modifiers) {\n      if (modifierCode[key]) {\n        genModifierCode += modifierCode[key]\n        // left/right\n        if (keyCodes[key]) {\n          keys.push(key)\n        }\n      } else {\n        keys.push(key)\n      }\n    }\n    if (keys.length) {\n      code += genKeyFilter(keys)\n    }\n    // Make sure modifiers like prevent and stop get executed after key filtering\n    if (genModifierCode) {\n      code += genModifierCode\n    }\n    const handlerCode = isMethodPath\n      ? handler.value + '($event)'\n      : isFunctionExpression\n      ? `(${handler.value})($event)`\n      : handler.value\n    return `function($event){${code}${handlerCode}}`\n  }\n}\n\nfunction genKeyFilter(keys: Array<string>): string {\n  return `if(!('button' in $event)&&${keys\n    .map(genFilterCode)\n    .join('&&')})return null;`\n}\n\nfunction genFilterCode(key: string): string {\n  const keyVal = parseInt(key, 10)\n  if (keyVal) {\n    return `$event.keyCode!==${keyVal}`\n  }\n  const alias = keyCodes[key]\n  return `_k($event.keyCode,${JSON.stringify(key)}${\n    alias ? ',' + JSON.stringify(alias) : ''\n  })`\n}\n"
  },
  {
    "path": "src/compiler/codegen/index.js",
    "content": "/* @flow */\n\nimport { genHandlers } from './events'\nimport { baseWarn, pluckModuleFunction } from '../helpers'\nimport baseDirectives from '../directives/index'\nimport { camelize, no } from 'shared/util'\n\ntype TransformFunction = (el: ASTElement, code: string) => string\ntype DataGenFunction = (el: ASTElement) => string\ntype DirectiveFunction = (\n  el: ASTElement,\n  dir: ASTDirective,\n  warn: Function,\n) => boolean\n\n// configurable state\nlet warn\nlet transforms: Array<TransformFunction>\nlet dataGenFns: Array<DataGenFunction>\nlet platformDirectives\nlet isPlatformReservedTag\nlet staticRenderFns\nlet onceCount\nlet currentOptions\n\nexport function generate(\n  ast: ASTElement | void,\n  options: CompilerOptions,\n): {\n  render: string,\n  staticRenderFns: Array<string>,\n} {\n  // save previous staticRenderFns so generate calls can be nested\n  const prevStaticRenderFns: Array<string> = staticRenderFns\n  const currentStaticRenderFns: Array<string> = (staticRenderFns = [])\n  const prevOnceCount = onceCount\n  onceCount = 0\n  currentOptions = options\n  warn = options.warn || baseWarn\n  transforms = pluckModuleFunction(options.modules, 'transformCode')\n  dataGenFns = pluckModuleFunction(options.modules, 'genData')\n  platformDirectives = options.directives || {}\n  isPlatformReservedTag = options.isReservedTag || no\n  const code = ast ? genElement(ast) : '_c(\"div\")'\n  staticRenderFns = prevStaticRenderFns\n  onceCount = prevOnceCount\n  return {\n    render: `with(this){return ${code}}`,\n    staticRenderFns: currentStaticRenderFns,\n  }\n}\n\nfunction genElement(el: ASTElement): string {\n  if (el.staticRoot && !el.staticProcessed) {\n    return genStatic(el)\n  } else if (el.once && !el.onceProcessed) {\n    return genOnce(el)\n  } else if (el.for && !el.forProcessed) {\n    return genFor(el)\n  } else if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.tag === 'template' && !el.slotTarget) {\n    return genChildren(el) || 'void 0'\n  } else if (el.tag === 'slot') {\n    return genSlot(el)\n  } else {\n    // component or element\n    let code\n    if (el.component) {\n      code = genComponent(el.component, el)\n    } else {\n      const data = el.plain ? undefined : genData(el)\n\n      const children = el.inlineTemplate ? null : genChildren(el, true)\n      code = `_c('${el.tag}'${\n        data ? `,${data}` : '' // data\n      }${\n        children ? `,${children}` : '' // children\n      })`\n    }\n    // module transforms\n    for (let i = 0; i < transforms.length; i++) {\n      code = transforms[i](el, code)\n    }\n    return code\n  }\n}\n\n// hoist static sub-trees out\nfunction genStatic(el: ASTElement): string {\n  el.staticProcessed = true\n  staticRenderFns.push(`with(this){return ${genElement(el)}}`)\n  return `_m(${staticRenderFns.length - 1}${el.staticInFor ? ',true' : ''})`\n}\n\n// v-once\nfunction genOnce(el: ASTElement): string {\n  el.onceProcessed = true\n  if (el.if && !el.ifProcessed) {\n    return genIf(el)\n  } else if (el.staticInFor) {\n    let key = ''\n    let parent = el.parent\n    while (parent) {\n      if (parent.for) {\n        key = parent.key\n        break\n      }\n      parent = parent.parent\n    }\n    if (!key) {\n      process.env.NODE_ENV !== 'production' &&\n        warn(`v-once can only be used inside v-for that is keyed. `)\n      return genElement(el)\n    }\n    return `_o(${genElement(el)},${onceCount++}${key ? `,${key}` : ``})`\n  } else {\n    return genStatic(el)\n  }\n}\n\nfunction genIf(el: any): string {\n  el.ifProcessed = true // avoid recursion\n  return genIfConditions(el.ifConditions.slice())\n}\n\nfunction genIfConditions(conditions: ASTIfConditions): string {\n  if (!conditions.length) {\n    return '_e()'\n  }\n\n  const condition = conditions.shift()\n  if (condition.exp) {\n    return `(${condition.exp})?${genTernaryExp(\n      condition.block,\n    )}:${genIfConditions(conditions)}`\n  } else {\n    return `${genTernaryExp(condition.block)}`\n  }\n\n  // v-if with v-once should generate code like (a)?_m(0):_m(1)\n  function genTernaryExp(el) {\n    return el.once ? genOnce(el) : genElement(el)\n  }\n}\n\nfunction genFor(el: any): string {\n  const exp = el.for\n  const alias = el.alias\n  const iterator1 = el.iterator1 ? `,${el.iterator1}` : ''\n  const iterator2 = el.iterator2 ? `,${el.iterator2}` : ''\n\n  if (\n    process.env.NODE_ENV !== 'production' &&\n    maybeComponent(el) &&\n    el.tag !== 'slot' &&\n    el.tag !== 'template' &&\n    !el.key\n  ) {\n    warn(\n      `<${el.tag} v-for=\"${alias} in ${exp}\">: component lists rendered with ` +\n        `v-for should have explicit keys. ` +\n        `See https://vuejs.org/guide/list.html#key for more info.`,\n      true /* tip */,\n    )\n  }\n\n  el.forProcessed = true // avoid recursion\n  return (\n    `_l((${exp}),` +\n    `function(${alias}${iterator1}${iterator2}){` +\n    `return ${genElement(el)}` +\n    '})'\n  )\n}\n\nfunction genData(el: ASTElement): string {\n  let data = '{'\n\n  // directives first.\n  // directives may mutate the el's other properties before they are generated.\n  const dirs = genDirectives(el)\n  if (dirs) data += dirs + ','\n\n  // key\n  if (el.key) {\n    data += `key:${el.key},`\n  }\n  // ref\n  if (el.ref) {\n    data += `ref:${el.ref},`\n  }\n  if (el.refInFor) {\n    data += `refInFor:true,`\n  }\n  // pre\n  if (el.pre) {\n    data += `pre:true,`\n  }\n  // record original tag name for components using \"is\" attribute\n  if (el.component) {\n    data += `tag:\"${el.tag}\",`\n  }\n  // module data generation functions\n  for (let i = 0; i < dataGenFns.length; i++) {\n    data += dataGenFns[i](el)\n  }\n  // attributes\n  if (el.attrs) {\n    data += `attrs:{${genProps(el.attrs)}},`\n  }\n  // DOM props\n  if (el.props) {\n    data += `domProps:{${genProps(el.props)}},`\n  }\n  // event handlers\n  if (el.events) {\n    data += `${genHandlers(el.events, false, warn)},`\n  }\n  if (el.nativeEvents) {\n    data += `${genHandlers(el.nativeEvents, true, warn)},`\n  }\n  // slot target\n  if (el.slotTarget) {\n    data += `slot:${el.slotTarget},`\n  }\n  // scoped slots\n  if (el.scopedSlots) {\n    data += `${genScopedSlots(el.scopedSlots)},`\n  }\n  // component v-model\n  if (el.model) {\n    data += `model:{value:${el.model.value},callback:${el.model.callback},expression:${el.model.expression}},`\n  }\n  // inline-template\n  if (el.inlineTemplate) {\n    const inlineTemplate = genInlineTemplate(el)\n    if (inlineTemplate) {\n      data += `${inlineTemplate},`\n    }\n  }\n  data = data.replace(/,$/, '') + '}'\n  // v-bind data wrap\n  if (el.wrapData) {\n    data = el.wrapData(data)\n  }\n  return data\n}\n\nfunction genDirectives(el: ASTElement): string | void {\n  const dirs = el.directives\n  if (!dirs) return\n  let res = 'directives:['\n  let hasRuntime = false\n  let i, l, dir, needRuntime\n  for (i = 0, l = dirs.length; i < l; i++) {\n    dir = dirs[i]\n    needRuntime = true\n    const gen: DirectiveFunction =\n      platformDirectives[dir.name] || baseDirectives[dir.name]\n    if (gen) {\n      // compile-time directive that manipulates AST.\n      // returns true if it also needs a runtime counterpart.\n      needRuntime = !!gen(el, dir, warn)\n    }\n    if (needRuntime) {\n      hasRuntime = true\n      res += `{name:\"${dir.name}\",rawName:\"${dir.rawName}\"${\n        dir.value\n          ? `,value:(${dir.value}),expression:${JSON.stringify(dir.value)}`\n          : ''\n      }${dir.arg ? `,arg:\"${dir.arg}\"` : ''}${\n        dir.modifiers ? `,modifiers:${JSON.stringify(dir.modifiers)}` : ''\n      }},`\n    }\n  }\n  if (hasRuntime) {\n    return res.slice(0, -1) + ']'\n  }\n}\n\nfunction genInlineTemplate(el: ASTElement): ?string {\n  const ast = el.children[0]\n  if (\n    process.env.NODE_ENV !== 'production' &&\n    (el.children.length > 1 || ast.type !== 1)\n  ) {\n    warn('Inline-template components must have exactly one child element.')\n  }\n  if (ast.type === 1) {\n    const inlineRenderFns = generate(ast, currentOptions)\n    return `inlineTemplate:{render:function(){${\n      inlineRenderFns.render\n    }},staticRenderFns:[${inlineRenderFns.staticRenderFns\n      .map(code => `function(){${code}}`)\n      .join(',')}]}`\n  }\n}\n\nfunction genScopedSlots(slots: { [key: string]: ASTElement }): string {\n  return `scopedSlots:_u([${Object.keys(slots)\n    .map(key => genScopedSlot(key, slots[key]))\n    .join(',')}])`\n}\n\nfunction genScopedSlot(key: string, el: ASTElement) {\n  return (\n    `[${key},function(${String(el.attrsMap.scope)}){` +\n    `return ${\n      el.tag === 'template' ? genChildren(el) || 'void 0' : genElement(el)\n    }}]`\n  )\n}\n\nfunction genChildren(el: ASTElement, checkSkip?: boolean): string | void {\n  const children = el.children\n  if (children.length) {\n    const el: any = children[0]\n    // optimize single v-for\n    if (\n      children.length === 1 &&\n      el.for &&\n      el.tag !== 'template' &&\n      el.tag !== 'slot'\n    ) {\n      return genElement(el)\n    }\n    const normalizationType = checkSkip ? getNormalizationType(children) : 0\n    return `[${children.map(genNode).join(',')}]${\n      normalizationType ? `,${normalizationType}` : ''\n    }`\n  }\n}\n\n// determine the normalization needed for the children array.\n// 0: no normalization needed\n// 1: simple normalization needed (possible 1-level deep nested array)\n// 2: full normalization needed\nfunction getNormalizationType(children: Array<ASTNode>): number {\n  let res = 0\n  for (let i = 0; i < children.length; i++) {\n    const el: ASTNode = children[i]\n    if (el.type !== 1) {\n      continue\n    }\n    if (\n      needsNormalization(el) ||\n      (el.ifConditions &&\n        el.ifConditions.some(c => needsNormalization(c.block)))\n    ) {\n      res = 2\n      break\n    }\n    if (\n      maybeComponent(el) ||\n      (el.ifConditions && el.ifConditions.some(c => maybeComponent(c.block)))\n    ) {\n      res = 1\n    }\n  }\n  return res\n}\n\nfunction needsNormalization(el: ASTElement): boolean {\n  return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'\n}\n\nfunction maybeComponent(el: ASTElement): boolean {\n  return !isPlatformReservedTag(el.tag)\n}\n\nfunction genNode(node: ASTNode): string {\n  if (node.type === 1) {\n    return genElement(node)\n  } else {\n    return genText(node)\n  }\n}\n\nfunction genText(text: ASTText | ASTExpression): string {\n  return `_v(${\n    text.type === 2\n      ? text.expression // no need for () because already wrapped in _s()\n      : transformSpecialNewlines(JSON.stringify(text.text))\n  })`\n}\n\nfunction genSlot(el: ASTElement): string {\n  const slotName = el.slotName || '\"default\"'\n  const children = genChildren(el)\n  let res = `_t(${slotName}${children ? `,${children}` : ''}`\n  const attrs =\n    el.attrs &&\n    `{${el.attrs.map(a => `${camelize(a.name)}:${a.value}`).join(',')}}`\n  const bind = el.attrsMap['v-bind']\n  if ((attrs || bind) && !children) {\n    res += `,null`\n  }\n  if (attrs) {\n    res += `,${attrs}`\n  }\n  if (bind) {\n    res += `${attrs ? '' : ',null'},${bind}`\n  }\n  return res + ')'\n}\n\n// componentName is el.component, take it as argument to shun flow's pessimistic refinement\nfunction genComponent(componentName: string, el: ASTElement): string {\n  const children = el.inlineTemplate ? null : genChildren(el, true)\n  return `_c(${componentName},${genData(el)}${children ? `,${children}` : ''})`\n}\n\nfunction genProps(props: Array<{ name: string, value: string }>): string {\n  let res = ''\n  for (let i = 0; i < props.length; i++) {\n    const prop = props[i]\n    res += `\"${prop.name}\":${transformSpecialNewlines(prop.value)},`\n  }\n  return res.slice(0, -1)\n}\n\n// #3895, #4268\nfunction transformSpecialNewlines(text: string): string {\n  return text.replace(/\\u2028/g, '\\\\u2028').replace(/\\u2029/g, '\\\\u2029')\n}\n"
  },
  {
    "path": "src/compiler/directives/bind.js",
    "content": "/* @flow */\n\nexport default function bind(el: ASTElement, dir: ASTDirective) {\n  el.wrapData = (code: string) => {\n    return `_b(${code},'${el.tag}',${dir.value}${\n      dir.modifiers && dir.modifiers.prop ? ',true' : ''\n    })`\n  }\n}\n"
  },
  {
    "path": "src/compiler/directives/index.js",
    "content": "/* @flow */\n\nimport bind from './bind'\nimport { noop } from 'shared/util'\n\nexport default {\n  bind,\n  cloak: noop,\n}\n"
  },
  {
    "path": "src/compiler/directives/model.js",
    "content": "/* @flow */\n\n/**\n * Cross-platform code generation for component v-model\n */\nexport function genComponentModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n): ?boolean {\n  const { number, trim } = modifiers || {}\n\n  const baseValueExpression = '$$v'\n  let valueExpression = baseValueExpression\n  if (trim) {\n    valueExpression =\n      `(typeof ${baseValueExpression} === 'string'` +\n      `? ${baseValueExpression}.trim()` +\n      `: ${baseValueExpression})`\n  }\n  if (number) {\n    valueExpression = `_n(${valueExpression})`\n  }\n  const assignment = genAssignmentCode(value, valueExpression)\n\n  el.model = {\n    value: `(${value})`,\n    expression: `\"${value}\"`,\n    callback: `function (${baseValueExpression}) {${assignment}}`,\n  }\n}\n\n/**\n * Cross-platform codegen helper for generating v-model value assignment code.\n */\nexport function genAssignmentCode(value: string, assignment: string): string {\n  const modelRs = parseModel(value)\n  if (modelRs.idx === null) {\n    return `${value}=${assignment}`\n  } else {\n    return (\n      `var $$exp = ${modelRs.exp}, $$idx = ${modelRs.idx};` +\n      `if (!Array.isArray($$exp)){` +\n      `${value}=${assignment}}` +\n      `else{$$exp.splice($$idx, 1, ${assignment})}`\n    )\n  }\n}\n\n/**\n * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)\n *\n * for loop possible cases:\n *\n * - test\n * - test[idx]\n * - test[test1[idx]]\n * - test[\"a\"][idx]\n * - xxx.test[a[a].test1[idx]]\n * - test.xxx.a[\"asa\"][test1[idx]]\n *\n */\n\nlet len, str, chr, index, expressionPos, expressionEndPos\n\nexport function parseModel(val: string): Object {\n  str = val\n  len = str.length\n  index = expressionPos = expressionEndPos = 0\n\n  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {\n    return {\n      exp: val,\n      idx: null,\n    }\n  }\n\n  while (!eof()) {\n    chr = next()\n    /* istanbul ignore if */\n    if (isStringStart(chr)) {\n      parseString(chr)\n    } else if (chr === 0x5b) {\n      parseBracket(chr)\n    }\n  }\n\n  return {\n    exp: val.substring(0, expressionPos),\n    idx: val.substring(expressionPos + 1, expressionEndPos),\n  }\n}\n\nfunction next(): number {\n  return str.charCodeAt(++index)\n}\n\nfunction eof(): boolean {\n  return index >= len\n}\n\nfunction isStringStart(chr: number): boolean {\n  return chr === 0x22 || chr === 0x27\n}\n\nfunction parseBracket(chr: number): void {\n  let inBracket = 1\n  expressionPos = index\n  while (!eof()) {\n    chr = next()\n    if (isStringStart(chr)) {\n      parseString(chr)\n      continue\n    }\n    if (chr === 0x5b) inBracket++\n    if (chr === 0x5d) inBracket--\n    if (inBracket === 0) {\n      expressionEndPos = index\n      break\n    }\n  }\n}\n\nfunction parseString(chr: number): void {\n  const stringQuote = chr\n  while (!eof()) {\n    chr = next()\n    if (chr === stringQuote) {\n      break\n    }\n  }\n}\n"
  },
  {
    "path": "src/compiler/error-detector.js",
    "content": "/* @flow */\n\nimport { dirRE, onRE } from './parser/index'\n\n// these keywords should not appear inside expressions, but operators like\n// typeof, instanceof and in are allowed\nconst prohibitedKeywordRE = new RegExp(\n  '\\\\b' +\n    (\n      'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\n      'super,throw,while,yield,delete,export,import,return,switch,default,' +\n      'extends,finally,continue,debugger,function,arguments'\n    )\n      .split(',')\n      .join('\\\\b|\\\\b') +\n    '\\\\b',\n)\n\n// these unary operators should not be used as property/method names\nconst unaryOperatorsRE = new RegExp(\n  '\\\\b' +\n    'delete,typeof,void'.split(',').join('\\\\s*\\\\([^\\\\)]*\\\\)|\\\\b') +\n    '\\\\s*\\\\([^\\\\)]*\\\\)',\n)\n\n// check valid identifier for v-for\nconst identRE = /[A-Za-z_$][\\w$]*/\n\n// strip strings in expressions\nconst stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g\n\n// detect problematic expressions in a template\nexport function detectErrors(ast: ?ASTNode): Array<string> {\n  const errors: Array<string> = []\n  if (ast) {\n    checkNode(ast, errors)\n  }\n  return errors\n}\n\nfunction checkNode(node: ASTNode, errors: Array<string>) {\n  if (node.type === 1) {\n    for (const name in node.attrsMap) {\n      if (dirRE.test(name)) {\n        const value = node.attrsMap[name]\n        if (value) {\n          if (name === 'v-for') {\n            checkFor(node, `v-for=\"${value}\"`, errors)\n          } else if (onRE.test(name)) {\n            checkEvent(value, `${name}=\"${value}\"`, errors)\n          } else {\n            checkExpression(value, `${name}=\"${value}\"`, errors)\n          }\n        }\n      }\n    }\n    if (node.children) {\n      for (let i = 0; i < node.children.length; i++) {\n        checkNode(node.children[i], errors)\n      }\n    }\n  } else if (node.type === 2) {\n    checkExpression(node.expression, node.text, errors)\n  }\n}\n\nfunction checkEvent(exp: string, text: string, errors: Array<string>) {\n  const stipped = exp.replace(stripStringRE, '')\n  const keywordMatch: any = stipped.match(unaryOperatorsRE)\n  if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {\n    errors.push(\n      `avoid using JavaScript unary operator as property name: ` +\n        `\"${keywordMatch[0]}\" in expression ${text.trim()}`,\n    )\n  }\n  checkExpression(exp, text, errors)\n}\n\nfunction checkFor(node: ASTElement, text: string, errors: Array<string>) {\n  checkExpression(node.for || '', text, errors)\n  checkIdentifier(node.alias, 'v-for alias', text, errors)\n  checkIdentifier(node.iterator1, 'v-for iterator', text, errors)\n  checkIdentifier(node.iterator2, 'v-for iterator', text, errors)\n}\n\nfunction checkIdentifier(\n  ident: ?string,\n  type: string,\n  text: string,\n  errors: Array<string>,\n) {\n  if (typeof ident === 'string' && !identRE.test(ident)) {\n    errors.push(`invalid ${type} \"${ident}\" in expression: ${text.trim()}`)\n  }\n}\n\nfunction checkExpression(exp: string, text: string, errors: Array<string>) {\n  try {\n    new Function(`return ${exp}`)\n  } catch (e) {\n    const keywordMatch = exp\n      .replace(stripStringRE, '')\n      .match(prohibitedKeywordRE)\n    if (keywordMatch) {\n      errors.push(\n        `avoid using JavaScript keyword as property name: ` +\n          `\"${keywordMatch[0]}\" in expression ${text.trim()}`,\n      )\n    } else {\n      errors.push(`invalid expression: ${text.trim()}`)\n    }\n  }\n}\n"
  },
  {
    "path": "src/compiler/helpers.js",
    "content": "/* @flow */\n\nimport { parseFilters } from './parser/filter-parser'\n\nexport function baseWarn(msg: string) {\n  console.error(`[Vue compiler]: ${msg}`)\n}\n\nexport function pluckModuleFunction<F: Function>(\n  modules: ?Array<Object>,\n  key: string,\n): Array<F> {\n  return modules ? modules.map(m => m[key]).filter(_ => _) : []\n}\n\nexport function addProp(el: ASTElement, name: string, value: string) {\n  ;(el.props || (el.props = [])).push({ name, value })\n}\n\nexport function addAttr(el: ASTElement, name: string, value: string) {\n  ;(el.attrs || (el.attrs = [])).push({ name, value })\n}\n\nexport function addDirective(\n  el: ASTElement,\n  name: string,\n  rawName: string,\n  value: string,\n  arg: ?string,\n  modifiers: ?ASTModifiers,\n) {\n  ;(el.directives || (el.directives = [])).push({\n    name,\n    rawName,\n    value,\n    arg,\n    modifiers,\n  })\n}\n\nexport function addHandler(\n  el: ASTElement,\n  name: string,\n  value: string,\n  modifiers: ?ASTModifiers,\n  important?: boolean,\n  warn?: Function,\n) {\n  // warn prevent and passive modifier\n  /* istanbul ignore if */\n  if (\n    process.env.NODE_ENV !== 'production' &&\n    warn &&\n    modifiers &&\n    modifiers.prevent &&\n    modifiers.passive\n  ) {\n    warn(\n      \"passive and prevent can't be used together. \" +\n        \"Passive handler can't prevent default event.\",\n    )\n  }\n  // check capture modifier\n  if (modifiers && modifiers.capture) {\n    delete modifiers.capture\n    name = '!' + name // mark the event as captured\n  }\n  if (modifiers && modifiers.once) {\n    delete modifiers.once\n    name = '~' + name // mark the event as once\n  }\n  /* istanbul ignore if */\n  if (modifiers && modifiers.passive) {\n    delete modifiers.passive\n    name = '&' + name // mark the event as passive\n  }\n  let events\n  if (modifiers && modifiers.native) {\n    delete modifiers.native\n    events = el.nativeEvents || (el.nativeEvents = {})\n  } else {\n    events = el.events || (el.events = {})\n  }\n  const newHandler = { value, modifiers }\n  const handlers = events[name]\n  /* istanbul ignore if */\n  if (Array.isArray(handlers)) {\n    important ? handlers.unshift(newHandler) : handlers.push(newHandler)\n  } else if (handlers) {\n    events[name] = important ? [newHandler, handlers] : [handlers, newHandler]\n  } else {\n    events[name] = newHandler\n  }\n}\n\nexport function getBindingAttr(\n  el: ASTElement,\n  name: string,\n  getStatic?: boolean,\n): ?string {\n  const dynamicValue =\n    getAndRemoveAttr(el, ':' + name) || getAndRemoveAttr(el, 'v-bind:' + name)\n  if (dynamicValue != null) {\n    return parseFilters(dynamicValue)\n  } else if (getStatic !== false) {\n    const staticValue = getAndRemoveAttr(el, name)\n    if (staticValue != null) {\n      return JSON.stringify(staticValue)\n    }\n  }\n}\n\nexport function getAndRemoveAttr(el: ASTElement, name: string): ?string {\n  let val\n  if ((val = el.attrsMap[name]) != null) {\n    const list = el.attrsList\n    for (let i = 0, l = list.length; i < l; i++) {\n      if (list[i].name === name) {\n        list.splice(i, 1)\n        break\n      }\n    }\n  }\n  return val\n}\n"
  },
  {
    "path": "src/compiler/index.js",
    "content": "/* @flow */\n\nimport { parse } from './parser/index'\nimport { optimize } from './optimizer'\nimport { generate } from './codegen/index'\nimport { detectErrors } from './error-detector'\nimport { extend, noop } from 'shared/util'\nimport { warn, tip } from 'core/util/debug'\n\nfunction baseCompile(\n  template: string,\n  options: CompilerOptions,\n): CompiledResult {\n  const ast = parse(template.trim(), options)\n  optimize(ast, options)\n  const code = generate(ast, options)\n  return {\n    ast,\n    render: code.render,\n    staticRenderFns: code.staticRenderFns,\n  }\n}\n\nfunction makeFunction(code, errors) {\n  try {\n    return new Function(code)\n  } catch (err) {\n    errors.push({ err, code })\n    return noop\n  }\n}\n\nexport function createCompiler(baseOptions: CompilerOptions) {\n  const functionCompileCache: {\n    [key: string]: CompiledFunctionResult,\n  } = Object.create(null)\n\n  function compile(\n    template: string,\n    options?: CompilerOptions,\n  ): CompiledResult {\n    const finalOptions = Object.create(baseOptions)\n    const errors = []\n    const tips = []\n    finalOptions.warn = (msg, tip) => {\n      ;(tip ? tips : errors).push(msg)\n    }\n\n    if (options) {\n      // merge custom modules\n      if (options.modules) {\n        finalOptions.modules = (baseOptions.modules || []).concat(\n          options.modules,\n        )\n      }\n      // merge custom directives\n      if (options.directives) {\n        finalOptions.directives = extend(\n          Object.create(baseOptions.directives),\n          options.directives,\n        )\n      }\n      // copy other options\n      for (const key in options) {\n        if (key !== 'modules' && key !== 'directives') {\n          finalOptions[key] = options[key]\n        }\n      }\n    }\n\n    const compiled = baseCompile(template, finalOptions)\n    if (process.env.NODE_ENV !== 'production') {\n      errors.push.apply(errors, detectErrors(compiled.ast))\n    }\n    compiled.errors = errors\n    compiled.tips = tips\n    return compiled\n  }\n\n  function compileToFunctions(\n    template: string,\n    options?: CompilerOptions,\n    vm?: Component,\n  ): CompiledFunctionResult {\n    options = options || {}\n\n    /* istanbul ignore if */\n    if (process.env.NODE_ENV !== 'production') {\n      // detect possible CSP restriction\n      try {\n        new Function('return 1')\n      } catch (e) {\n        if (e.toString().match(/unsafe-eval|CSP/)) {\n          warn(\n            'It seems you are using the standalone build of Vue.js in an ' +\n              'environment with Content Security Policy that prohibits unsafe-eval. ' +\n              'The template compiler cannot work in this environment. Consider ' +\n              'relaxing the policy to allow unsafe-eval or pre-compiling your ' +\n              'templates into render functions.',\n          )\n        }\n      }\n    }\n\n    // check cache\n    const key = options.delimiters\n      ? String(options.delimiters) + template\n      : template\n    if (functionCompileCache[key]) {\n      return functionCompileCache[key]\n    }\n\n    // compile\n    const compiled = compile(template, options)\n\n    // check compilation errors/tips\n    if (process.env.NODE_ENV !== 'production') {\n      if (compiled.errors && compiled.errors.length) {\n        warn(\n          `Error compiling template:\\n\\n${template}\\n\\n` +\n            compiled.errors.map(e => `- ${e}`).join('\\n') +\n            '\\n',\n          vm,\n        )\n      }\n      if (compiled.tips && compiled.tips.length) {\n        compiled.tips.forEach(msg => tip(msg, vm))\n      }\n    }\n\n    // turn code into functions\n    const res = {}\n    const fnGenErrors = []\n    res.render = makeFunction(compiled.render, fnGenErrors)\n    const l = compiled.staticRenderFns.length\n    res.staticRenderFns = new Array(l)\n    for (let i = 0; i < l; i++) {\n      res.staticRenderFns[i] = makeFunction(\n        compiled.staticRenderFns[i],\n        fnGenErrors,\n      )\n    }\n\n    // check function generation errors.\n    // this should only happen if there is a bug in the compiler itself.\n    // mostly for codegen development use\n    /* istanbul ignore if */\n    if (process.env.NODE_ENV !== 'production') {\n      if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {\n        warn(\n          `Failed to generate render function:\\n\\n` +\n            fnGenErrors\n              .map(({ err, code }) => `${err.toString()} in\\n\\n${code}\\n`)\n              .join('\\n'),\n          vm,\n        )\n      }\n    }\n\n    return (functionCompileCache[key] = res)\n  }\n\n  return {\n    compile,\n    compileToFunctions,\n  }\n}\n"
  },
  {
    "path": "src/compiler/optimizer.js",
    "content": "/* @flow */\n\nimport { makeMap, isBuiltInTag, cached, no } from 'shared/util'\n\nlet isStaticKey\nlet isPlatformReservedTag\n\nconst genStaticKeysCached = cached(genStaticKeys)\n\n/**\n * Goal of the optimizer: walk the generated template AST tree\n * and detect sub-trees that are purely static, i.e. parts of\n * the DOM that never needs to change.\n *\n * Once we detect these sub-trees, we can:\n *\n * 1. Hoist them into constants, so that we no longer need to\n *    create fresh nodes for them on each re-render;\n * 2. Completely skip them in the patching process.\n */\nexport function optimize(root: ?ASTElement, options: CompilerOptions) {\n  if (!root) return\n  isStaticKey = genStaticKeysCached(options.staticKeys || '')\n  isPlatformReservedTag = options.isReservedTag || no\n  // first pass: mark all non-static nodes.\n  markStatic(root)\n  // second pass: mark static roots.\n  markStaticRoots(root, false)\n}\n\nfunction genStaticKeys(keys: string): Function {\n  return makeMap(\n    'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +\n      (keys ? ',' + keys : ''),\n  )\n}\n\nfunction markStatic(node: ASTNode) {\n  node.static = isStatic(node)\n  if (node.type === 1) {\n    // do not make component slot content static. this avoids\n    // 1. components not able to mutate slot nodes\n    // 2. static slot content fails for hot-reloading\n    if (\n      !isPlatformReservedTag(node.tag) &&\n      node.tag !== 'slot' &&\n      node.attrsMap['inline-template'] == null\n    ) {\n      return\n    }\n    for (let i = 0, l = node.children.length; i < l; i++) {\n      const child = node.children[i]\n      markStatic(child)\n      if (!child.static) {\n        node.static = false\n      }\n    }\n  }\n}\n\nfunction markStaticRoots(node: ASTNode, isInFor: boolean) {\n  if (node.type === 1) {\n    if (node.static || node.once) {\n      node.staticInFor = isInFor\n    }\n    // For a node to qualify as a static root, it should have children that\n    // are not just static text. Otherwise the cost of hoisting out will\n    // outweigh the benefits and it's better off to just always render it fresh.\n    if (\n      node.static &&\n      node.children.length &&\n      !(node.children.length === 1 && node.children[0].type === 3)\n    ) {\n      node.staticRoot = true\n      return\n    } else {\n      node.staticRoot = false\n    }\n    if (node.children) {\n      for (let i = 0, l = node.children.length; i < l; i++) {\n        markStaticRoots(node.children[i], isInFor || !!node.for)\n      }\n    }\n    if (node.ifConditions) {\n      walkThroughConditionsBlocks(node.ifConditions, isInFor)\n    }\n  }\n}\n\nfunction walkThroughConditionsBlocks(\n  conditionBlocks: ASTIfConditions,\n  isInFor: boolean,\n): void {\n  for (let i = 1, len = conditionBlocks.length; i < len; i++) {\n    markStaticRoots(conditionBlocks[i].block, isInFor)\n  }\n}\n\nfunction isStatic(node: ASTNode): boolean {\n  if (node.type === 2) {\n    // expression\n    return false\n  }\n  if (node.type === 3) {\n    // text\n    return true\n  }\n  return !!(\n    node.pre ||\n    (!node.hasBindings && // no dynamic bindings\n    !node.if &&\n    !node.for && // not v-if or v-for or v-else\n    !isBuiltInTag(node.tag) && // not a built-in\n    isPlatformReservedTag(node.tag) && // not a component\n      !isDirectChildOfTemplateFor(node) &&\n      Object.keys(node).every(isStaticKey))\n  )\n}\n\nfunction isDirectChildOfTemplateFor(node: ASTElement): boolean {\n  while (node.parent) {\n    node = node.parent\n    if (node.tag !== 'template') {\n      return false\n    }\n    if (node.for) {\n      return true\n    }\n  }\n  return false\n}\n"
  },
  {
    "path": "src/compiler/parser/entity-decoder.js",
    "content": "/* @flow */\n\nlet decoder\n\nexport function decode(html: string): string {\n  decoder = decoder || document.createElement('div')\n  decoder.innerHTML = html\n  return decoder.textContent\n}\n"
  },
  {
    "path": "src/compiler/parser/filter-parser.js",
    "content": "/* @flow */\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/\n\nexport function parseFilters(exp: string): string {\n  let inSingle = false\n  let inDouble = false\n  let inTemplateString = false\n  let inRegex = false\n  let curly = 0\n  let square = 0\n  let paren = 0\n  let lastFilterIndex = 0\n  let c, prev, i, expression, filters\n\n  for (i = 0; i < exp.length; i++) {\n    prev = c\n    c = exp.charCodeAt(i)\n    if (inSingle) {\n      if (c === 0x27 && prev !== 0x5c) inSingle = false\n    } else if (inDouble) {\n      if (c === 0x22 && prev !== 0x5c) inDouble = false\n    } else if (inTemplateString) {\n      if (c === 0x60 && prev !== 0x5c) inTemplateString = false\n    } else if (inRegex) {\n      if (c === 0x2f && prev !== 0x5c) inRegex = false\n    } else if (\n      c === 0x7c && // pipe\n      exp.charCodeAt(i + 1) !== 0x7c &&\n      exp.charCodeAt(i - 1) !== 0x7c &&\n      !curly &&\n      !square &&\n      !paren\n    ) {\n      if (expression === undefined) {\n        // first filter, end of expression\n        lastFilterIndex = i + 1\n        expression = exp.slice(0, i).trim()\n      } else {\n        pushFilter()\n      }\n    } else {\n      switch (c) {\n        case 0x22:\n          inDouble = true\n          break // \"\n        case 0x27:\n          inSingle = true\n          break // '\n        case 0x60:\n          inTemplateString = true\n          break // `\n        case 0x28:\n          paren++\n          break // (\n        case 0x29:\n          paren--\n          break // )\n        case 0x5b:\n          square++\n          break // [\n        case 0x5d:\n          square--\n          break // ]\n        case 0x7b:\n          curly++\n          break // {\n        case 0x7d:\n          curly--\n          break // }\n      }\n      if (c === 0x2f) {\n        // /\n        let j = i - 1\n        let p\n        // find first non-whitespace prev char\n        for (; j >= 0; j--) {\n          p = exp.charAt(j)\n          if (p !== ' ') break\n        }\n        if (!p || !validDivisionCharRE.test(p)) {\n          inRegex = true\n        }\n      }\n    }\n  }\n\n  if (expression === undefined) {\n    expression = exp.slice(0, i).trim()\n  } else if (lastFilterIndex !== 0) {\n    pushFilter()\n  }\n\n  function pushFilter() {\n    ;(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim())\n    lastFilterIndex = i + 1\n  }\n\n  if (filters) {\n    for (i = 0; i < filters.length; i++) {\n      expression = wrapFilter(expression, filters[i])\n    }\n  }\n\n  return expression\n}\n\nfunction wrapFilter(exp: string, filter: string): string {\n  const i = filter.indexOf('(')\n  if (i < 0) {\n    // _f: resolveFilter\n    return `_f(\"${filter}\")(${exp})`\n  } else {\n    const name = filter.slice(0, i)\n    const args = filter.slice(i + 1)\n    return `_f(\"${name}\")(${exp},${args}`\n  }\n}\n"
  },
  {
    "path": "src/compiler/parser/html-parser.js",
    "content": "/**\n * Not type-checking this file because it's mostly vendor code.\n */\n\n/*!\n * HTML Parser By John Resig (ejohn.org)\n * Modified by Juriy \"kangax\" Zaytsev\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n */\n\nimport { makeMap, no } from 'shared/util'\nimport { isNonPhrasingTag } from 'web/compiler/util'\n\n// Regular Expressions for parsing tags and attributes\nconst singleAttrIdentifier = /([^\\s\"'<>/=]+)/\nconst singleAttrAssign = /(?:=)/\nconst singleAttrValues = [\n  // attr value double quotes\n  /\"([^\"]*)\"+/.source,\n  // attr value, single quotes\n  /'([^']*)'+/.source,\n  // attr value, no quotes\n  /([^\\s\"'=<>`]+)/.source,\n]\nconst attribute = new RegExp(\n  '^\\\\s*' +\n    singleAttrIdentifier.source +\n    '(?:\\\\s*(' +\n    singleAttrAssign.source +\n    ')' +\n    '\\\\s*(?:' +\n    singleAttrValues.join('|') +\n    '))?',\n)\n\n// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName\n// but for Vue templates we can enforce a simple charset\nconst ncname = '[a-zA-Z_][\\\\w\\\\-\\\\.]*'\nconst qnameCapture = '((?:' + ncname + '\\\\:)?' + ncname + ')'\nconst startTagOpen = new RegExp('^<' + qnameCapture)\nconst startTagClose = /^\\s*(\\/?)>/\nconst endTag = new RegExp('^<\\\\/' + qnameCapture + '[^>]*>')\nconst doctype = /^<!DOCTYPE [^>]+>/i\nconst comment = /^<!--/\nconst conditionalComment = /^<!\\[/\n\nlet IS_REGEX_CAPTURING_BROKEN = false\n'x'.replace(/x(.)?/g, function(m, g) {\n  IS_REGEX_CAPTURING_BROKEN = g === ''\n})\n\n// Special Elements (can contain anything)\nconst isPlainTextElement = makeMap('script,style,textarea', true)\nconst reCache = {}\n\nconst decodingMap = {\n  '&lt;': '<',\n  '&gt;': '>',\n  '&quot;': '\"',\n  '&amp;': '&',\n  '&#10;': '\\n',\n}\nconst encodedAttr = /&(?:lt|gt|quot|amp);/g\nconst encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g\n\nfunction decodeAttr(value, shouldDecodeNewlines) {\n  const re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr\n  return value.replace(re, match => decodingMap[match])\n}\n\nexport function parseHTML(html, options) {\n  const stack = []\n  const expectHTML = options.expectHTML\n  const isUnaryTag = options.isUnaryTag || no\n  const canBeLeftOpenTag = options.canBeLeftOpenTag || no\n  let index = 0\n  let last, lastTag\n  while (html) {\n    last = html\n    // Make sure we're not in a plaintext content element like script/style\n    if (!lastTag || !isPlainTextElement(lastTag)) {\n      let textEnd = html.indexOf('<')\n      if (textEnd === 0) {\n        // Comment:\n        if (comment.test(html)) {\n          const commentEnd = html.indexOf('-->')\n\n          if (commentEnd >= 0) {\n            advance(commentEnd + 3)\n            continue\n          }\n        }\n\n        // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment\n        if (conditionalComment.test(html)) {\n          const conditionalEnd = html.indexOf(']>')\n\n          if (conditionalEnd >= 0) {\n            advance(conditionalEnd + 2)\n            continue\n          }\n        }\n\n        // Doctype:\n        const doctypeMatch = html.match(doctype)\n        if (doctypeMatch) {\n          advance(doctypeMatch[0].length)\n          continue\n        }\n\n        // End tag:\n        const endTagMatch = html.match(endTag)\n        if (endTagMatch) {\n          const curIndex = index\n          advance(endTagMatch[0].length)\n          parseEndTag(endTagMatch[1], curIndex, index)\n          continue\n        }\n\n        // Start tag:\n        const startTagMatch = parseStartTag()\n        if (startTagMatch) {\n          handleStartTag(startTagMatch)\n          continue\n        }\n      }\n\n      let text, rest, next\n      if (textEnd >= 0) {\n        rest = html.slice(textEnd)\n        while (\n          !endTag.test(rest) &&\n          !startTagOpen.test(rest) &&\n          !comment.test(rest) &&\n          !conditionalComment.test(rest)\n        ) {\n          // < in plain text, be forgiving and treat it as text\n          next = rest.indexOf('<', 1)\n          if (next < 0) break\n          textEnd += next\n          rest = html.slice(textEnd)\n        }\n        text = html.substring(0, textEnd)\n        advance(textEnd)\n      }\n\n      if (textEnd < 0) {\n        text = html\n        html = ''\n      }\n\n      if (options.chars && text) {\n        options.chars(text)\n      }\n    } else {\n      var stackedTag = lastTag.toLowerCase()\n      var reStackedTag =\n        reCache[stackedTag] ||\n        (reCache[stackedTag] = new RegExp(\n          '([\\\\s\\\\S]*?)(</' + stackedTag + '[^>]*>)',\n          'i',\n        ))\n      var endTagLength = 0\n      var rest = html.replace(reStackedTag, function(all, text, endTag) {\n        endTagLength = endTag.length\n        if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {\n          text = text\n            .replace(/<!--([\\s\\S]*?)-->/g, '$1')\n            .replace(/<!\\[CDATA\\[([\\s\\S]*?)]]>/g, '$1')\n        }\n        if (options.chars) {\n          options.chars(text)\n        }\n        return ''\n      })\n      index += html.length - rest.length\n      html = rest\n      parseEndTag(stackedTag, index - endTagLength, index)\n    }\n\n    if (html === last) {\n      options.chars && options.chars(html)\n      if (\n        process.env.NODE_ENV !== 'production' &&\n        !stack.length &&\n        options.warn\n      ) {\n        options.warn(`Mal-formatted tag at end of template: \"${html}\"`)\n      }\n      break\n    }\n  }\n\n  // Clean up any remaining tags\n  parseEndTag()\n\n  function advance(n) {\n    index += n\n    html = html.substring(n)\n  }\n\n  function parseStartTag() {\n    const start = html.match(startTagOpen)\n    if (start) {\n      const match = {\n        tagName: start[1],\n        attrs: [],\n        start: index,\n      }\n      advance(start[0].length)\n      let end, attr\n      while (\n        !(end = html.match(startTagClose)) &&\n        (attr = html.match(attribute))\n      ) {\n        advance(attr[0].length)\n        match.attrs.push(attr)\n      }\n      if (end) {\n        match.unarySlash = end[1]\n        advance(end[0].length)\n        match.end = index\n        return match\n      }\n    }\n  }\n\n  function handleStartTag(match) {\n    const tagName = match.tagName\n    const unarySlash = match.unarySlash\n\n    if (expectHTML) {\n      if (lastTag === 'p' && isNonPhrasingTag(tagName)) {\n        parseEndTag(lastTag)\n      }\n      if (canBeLeftOpenTag(tagName) && lastTag === tagName) {\n        parseEndTag(tagName)\n      }\n    }\n\n    const unary =\n      isUnaryTag(tagName) ||\n      (tagName === 'html' && lastTag === 'head') ||\n      !!unarySlash\n\n    const l = match.attrs.length\n    const attrs = new Array(l)\n    for (let i = 0; i < l; i++) {\n      const args = match.attrs[i]\n      // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778\n      if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('\"\"') === -1) {\n        if (args[3] === '') {\n          delete args[3]\n        }\n        if (args[4] === '') {\n          delete args[4]\n        }\n        if (args[5] === '') {\n          delete args[5]\n        }\n      }\n      let value = args[3] || args[4] || args[5] || ''\n      let name = args[1]\n      /**\n       * react-vue change\n       * <div autorun></div>\n       * {name: \"autorun\", value: \"\"\"\"} => {name: \"autorun\", value: \"true\"}\n       */\n      if (args[1].indexOf('v-') === -1 && args[2] === undefined) {\n        value = 'true'\n        name = ':' + name\n      }\n      attrs[i] = {\n        name: name,\n        value: decodeAttr(value, options.shouldDecodeNewlines),\n      }\n    }\n\n    if (!unary) {\n      stack.push({\n        tag: tagName,\n        lowerCasedTag: tagName.toLowerCase(),\n        attrs: attrs,\n      })\n      lastTag = tagName\n    }\n\n    if (options.start) {\n      options.start(tagName, attrs, unary, match.start, match.end)\n    }\n  }\n\n  function parseEndTag(tagName, start, end) {\n    let pos, lowerCasedTagName\n    if (start == null) start = index\n    if (end == null) end = index\n\n    if (tagName) {\n      lowerCasedTagName = tagName.toLowerCase()\n    }\n\n    // Find the closest opened tag of the same type\n    if (tagName) {\n      for (pos = stack.length - 1; pos >= 0; pos--) {\n        if (stack[pos].lowerCasedTag === lowerCasedTagName) {\n          break\n        }\n      }\n    } else {\n      // If no tag name is provided, clean shop\n      pos = 0\n    }\n\n    if (pos >= 0) {\n      // Close all the open elements, up the stack\n      for (let i = stack.length - 1; i >= pos; i--) {\n        if (\n          process.env.NODE_ENV !== 'production' &&\n          (i > pos || !tagName) &&\n          options.warn\n        ) {\n          options.warn(`tag <${stack[i].tag}> has no matching end tag.`)\n        }\n        if (options.end) {\n          options.end(stack[i].tag, start, end)\n        }\n      }\n\n      // Remove the open elements from the stack\n      stack.length = pos\n      lastTag = pos && stack[pos - 1].tag\n    } else if (lowerCasedTagName === 'br') {\n      if (options.start) {\n        options.start(tagName, [], true, start, end)\n      }\n    } else if (lowerCasedTagName === 'p') {\n      if (options.start) {\n        options.start(tagName, [], false, start, end)\n      }\n      if (options.end) {\n        options.end(tagName, start, end)\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/compiler/parser/index.js",
    "content": "/* @flow */\n\nimport { decode } from 'he'\nimport { parseHTML } from './html-parser'\nimport { parseText } from './text-parser'\nimport { parseFilters } from './filter-parser'\nimport { cached, no, camelize } from 'shared/util'\nimport { genAssignmentCode } from '../directives/model'\nimport { isIE, isEdge, isServerRendering, isNative } from 'core/util/env'\n\nimport ReactNativeRenderGenerator from 'vue-native/compiler/codegen/NativeRenderGenerator.js'\n\nimport {\n  addProp,\n  addAttr,\n  baseWarn,\n  addHandler,\n  addDirective,\n  getBindingAttr,\n  getAndRemoveAttr,\n  pluckModuleFunction,\n} from '../helpers'\n\nexport const onRE = /^@|^v-on:/\nexport const dirRE = /^v-|^@|^:/\nexport const forAliasRE = /(.*?)\\s+(?:in|of)\\s+(.*)/\nexport const forIteratorRE = /\\((\\{[^}]*\\}|[^,]*),([^,]*)(?:,([^,]*))?\\)/\n\nconst argRE = /:(.*)$/\nconst bindRE = /^:|^v-bind:/\nconst modifierRE = /\\.[^.]+/g\nconst splitRE = /\\r?\\n/g\n\nconst decodeHTMLCached = cached(decode)\n\n// configurable state\nexport let warn\nlet delimiters\nlet transforms\nlet preTransforms\nlet postTransforms\nlet platformIsPreTag\nlet platformMustUseProp\nlet platformGetTagNamespace\n\n/**\n * Convert HTML string to AST.\n */\nexport function parse(\n  template: string,\n  options: CompilerOptions,\n): ASTElement | void {\n  warn = options.warn || baseWarn\n  platformGetTagNamespace = options.getTagNamespace || no\n  platformMustUseProp = options.mustUseProp || no\n  platformIsPreTag = options.isPreTag || no\n  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode')\n  transforms = pluckModuleFunction(options.modules, 'transformNode')\n  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode')\n  delimiters = options.delimiters\n\n  const stack = []\n  const preserveWhitespace = options.preserveWhitespace !== false\n  let root\n  let currentParent\n  let inVPre = false\n  let inPre = false\n  let warned = false\n\n  function warnOnce(msg) {\n    if (!warned) {\n      warned = true\n      warn(msg)\n    }\n  }\n\n  function endPre(element) {\n    // check pre state\n    if (element.pre) {\n      inVPre = false\n    }\n    if (platformIsPreTag(element.tag)) {\n      inPre = false\n    }\n  }\n\n  parseHTML(template, {\n    warn,\n    expectHTML: options.expectHTML,\n    isUnaryTag: options.isUnaryTag,\n    canBeLeftOpenTag: options.canBeLeftOpenTag,\n    shouldDecodeNewlines: options.shouldDecodeNewlines,\n    start(tag, attrs, unary) {\n      // check namespace.\n      // inherit parent ns if there is one\n      const ns =\n        (currentParent && currentParent.ns) || platformGetTagNamespace(tag)\n\n      // handle IE svg bug\n      /* istanbul ignore if */\n      if (isIE && ns === 'svg') {\n        attrs = guardIESVGBug(attrs)\n      }\n\n      const element: ASTElement = {\n        type: 1,\n        tag,\n        attrsList: attrs,\n        attrsMap: makeAttrsMap(attrs),\n        parent: currentParent,\n        children: [],\n      }\n      if (ns) {\n        element.ns = ns\n      }\n\n      if (isForbiddenTag(element) && !isServerRendering()) {\n        element.forbidden = true\n        process.env.NODE_ENV !== 'production' &&\n          warn(\n            'Templates should only be responsible for mapping the state to the ' +\n              'UI. Avoid placing tags with side-effects in your templates, such as ' +\n              `<${tag}>` +\n              ', as they will not be parsed.',\n          )\n      }\n\n      // apply pre-transforms\n      for (let i = 0; i < preTransforms.length; i++) {\n        preTransforms[i](element, options)\n      }\n\n      if (!inVPre) {\n        processPre(element)\n        if (element.pre) {\n          inVPre = true\n        }\n      }\n      if (platformIsPreTag(element.tag)) {\n        inPre = true\n      }\n      if (inVPre) {\n        processRawAttrs(element)\n      } else {\n        processFor(element)\n        processIf(element)\n        processOnce(element)\n        processKey(element)\n\n        // determine whether this is a plain element after\n        // removing structural attributes\n        element.plain = !element.key && !attrs.length\n\n        processRef(element)\n        processSlot(element)\n        processComponent(element)\n        for (let i = 0; i < transforms.length; i++) {\n          transforms[i](element, options)\n        }\n        processAttrs(element)\n      }\n\n      function checkRootConstraints(el) {\n        if (process.env.NODE_ENV !== 'production') {\n          if (el.tag === 'slot' || el.tag === 'template') {\n            warnOnce(\n              `Cannot use <${el.tag}> as component root element because it may ` +\n                'contain multiple nodes.',\n            )\n          }\n          // eslint-disable-next-line no-prototype-builtins\n          if (el.attrsMap.hasOwnProperty('v-for')) {\n            warnOnce(\n              'Cannot use v-for on stateful component root element because ' +\n                'it renders multiple elements.',\n            )\n          }\n        }\n      }\n\n      // tree management\n      if (!root) {\n        root = element\n        checkRootConstraints(root)\n      } else if (!stack.length) {\n        // allow root elements with v-if, v-else-if and v-else\n        if (root.if && (element.elseif || element.else)) {\n          checkRootConstraints(element)\n          addIfCondition(root, {\n            exp: element.elseif,\n            block: element,\n          })\n        } else if (process.env.NODE_ENV !== 'production') {\n          warnOnce(\n            `Component template should contain exactly one root element. ` +\n              `If you are using v-if on multiple elements, ` +\n              `use v-else-if to chain them instead.`,\n          )\n        }\n      }\n      if (currentParent && !element.forbidden) {\n        if (element.elseif || element.else) {\n          processIfConditions(element, currentParent)\n        } else if (element.slotScope) {\n          // scoped slot\n          currentParent.plain = false\n          const name = element.slotTarget || '\"default\"'\n          ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[\n            name\n          ] = element\n        } else {\n          currentParent.children.push(element)\n          element.parent = currentParent\n        }\n      }\n      if (!unary) {\n        currentParent = element\n        stack.push(element)\n      } else {\n        endPre(element)\n      }\n      // apply post-transforms\n      for (let i = 0; i < postTransforms.length; i++) {\n        postTransforms[i](element, options)\n      }\n    },\n\n    end() {\n      // remove trailing whitespace\n      const element = stack[stack.length - 1]\n      const lastNode = element.children[element.children.length - 1]\n      if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {\n        element.children.pop()\n      }\n      // pop stack\n      stack.length -= 1\n      currentParent = stack[stack.length - 1]\n      endPre(element)\n    },\n\n    chars(text: string) {\n      if (!currentParent) {\n        if (process.env.NODE_ENV !== 'production') {\n          if (text === template) {\n            warnOnce(\n              'Component template requires a root element, rather than just text.',\n            )\n          } else if ((text = text.trim())) {\n            warnOnce(`text \"${text}\" outside root element will be ignored.`)\n          }\n        }\n        return\n      }\n      // IE textarea placeholder bug\n      /* istanbul ignore if */\n      if (\n        isIE &&\n        currentParent.tag === 'textarea' &&\n        currentParent.attrsMap.placeholder === text\n      ) {\n        return\n      }\n      const children = currentParent.children\n      text =\n        inPre || text.trim()\n          ? decodeHTMLCached(text)\n          : // only preserve whitespace if its not right after a starting tag\n          preserveWhitespace && children.length\n          ? ' '\n          : ''\n      if (text) {\n        let expression\n        if (\n          !inVPre &&\n          text !== ' ' &&\n          (expression = parseText(text, delimiters))\n        ) {\n          children.push({\n            type: 2,\n            expression,\n            text,\n          })\n        } else if (\n          text !== ' ' ||\n          !children.length ||\n          children[children.length - 1].text !== ' '\n        ) {\n          children.push({\n            type: 3,\n            text,\n          })\n        }\n      }\n    },\n  })\n  return root\n}\n\nfunction processPre(el) {\n  if (getAndRemoveAttr(el, 'v-pre') != null) {\n    el.pre = true\n  }\n}\n\nfunction processRawAttrs(el) {\n  const l = el.attrsList.length\n  if (l) {\n    const attrs = (el.attrs = new Array(l))\n    for (let i = 0; i < l; i++) {\n      attrs[i] = {\n        name: el.attrsList[i].name,\n        value: JSON.stringify(el.attrsList[i].value),\n      }\n    }\n  } else if (!el.pre) {\n    // non root node in pre blocks with no attributes\n    el.plain = true\n  }\n}\n\nfunction processKey(el) {\n  const exp = getBindingAttr(el, 'key')\n  if (exp) {\n    if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {\n      warn(\n        `<template> cannot be keyed. Place the key on real elements instead.`,\n      )\n    }\n    el.key = exp\n  }\n}\n\nfunction processRef(el) {\n  const ref = getBindingAttr(el, 'ref')\n  if (ref) {\n    el.ref = ref\n    el.refInFor = checkInFor(el)\n  }\n}\n\nfunction processFor(el) {\n  let exp\n  if ((exp = getAndRemoveAttr(el, 'v-for'))) {\n    const inMatch = exp.match(forAliasRE)\n    if (!inMatch) {\n      process.env.NODE_ENV !== 'production' &&\n        warn(`Invalid v-for expression: ${exp}`)\n      return\n    }\n    el.for = inMatch[2].trim()\n    const alias = inMatch[1].trim()\n    const iteratorMatch = alias.match(forIteratorRE)\n    if (iteratorMatch) {\n      el.alias = iteratorMatch[1].trim()\n      el.iterator1 = iteratorMatch[2].trim()\n      if (iteratorMatch[3]) {\n        el.iterator2 = iteratorMatch[3].trim()\n      }\n    } else {\n      el.alias = alias\n    }\n  }\n}\n\nfunction processIf(el) {\n  const exp = getAndRemoveAttr(el, 'v-if')\n  if (exp) {\n    el.if = exp\n    addIfCondition(el, {\n      exp: exp,\n      block: el,\n    })\n  } else {\n    if (getAndRemoveAttr(el, 'v-else') != null) {\n      el.else = true\n    }\n    const elseif = getAndRemoveAttr(el, 'v-else-if')\n    if (elseif) {\n      el.elseif = elseif\n    }\n  }\n}\n\nfunction processIfConditions(el, parent) {\n  const prev = findPrevElement(parent.children)\n  if (prev && prev.if) {\n    addIfCondition(prev, {\n      exp: el.elseif,\n      block: el,\n    })\n  } else if (process.env.NODE_ENV !== 'production') {\n    warn(\n      `v-${el.elseif ? 'else-if=\"' + el.elseif + '\"' : 'else'} ` +\n        `used on element <${el.tag}> without corresponding v-if.`,\n    )\n  }\n}\n\nfunction findPrevElement(children: Array<any>): ASTElement | void {\n  let i = children.length\n  while (i--) {\n    if (children[i].type === 1) {\n      return children[i]\n    } else {\n      if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {\n        warn(\n          `text \"${children[i].text.trim()}\" between v-if and v-else(-if) ` +\n            `will be ignored.`,\n        )\n      }\n      children.pop()\n    }\n  }\n}\n\nfunction addIfCondition(el, condition) {\n  if (!el.ifConditions) {\n    el.ifConditions = []\n  }\n  el.ifConditions.push(condition)\n}\n\nfunction processOnce(el) {\n  const once = getAndRemoveAttr(el, 'v-once')\n  if (once != null) {\n    el.once = true\n  }\n}\n\nfunction processSlot(el) {\n  if (el.tag === 'slot') {\n    el.slotName = getBindingAttr(el, 'name')\n    if (process.env.NODE_ENV !== 'production' && el.key) {\n      warn(\n        `\\`key\\` does not work on <slot> because slots are abstract outlets ` +\n          `and can possibly expand into multiple elements. ` +\n          `Use the key on a wrapping element instead.`,\n      )\n    }\n  } else {\n    const slotTarget = getBindingAttr(el, 'slot')\n    if (slotTarget) {\n      el.slotTarget = slotTarget === '\"\"' ? '\"default\"' : slotTarget\n    }\n    if (el.tag === 'template') {\n      el.slotScope = getAndRemoveAttr(el, 'scope')\n    }\n  }\n}\n\nfunction processComponent(el) {\n  let binding\n  if ((binding = getBindingAttr(el, 'is'))) {\n    el.component = binding\n  }\n  if (getAndRemoveAttr(el, 'inline-template') != null) {\n    el.inlineTemplate = true\n  }\n}\n\nexport function processAttrs(\n  el: ASTElement,\n  options: Object | void,\n  customSlot: boolean = false,\n) {\n  const list = el.attrsList\n  let i, l, name, rawName, value, modifiers, isProp\n  for (i = 0, l = list.length; i < l; i++) {\n    name = rawName = list[i].name\n    value = list[i].value\n    if (dirRE.test(name)) {\n      // mark element as dynamic\n      el.hasBindings = true\n      // modifiers\n      modifiers = parseModifiers(name)\n      if (modifiers) {\n        name = name.replace(modifierRE, '')\n      }\n      if (bindRE.test(name)) {\n        // v-bind\n        name = name.replace(bindRE, '')\n        value = parseFilters(value)\n        isProp = false\n        if (modifiers) {\n          if (modifiers.prop) {\n            isProp = true\n            name = camelize(name)\n            if (name === 'innerHtml') name = 'innerHTML'\n          }\n          if (modifiers.camel) {\n            name = camelize(name)\n          }\n          if (modifiers.sync) {\n            addHandler(\n              el,\n              `update:${camelize(name)}`,\n              genAssignmentCode(value, `$event`),\n            )\n          }\n        }\n        if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {\n          addProp(el, name, value)\n        } else {\n          addAttr(el, name, value)\n        }\n      } else if (onRE.test(name)) {\n        // v-on\n        name = name.replace(onRE, '')\n        addHandler(el, name, value, modifiers, false, warn)\n        //Check if its expression or function\n        //\n        if (isNative) {\n          let camelCaseName = 'on-' + name\n          camelCaseName = camelCaseName.replace(/-([a-z])/g, function(g) {\n            return g[1].toUpperCase()\n          })\n          addAttr(el, camelCaseName, `() => ${value}`)\n        }\n      } else {\n        // normal directives\n        name = name.replace(dirRE, '')\n        // parse arg\n        const argMatch = name.match(argRE)\n        const arg = argMatch && argMatch[1]\n        if (arg) {\n          name = name.slice(0, -(arg.length + 1))\n        }\n        if (isNative) {\n          addHandler(el, name, value, modifiers, false, warn)\n          if (name === 'model') {\n            addAttr(el, 'value', value)\n            let detectOnChange = false\n            // $flow-disable-line\n            el.attrs.forEach(attr => {\n              if (attr.name === 'on-change') {\n                detectOnChange = true\n              }\n            })\n            if (!detectOnChange) {\n              if (el.tag !== 'switch') {\n                addAttr(\n                  el,\n                  'on-change',\n                  `(value) => ${value}=value.nativeEvent.text`,\n                )\n              } else {\n                addAttr(el, 'on-value-change', `(value) => ${value}=value`)\n              }\n            }\n          }\n        } else {\n          addDirective(el, name, rawName, value, arg, modifiers)\n        }\n        if (process.env.NODE_ENV !== 'production' && name === 'model') {\n          checkForAliasModel(el, value)\n        }\n      }\n    } else {\n      // literal attribute\n      if (process.env.NODE_ENV !== 'production') {\n        const expression = parseText(value, delimiters)\n        if (expression) {\n          warn(\n            `${name}=\"${value}\": ` +\n              'Interpolation inside attributes has been removed. ' +\n              'Use v-bind or the colon shorthand instead. For example, ' +\n              'instead of <div id=\"{{ val }}\">, use <div :id=\"val\">.',\n          )\n        }\n      }\n      if (name === 'to') {\n        value = value.replace(/\\//, '')\n        addAttr(el, 'on-press', `() => ${'navigation'}.navigate('${value}')`)\n      } else {\n        if (\n          (name === 'render-prop-fn' || name === 'render-prop') &&\n          customSlot\n        ) {\n          // Add Attribute in parent element\n          //\n          const renderer = new ReactNativeRenderGenerator(el, options)\n          let customRenderer = renderer.generateRender()\n          let customImport = renderer.generateImport()\n          customRenderer = customRenderer.replace(\n            /render \\(vm\\)/,\n            'render (slotProps)',\n          )\n\n          if (name === 'render-prop') {\n            customRenderer = '(' + customRenderer + ')()'\n          } else {\n            // Support for args\n            customRenderer = customRenderer.replace(\n              /render \\(slotProps\\)/,\n              'render (args)',\n            )\n            if (\n              el.attrsMap['arguments'] &&\n              typeof el.attrsMap['arguments'] === 'string'\n            ) {\n              let customArguments = el.attrsMap['arguments'].split(',')\n              customRenderer = customRenderer.replace(\n                /render \\(args\\)/,\n                // $flow-disable-line\n                `render (${el.attrsMap['arguments']})`,\n              )\n              // Replace each instance of the argument\n              //\n              customArguments.forEach(argument => {\n                let reg = new RegExp('vm[' + argument + ']', 'g')\n                customRenderer = customRenderer.replace(reg, argument)\n              })\n            } else {\n              customRenderer = customRenderer.replace(/vm\\(args\\)/g, 'args')\n            }\n          }\n          // $flow-disable-line\n          addAttr(el.parent, value, `${customRenderer}`)\n          let vueNativeCoreImport = customImport.split(splitRE)\n          if (vueNativeCoreImport && vueNativeCoreImport[0]) {\n            let imports = vueNativeCoreImport[0]\n            imports = imports.replace(/import \\{/g, '')\n            imports = imports.replace(/\\} from 'vue-native-helper'/g, '')\n            return imports.split(',').map(function(item) {\n              return item.trim()\n            })\n          }\n        } else {\n          addAttr(el, name, JSON.stringify(value))\n        }\n      }\n    }\n  }\n}\n\nfunction checkInFor(el: ASTElement): boolean {\n  let parent = el\n  while (parent) {\n    if (parent.for !== undefined) {\n      return true\n    }\n    parent = parent.parent\n  }\n  return false\n}\n\nfunction parseModifiers(name: string): Object | void {\n  const match = name.match(modifierRE)\n  if (match) {\n    const ret = {}\n    match.forEach(m => {\n      ret[m.slice(1)] = true\n    })\n    return ret\n  }\n}\n\nfunction makeAttrsMap(attrs: Array<Object>): Object {\n  const map = {}\n  for (let i = 0, l = attrs.length; i < l; i++) {\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      map[attrs[i].name] &&\n      !isIE &&\n      !isEdge\n    ) {\n      warn('duplicate attribute: ' + attrs[i].name)\n    }\n    map[attrs[i].name] = attrs[i].value\n  }\n  return map\n}\n\nfunction isForbiddenTag(el): boolean {\n  return (\n    el.tag === 'style' ||\n    (el.tag === 'script' &&\n      (!el.attrsMap.type || el.attrsMap.type === 'text/javascript'))\n  )\n}\n\nconst ieNSBug = /^xmlns:NS\\d+/\nconst ieNSPrefix = /^NS\\d+:/\n\n/* istanbul ignore next */\nfunction guardIESVGBug(attrs) {\n  const res = []\n  for (let i = 0; i < attrs.length; i++) {\n    const attr = attrs[i]\n    if (!ieNSBug.test(attr.name)) {\n      attr.name = attr.name.replace(ieNSPrefix, '')\n      res.push(attr)\n    }\n  }\n  return res\n}\n\nfunction checkForAliasModel(el, value) {\n  let _el = el\n  while (_el) {\n    if (_el.for && _el.alias === value) {\n      warn(\n        `<${el.tag} v-model=\"${value}\">: ` +\n          `You are binding v-model directly to a v-for iteration alias. ` +\n          `This will not be able to modify the v-for source array because ` +\n          `writing to the alias is like modifying a function local variable. ` +\n          `Consider using an array of objects and use v-model on an object property instead.`,\n      )\n    }\n    _el = _el.parent\n  }\n}\n"
  },
  {
    "path": "src/compiler/parser/text-parser.js",
    "content": "/* @flow */\n\nimport { cached } from 'shared/util'\nimport { parseFilters } from './filter-parser'\n\nconst defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g\nconst regexEscapeRE = /[-.*+?^${}()|[\\]\\/\\\\]/g\n\nconst buildRegex = cached(delimiters => {\n  const open = delimiters[0].replace(regexEscapeRE, '\\\\$&')\n  const close = delimiters[1].replace(regexEscapeRE, '\\\\$&')\n  return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n})\n\nexport function parseText(\n  text: string,\n  delimiters?: [string, string],\n): string | void {\n  const tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE\n  if (!tagRE.test(text)) {\n    return\n  }\n  const tokens = []\n  let lastIndex = (tagRE.lastIndex = 0)\n  let match, index\n  while ((match = tagRE.exec(text))) {\n    index = match.index\n    // push text token\n    if (index > lastIndex) {\n      tokens.push(JSON.stringify(text.slice(lastIndex, index)))\n    }\n    // tag token\n    const exp = parseFilters(match[1].trim())\n    tokens.push(`_s(${exp})`)\n    lastIndex = index + match[0].length\n  }\n  if (lastIndex < text.length) {\n    tokens.push(JSON.stringify(text.slice(lastIndex)))\n  }\n  return tokens.join('+')\n}\n"
  },
  {
    "path": "src/core/components/index.js",
    "content": "import KeepAlive from './keep-alive'\n\nexport default {\n  KeepAlive,\n}\n"
  },
  {
    "path": "src/core/components/keep-alive.js",
    "content": "/* @flow */\n\nimport { getFirstComponentChild } from 'core/vdom/helpers/index'\n\ntype VNodeCache = { [key: string]: ?VNode }\n\nconst patternTypes: Array<Function> = [String, RegExp]\n\nfunction getComponentName(opts: ?VNodeComponentOptions): ?string {\n  return opts && (opts.Ctor.options.name || opts.tag)\n}\n\nfunction matches(pattern: string | RegExp, name: string): boolean {\n  if (typeof pattern === 'string') {\n    return pattern.split(',').indexOf(name) > -1\n  } else if (pattern instanceof RegExp) {\n    return pattern.test(name)\n  }\n  /* istanbul ignore next */\n  return false\n}\n\nfunction pruneCache(cache: VNodeCache, current: VNode, filter: Function) {\n  for (const key in cache) {\n    const cachedNode: ?VNode = cache[key]\n    if (cachedNode) {\n      const name: ?string = getComponentName(cachedNode.componentOptions)\n      if (name && !filter(name)) {\n        if (cachedNode !== current) {\n          pruneCacheEntry(cachedNode)\n        }\n        cache[key] = null\n      }\n    }\n  }\n}\n\nfunction pruneCacheEntry(vnode: ?VNode) {\n  if (vnode) {\n    vnode.componentInstance.$destroy()\n  }\n}\n\nexport default {\n  name: 'keep-alive',\n  abstract: true,\n\n  props: {\n    include: patternTypes,\n    exclude: patternTypes,\n  },\n\n  created() {\n    this.cache = Object.create(null)\n  },\n\n  destroyed() {\n    for (const key in this.cache) {\n      pruneCacheEntry(this.cache[key])\n    }\n  },\n\n  watch: {\n    include(val: string | RegExp) {\n      pruneCache(this.cache, this._vnode, name => matches(val, name))\n    },\n    exclude(val: string | RegExp) {\n      pruneCache(this.cache, this._vnode, name => !matches(val, name))\n    },\n  },\n\n  render() {\n    const vnode: VNode = getFirstComponentChild(this.$slots.default)\n    const componentOptions: ?VNodeComponentOptions =\n      vnode && vnode.componentOptions\n    if (componentOptions) {\n      // check pattern\n      const name: ?string = getComponentName(componentOptions)\n      if (\n        name &&\n        ((this.include && !matches(this.include, name)) ||\n          (this.exclude && matches(this.exclude, name)))\n      ) {\n        return vnode\n      }\n      const key: ?string =\n        vnode.key == null\n          ? // same constructor may get registered as different local components\n            // so cid alone is not enough (#3269)\n            componentOptions.Ctor.cid +\n            (componentOptions.tag ? `::${componentOptions.tag}` : '')\n          : vnode.key\n      if (this.cache[key]) {\n        vnode.componentInstance = this.cache[key].componentInstance\n      } else {\n        this.cache[key] = vnode\n      }\n      vnode.data.keepAlive = true\n    }\n    return vnode\n  },\n}\n"
  },
  {
    "path": "src/core/config.js",
    "content": "/* @flow */\n\nimport { no, noop, identity } from 'shared/util'\n\nimport { LIFECYCLE_HOOKS } from 'shared/constants'\n\nexport type Config = {\n  // user\n  optionMergeStrategies: { [key: string]: Function },\n  silent: boolean,\n  productionTip: boolean,\n  performance: boolean,\n  devtools: boolean,\n  errorHandler: ?(err: Error, vm: Component, info: string) => void,\n  ignoredElements: Array<string>,\n  keyCodes: { [key: string]: number | Array<number> },\n\n  // platform\n  isReservedTag: (x?: string) => boolean,\n  isReservedAttr: (x?: string) => boolean,\n  parsePlatformTagName: (x: string) => string,\n  isUnknownElement: (x?: string) => boolean,\n  getTagNamespace: (x?: string) => string | void,\n  mustUseProp: (tag: string, type: ?string, name: string) => boolean,\n\n  // legacy\n  _lifecycleHooks: Array<string>,\n}\n\nexport default ({\n  /**\n   * Option merge strategies (used in core/util/options)\n   */\n  optionMergeStrategies: Object.create(null),\n\n  /**\n   * Whether to suppress warnings.\n   */\n  silent: false,\n\n  /**\n   * Show production mode tip message on boot?\n   */\n  productionTip: process.env.NODE_ENV !== 'production',\n\n  /**\n   * Whether to enable devtools\n   */\n  devtools: process.env.NODE_ENV !== 'production',\n\n  /**\n   * Whether to record perf\n   */\n  performance: false,\n\n  /**\n   * Error handler for watcher errors\n   */\n  errorHandler: null,\n\n  /**\n   * Ignore certain custom elements\n   */\n  ignoredElements: [],\n\n  /**\n   * Custom user key aliases for v-on\n   */\n  keyCodes: Object.create(null),\n\n  /**\n   * Check if a tag is reserved so that it cannot be registered as a\n   * component. This is platform-dependent and may be overwritten.\n   */\n  isReservedTag: no,\n\n  /**\n   * Check if an attribute is reserved so that it cannot be used as a component\n   * prop. This is platform-dependent and may be overwritten.\n   */\n  isReservedAttr: no,\n\n  /**\n   * Check if a tag is an unknown element.\n   * Platform-dependent.\n   */\n  isUnknownElement: no,\n\n  /**\n   * Get the namespace of an element\n   */\n  getTagNamespace: noop,\n\n  /**\n   * Parse the real tag name for the specific platform.\n   */\n  parsePlatformTagName: identity,\n\n  /**\n   * Check if an attribute must be bound using property, e.g. value\n   * Platform-dependent.\n   */\n  mustUseProp: no,\n\n  /**\n   * Exposed for legacy reasons\n   */\n  _lifecycleHooks: LIFECYCLE_HOOKS,\n}: Config)\n"
  },
  {
    "path": "src/core/global-api/assets.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport { ASSET_TYPES } from 'shared/constants'\nimport {\n  warn,\n  // isPlainObject,\n  camelize,\n  capitalize,\n} from '../util/index'\n\nexport function initAssetRegisters(Vue: GlobalAPI) {\n  /**\n   * Create asset registration methods.\n   */\n  ASSET_TYPES.forEach(type => {\n    Vue[type] = function(\n      id: string,\n      definition: Function | Object,\n    ): Function | Object | void {\n      if (!definition) {\n        return this.options[type + 's'][id]\n      } else {\n        /* istanbul ignore if */\n        if (process.env.NODE_ENV !== 'production') {\n          if (type === 'component' && config.isReservedTag(id)) {\n            warn(\n              'Do not use built-in or reserved HTML elements as component ' +\n                'id: ' +\n                id,\n            )\n          }\n        }\n        // if (type === 'component' && isPlainObject(definition)) {\n        //   definition.name = definition.name || id\n        //   definition = this.options._base.extend(definition)\n        // }\n        if (type === 'directive' && typeof definition === 'function') {\n          definition = { bind: definition, update: definition }\n        }\n        /**\n         * react-vue change\n         */\n        if (type === 'component' && typeof definition === 'function') {\n          id = capitalize(camelize(id))\n          if (definition.name) {\n            const _id = capitalize(camelize(definition.name))\n            if (_id !== id) {\n              this.options[type + 's'][_id] = definition\n            }\n          }\n        }\n\n        this.options[type + 's'][id] = definition\n        return definition\n      }\n    }\n  })\n}\n"
  },
  {
    "path": "src/core/global-api/extend.js",
    "content": "/* @flow */\n\nimport { ASSET_TYPES } from 'shared/constants'\nimport { warn, extend, mergeOptions } from '../util/index'\nimport { defineComputed, proxy } from '../instance/state'\n\nexport function initExtend(Vue: GlobalAPI) {\n  /**\n   * Each instance constructor, including Vue, has a unique\n   * cid. This enables us to create wrapped \"child\n   * constructors\" for prototypal inheritance and cache them.\n   */\n  Vue.cid = 0\n  let cid = 1\n\n  /**\n   * Class inheritance\n   */\n  Vue.extend = function(extendOptions: Object): Function {\n    extendOptions = extendOptions || {}\n    const Super = this\n    const SuperId = Super.cid\n    const cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {})\n    if (cachedCtors[SuperId]) {\n      return cachedCtors[SuperId]\n    }\n\n    const name = extendOptions.name || Super.options.name\n    if (process.env.NODE_ENV !== 'production') {\n      if (!/^[a-zA-Z][\\w-]*$/.test(name)) {\n        warn(\n          'Invalid component name: \"' +\n            name +\n            '\". Component names ' +\n            'can only contain alphanumeric characters and the hyphen, ' +\n            'and must start with a letter.',\n        )\n      }\n    }\n\n    const Sub = function VueComponent(options) {\n      this._init(options)\n    }\n    Sub.prototype = Object.create(Super.prototype)\n    Sub.prototype.constructor = Sub\n    Sub.cid = cid++\n    Sub.options = mergeOptions(Super.options, extendOptions)\n    Sub['super'] = Super\n\n    // For props and computed properties, we define the proxy getters on\n    // the Vue instances at extension time, on the extended prototype. This\n    // avoids Object.defineProperty calls for each instance created.\n    if (Sub.options.props) {\n      initProps(Sub)\n    }\n    if (Sub.options.computed) {\n      initComputed(Sub)\n    }\n\n    // allow further extension/mixin/plugin usage\n    Sub.extend = Super.extend\n    Sub.mixin = Super.mixin\n    Sub.use = Super.use\n\n    // create asset registers, so extended classes\n    // can have their private assets too.\n    ASSET_TYPES.forEach(function(type) {\n      Sub[type] = Super[type]\n    })\n    // enable recursive self-lookup\n    if (name) {\n      Sub.options.components[name] = Sub\n    }\n\n    // keep a reference to the super options at extension time.\n    // later at instantiation we can check if Super's options have\n    // been updated.\n    Sub.superOptions = Super.options\n    Sub.extendOptions = extendOptions\n    Sub.sealedOptions = extend({}, Sub.options)\n\n    // cache constructor\n    cachedCtors[SuperId] = Sub\n    return Sub\n  }\n}\n\nfunction initProps(Comp) {\n  const props = Comp.options.props\n  for (const key in props) {\n    proxy(Comp.prototype, `_props`, key)\n  }\n}\n\nfunction initComputed(Comp) {\n  const computed = Comp.options.computed\n  for (const key in computed) {\n    defineComputed(Comp.prototype, key, computed[key])\n  }\n}\n"
  },
  {
    "path": "src/core/global-api/index.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport { initUse } from './use'\nimport { initMixin } from './mixin'\nimport { initExtend } from './extend'\nimport { initAssetRegisters } from './assets'\nimport { set, del } from '../observer/index'\nimport { ASSET_TYPES } from 'shared/constants'\nimport builtInComponents from '../components/index'\n\nimport {\n  warn,\n  extend,\n  nextTick,\n  mergeOptions,\n  defineReactive,\n} from '../util/index'\n\nexport function initGlobalAPI(Vue: GlobalAPI) {\n  // config\n  const configDef = {}\n  configDef.get = () => config\n  if (process.env.NODE_ENV !== 'production') {\n    configDef.set = () => {\n      warn(\n        'Do not replace the Vue.config object, set individual fields instead.',\n      )\n    }\n  }\n  Object.defineProperty(Vue, 'config', configDef)\n\n  // exposed util methods.\n  // NOTE: these are not considered part of the public API - avoid relying on\n  // them unless you are aware of the risk.\n  Vue.util = {\n    warn,\n    extend,\n    mergeOptions,\n    defineReactive,\n  }\n\n  Vue.set = set\n  Vue.delete = del\n  Vue.nextTick = nextTick\n\n  Vue.options = Object.create(null)\n  ASSET_TYPES.forEach(type => {\n    Vue.options[type + 's'] = Object.create(null)\n  })\n\n  // this is used to identify the \"base\" constructor to extend all plain-object\n  // components with in Weex's multi-instance scenarios.\n  Vue.options._base = Vue\n\n  extend(Vue.options.components, builtInComponents)\n\n  initUse(Vue)\n  initMixin(Vue)\n  initExtend(Vue)\n  initAssetRegisters(Vue)\n}\n"
  },
  {
    "path": "src/core/global-api/mixin.js",
    "content": "/* @flow */\n\nimport { mergeOptions } from '../util/index'\n\nexport function initMixin(Vue: GlobalAPI) {\n  Vue.mixin = function(mixin: Object) {\n    this.options = mergeOptions(this.options, mixin)\n  }\n}\n"
  },
  {
    "path": "src/core/global-api/use.js",
    "content": "/* @flow */\n\nimport { toArray } from '../util/index'\n\nexport function initUse(Vue: GlobalAPI) {\n  Vue.use = function(plugin: Function | Object) {\n    /* istanbul ignore if */\n    if (plugin.installed) {\n      return\n    }\n    // additional parameters\n    const args = toArray(arguments, 1)\n    args.unshift(this)\n    if (typeof plugin.install === 'function') {\n      plugin.install.apply(plugin, args)\n    } else if (typeof plugin === 'function') {\n      plugin.apply(null, args)\n    }\n    plugin.installed = true\n    return this\n  }\n}\n"
  },
  {
    "path": "src/core/index.js",
    "content": "import Vue from './instance/index'\nimport { initGlobalAPI } from './global-api/index'\nimport { isServerRendering } from 'core/util/env'\n\ninitGlobalAPI(Vue)\n\nObject.defineProperty(Vue.prototype, '$isServer', {\n  get: isServerRendering,\n})\n\nVue.version = '__VERSION__'\n\nexport default Vue\n"
  },
  {
    "path": "src/core/instance/events.js",
    "content": "/* @flow */\n\nimport { updateListeners } from '../vdom/helpers/index'\nimport { toArray, tip, hyphenate, formatComponentName } from '../util/index'\n\nexport function initEvents(vm: Component) {\n  vm._events = Object.create(null)\n\n  /**\n   * react-vue change\n   */\n  if (Array.isArray(vm.$options.reactVueCustomEvent)) {\n    vm.$options.reactVueCustomEvent.forEach((v: any) => {\n      vm.$on(v.name, v.handle)\n    })\n  }\n  // vm._hasHookEvent = false\n  // // init parent attached events\n  // const listeners = vm.$options._parentListeners\n  // if (listeners) {\n  //   updateComponentListeners(vm, listeners)\n  // }\n}\n\nlet target: Component\n\nfunction add(event, fn, once) {\n  if (once) {\n    target.$once(event, fn)\n  } else {\n    target.$on(event, fn)\n  }\n}\n\nfunction remove(event, fn) {\n  target.$off(event, fn)\n}\n\nexport function updateComponentListeners(\n  vm: Component,\n  listeners: Object,\n  oldListeners: ?Object,\n) {\n  target = vm\n  updateListeners(listeners, oldListeners || {}, add, remove, vm)\n}\n\nexport function eventsMixin(Vue: Class<Component>) {\n  const hookRE = /^hook:/\n  Vue.prototype.$on = function(\n    event: string | Array<string>,\n    fn: Function,\n  ): Component {\n    const vm: Component = this\n    if (Array.isArray(event)) {\n      for (let i = 0, l = event.length; i < l; i++) {\n        this.$on(event[i], fn)\n      }\n    } else {\n      ;(vm._events[event] || (vm._events[event] = [])).push(fn)\n      // optimize hook:event cost by using a boolean flag marked at registration\n      // instead of a hash lookup\n      if (hookRE.test(event)) {\n        vm._hasHookEvent = true\n      }\n    }\n    return vm\n  }\n\n  Vue.prototype.$once = function(event: string, fn: Function): Component {\n    const vm: Component = this\n    function on() {\n      vm.$off(event, on)\n      fn.apply(vm, arguments)\n    }\n    on.fn = fn\n    vm.$on(event, on)\n    return vm\n  }\n\n  Vue.prototype.$off = function(\n    event?: string | Array<string>,\n    fn?: Function,\n  ): Component {\n    const vm: Component = this\n    // all\n    if (!arguments.length) {\n      vm._events = Object.create(null)\n      return vm\n    }\n    // array of events\n    if (Array.isArray(event)) {\n      for (let i = 0, l = event.length; i < l; i++) {\n        this.$off(event[i], fn)\n      }\n      return vm\n    }\n    // specific event\n    const cbs = vm._events[event]\n    if (!cbs) {\n      return vm\n    }\n    if (arguments.length === 1) {\n      vm._events[event] = null\n      return vm\n    }\n    // specific handler\n    let cb\n    let i = cbs.length\n    while (i--) {\n      cb = cbs[i]\n      if (cb === fn || cb.fn === fn) {\n        cbs.splice(i, 1)\n        break\n      }\n    }\n    return vm\n  }\n\n  Vue.prototype.$emit = function(event: string): Component {\n    const vm: Component = this\n    if (process.env.NODE_ENV !== 'production') {\n      const lowerCaseEvent = event.toLowerCase()\n      if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {\n        tip(\n          `Event \"${lowerCaseEvent}\" is emitted in component ` +\n            `${formatComponentName(\n              vm,\n            )} but the handler is registered for \"${event}\". ` +\n            `Note that HTML attributes are case-insensitive and you cannot use ` +\n            `v-on to listen to camelCase events when using in-DOM templates. ` +\n            `You should probably use \"${hyphenate(\n              event,\n            )}\" instead of \"${event}\".`,\n        )\n      }\n    }\n    let cbs = vm._events[event]\n    if (cbs) {\n      cbs = cbs.length > 1 ? toArray(cbs) : cbs\n      const args = toArray(arguments, 1)\n      for (let i = 0, l = cbs.length; i < l; i++) {\n        cbs[i].apply(vm, args)\n      }\n    }\n    return vm\n  }\n}\n"
  },
  {
    "path": "src/core/instance/index.js",
    "content": "import { initMixin } from './init'\nimport { stateMixin } from './state'\n/**\n * react-vue change\n */\n// import { renderMixin } from './render'\nimport { eventsMixin } from './events'\n/**\n * react-vue change\n */\n// import { lifecycleMixin } from './lifecycle'\nimport {\n  warn,\n  // nextTick,\n} from '../util/index'\n\nfunction Vue(options) {\n  if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue)) {\n    warn('Vue is a constructor and should be called with the `new` keyword')\n  }\n\n  if (process.env.NODE_ENV !== 'production') {\n    warn(\n      'Vue Native has been deprecated and is no longer being maintained. Please consider migrating to React Native or use NativeScript-Vue instead',\n    )\n  }\n  /**\n   * react-vue change\n   */\n  if (options) {\n    if (options.reactVueSlots) {\n      this.$slots = options.reactVueSlots\n    }\n    if (options.reactVueForceUpdate) {\n      this.$forceUpdate = options.reactVueForceUpdate\n    }\n  }\n  this._init(options)\n}\n\ninitMixin(Vue)\nstateMixin(Vue)\neventsMixin(Vue)\n\n/**\n * react-vue change\n */\n// lifecycleMixin(Vue)\n// renderMixin(Vue)\n\nexport default Vue\n"
  },
  {
    "path": "src/core/instance/init.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport { initProxy } from './proxy'\nimport { initState } from './state'\nimport { initRender } from './render'\nimport { initEvents } from './events'\nimport { mark, measure } from '../util/perf'\nimport { initLifecycle, callHook } from './lifecycle'\nimport { initProvide, initInjections } from './inject'\nimport { extend, mergeOptions, formatComponentName } from '../util/index'\n\nlet uid = 0\n\nexport function initMixin(Vue: Class<Component>) {\n  Vue.prototype._init = function(options?: Object) {\n    const vm: Component = this\n    // a uid\n    vm._uid = uid++\n\n    let startTag, endTag\n    /* istanbul ignore if */\n    if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n      startTag = `vue-perf-init:${vm._uid}`\n      endTag = `vue-perf-end:${vm._uid}`\n      mark(startTag)\n    }\n\n    // a flag to avoid this being observed\n    vm._isVue = true\n    // merge options\n    if (options && options._isComponent) {\n      // optimize internal component instantiation\n      // since dynamic options merging is pretty slow, and none of the\n      // internal component options needs special treatment.\n      initInternalComponent(vm, options)\n    } else {\n      vm.$options = mergeOptions(\n        resolveConstructorOptions(vm.constructor),\n        options || {},\n        vm,\n      )\n    }\n    /* istanbul ignore else */\n    if (process.env.NODE_ENV !== 'production') {\n      initProxy(vm)\n    } else {\n      vm._renderProxy = vm\n    }\n    // expose real self\n    vm._self = vm\n    initLifecycle(vm)\n    initEvents(vm)\n    initRender(vm)\n    callHook(vm, 'beforeCreate')\n    initInjections(vm) // resolve injections before data/props\n    initState(vm)\n    initProvide(vm) // resolve provide after data/props\n    callHook(vm, 'created')\n\n    /* istanbul ignore if */\n    if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n      vm._name = formatComponentName(vm, false)\n      mark(endTag)\n      measure(`${vm._name} init`, startTag, endTag)\n    }\n\n    if (vm.$options.el) {\n      vm.$mount(vm.$options.el)\n    }\n  }\n}\n\nfunction initInternalComponent(\n  vm: Component,\n  options: InternalComponentOptions,\n) {\n  const opts = (vm.$options = Object.create(vm.constructor.options))\n  // doing this because it's faster than dynamic enumeration.\n  opts.parent = options.parent\n  opts.propsData = options.propsData\n  opts._parentVnode = options._parentVnode\n  opts._parentListeners = options._parentListeners\n  opts._renderChildren = options._renderChildren\n  opts._componentTag = options._componentTag\n  opts._parentElm = options._parentElm\n  opts._refElm = options._refElm\n  if (options.render) {\n    opts.render = options.render\n    opts.staticRenderFns = options.staticRenderFns\n  }\n}\n\nexport function resolveConstructorOptions(Ctor: Class<Component>) {\n  let options = Ctor.options\n  if (Ctor.super) {\n    const superOptions = resolveConstructorOptions(Ctor.super)\n    const cachedSuperOptions = Ctor.superOptions\n    if (superOptions !== cachedSuperOptions) {\n      // super option changed,\n      // need to resolve new options.\n      Ctor.superOptions = superOptions\n      // check if there are any late-modified/attached options (#4976)\n      const modifiedOptions = resolveModifiedOptions(Ctor)\n      // update base extend options\n      if (modifiedOptions) {\n        extend(Ctor.extendOptions, modifiedOptions)\n      }\n      options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions)\n      if (options.name) {\n        options.components[options.name] = Ctor\n      }\n    }\n  }\n  return options\n}\n\nfunction resolveModifiedOptions(Ctor: Class<Component>): ?Object {\n  let modified\n  const latest = Ctor.options\n  const sealed = Ctor.sealedOptions\n  for (const key in latest) {\n    if (latest[key] !== sealed[key]) {\n      if (!modified) modified = {}\n      modified[key] = dedupe(latest[key], sealed[key])\n    }\n  }\n  return modified\n}\n\nfunction dedupe(latest, sealed) {\n  // compare latest and sealed to ensure lifecycle hooks won't be duplicated\n  // between merges\n  if (Array.isArray(latest)) {\n    const res = []\n    sealed = Array.isArray(sealed) ? sealed : [sealed]\n    for (let i = 0; i < latest.length; i++) {\n      if (sealed.indexOf(latest[i]) < 0) {\n        res.push(latest[i])\n      }\n    }\n    return res\n  } else {\n    return latest\n  }\n}\n"
  },
  {
    "path": "src/core/instance/inject.js",
    "content": "/* @flow */\n\nimport { hasSymbol } from 'core/util/env'\nimport { warn } from '../util/index'\nimport { defineReactive } from '../observer/index'\n\nexport function initProvide(vm: Component) {\n  const provide = vm.$options.provide\n  if (provide) {\n    vm._provided = typeof provide === 'function' ? provide.call(vm) : provide\n  }\n}\n\nexport function initInjections(vm: Component) {\n  const result = resolveInject(vm.$options.inject, vm)\n  if (result) {\n    Object.keys(result).forEach(key => {\n      /* istanbul ignore else */\n      if (process.env.NODE_ENV !== 'production') {\n        defineReactive(vm, key, result[key], () => {\n          warn(\n            `Avoid mutating an injected value directly since the changes will be ` +\n              `overwritten whenever the provided component re-renders. ` +\n              `injection being mutated: \"${key}\"`,\n            vm,\n          )\n        })\n      } else {\n        defineReactive(vm, key, result[key])\n      }\n    })\n  }\n}\n\nexport function resolveInject(inject: any, vm: Component): ?Object {\n  if (inject) {\n    // inject is :any because flow is not smart enough to figure out cached\n    // isArray here\n    const isArray = Array.isArray(inject)\n    const result = Object.create(null)\n    const keys = isArray\n      ? inject\n      : hasSymbol\n      ? Reflect.ownKeys(inject)\n      : Object.keys(inject)\n\n    for (let i = 0; i < keys.length; i++) {\n      const key = keys[i]\n      const provideKey = isArray ? key : inject[key]\n      let source = vm\n      while (source) {\n        if (source._provided && provideKey in source._provided) {\n          result[key] = source._provided[provideKey]\n          break\n        }\n        source = source.$parent\n      }\n    }\n    return result\n  }\n}\n"
  },
  {
    "path": "src/core/instance/lifecycle.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport Watcher from '../observer/watcher'\nimport { mark, measure } from '../util/perf'\nimport { createEmptyVNode } from '../vdom/vnode'\nimport { observerState } from '../observer/index'\nimport { updateComponentListeners } from './events'\n\nimport {\n  warn,\n  noop,\n  remove,\n  handleError,\n  emptyObject,\n  validateProp,\n} from '../util/index'\n\nexport let activeInstance: any = null\n\nexport function initLifecycle(vm: Component) {\n  const options = vm.$options\n\n  // locate first non-abstract parent\n  let parent = options.parent\n  if (parent && !options.abstract) {\n    while (parent.$options.abstract && parent.$parent) {\n      parent = parent.$parent\n    }\n    parent.$children.push(vm)\n  }\n\n  vm.$parent = parent\n  vm.$root = parent ? parent.$root : vm\n\n  vm.$children = []\n  vm.$refs = {}\n\n  vm._watcher = null\n  vm._inactive = null\n  vm._directInactive = false\n  vm._isMounted = false\n  vm._isDestroyed = false\n  vm._isBeingDestroyed = false\n}\n\nexport function lifecycleMixin(Vue: Class<Component>) {\n  Vue.prototype._update = function(vnode: VNode, hydrating?: boolean) {\n    const vm: Component = this\n    if (vm._isMounted) {\n      callHook(vm, 'beforeUpdate')\n    }\n    const prevEl = vm.$el\n    const prevVnode = vm._vnode\n    const prevActiveInstance = activeInstance\n    activeInstance = vm\n    vm._vnode = vnode\n    // Vue.prototype.__patch__ is injected in entry points\n    // based on the rendering backend used.\n    if (!prevVnode) {\n      // initial render\n      vm.$el = vm.__patch__(\n        vm.$el,\n        vnode,\n        hydrating,\n        false /* removeOnly */,\n        vm.$options._parentElm,\n        vm.$options._refElm,\n      )\n    } else {\n      // updates\n      vm.$el = vm.__patch__(prevVnode, vnode)\n    }\n    activeInstance = prevActiveInstance\n    // update __vue__ reference\n    if (prevEl) {\n      prevEl.__vue__ = null\n    }\n    if (vm.$el) {\n      vm.$el.__vue__ = vm\n    }\n    // if parent is an HOC, update its $el as well\n    if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {\n      vm.$parent.$el = vm.$el\n    }\n    // updated hook is called by the scheduler to ensure that children are\n    // updated in a parent's updated hook.\n  }\n\n  Vue.prototype.$forceUpdate = function() {\n    const vm: Component = this\n    if (vm._watcher) {\n      vm._watcher.update()\n    }\n  }\n\n  Vue.prototype.$destroy = function() {\n    const vm: Component = this\n    if (vm._isBeingDestroyed) {\n      return\n    }\n    callHook(vm, 'beforeDestroy')\n    vm._isBeingDestroyed = true\n    // remove self from parent\n    const parent = vm.$parent\n    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n      remove(parent.$children, vm)\n    }\n    // teardown watchers\n    if (vm._watcher) {\n      vm._watcher.teardown()\n    }\n    let i = vm._watchers.length\n    while (i--) {\n      vm._watchers[i].teardown()\n    }\n    // remove reference from data ob\n    // frozen object may not have observer.\n    if (vm._data.__ob__) {\n      vm._data.__ob__.vmCount--\n    }\n    // call the last hook...\n    vm._isDestroyed = true\n    // invoke destroy hooks on current rendered tree\n    vm.__patch__(vm._vnode, null)\n    // fire destroyed hook\n    callHook(vm, 'destroyed')\n    // turn off all instance listeners.\n    vm.$off()\n    // remove __vue__ reference\n    if (vm.$el) {\n      vm.$el.__vue__ = null\n    }\n    // remove reference to DOM nodes (prevents leak)\n    vm.$options._parentElm = vm.$options._refElm = null\n  }\n}\n\nexport function mountComponent(\n  vm: Component,\n  el: ?Element,\n  hydrating?: boolean,\n): Component {\n  vm.$el = el\n  if (!vm.$options.render) {\n    vm.$options.render = createEmptyVNode\n    if (process.env.NODE_ENV !== 'production') {\n      /* istanbul ignore if */\n      if (\n        (vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\n        vm.$options.el ||\n        el\n      ) {\n        warn(\n          'You are using the runtime-only build of Vue where the template ' +\n            'compiler is not available. Either pre-compile the templates into ' +\n            'render functions, or use the compiler-included build.',\n          vm,\n        )\n      } else {\n        warn(\n          'Failed to mount component: template or render function not defined.',\n          vm,\n        )\n      }\n    }\n  }\n  callHook(vm, 'beforeMount')\n\n  let updateComponent\n  /* istanbul ignore if */\n  if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n    updateComponent = () => {\n      const name = vm._name\n      const id = vm._uid\n      const startTag = `vue-perf-start:${id}`\n      const endTag = `vue-perf-end:${id}`\n\n      mark(startTag)\n      const vnode = vm._render()\n      mark(endTag)\n      measure(`${name} render`, startTag, endTag)\n\n      mark(startTag)\n      vm._update(vnode, hydrating)\n      mark(endTag)\n      measure(`${name} patch`, startTag, endTag)\n    }\n  } else {\n    updateComponent = () => {\n      vm._update(vm._render(), hydrating)\n    }\n  }\n\n  vm._watcher = new Watcher(vm, updateComponent, noop)\n  hydrating = false\n\n  // manually mounted instance, call mounted on self\n  // mounted is called for render-created child components in its inserted hook\n  if (vm.$vnode == null) {\n    vm._isMounted = true\n    callHook(vm, 'mounted')\n  }\n  return vm\n}\n\nexport function updateChildComponent(\n  vm: Component,\n  propsData: ?Object,\n  listeners: ?Object,\n  parentVnode: VNode,\n  renderChildren: ?Array<VNode>,\n) {\n  // determine whether component has slot children\n  // we need to do this before overwriting $options._renderChildren\n  const hasChildren = !!(\n    (\n      renderChildren || // has new static slots\n      vm.$options._renderChildren || // has old static slots\n      parentVnode.data.scopedSlots || // has new scoped slots\n      vm.$scopedSlots !== emptyObject\n    ) // has old scoped slots\n  )\n\n  vm.$options._parentVnode = parentVnode\n  vm.$vnode = parentVnode // update vm's placeholder node without re-render\n  if (vm._vnode) {\n    // update child tree's parent\n    vm._vnode.parent = parentVnode\n  }\n  vm.$options._renderChildren = renderChildren\n\n  // update props\n  if (propsData && vm.$options.props) {\n    observerState.shouldConvert = false\n    if (process.env.NODE_ENV !== 'production') {\n      observerState.isSettingProps = true\n    }\n    const props = vm._props\n    const propKeys = vm.$options._propKeys || []\n    for (let i = 0; i < propKeys.length; i++) {\n      const key = propKeys[i]\n      props[key] = validateProp(key, vm.$options.props, propsData, vm)\n    }\n    observerState.shouldConvert = true\n    if (process.env.NODE_ENV !== 'production') {\n      observerState.isSettingProps = false\n    }\n    // keep a copy of raw propsData\n    vm.$options.propsData = propsData\n  }\n  // update listeners\n  if (listeners) {\n    const oldListeners = vm.$options._parentListeners\n    vm.$options._parentListeners = listeners\n    updateComponentListeners(vm, listeners, oldListeners)\n  }\n  // resolve slots + force update if has children\n  if (hasChildren) {\n    vm.$forceUpdate()\n  }\n}\n\nfunction isInInactiveTree(vm) {\n  while (vm && (vm = vm.$parent)) {\n    if (vm._inactive) return true\n  }\n  return false\n}\n\nexport function activateChildComponent(vm: Component, direct?: boolean) {\n  if (direct) {\n    vm._directInactive = false\n    if (isInInactiveTree(vm)) {\n      return\n    }\n  } else if (vm._directInactive) {\n    return\n  }\n  if (vm._inactive || vm._inactive === null) {\n    vm._inactive = false\n    for (let i = 0; i < vm.$children.length; i++) {\n      activateChildComponent(vm.$children[i])\n    }\n    callHook(vm, 'activated')\n  }\n}\n\nexport function deactivateChildComponent(vm: Component, direct?: boolean) {\n  if (direct) {\n    vm._directInactive = true\n    if (isInInactiveTree(vm)) {\n      return\n    }\n  }\n  if (!vm._inactive) {\n    vm._inactive = true\n    for (let i = 0; i < vm.$children.length; i++) {\n      deactivateChildComponent(vm.$children[i])\n    }\n    callHook(vm, 'deactivated')\n  }\n}\n\nexport function callHook(vm: Component, hook: string) {\n  const handlers = vm.$options[hook]\n  if (handlers) {\n    for (let i = 0, j = handlers.length; i < j; i++) {\n      try {\n        handlers[i].call(vm)\n      } catch (e) {\n        handleError(e, vm, `${hook} hook`)\n      }\n    }\n  }\n  if (vm._hasHookEvent) {\n    vm.$emit('hook:' + hook)\n  }\n}\n"
  },
  {
    "path": "src/core/instance/proxy.js",
    "content": "/* not type checking this file because flow doesn't play well with Proxy */\n\nimport config from 'core/config'\nimport { warn, makeMap } from '../util/index'\n\nlet initProxy\n\nif (process.env.NODE_ENV !== 'production') {\n  const allowedGlobals = makeMap(\n    'Infinity,undefined,NaN,isFinite,isNaN,' +\n      'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n      'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n      'require, toJSON', // for Webpack/Browserify\n  )\n\n  const warnNonPresent = (target, key) => {\n    warn(\n      `Property or method \"${key}\" is not defined on the instance but ` +\n        `referenced during render. Make sure to declare reactive data ` +\n        `properties in the data option.`,\n      target,\n    )\n  }\n\n  const hasProxy =\n    typeof Proxy !== 'undefined' && Proxy.toString().match(/native code/)\n\n  if (hasProxy) {\n    const isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta')\n    config.keyCodes = new Proxy(config.keyCodes, {\n      set(target, key, value) {\n        if (isBuiltInModifier(key)) {\n          warn(\n            `Avoid overwriting built-in modifier in config.keyCodes: .${key}`,\n          )\n          return false\n        } else {\n          target[key] = value\n          return true\n        }\n      },\n    })\n  }\n\n  const hasHandler = {\n    has(target, key) {\n      const has = key in target\n      const isAllowed = allowedGlobals(key) || key.charAt(0) === '_'\n      if (!has && !isAllowed) {\n        warnNonPresent(target, key)\n      }\n      return has || !isAllowed\n    },\n  }\n\n  const getHandler = {\n    get(target, key) {\n      // react-vue change ```key === 'toJSON'``` prevent warn in react-native\n      if (typeof key === 'string' && !(key in target) && key !== 'toJSON') {\n        warnNonPresent(target, key)\n      }\n      return target[key]\n    },\n  }\n\n  initProxy = function initProxy(vm) {\n    if (hasProxy) {\n      // determine which proxy handler to use\n      const options = vm.$options\n      const handlers =\n        options.render && options.render._withStripped ? getHandler : hasHandler\n      vm._renderProxy = new Proxy(vm, handlers)\n    } else {\n      vm._renderProxy = vm\n    }\n  }\n}\n\nexport { initProxy }\n"
  },
  {
    "path": "src/core/instance/render-helpers/bind-object-props.js",
    "content": "/* @flow */\n\nimport config from 'core/config'\nimport { isObject, warn, toObject } from 'core/util/index'\n\n/**\n * Runtime helper for merging v-bind=\"object\" into a VNode's data.\n */\nexport function bindObjectProps(\n  data: any,\n  tag: string,\n  value: any,\n  asProp?: boolean,\n): VNodeData {\n  if (value) {\n    if (!isObject(value)) {\n      process.env.NODE_ENV !== 'production' &&\n        warn('v-bind without argument expects an Object or Array value', this)\n    } else {\n      if (Array.isArray(value)) {\n        value = toObject(value)\n      }\n      let hash\n      for (const key in value) {\n        if (key === 'class' || key === 'style') {\n          hash = data\n        } else {\n          const type = data.attrs && data.attrs.type\n          hash =\n            asProp || config.mustUseProp(tag, type, key)\n              ? data.domProps || (data.domProps = {})\n              : data.attrs || (data.attrs = {})\n        }\n        if (!(key in hash)) {\n          hash[key] = value[key]\n        }\n      }\n    }\n  }\n  return data\n}\n"
  },
  {
    "path": "src/core/instance/render-helpers/check-keycodes.js",
    "content": "/* @flow */\n\nimport config from 'core/config'\n\n/**\n * Runtime helper for checking keyCodes from config.\n */\nexport function checkKeyCodes(\n  eventKeyCode: number,\n  key: string,\n  builtInAlias: number | Array<number> | void,\n): boolean {\n  const keyCodes = config.keyCodes[key] || builtInAlias\n  if (Array.isArray(keyCodes)) {\n    return keyCodes.indexOf(eventKeyCode) === -1\n  } else {\n    return keyCodes !== eventKeyCode\n  }\n}\n"
  },
  {
    "path": "src/core/instance/render-helpers/render-list.js",
    "content": "/* @flow */\n\nimport { isObject } from 'core/util/index'\n\n/**\n * Runtime helper for rendering v-for lists.\n */\nexport function renderList(val: any, render: () => VNode): ?Array<VNode> {\n  let ret: ?Array<VNode>, i, l, keys, key\n  if (Array.isArray(val) || typeof val === 'string') {\n    ret = new Array(val.length)\n    for (i = 0, l = val.length; i < l; i++) {\n      ret[i] = render(val[i], i)\n    }\n  } else if (typeof val === 'number') {\n    ret = new Array(val)\n    for (i = 0; i < val; i++) {\n      ret[i] = render(i + 1, i)\n    }\n  } else if (isObject(val)) {\n    keys = Object.keys(val)\n    ret = new Array(keys.length)\n    for (i = 0, l = keys.length; i < l; i++) {\n      key = keys[i]\n      ret[i] = render(val[key], key, i)\n    }\n  }\n  return ret\n}\n"
  },
  {
    "path": "src/core/instance/render-helpers/render-slot.js",
    "content": "/* @flow */\n\nimport { extend, warn } from 'core/util/index'\n\n/**\n * Runtime helper for rendering <slot>\n */\nexport function renderSlot(\n  name: string,\n  fallback: ?Array<VNode>,\n  props: ?Object,\n  bindObject: ?Object,\n): ?Array<VNode> {\n  const scopedSlotFn = this.$scopedSlots[name]\n  if (scopedSlotFn) {\n    // scoped slot\n    props = props || {}\n    if (bindObject) {\n      extend(props, bindObject)\n    }\n    return scopedSlotFn(props) || fallback\n  } else {\n    const slotNodes = this.$slots[name]\n    // warn duplicate slot usage\n    if (slotNodes && process.env.NODE_ENV !== 'production') {\n      slotNodes._rendered &&\n        warn(\n          `Duplicate presence of slot \"${name}\" found in the same render tree ` +\n            `- this will likely cause render errors.`,\n          this,\n        )\n      slotNodes._rendered = true\n    }\n    return slotNodes || fallback\n  }\n}\n"
  },
  {
    "path": "src/core/instance/render-helpers/render-static.js",
    "content": "/* @flow */\n\nimport { cloneVNode, cloneVNodes } from 'core/vdom/vnode'\n\n/**\n * Runtime helper for rendering static trees.\n */\nexport function renderStatic(\n  index: number,\n  isInFor?: boolean,\n): VNode | Array<VNode> {\n  let tree = this._staticTrees[index]\n  // if has already-rendered static tree and not inside v-for,\n  // we can reuse the same tree by doing a shallow clone.\n  if (tree && !isInFor) {\n    return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree)\n  }\n  // otherwise, render a fresh tree.\n  tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(\n    this._renderProxy,\n  )\n  markStatic(tree, `__static__${index}`, false)\n  return tree\n}\n\n/**\n * Runtime helper for v-once.\n * Effectively it means marking the node as static with a unique key.\n */\nexport function markOnce(\n  tree: VNode | Array<VNode>,\n  index: number,\n  key: string,\n) {\n  markStatic(tree, `__once__${index}${key ? `_${key}` : ``}`, true)\n  return tree\n}\n\nfunction markStatic(tree: VNode | Array<VNode>, key: string, isOnce: boolean) {\n  if (Array.isArray(tree)) {\n    for (let i = 0; i < tree.length; i++) {\n      if (tree[i] && typeof tree[i] !== 'string') {\n        markStaticNode(tree[i], `${key}_${i}`, isOnce)\n      }\n    }\n  } else {\n    markStaticNode(tree, key, isOnce)\n  }\n}\n\nfunction markStaticNode(node, key, isOnce) {\n  node.isStatic = true\n  node.key = key\n  node.isOnce = isOnce\n}\n"
  },
  {
    "path": "src/core/instance/render-helpers/resolve-filter.js",
    "content": "/* @flow */\n\nimport { identity, resolveAsset } from 'core/util/index'\n\n/**\n * Runtime helper for resolving filters\n */\nexport function resolveFilter(id: string): Function {\n  return resolveAsset(this.$options, 'filters', id, true) || identity\n}\n"
  },
  {
    "path": "src/core/instance/render-helpers/resolve-slots.js",
    "content": "/* @flow */\n\n/**\n * Runtime helper for resolving raw children VNodes into a slot object.\n */\nexport function resolveSlots(\n  children: ?Array<VNode>,\n  context: ?Component,\n): { [key: string]: Array<VNode> } {\n  const slots = {}\n  if (!children) {\n    return slots\n  }\n  const defaultSlot = []\n  let name, child\n  for (let i = 0, l = children.length; i < l; i++) {\n    child = children[i]\n    // named slots should only be respected if the vnode was rendered in the\n    // same context.\n    if (\n      (child.context === context || child.functionalContext === context) &&\n      child.data &&\n      (name = child.data.slot)\n    ) {\n      const slot = slots[name] || (slots[name] = [])\n      if (child.tag === 'template') {\n        slot.push.apply(slot, child.children)\n      } else {\n        slot.push(child)\n      }\n    } else {\n      defaultSlot.push(child)\n    }\n  }\n  // ignore whitespace\n  if (!defaultSlot.every(isWhitespace)) {\n    slots.default = defaultSlot\n  }\n  return slots\n}\n\nfunction isWhitespace(node: VNode): boolean {\n  return node.isComment || node.text === ' '\n}\n\nexport function resolveScopedSlots(\n  fns: Array<[string, Function]>,\n): { [key: string]: Function } {\n  const res = {}\n  for (let i = 0; i < fns.length; i++) {\n    res[fns[i][0]] = fns[i][1]\n  }\n  return res\n}\n"
  },
  {
    "path": "src/core/instance/render.js",
    "content": "/* @flow */\n\nimport {\n  warn,\n  nextTick,\n  toNumber,\n  _toString,\n  looseEqual,\n  emptyObject,\n  handleError,\n  looseIndexOf,\n} from '../util/index'\n\nimport VNode, {\n  cloneVNodes,\n  createTextVNode,\n  createEmptyVNode,\n} from '../vdom/vnode'\n\nimport { createElement } from '../vdom/create-element'\nimport { renderList } from './render-helpers/render-list'\nimport { renderSlot } from './render-helpers/render-slot'\nimport { resolveFilter } from './render-helpers/resolve-filter'\nimport { checkKeyCodes } from './render-helpers/check-keycodes'\nimport { bindObjectProps } from './render-helpers/bind-object-props'\nimport { renderStatic, markOnce } from './render-helpers/render-static'\nimport {\n  // resolveSlots,\n  resolveScopedSlots,\n} from './render-helpers/resolve-slots'\n\nexport function initRender(vm: Component) {\n  vm._vnode = null // the root of the child tree\n  vm._staticTrees = null\n  // const parentVnode = vm.$vnode = vm.$options._parentVnode // the placeholder node in parent tree\n  // const renderContext = parentVnode && parentVnode.context\n  /**\n   * react-vue change\n   */\n  // vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext)\n  vm.$scopedSlots = emptyObject\n  // bind the createElement fn to this instance\n  // so that we get proper render context inside it.\n  // args order: tag, data, children, normalizationType, alwaysNormalize\n  // internal version is used by render functions compiled from templates\n  vm._c = (a, b, c, d) => createElement(vm, a, b, c, d, false)\n  // normalization is always applied for the public version, used in\n  // user-written render functions.\n  vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)\n}\n\nexport function renderMixin(Vue: Class<Component>) {\n  Vue.prototype.$nextTick = function(fn: Function) {\n    return nextTick(fn, this)\n  }\n\n  Vue.prototype._render = function(): VNode {\n    const vm: Component = this\n    const { render, staticRenderFns, _parentVnode } = vm.$options\n\n    if (vm._isMounted) {\n      // clone slot nodes on re-renders\n      for (const key in vm.$slots) {\n        vm.$slots[key] = cloneVNodes(vm.$slots[key])\n      }\n    }\n\n    vm.$scopedSlots =\n      (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject\n\n    if (staticRenderFns && !vm._staticTrees) {\n      vm._staticTrees = []\n    }\n    // set parent vnode. this allows render functions to have access\n    // to the data on the placeholder node.\n    vm.$vnode = _parentVnode\n    // render self\n    let vnode\n    try {\n      vnode = render.call(vm._renderProxy, vm.$createElement)\n    } catch (e) {\n      handleError(e, vm, `render function`)\n      // return error render result,\n      // or previous vnode to prevent render error causing blank component\n      /* istanbul ignore else */\n      if (process.env.NODE_ENV !== 'production') {\n        vnode = vm.$options.renderError\n          ? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)\n          : vm._vnode\n      } else {\n        vnode = vm._vnode\n      }\n    }\n    // return empty vnode in case the render function errored out\n    if (!(vnode instanceof VNode)) {\n      if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {\n        warn(\n          'Multiple root nodes returned from render function. Render function ' +\n            'should return a single root node.',\n          vm,\n        )\n      }\n      vnode = createEmptyVNode()\n    }\n    // set parent\n    vnode.parent = _parentVnode\n    return vnode\n  }\n\n  // internal render helpers.\n  // these are exposed on the instance prototype to reduce generated render\n  // code size.\n  Vue.prototype._o = markOnce\n  Vue.prototype._n = toNumber\n  Vue.prototype._s = _toString\n  Vue.prototype._l = renderList\n  Vue.prototype._t = renderSlot\n  Vue.prototype._q = looseEqual\n  Vue.prototype._i = looseIndexOf\n  Vue.prototype._m = renderStatic\n  Vue.prototype._f = resolveFilter\n  Vue.prototype._k = checkKeyCodes\n  Vue.prototype._b = bindObjectProps\n  Vue.prototype._v = createTextVNode\n  Vue.prototype._e = createEmptyVNode\n  Vue.prototype._u = resolveScopedSlots\n}\n"
  },
  {
    "path": "src/core/instance/state.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport Dep from '../observer/dep'\nimport Watcher from '../observer/watcher'\n\nimport {\n  set,\n  del,\n  observe,\n  observerState,\n  defineReactive,\n} from '../observer/index'\n\nimport {\n  warn,\n  bind,\n  noop,\n  hasOwn,\n  isReserved,\n  handleError,\n  validateProp,\n  isPlainObject,\n} from '../util/index'\n\nconst sharedPropertyDefinition = {\n  enumerable: true,\n  configurable: true,\n  get: noop,\n  set: noop,\n}\n\nexport function proxy(target: Object, sourceKey: string, key: string) {\n  sharedPropertyDefinition.get = function proxyGetter() {\n    return this[sourceKey][key]\n  }\n  sharedPropertyDefinition.set = function proxySetter(val) {\n    this[sourceKey][key] = val\n  }\n  Object.defineProperty(target, key, sharedPropertyDefinition)\n}\n\nexport function initState(vm: Component) {\n  vm._watchers = []\n  const opts = vm.$options\n  if (opts.props) initProps(vm, opts.props)\n  if (opts.methods) initMethods(vm, opts.methods)\n  if (opts.data) {\n    initData(vm)\n  } else {\n    observe((vm._data = {}), true /* asRootData */)\n  }\n  if (opts.computed) initComputed(vm, opts.computed)\n  if (opts.watch) initWatch(vm, opts.watch)\n}\n\nconst isReservedProp = {\n  key: 1,\n  ref: 1,\n  slot: 1,\n}\n\nfunction initProps(vm: Component, propsOptions: Object) {\n  const propsData = vm.$options.propsData || {}\n  const props = (vm._props = {})\n  // cache prop keys so that future props updates can iterate using Array\n  // instead of dynamic object key enumeration.\n  const keys = (vm.$options._propKeys = [])\n  const isRoot = !vm.$parent\n  // root instance props should be converted\n  observerState.shouldConvert = isRoot\n  for (const key in propsOptions) {\n    keys.push(key)\n    const value = validateProp(key, propsOptions, propsData, vm)\n    /* istanbul ignore else */\n    if (process.env.NODE_ENV !== 'production') {\n      if (isReservedProp[key] || config.isReservedAttr(key)) {\n        warn(\n          `\"${key}\" is a reserved attribute and cannot be used as component prop.`,\n          vm,\n        )\n      }\n      /**\n       * react-vue change\n       */\n      defineReactive(props, key, value, () => {\n        // if (vm.$parent && !observerState.isSettingProps) {\n        //   warn(\n        //     `Avoid mutating a prop directly since the value will be ` +\n        //     `overwritten whenever the parent component re-renders. ` +\n        //     `Instead, use a data or computed property based on the prop's ` +\n        //     `value. Prop being mutated: \"${key}\"`,\n        //     vm\n        //   )\n        // }\n      })\n    } else {\n      defineReactive(props, key, value)\n    }\n    // static props are already proxied on the component's prototype\n    // during Vue.extend(). We only need to proxy props defined at\n    // instantiation here.\n    if (!(key in vm)) {\n      proxy(vm, `_props`, key)\n    }\n  }\n  observerState.shouldConvert = true\n}\n\nfunction initData(vm: Component) {\n  let data = vm.$options.data\n  data = vm._data = typeof data === 'function' ? getData(data, vm) : data || {}\n  if (!isPlainObject(data)) {\n    data = {}\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        'data functions should return an object:\\n' +\n          'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',\n        vm,\n      )\n  }\n  // proxy data on instance\n  const keys = Object.keys(data)\n  const props = vm.$options.props\n  let i = keys.length\n  while (i--) {\n    if (props && hasOwn(props, keys[i])) {\n      process.env.NODE_ENV !== 'production' &&\n        warn(\n          `The data property \"${keys[i]}\" is already declared as a prop. ` +\n            `Use prop default value instead.`,\n          vm,\n        )\n    } else if (!isReserved(keys[i])) {\n      proxy(vm, `_data`, keys[i])\n    }\n  }\n  // observe data\n  observe(data, true /* asRootData */)\n}\n\nfunction getData(data: Function, vm: Component): any {\n  try {\n    return data.call(vm)\n  } catch (e) {\n    handleError(e, vm, `data()`)\n    return {}\n  }\n}\n\nconst computedWatcherOptions = { lazy: true }\n\nfunction initComputed(vm: Component, computed: Object) {\n  const watchers = (vm._computedWatchers = Object.create(null))\n\n  for (const key in computed) {\n    const userDef = computed[key]\n    let getter = typeof userDef === 'function' ? userDef : userDef.get\n    if (process.env.NODE_ENV !== 'production') {\n      if (getter === undefined) {\n        warn(\n          `No getter function has been defined for computed property \"${key}\".`,\n          vm,\n        )\n        getter = noop\n      }\n    }\n    // create internal watcher for the computed property.\n    watchers[key] = new Watcher(vm, getter, noop, computedWatcherOptions)\n\n    // component-defined computed properties are already defined on the\n    // component prototype. We only need to define computed properties defined\n    // at instantiation here.\n    if (!(key in vm)) {\n      defineComputed(vm, key, userDef)\n    } else if (process.env.NODE_ENV !== 'production') {\n      if (key in vm.$data) {\n        warn(`The computed property \"${key}\" is already defined in data.`, vm)\n      } else if (vm.$options.props && key in vm.$options.props) {\n        warn(`The computed property \"${key}\" is already defined as a prop.`, vm)\n      }\n    }\n  }\n}\n\nexport function defineComputed(\n  target: any,\n  key: string,\n  userDef: Object | Function,\n) {\n  if (typeof userDef === 'function') {\n    sharedPropertyDefinition.get = createComputedGetter(key)\n    sharedPropertyDefinition.set = noop\n  } else {\n    sharedPropertyDefinition.get = userDef.get\n      ? userDef.cache !== false\n        ? createComputedGetter(key)\n        : userDef.get\n      : noop\n    sharedPropertyDefinition.set = userDef.set ? userDef.set : noop\n  }\n  Object.defineProperty(target, key, sharedPropertyDefinition)\n}\n\nfunction createComputedGetter(key) {\n  return function computedGetter() {\n    const watcher = this._computedWatchers && this._computedWatchers[key]\n    if (watcher) {\n      if (watcher.dirty) {\n        watcher.evaluate()\n      }\n      if (Dep.target) {\n        watcher.depend()\n      }\n      return watcher.value\n    }\n  }\n}\n\nfunction initMethods(vm: Component, methods: Object) {\n  const props = vm.$options.props\n  for (const key in methods) {\n    vm[key] = methods[key] == null ? noop : bind(methods[key], vm)\n    if (process.env.NODE_ENV !== 'production') {\n      if (methods[key] == null) {\n        warn(\n          `method \"${key}\" has an undefined value in the component definition. ` +\n            `Did you reference the function correctly?`,\n          vm,\n        )\n      }\n      if (props && hasOwn(props, key)) {\n        warn(`method \"${key}\" has already been defined as a prop.`, vm)\n      }\n    }\n  }\n}\n\nfunction initWatch(vm: Component, watch: Object) {\n  for (const key in watch) {\n    const handler = watch[key]\n    if (Array.isArray(handler)) {\n      for (let i = 0; i < handler.length; i++) {\n        createWatcher(vm, key, handler[i])\n      }\n    } else {\n      createWatcher(vm, key, handler)\n    }\n  }\n}\n\nfunction createWatcher(vm: Component, key: string, handler: any) {\n  let options\n  if (isPlainObject(handler)) {\n    options = handler\n    handler = handler.handler\n  }\n  if (typeof handler === 'string') {\n    handler = vm[handler]\n  }\n  vm.$watch(key, handler, options)\n}\n\nexport function stateMixin(Vue: Class<Component>) {\n  // flow somehow has problems with directly declared definition object\n  // when using Object.defineProperty, so we have to procedurally build up\n  // the object here.\n  const dataDef = {}\n  dataDef.get = function() {\n    return this._data\n  }\n  const propsDef = {}\n  propsDef.get = function() {\n    return this._props\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    // eslint-disable-next-line no-unused-vars\n    dataDef.set = function(newData: Object) {\n      warn(\n        'Avoid replacing instance root $data. ' +\n          'Use nested data properties instead.',\n        this,\n      )\n    }\n    propsDef.set = function() {\n      warn(`$props is readonly.`, this)\n    }\n  }\n  Object.defineProperty(Vue.prototype, '$data', dataDef)\n  Object.defineProperty(Vue.prototype, '$props', propsDef)\n\n  Vue.prototype.$set = set\n  Vue.prototype.$delete = del\n\n  Vue.prototype.$watch = function(\n    expOrFn: string | Function,\n    cb: Function,\n    options?: Object,\n  ): Function {\n    const vm: Component = this\n    options = options || {}\n    options.user = true\n    const watcher = new Watcher(vm, expOrFn, cb, options)\n    if (options.immediate) {\n      cb.call(vm, watcher.value)\n    }\n    return function unwatchFn() {\n      watcher.teardown()\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/observer/array.js",
    "content": "/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nimport { def } from '../util/index'\n\nconst arrayProto = Array.prototype\nexport const arrayMethods = Object.create(arrayProto)\n\n/**\n * Intercept mutating methods and emit events\n */\n;['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'].forEach(\n  function(method) {\n    // cache original method\n    const original = arrayProto[method]\n    def(arrayMethods, method, function mutator() {\n      // avoid leaking arguments:\n      // http://jsperf.com/closure-with-arguments\n      let i = arguments.length\n      const args = new Array(i)\n      while (i--) {\n        args[i] = arguments[i]\n      }\n      const result = original.apply(this, args)\n      const ob = this.__ob__\n      let 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"
  },
  {
    "path": "src/core/observer/dep.js",
    "content": "/* @flow */\n\nimport type Watcher from './watcher'\nimport { remove } from '../util/index'\n\nlet uid = 0\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nexport default class Dep {\n  static target: ?Watcher\n  id: number\n  subs: Array<Watcher>\n\n  constructor() {\n    this.id = uid++\n    this.subs = []\n  }\n\n  addSub(sub: Watcher) {\n    this.subs.push(sub)\n  }\n\n  removeSub(sub: Watcher) {\n    remove(this.subs, sub)\n  }\n\n  depend() {\n    if (Dep.target) {\n      Dep.target.addDep(this)\n    }\n  }\n\n  notify() {\n    // stabilize the subscriber list first\n    const subs = this.subs.slice()\n    for (let i = 0, l = subs.length; i < l; i++) {\n      subs[i].update()\n    }\n  }\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\nconst targetStack = []\n\nexport function pushTarget(_target: Watcher) {\n  if (Dep.target) targetStack.push(Dep.target)\n  Dep.target = _target\n}\n\nexport function popTarget() {\n  Dep.target = targetStack.pop()\n}\n"
  },
  {
    "path": "src/core/observer/index.js",
    "content": "/* @flow */\n\nimport Dep from './dep'\nimport { arrayMethods } from './array'\nimport {\n  def,\n  isObject,\n  isPlainObject,\n  hasProto,\n  hasOwn,\n  warn,\n  isServerRendering,\n} from '../util/index'\n\nconst 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 when passing down props,\n * we don't want to force conversion because the value may be a nested value\n * under a frozen data structure. Converting it would defeat the optimization.\n */\nexport const observerState = {\n  shouldConvert: true,\n  isSettingProps: false,\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 */\nexport class Observer {\n  value: any\n  dep: Dep\n  vmCount: number // number of vms that has this object as root $data\n\n  constructor(value: any) {\n    this.value = value\n    this.dep = new Dep()\n    this.vmCount = 0\n    def(value, '__ob__', this)\n    if (Array.isArray(value)) {\n      const augment = hasProto ? protoAugment : copyAugment\n      augment(value, arrayMethods, arrayKeys)\n      this.observeArray(value)\n    } else {\n      this.walk(value)\n    }\n  }\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  walk(obj: Object) {\n    const keys = Object.keys(obj)\n    for (let i = 0; i < keys.length; i++) {\n      defineReactive(obj, keys[i], obj[keys[i]])\n    }\n  }\n\n  /**\n   * Observe a list of Array items.\n   */\n  observeArray(items: Array<any>) {\n    for (let i = 0, l = items.length; i < l; i++) {\n      observe(items[i])\n    }\n  }\n}\n\n// helpers\n\n/**\n * Augment an target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment(target, src: Object) {\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/* istanbul ignore next */\nfunction copyAugment(target: Object, src: Object, keys: Array<string>) {\n  for (let i = 0, l = keys.length; i < l; i++) {\n    const 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 */\nexport function observe(value: any, asRootData: ?boolean): Observer | void {\n  if (!isObject(value)) {\n    return\n  }\n  let ob: Observer | void\n  if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n    ob = value.__ob__\n  } else if (\n    observerState.shouldConvert &&\n    !isServerRendering() &&\n    (Array.isArray(value) || isPlainObject(value)) &&\n    Object.isExtensible(value) &&\n    !value._isVue\n  ) {\n    ob = new Observer(value)\n  }\n  if (asRootData && ob) {\n    ob.vmCount++\n  }\n  return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nexport function defineReactive(\n  obj: Object,\n  key: string,\n  val: any,\n  customSetter?: Function,\n) {\n  const dep = new Dep()\n\n  const property = Object.getOwnPropertyDescriptor(obj, key)\n  if (property && property.configurable === false) {\n    return\n  }\n\n  // cater for pre-defined getter/setters\n  const getter = property && property.get\n  const setter = property && property.set\n\n  let childOb = observe(val)\n  Object.defineProperty(obj, key, {\n    enumerable: true,\n    configurable: true,\n    get: function reactiveGetter() {\n      const value = getter ? getter.call(obj) : val\n      if (Dep.target) {\n        dep.depend()\n        if (childOb) {\n          childOb.dep.depend()\n        }\n        if (Array.isArray(value)) {\n          dependArray(value)\n        }\n      }\n      return value\n    },\n    set: function reactiveSetter(newVal) {\n      const value = getter ? getter.call(obj) : val\n      /* eslint-disable no-self-compare */\n      if (newVal === value || (newVal !== newVal && value !== value)) {\n        return\n      }\n      /* eslint-enable no-self-compare */\n      if (process.env.NODE_ENV !== 'production' && customSetter) {\n        customSetter()\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 * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nexport function set(target: Array<any> | Object, key: any, val: any): any {\n  if (Array.isArray(target) && typeof key === 'number') {\n    target.length = Math.max(target.length, key)\n    target.splice(key, 1, val)\n    return val\n  }\n  if (hasOwn(target, key)) {\n    target[key] = val\n    return val\n  }\n  const ob = (target: any).__ob__\n  if (target._isVue || (ob && ob.vmCount)) {\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        'Avoid adding reactive properties to a Vue instance or its root $data ' +\n          'at runtime - declare it upfront in the data option.',\n      )\n    return val\n  }\n  if (!ob) {\n    target[key] = val\n    return val\n  }\n  defineReactive(ob.value, key, val)\n  ob.dep.notify()\n  return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nexport function del(target: Array<any> | Object, key: any) {\n  if (Array.isArray(target) && typeof key === 'number') {\n    target.splice(key, 1)\n    return\n  }\n  const ob = (target: any).__ob__\n  if (target._isVue || (ob && ob.vmCount)) {\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        'Avoid deleting properties on a Vue instance or its root $data ' +\n          '- just set it to null.',\n      )\n    return\n  }\n  if (!hasOwn(target, key)) {\n    return\n  }\n  delete target[key]\n  if (!ob) {\n    return\n  }\n  ob.dep.notify()\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray(value: Array<any>) {\n  for (let e, i = 0, l = value.length; i < l; i++) {\n    e = value[i]\n    e && e.__ob__ && e.__ob__.dep.depend()\n    if (Array.isArray(e)) {\n      dependArray(e)\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/observer/scheduler.js",
    "content": "/* @flow */\n\nimport type Watcher from './watcher'\nimport config from '../config'\nimport { callHook, activateChildComponent } from '../instance/lifecycle'\n\nimport { warn, nextTick, devtools } from '../util/index'\n\nexport const MAX_UPDATE_COUNT = 100\n\nconst queue: Array<Watcher> = []\nconst activatedChildren: Array<Component> = []\nlet has: { [key: number]: ?true } = {}\nlet circular: { [key: number]: number } = {}\nlet waiting = false\nlet flushing = false\nlet index = 0\n\n/**\n * Reset the scheduler's state.\n */\nfunction resetSchedulerState() {\n  queue.length = activatedChildren.length = 0\n  has = {}\n  if (process.env.NODE_ENV !== 'production') {\n    circular = {}\n  }\n  waiting = flushing = false\n}\n\n/**\n * Flush both queues and run the watchers.\n */\nfunction flushSchedulerQueue() {\n  flushing = true\n  let watcher, id\n\n  // Sort queue before flush.\n  // This ensures that:\n  // 1. Components are updated from parent to child. (because parent is always\n  //    created before the child)\n  // 2. A component's user watchers are run before its render watcher (because\n  //    user watchers are created before the render watcher)\n  // 3. If a component is destroyed during a parent component's watcher run,\n  //    its watchers can be skipped.\n  queue.sort((a, b) => a.id - b.id)\n\n  // do not cache length because more watchers might be pushed\n  // as we run existing watchers\n  for (index = 0; index < queue.length; index++) {\n    watcher = queue[index]\n    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] > MAX_UPDATE_COUNT) {\n        warn(\n          'You may have an infinite update loop ' +\n            (watcher.user\n              ? `in watcher with expression \"${watcher.expression}\"`\n              : `in a component render function.`),\n          watcher.vm,\n        )\n        break\n      }\n    }\n  }\n\n  // keep copies of post queues before resetting state\n  const activatedQueue = activatedChildren.slice()\n  const updatedQueue = queue.slice()\n\n  resetSchedulerState()\n\n  // call component updated and activated hooks\n  callActivatedHooks(activatedQueue)\n  callUpdateHooks(updatedQueue)\n\n  // devtool hook\n  /* istanbul ignore if */\n  if (devtools && config.devtools) {\n    devtools.emit('flush')\n  }\n}\n\nfunction callUpdateHooks(queue) {\n  let i = queue.length\n  while (i--) {\n    const watcher = queue[i]\n    const vm = watcher.vm\n    if (vm._watcher === watcher && vm._isMounted) {\n      callHook(vm, 'updated')\n    }\n  }\n}\n\n/**\n * Queue a kept-alive component that was activated during patch.\n * The queue will be processed after the entire tree has been patched.\n */\nexport function queueActivatedComponent(vm: Component) {\n  // setting _inactive to false here so that a render function can\n  // rely on checking whether it's in an inactive tree (e.g. router-view)\n  vm._inactive = false\n  activatedChildren.push(vm)\n}\n\nfunction callActivatedHooks(queue) {\n  for (let i = 0; i < queue.length; i++) {\n    queue[i]._inactive = true\n    activateChildComponent(queue[i], true /* true */)\n  }\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 */\nexport function queueWatcher(watcher: Watcher) {\n  const id = watcher.id\n  if (has[id] == null) {\n    has[id] = true\n    if (!flushing) {\n      queue.push(watcher)\n    } else {\n      // if already flushing, splice the watcher based on its id\n      // if already past its id, it will be run next immediately.\n      let i = queue.length - 1\n      while (i >= 0 && queue[i].id > watcher.id) {\n        i--\n      }\n      queue.splice(Math.max(i, index) + 1, 0, watcher)\n    }\n    // queue the flush\n    if (!waiting) {\n      waiting = true\n      nextTick(flushSchedulerQueue)\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/observer/watcher.js",
    "content": "/* @flow */\n\nimport { queueWatcher } from './scheduler'\nimport Dep, { pushTarget, popTarget } from './dep'\n\nimport {\n  warn,\n  remove,\n  isObject,\n  parsePath,\n  _Set as Set,\n  handleError,\n} from '../util/index'\n\nlet uid = 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 */\nexport default class Watcher {\n  vm: Component\n  expression: string\n  cb: Function\n  id: number\n  deep: boolean\n  user: boolean\n  lazy: boolean\n  sync: boolean\n  dirty: boolean\n  active: boolean\n  deps: Array<Dep>\n  newDeps: Array<Dep>\n  depIds: Set\n  newDepIds: Set\n  getter: Function\n  value: any\n\n  constructor(\n    vm: Component,\n    expOrFn: string | Function,\n    cb: Function,\n    options?: Object,\n  ) {\n    this.vm = vm\n    vm._watchers.push(this)\n    // options\n    if (options) {\n      this.deep = !!options.deep\n      this.user = !!options.user\n      this.lazy = !!options.lazy\n      this.sync = !!options.sync\n    } else {\n      this.deep = this.user = this.lazy = this.sync = false\n    }\n    this.cb = cb\n    this.id = ++uid // 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.expression =\n      process.env.NODE_ENV !== 'production' ? expOrFn.toString() : ''\n    // parse expression for getter\n    if (typeof expOrFn === 'function') {\n      this.getter = expOrFn\n    } else {\n      this.getter = parsePath(expOrFn)\n      if (!this.getter) {\n        this.getter = function() {}\n        process.env.NODE_ENV !== 'production' &&\n          warn(\n            `Failed watching path: \"${expOrFn}\" ` +\n              'Watcher only accepts simple dot-delimited paths. ' +\n              'For full control, use a function instead.',\n            vm,\n          )\n      }\n    }\n    this.value = this.lazy ? undefined : this.get()\n  }\n\n  /**\n   * Evaluate the getter, and re-collect dependencies.\n   */\n  get() {\n    pushTarget(this)\n    let value\n    const vm = this.vm\n    if (this.user) {\n      try {\n        value = this.getter.call(vm, vm)\n      } catch (e) {\n        handleError(e, vm, `getter for watcher \"${this.expression}\"`)\n      }\n    } else {\n      value = this.getter.call(vm, vm)\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    popTarget()\n    this.cleanupDeps()\n    return value\n  }\n\n  /**\n   * Add a dependency to this directive.\n   */\n  addDep(dep: Dep) {\n    const 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  cleanupDeps() {\n    let i = this.deps.length\n    while (i--) {\n      const dep = this.deps[i]\n      if (!this.newDepIds.has(dep.id)) {\n        dep.removeSub(this)\n      }\n    }\n    let 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  update() {\n    /* istanbul ignore else */\n    if (this.lazy) {\n      this.dirty = true\n    } else if (this.sync) {\n      this.run()\n    } else {\n      queueWatcher(this)\n    }\n  }\n\n  /**\n   * Scheduler job interface.\n   * Will be called by the scheduler.\n   */\n  run() {\n    if (this.active) {\n      const value = this.get()\n      if (\n        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.\n        isObject(value) ||\n        this.deep\n      ) {\n        // set new value\n        const oldValue = this.value\n        this.value = value\n        if (this.user) {\n          try {\n            this.cb.call(this.vm, value, oldValue)\n          } catch (e) {\n            handleError(e, this.vm, `callback for watcher \"${this.expression}\"`)\n          }\n        } else {\n          this.cb.call(this.vm, value, oldValue)\n        }\n      }\n    }\n  }\n\n  /**\n   * Evaluate the value of the watcher.\n   * This only gets called for lazy watchers.\n   */\n  evaluate() {\n    this.value = this.get()\n    this.dirty = false\n  }\n\n  /**\n   * Depend on all deps collected by this watcher.\n   */\n  depend() {\n    let i = this.deps.length\n    while (i--) {\n      this.deps[i].depend()\n    }\n  }\n\n  /**\n   * Remove self from all dependencies' subscriber list.\n   */\n  teardown() {\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.\n      if (!this.vm._isBeingDestroyed) {\n        remove(this.vm._watchers, this)\n      }\n      let i = this.deps.length\n      while (i--) {\n        this.deps[i].removeSub(this)\n      }\n      this.active = false\n    }\n  }\n}\n\n/**\n * Recursively 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 */\nconst seenObjects = new Set()\nfunction traverse(val: any) {\n  seenObjects.clear()\n  _traverse(val, seenObjects)\n}\n\nfunction _traverse(val: any, seen: Set) {\n  let i, keys\n  const isA = Array.isArray(val)\n  if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {\n    return\n  }\n  if (val.__ob__) {\n    const depId = val.__ob__.dep.id\n    if (seen.has(depId)) {\n      return\n    }\n    seen.add(depId)\n  }\n  if (isA) {\n    i = val.length\n    while (i--) _traverse(val[i], seen)\n  } else {\n    keys = Object.keys(val)\n    i = keys.length\n    while (i--) _traverse(val[keys[i]], seen)\n  }\n}\n"
  },
  {
    "path": "src/core/util/debug.js",
    "content": "import config from '../config'\nimport { noop } from 'shared/util'\n\nexport let warn = noop\nexport let tip = noop\nexport let formatComponentName\n\nif (process.env.NODE_ENV !== 'production') {\n  const hasConsole = typeof console !== 'undefined'\n  const classifyRE = /(?:^|[-_])(\\w)/g\n  const classify = str =>\n    str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '')\n\n  warn = (msg, vm) => {\n    if (hasConsole && !config.silent) {\n      console.error(\n        `[Vue warn]: ${msg}` + (vm ? generateComponentTrace(vm) : ''),\n      )\n    }\n  }\n\n  tip = (msg, vm) => {\n    if (hasConsole && !config.silent) {\n      console.warn(`[Vue tip]: ${msg}` + (vm ? generateComponentTrace(vm) : ''))\n    }\n  }\n\n  formatComponentName = (vm, includeFile) => {\n    if (vm.$root === vm) {\n      return '<Root>'\n    }\n    let name =\n      typeof vm === 'string'\n        ? vm\n        : typeof vm === 'function' && vm.options\n        ? vm.options.name\n        : vm._isVue\n        ? vm.$options.name || vm.$options._componentTag\n        : vm.name\n\n    const file = vm._isVue && vm.$options.__file\n    if (!name && file) {\n      const match = file.match(/([^/\\\\]+)\\.vue$/)\n      name = match && match[1]\n    }\n\n    return (\n      (name ? `<${classify(name)}>` : `<Anonymous>`) +\n      (file && includeFile !== false ? ` at ${file}` : '')\n    )\n  }\n\n  const repeat = (str, n) => {\n    let res = ''\n    while (n) {\n      if (n % 2 === 1) res += str\n      if (n > 1) str += str\n      n >>= 1\n    }\n    return res\n  }\n\n  const generateComponentTrace = vm => {\n    if (vm._isVue && vm.$parent) {\n      const tree = []\n      let currentRecursiveSequence = 0\n      while (vm) {\n        if (tree.length > 0) {\n          const last = tree[tree.length - 1]\n          if (last.constructor === vm.constructor) {\n            currentRecursiveSequence++\n            vm = vm.$parent\n            continue\n          } else if (currentRecursiveSequence > 0) {\n            tree[tree.length - 1] = [last, currentRecursiveSequence]\n            currentRecursiveSequence = 0\n          }\n        }\n        tree.push(vm)\n        vm = vm.$parent\n      }\n      return (\n        '\\n\\nfound in\\n\\n' +\n        tree\n          .map(\n            (vm, i) =>\n              `${i === 0 ? '---> ' : repeat(' ', 5 + i * 2)}${\n                Array.isArray(vm)\n                  ? `${formatComponentName(vm[0])}... (${\n                      vm[1]\n                    } recursive calls)`\n                  : formatComponentName(vm)\n              }`,\n          )\n          .join('\\n')\n      )\n    } else {\n      return `\\n\\n(found in ${formatComponentName(vm)})`\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/util/env.js",
    "content": "/* @flow */\n\nimport { noop } from 'shared/util'\nimport { handleError } from './error'\n\n// can we use __proto__?\nexport const hasProto = '__proto__' in {}\n\n// Browser environment sniffing\nexport const inBrowser = typeof window !== 'undefined'\nexport const UA =\n  inBrowser &&\n  window.navigator &&\n  window.navigator.userAgent &&\n  window.navigator.userAgent.toLowerCase()\nexport const isIE = UA && /msie|trident/.test(UA)\nexport const isIE9 = UA && UA.indexOf('msie 9.0') > 0\nexport const isEdge = UA && UA.indexOf('edge/') > 0\nexport const isAndroid = UA && UA.indexOf('android') > 0\nexport const isIOS = UA && /iphone|ipad|ipod|ios/.test(UA)\nexport const isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge\n\nexport let supportsPassive = false\nif (inBrowser) {\n  try {\n    const opts = {}\n    Object.defineProperty(\n      opts,\n      'passive',\n      ({\n        get() {\n          /* istanbul ignore next */\n          supportsPassive = true\n        },\n      }: Object),\n    ) // https://github.com/facebook/flow/issues/285\n    window.addEventListener('test-passive', null, opts)\n  } catch (e) {}\n}\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nlet _isServer\nexport const isServerRendering = () => {\n  if (_isServer === undefined) {\n    /* istanbul ignore if */\n    if (!inBrowser && typeof global !== 'undefined') {\n      // detect presence of vue-server-renderer and avoid\n      // Webpack shimming the process\n      _isServer = global['process'].env.VUE_ENV === 'server'\n    } else {\n      _isServer = false\n    }\n  }\n  return _isServer\n}\n\n// detect devtools\nexport const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__\n\n/* istanbul ignore next */\nexport function isNative(Ctor: any): boolean {\n  return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n}\n\nexport const hasSymbol =\n  typeof Symbol !== 'undefined' &&\n  isNative(Symbol) &&\n  typeof Reflect !== 'undefined' &&\n  isNative(Reflect.ownKeys)\n\n/**\n * Defer a task to execute it asynchronously.\n */\nexport const nextTick = (function() {\n  const callbacks = []\n  let pending = false\n  let timerFunc\n\n  function nextTickHandler() {\n    pending = false\n    const copies = callbacks.slice(0)\n    callbacks.length = 0\n    for (let i = 0; i < copies.length; i++) {\n      copies[i]()\n    }\n  }\n\n  // the nextTick behavior leverages the microtask queue, which can be accessed\n  // via either native Promise.then or MutationObserver.\n  // MutationObserver has wider support, however it is seriously bugged in\n  // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n  // completely stops working after triggering a few times... so, if native\n  // Promise is available, we will use it:\n  /* istanbul ignore if */\n  if (typeof Promise !== 'undefined' && isNative(Promise)) {\n    var p = Promise.resolve()\n    var logError = err => {\n      console.error(err)\n    }\n    timerFunc = () => {\n      p.then(nextTickHandler).catch(logError)\n      // in problematic UIWebViews, Promise.then doesn't completely break, but\n      // it can get stuck in a weird state where callbacks are pushed into the\n      // microtask queue but the queue isn't being flushed, until the browser\n      // needs to do some other work, e.g. handle a timer. Therefore we can\n      // \"force\" the microtask queue to be flushed by adding an empty timer.\n      if (isIOS) setTimeout(noop)\n    }\n  } else if (\n    typeof MutationObserver !== 'undefined' &&\n    (isNative(MutationObserver) ||\n      // PhantomJS and iOS 7.x\n      MutationObserver.toString() === '[object MutationObserverConstructor]')\n  ) {\n    // use MutationObserver where native Promise is not available,\n    // e.g. PhantomJS IE11, iOS7, Android 4.4\n    var counter = 1\n    var observer = new MutationObserver(nextTickHandler)\n    var textNode = document.createTextNode(String(counter))\n    observer.observe(textNode, {\n      characterData: true,\n    })\n    timerFunc = () => {\n      counter = (counter + 1) % 2\n      textNode.data = String(counter)\n    }\n  } else {\n    if (Promise !== undefined) {\n      // If Promise is supported for android\n      timerFunc = function() {\n        var p = Promise.resolve()\n        p.then(nextTickHandler).catch(logError)\n      }\n    } else {\n      // fallback to setTimeout\n      /* istanbul ignore next */\n      timerFunc = function() {\n        setTimeout(nextTickHandler, 0)\n      }\n    }\n  }\n\n  return function queueNextTick(cb?: Function, ctx?: Object) {\n    let _resolve\n    callbacks.push(() => {\n      if (cb) {\n        try {\n          cb.call(ctx)\n        } catch (e) {\n          handleError(e, ctx, 'nextTick')\n        }\n      } else if (_resolve) {\n        _resolve(ctx)\n      }\n    })\n    if (!pending) {\n      pending = true\n      timerFunc()\n    }\n    if (!cb && typeof Promise !== 'undefined') {\n      // eslint-disable-next-line no-unused-vars\n      return new Promise((resolve, reject) => {\n        _resolve = resolve\n      })\n    }\n  }\n})()\n\nlet _Set\n/* istanbul ignore if */\nif (typeof Set !== 'undefined' && isNative(Set)) {\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 = class Set {\n    set: Object\n    constructor() {\n      this.set = Object.create(null)\n    }\n    has(key: string | number) {\n      return this.set[key] === true\n    }\n    add(key: string | number) {\n      this.set[key] = true\n    }\n    clear() {\n      this.set = Object.create(null)\n    }\n  }\n}\n\nexport { _Set }\n"
  },
  {
    "path": "src/core/util/error.js",
    "content": "import config from '../config'\nimport { warn } from './debug'\nimport { inBrowser } from './env'\n\nexport function handleError(err, vm, info) {\n  if (config.errorHandler) {\n    config.errorHandler.call(null, err, vm, info)\n  } else {\n    if (process.env.NODE_ENV !== 'production') {\n      warn(`Error in ${info}: \"${err.toString()}\"`, vm)\n    }\n    /* istanbul ignore else */\n    if (inBrowser && typeof console !== 'undefined') {\n      console.error(err)\n    } else {\n      throw err\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/util/index.js",
    "content": "export * from 'shared/util'\nexport * from './lang'\nexport * from './env'\nexport * from './options'\nexport * from './debug'\nexport * from './props'\nexport * from './error'\nexport { defineReactive } from '../observer/index'\n"
  },
  {
    "path": "src/core/util/lang.js",
    "content": "/* @flow */\n\nexport const emptyObject = Object.freeze({})\n\n/**\n * Check if a string starts with $ or _\n */\nexport function isReserved(str: string): boolean {\n  const c = (str + '').charCodeAt(0)\n  return c === 0x24 || c === 0x5f\n}\n\n/**\n * Define a property.\n */\nexport function def(obj: Object, key: string, val: any, enumerable?: boolean) {\n  Object.defineProperty(obj, key, {\n    value: val,\n    enumerable: !!enumerable,\n    writable: true,\n    configurable: true,\n  })\n}\n\n/**\n * Parse simple path.\n */\nconst bailRE = /[^\\w.$]/\nexport function parsePath(path: string): any {\n  if (bailRE.test(path)) {\n    return\n  }\n  const segments = path.split('.')\n  return function(obj) {\n    for (let i = 0; i < segments.length; i++) {\n      if (!obj) return\n      obj = obj[segments[i]]\n    }\n    return obj\n  }\n}\n"
  },
  {
    "path": "src/core/util/options.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport { warn } from './debug'\nimport { set } from '../observer/index'\n\nimport { ASSET_TYPES, LIFECYCLE_HOOKS } from 'shared/constants'\n\nimport {\n  extend,\n  hasOwn,\n  camelize,\n  capitalize,\n  isBuiltInTag,\n  isPlainObject,\n} from 'shared/util'\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 */\nconst strats = config.optionMergeStrategies\n\n/**\n * Options with restrictions\n */\nif (process.env.NODE_ENV !== 'production') {\n  strats.el = strats.propsData = function(parent, child, vm, key) {\n    if (!vm) {\n      warn(\n        `option \"${key}\" can only be used during instance ` +\n          'creation with the `new` keyword.',\n      )\n    }\n    return defaultStrat(parent, child)\n  }\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData(to: Object, from: ?Object): Object {\n  if (!from) return to\n  let key, toVal, fromVal\n  const keys = Object.keys(from)\n  for (let i = 0; i < keys.length; i++) {\n    key = keys[i]\n    toVal = to[key]\n    fromVal = from[key]\n    if (!hasOwn(to, key)) {\n      set(to, key, fromVal)\n    } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {\n      mergeData(toVal, fromVal)\n    }\n  }\n  return to\n}\n\n/**\n * Data\n */\nstrats.data = function(\n  parentVal: any,\n  childVal: any,\n  vm?: Component,\n): ?Function {\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' &&\n        warn(\n          'The \"data\" option should be a function ' +\n            'that returns a per-instance value in component ' +\n            'definitions.',\n          vm,\n        )\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      const instanceData =\n        typeof childVal === 'function' ? childVal.call(vm) : childVal\n      const defaultData =\n        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 * Hooks and props are merged as arrays.\n */\nfunction mergeHook(\n  parentVal: ?Array<Function>,\n  childVal: ?Function | ?Array<Function>,\n): ?Array<Function> {\n  return childVal\n    ? parentVal\n      ? parentVal.concat(childVal)\n      : Array.isArray(childVal)\n      ? childVal\n      : [childVal]\n    : parentVal\n}\n\nLIFECYCLE_HOOKS.forEach(hook => {\n  strats[hook] = mergeHook\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 */\nfunction mergeAssets(parentVal: ?Object, childVal: ?Object): Object {\n  const res = Object.create(parentVal || null)\n  return childVal ? extend(res, childVal) : res\n}\n\nASSET_TYPES.forEach(function(type) {\n  strats[type + 's'] = mergeAssets\n})\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function(parentVal: ?Object, childVal: ?Object): ?Object {\n  /* istanbul ignore if */\n  if (!childVal) return Object.create(parentVal || null)\n  if (!parentVal) return childVal\n  const ret = {}\n  extend(ret, parentVal)\n  for (const key in childVal) {\n    let parent = ret[key]\n    const child = childVal[key]\n    if (parent && !Array.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 */\nstrats.props = strats.methods = strats.computed = function(\n  parentVal: ?Object,\n  childVal: ?Object,\n): ?Object {\n  if (!childVal) return Object.create(parentVal || null)\n  if (!parentVal) return childVal\n  const ret = Object.create(null)\n  extend(ret, parentVal)\n  extend(ret, childVal)\n  return ret\n}\n\n/**\n * Default strategy.\n */\nconst defaultStrat = function(parentVal: any, childVal: any): any {\n  return childVal === undefined ? parentVal : childVal\n}\n\n/**\n * Validate component names\n */\nfunction checkComponents(options: Object) {\n  for (const key in options.components) {\n    const lower = key.toLowerCase()\n    if (isBuiltInTag(lower) || config.isReservedTag(lower)) {\n      warn(\n        'Do not use built-in or reserved HTML elements as component ' +\n          'id: ' +\n          key,\n      )\n    }\n  }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps(options: Object) {\n  const props = options.props\n  if (!props) return\n  const res = {}\n  let i, val, name\n  if (Array.isArray(props)) {\n    i = props.length\n    while (i--) {\n      val = props[i]\n      if (typeof val === 'string') {\n        name = camelize(val)\n        res[name] = { type: null }\n      } else if (process.env.NODE_ENV !== 'production') {\n        warn('props must be strings when using array syntax.')\n      }\n    }\n  } else if (isPlainObject(props)) {\n    for (const key in props) {\n      val = props[key]\n      name = camelize(key)\n      res[name] = isPlainObject(val) ? val : { type: val }\n    }\n  }\n  options.props = res\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives(options: Object) {\n  const dirs = options.directives\n  if (dirs) {\n    for (const key in dirs) {\n      const def = dirs[key]\n      if (typeof def === 'function') {\n        dirs[key] = { bind: def, update: def }\n      }\n    }\n  }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nexport function mergeOptions(\n  parent: Object,\n  child: Object,\n  vm?: Component,\n): Object {\n  if (process.env.NODE_ENV !== 'production') {\n    checkComponents(child)\n  }\n\n  if (typeof child === 'function') {\n    child = child.options\n  }\n\n  normalizeProps(child)\n  normalizeDirectives(child)\n  const extendsFrom = child.extends\n  if (extendsFrom) {\n    parent = mergeOptions(parent, extendsFrom, vm)\n  }\n  if (child.mixins) {\n    for (let i = 0, l = child.mixins.length; i < l; i++) {\n      parent = mergeOptions(parent, child.mixins[i], vm)\n    }\n  }\n  const options = {}\n  let key\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    const 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 */\nexport function resolveAsset(\n  options: Object,\n  type: string,\n  id: string,\n  warnMissing?: boolean,\n): any {\n  /* istanbul ignore if */\n  if (typeof id !== 'string') {\n    return\n  }\n  const assets = options[type]\n  // check local registration variations first\n  if (hasOwn(assets, id)) return assets[id]\n  const camelizedId = camelize(id)\n  if (hasOwn(assets, camelizedId)) return assets[camelizedId]\n  const PascalCaseId = capitalize(camelizedId)\n  if (hasOwn(assets, PascalCaseId)) return assets[PascalCaseId]\n  // fallback to prototype chain\n  const res = assets[id] || assets[camelizedId] || assets[PascalCaseId]\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"
  },
  {
    "path": "src/core/util/perf.js",
    "content": "import { inBrowser } from './env'\n\nexport let mark\nexport let measure\n\nif (process.env.NODE_ENV !== 'production') {\n  const perf = inBrowser && window.performance\n  /* istanbul ignore if */\n  if (\n    perf &&\n    perf.mark &&\n    perf.measure &&\n    perf.clearMarks &&\n    perf.clearMeasures\n  ) {\n    mark = tag => perf.mark(tag)\n    measure = (name, startTag, endTag) => {\n      perf.measure(name, startTag, endTag)\n      perf.clearMarks(startTag)\n      perf.clearMarks(endTag)\n      perf.clearMeasures(name)\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/util/props.js",
    "content": "/* @flow */\n\nimport {\n  hasOwn,\n  isObject,\n  isPlainObject,\n  capitalize,\n  hyphenate,\n} from 'shared/util'\nimport { observe, observerState } from '../observer/index'\nimport { warn } from './debug'\n\ntype PropOptions = {\n  type: Function | Array<Function> | null,\n  default: any,\n  required: ?boolean,\n  validator: ?Function,\n}\n\nexport function validateProp(\n  key: string,\n  propOptions: Object,\n  propsData: Object,\n  vm?: Component,\n): any {\n  const prop = propOptions[key]\n  const absent = !hasOwn(propsData, key)\n  let value = propsData[key]\n  // handle boolean props\n  if (isType(Boolean, prop.type)) {\n    if (absent && !hasOwn(prop, 'default')) {\n      value = false\n    } else if (\n      !isType(String, prop.type) &&\n      (value === '' || value === hyphenate(key))\n    ) {\n      value = true\n    }\n  }\n  // check default value\n  if (value === undefined) {\n    value = getPropDefaultValue(vm, prop, key)\n    // since the default value is a fresh copy,\n    // make sure to observe it.\n    const prevShouldConvert = observerState.shouldConvert\n    observerState.shouldConvert = true\n    observe(value)\n    observerState.shouldConvert = prevShouldConvert\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    assertProp(prop, key, value, vm, absent)\n  }\n  return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue(\n  vm: ?Component,\n  prop: PropOptions,\n  key: string,\n): any {\n  // no default, return undefined\n  if (!hasOwn(prop, 'default')) {\n    return undefined\n  }\n  const def = prop.default\n  // warn against non-factory defaults for Object & Array\n  if (process.env.NODE_ENV !== 'production' && isObject(def)) {\n    warn(\n      'Invalid default value for prop \"' +\n        key +\n        '\": ' +\n        'Props with type Object/Array must use a factory function ' +\n        'to return the default value.',\n      vm,\n    )\n  }\n  // the raw prop value was also undefined from previous render,\n  // return previous default value to avoid unnecessary watcher trigger\n  if (\n    vm &&\n    vm.$options.propsData &&\n    vm.$options.propsData[key] === undefined &&\n    vm._props[key] !== undefined\n  ) {\n    return vm._props[key]\n  }\n  // call factory function for non-Function types\n  // a value is Function if its prototype is function even across different execution context\n  return typeof def === 'function' && getType(prop.type) !== 'Function'\n    ? def.call(vm)\n    : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp(\n  prop: PropOptions,\n  name: string,\n  value: any,\n  vm: ?Component,\n  absent: boolean,\n) {\n  if (prop.required && absent) {\n    warn('Missing required prop: \"' + name + '\"', vm)\n    return\n  }\n  if (value == null && !prop.required) {\n    return\n  }\n  let type = prop.type\n  let valid = !type || type === true\n  const expectedTypes = []\n  if (type) {\n    if (!Array.isArray(type)) {\n      type = [type]\n    }\n    for (let i = 0; i < type.length && !valid; i++) {\n      const assertedType = assertType(value, type[i])\n      expectedTypes.push(assertedType.expectedType || '')\n      valid = assertedType.valid\n    }\n  }\n  if (!valid) {\n    warn(\n      'Invalid prop: type check failed for prop \"' +\n        name +\n        '\".' +\n        ' Expected ' +\n        expectedTypes.map(capitalize).join(', ') +\n        ', got ' +\n        Object.prototype.toString.call(value).slice(8, -1) +\n        '.',\n      vm,\n    )\n    return\n  }\n  const validator = prop.validator\n  if (validator) {\n    if (!validator(value)) {\n      warn(\n        'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n        vm,\n      )\n    }\n  }\n}\n\nconst simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/\n\nfunction assertType(\n  value: any,\n  type: Function,\n): {\n  valid: boolean,\n  expectedType: string,\n} {\n  let valid\n  const expectedType = getType(type)\n  if (simpleCheckRE.test(expectedType)) {\n    valid = typeof value === expectedType.toLowerCase()\n  } else if (expectedType === 'Object') {\n    valid = isPlainObject(value)\n  } else if (expectedType === 'Array') {\n    valid = Array.isArray(value)\n  } else {\n    valid = value instanceof type\n  }\n  return {\n    valid,\n    expectedType,\n  }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType(fn) {\n  const match = fn && fn.toString().match(/^\\s*function (\\w+)/)\n  return match ? match[1] : ''\n}\n\nfunction isType(type, fn) {\n  if (!Array.isArray(fn)) {\n    return getType(fn) === getType(type)\n  }\n  for (let i = 0, len = fn.length; i < len; i++) {\n    if (getType(fn[i]) === getType(type)) {\n      return true\n    }\n  }\n  /* istanbul ignore next */\n  return false\n}\n"
  },
  {
    "path": "src/core/vdom/create-component.js",
    "content": "/* @flow */\n\nimport VNode from './vnode'\nimport { resolveConstructorOptions } from 'core/instance/init'\nimport { queueActivatedComponent } from 'core/observer/scheduler'\nimport { createFunctionalComponent } from './create-functional-component'\n\nimport { warn, isDef, isUndef, isTrue, isObject } from '../util/index'\n\nimport {\n  resolveAsyncComponent,\n  extractPropsFromVNodeData,\n} from './helpers/index'\n\nimport {\n  callHook,\n  activeInstance,\n  updateChildComponent,\n  activateChildComponent,\n  deactivateChildComponent,\n} from '../instance/lifecycle'\n\n// hooks to be invoked on component VNodes during patch\nconst componentVNodeHooks = {\n  init(\n    vnode: VNodeWithData,\n    hydrating: boolean,\n    parentElm: ?Node,\n    refElm: ?Node,\n  ): ?boolean {\n    if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {\n      const child = (vnode.componentInstance = createComponentInstanceForVnode(\n        vnode,\n        activeInstance,\n        parentElm,\n        refElm,\n      ))\n      child.$mount(hydrating ? vnode.elm : undefined, hydrating)\n    } else if (vnode.data.keepAlive) {\n      // kept-alive components, treat as a patch\n      const mountedNode: any = vnode // work around flow\n      componentVNodeHooks.prepatch(mountedNode, mountedNode)\n    }\n  },\n\n  prepatch(oldVnode: MountedComponentVNode, vnode: MountedComponentVNode) {\n    const options = vnode.componentOptions\n    const child = (vnode.componentInstance = oldVnode.componentInstance)\n    updateChildComponent(\n      child,\n      options.propsData, // updated props\n      options.listeners, // updated listeners\n      vnode, // new parent vnode\n      options.children, // new children\n    )\n  },\n\n  insert(vnode: MountedComponentVNode) {\n    const { context, componentInstance } = vnode\n    if (!componentInstance._isMounted) {\n      componentInstance._isMounted = true\n      callHook(componentInstance, 'mounted')\n    }\n    if (vnode.data.keepAlive) {\n      if (context._isMounted) {\n        // vue-router#1212\n        // During updates, a kept-alive component's child components may\n        // change, so directly walking the tree here may call activated hooks\n        // on incorrect children. Instead we push them into a queue which will\n        // be processed after the whole patch process ended.\n        queueActivatedComponent(componentInstance)\n      } else {\n        activateChildComponent(componentInstance, true /* direct */)\n      }\n    }\n  },\n\n  destroy(vnode: MountedComponentVNode) {\n    const { componentInstance } = vnode\n    if (!componentInstance._isDestroyed) {\n      if (!vnode.data.keepAlive) {\n        componentInstance.$destroy()\n      } else {\n        deactivateChildComponent(componentInstance, true /* direct */)\n      }\n    }\n  },\n}\n\nconst hooksToMerge = Object.keys(componentVNodeHooks)\n\nexport function createComponent(\n  Ctor: any,\n  data?: VNodeData,\n  context: Component,\n  children: ?Array<VNode>,\n  tag?: string,\n): VNode | void {\n  if (isUndef(Ctor)) {\n    return\n  }\n\n  const baseCtor = context.$options._base\n\n  // plain options object: turn it into a constructor\n  if (isObject(Ctor)) {\n    Ctor = baseCtor.extend(Ctor)\n  }\n\n  // if at this stage it's not a constructor or an async component factory,\n  // reject.\n  if (typeof Ctor !== 'function') {\n    if (process.env.NODE_ENV !== 'production') {\n      warn(`Invalid Component definition: ${String(Ctor)}`, context)\n    }\n    return\n  }\n\n  // async component\n  if (isUndef(Ctor.cid)) {\n    Ctor = resolveAsyncComponent(Ctor, baseCtor, context)\n    if (Ctor === undefined) {\n      // return nothing if this is indeed an async component\n      // wait for the callback to trigger parent update.\n      return\n    }\n  }\n\n  // resolve constructor options in case global mixins are applied after\n  // component constructor creation\n  resolveConstructorOptions(Ctor)\n\n  data = data || {}\n\n  // transform component v-model data into props & events\n  if (isDef(data.model)) {\n    transformModel(Ctor.options, data)\n  }\n\n  // extract props\n  const propsData = extractPropsFromVNodeData(data, Ctor, tag)\n\n  // functional component\n  if (isTrue(Ctor.options.functional)) {\n    return createFunctionalComponent(Ctor, propsData, data, context, children)\n  }\n\n  // extract listeners, since these needs to be treated as\n  // child component listeners instead of DOM listeners\n  const listeners = data.on\n  // replace with listeners with .native modifier\n  data.on = data.nativeOn\n\n  if (isTrue(Ctor.options.abstract)) {\n    // abstract components do not keep anything\n    // other than props & listeners\n    data = {}\n  }\n\n  // merge component management hooks onto the placeholder node\n  mergeHooks(data)\n\n  // return a placeholder vnode\n  const name = Ctor.options.name || tag\n  const vnode = new VNode(\n    `vue-component-${Ctor.cid}${name ? `-${name}` : ''}`,\n    data,\n    undefined,\n    undefined,\n    undefined,\n    context,\n    { Ctor, propsData, listeners, tag, children },\n  )\n  return vnode\n}\n\nexport function createComponentInstanceForVnode(\n  vnode: any, // we know it's MountedComponentVNode but flow doesn't\n  parent: any, // activeInstance in lifecycle state\n  parentElm?: ?Node,\n  refElm?: ?Node,\n): Component {\n  const vnodeComponentOptions = vnode.componentOptions\n  const options: InternalComponentOptions = {\n    _isComponent: true,\n    parent,\n    propsData: vnodeComponentOptions.propsData,\n    _componentTag: vnodeComponentOptions.tag,\n    _parentVnode: vnode,\n    _parentListeners: vnodeComponentOptions.listeners,\n    _renderChildren: vnodeComponentOptions.children,\n    _parentElm: parentElm || null,\n    _refElm: refElm || null,\n  }\n  // check inline-template render functions\n  const inlineTemplate = vnode.data.inlineTemplate\n  if (isDef(inlineTemplate)) {\n    options.render = inlineTemplate.render\n    options.staticRenderFns = inlineTemplate.staticRenderFns\n  }\n  return new vnodeComponentOptions.Ctor(options)\n}\n\nfunction mergeHooks(data: VNodeData) {\n  if (!data.hook) {\n    data.hook = {}\n  }\n  for (let i = 0; i < hooksToMerge.length; i++) {\n    const key = hooksToMerge[i]\n    const fromParent = data.hook[key]\n    const ours = componentVNodeHooks[key]\n    data.hook[key] = fromParent ? mergeHook(ours, fromParent) : ours\n  }\n}\n\nfunction mergeHook(one: Function, two: Function): Function {\n  return function(a, b, c, d) {\n    one(a, b, c, d)\n    two(a, b, c, d)\n  }\n}\n\n// transform component v-model info (value and callback) into\n// prop and event handler respectively.\nfunction transformModel(options, data: any) {\n  const prop = (options.model && options.model.prop) || 'value'\n  const event = (options.model && options.model.event) || 'input'\n  ;(data.props || (data.props = {}))[prop] = data.model.value\n  const on = data.on || (data.on = {})\n  if (isDef(on[event])) {\n    on[event] = [data.model.callback].concat(on[event])\n  } else {\n    on[event] = data.model.callback\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/create-element.js",
    "content": "/* @flow */\n\nimport config from '../config'\nimport VNode, { createEmptyVNode } from './vnode'\nimport { createComponent } from './create-component'\n\nimport {\n  warn,\n  isDef,\n  isUndef,\n  isTrue,\n  isPrimitive,\n  resolveAsset,\n} from '../util/index'\n\nimport { normalizeChildren, simpleNormalizeChildren } from './helpers/index'\n\nconst SIMPLE_NORMALIZE = 1\nconst ALWAYS_NORMALIZE = 2\n\n// wrapper function for providing a more flexible interface\n// without getting yelled at by flow\nexport function createElement(\n  context: Component,\n  tag: any,\n  data: any,\n  children: any,\n  normalizationType: any,\n  alwaysNormalize: boolean,\n): VNode {\n  if (Array.isArray(data) || isPrimitive(data)) {\n    normalizationType = children\n    children = data\n    data = undefined\n  }\n  if (isTrue(alwaysNormalize)) {\n    normalizationType = ALWAYS_NORMALIZE\n  }\n  return _createElement(context, tag, data, children, normalizationType)\n}\n\nexport function _createElement(\n  context: Component,\n  tag?: string | Class<Component> | Function | Object,\n  data?: VNodeData,\n  children?: any,\n  normalizationType?: number,\n): VNode {\n  if (isDef(data) && isDef((data: any).__ob__)) {\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        `Avoid using observed data object as vnode data: ${JSON.stringify(\n          data,\n        )}\\n` + 'Always create fresh vnode data objects in each render!',\n        context,\n      )\n    return createEmptyVNode()\n  }\n  if (!tag) {\n    // in case of component :is set to falsy value\n    return createEmptyVNode()\n  }\n  // support single function children as default scoped slot\n  if (Array.isArray(children) && typeof children[0] === 'function') {\n    data = data || {}\n    data.scopedSlots = { default: children[0] }\n    children.length = 0\n  }\n  if (normalizationType === ALWAYS_NORMALIZE) {\n    children = normalizeChildren(children)\n  } else if (normalizationType === SIMPLE_NORMALIZE) {\n    children = simpleNormalizeChildren(children)\n  }\n  let vnode, ns\n  if (typeof tag === 'string') {\n    let Ctor\n    ns = config.getTagNamespace(tag)\n    if (config.isReservedTag(tag)) {\n      // platform built-in elements\n      vnode = new VNode(\n        config.parsePlatformTagName(tag),\n        data,\n        children,\n        undefined,\n        undefined,\n        context,\n      )\n    } else if (\n      isDef((Ctor = resolveAsset(context.$options, 'components', tag)))\n    ) {\n      // component\n      vnode = createComponent(Ctor, data, context, children, tag)\n    } else {\n      // unknown or unlisted namespaced elements\n      // check at runtime because it may get assigned a namespace when its\n      // parent normalizes children\n      vnode = new VNode(tag, data, children, undefined, undefined, context)\n    }\n  } else {\n    // direct component options / constructor\n    vnode = createComponent(tag, data, context, children)\n  }\n  if (vnode !== undefined) {\n    if (ns) applyNS(vnode, ns)\n    return vnode\n  } else {\n    return createEmptyVNode()\n  }\n}\n\nfunction applyNS(vnode, ns) {\n  vnode.ns = ns\n  if (vnode.tag === 'foreignObject') {\n    // use default namespace inside foreignObject\n    return\n  }\n  if (Array.isArray(vnode.children)) {\n    for (let i = 0, l = vnode.children.length; i < l; i++) {\n      const child = vnode.children[i]\n      if (isDef(child.tag) && isUndef(child.ns)) {\n        applyNS(child, ns)\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/create-functional-component.js",
    "content": "/* @flow */\n\nimport VNode from './vnode'\nimport { createElement } from './create-element'\nimport { resolveInject } from '../instance/inject'\nimport { resolveSlots } from '../instance/render-helpers/resolve-slots'\n\nimport { isDef, camelize, validateProp } from '../util/index'\n\nexport function createFunctionalComponent(\n  Ctor: Class<Component>,\n  propsData: ?Object,\n  data: VNodeData,\n  context: Component,\n  children: ?Array<VNode>,\n): VNode | void {\n  const props = {}\n  const propOptions = Ctor.options.props\n  if (isDef(propOptions)) {\n    for (const key in propOptions) {\n      props[key] = validateProp(key, propOptions, propsData)\n    }\n  } else {\n    if (isDef(data.attrs)) mergeProps(props, data.attrs)\n    if (isDef(data.props)) mergeProps(props, data.props)\n  }\n  // ensure the createElement function in functional components\n  // gets a unique context - this is necessary for correct named slot check\n  const _context = Object.create(context)\n  const h = (a, b, c, d) => createElement(_context, a, b, c, d, true)\n  const vnode = Ctor.options.render.call(null, h, {\n    data,\n    props,\n    children,\n    parent: context,\n    listeners: data.on || {},\n    injections: resolveInject(Ctor.options.inject, context),\n    slots: () => resolveSlots(children, context),\n  })\n  if (vnode instanceof VNode) {\n    vnode.functionalContext = context\n    if (data.slot) {\n      ;(vnode.data || (vnode.data = {})).slot = data.slot\n    }\n  }\n  return vnode\n}\n\nfunction mergeProps(to, from) {\n  for (const key in from) {\n    to[camelize(key)] = from[key]\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/helpers/extract-props.js",
    "content": "/* @flow */\n\nimport {\n  tip,\n  hasOwn,\n  isDef,\n  isUndef,\n  hyphenate,\n  formatComponentName,\n} from 'core/util/index'\n\nexport function extractPropsFromVNodeData(\n  data: VNodeData,\n  Ctor: Class<Component>,\n  tag?: string,\n): ?Object {\n  // we are only extracting raw values here.\n  // validation and default values are handled in the child\n  // component itself.\n  const propOptions = Ctor.options.props\n  if (isUndef(propOptions)) {\n    return\n  }\n  const res = {}\n  const { attrs, props } = data\n  if (isDef(attrs) || isDef(props)) {\n    for (const key in propOptions) {\n      const altKey = hyphenate(key)\n      if (process.env.NODE_ENV !== 'production') {\n        const keyInLowerCase = key.toLowerCase()\n        if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {\n          tip(\n            `Prop \"${keyInLowerCase}\" is passed to component ` +\n              `${formatComponentName(\n                tag || Ctor,\n              )}, but the declared prop name is` +\n              ` \"${key}\". ` +\n              `Note that HTML attributes are case-insensitive and camelCased ` +\n              `props need to use their kebab-case equivalents when using in-DOM ` +\n              `templates. You should probably use \"${altKey}\" instead of \"${key}\".`,\n          )\n        }\n      }\n      checkProp(res, props, key, altKey, true) ||\n        checkProp(res, attrs, key, altKey, false)\n    }\n  }\n  return res\n}\n\nfunction checkProp(\n  res: Object,\n  hash: any,\n  key: string,\n  altKey: string,\n  preserve: boolean,\n): boolean {\n  if (isDef(hash)) {\n    if (hasOwn(hash, key)) {\n      res[key] = hash[key]\n      if (!preserve) {\n        delete hash[key]\n      }\n      return true\n    } else if (hasOwn(hash, altKey)) {\n      res[key] = hash[altKey]\n      if (!preserve) {\n        delete hash[altKey]\n      }\n      return true\n    }\n  }\n  return false\n}\n"
  },
  {
    "path": "src/core/vdom/helpers/get-first-component-child.js",
    "content": "/* @flow */\n\nimport { isDef } from 'shared/util'\n\nexport function getFirstComponentChild(children: ?Array<VNode>): ?VNode {\n  if (Array.isArray(children)) {\n    for (let i = 0; i < children.length; i++) {\n      const c = children[i]\n      if (isDef(c) && isDef(c.componentOptions)) {\n        return c\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/helpers/index.js",
    "content": "/* @flow */\n\nexport * from './merge-hook'\nexport * from './extract-props'\nexport * from './update-listeners'\nexport * from './normalize-children'\nexport * from './resolve-async-component'\nexport * from './get-first-component-child'\n"
  },
  {
    "path": "src/core/vdom/helpers/merge-hook.js",
    "content": "/* @flow */\n\nimport { createFnInvoker } from './update-listeners'\nimport { remove, isDef, isUndef, isTrue } from 'shared/util'\n\nexport function mergeVNodeHook(def: Object, hookKey: string, hook: Function) {\n  let invoker\n  const oldHook = def[hookKey]\n\n  function wrappedHook() {\n    hook.apply(this, arguments)\n    // important: remove merged hook to ensure it's called only once\n    // and prevent memory leak\n    remove(invoker.fns, wrappedHook)\n  }\n\n  if (isUndef(oldHook)) {\n    // no existing hook\n    invoker = createFnInvoker([wrappedHook])\n  } else {\n    /* istanbul ignore if */\n    if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {\n      // already a merged invoker\n      invoker = oldHook\n      invoker.fns.push(wrappedHook)\n    } else {\n      // existing plain hook\n      invoker = createFnInvoker([oldHook, wrappedHook])\n    }\n  }\n\n  invoker.merged = true\n  def[hookKey] = invoker\n}\n"
  },
  {
    "path": "src/core/vdom/helpers/normalize-children.js",
    "content": "/* @flow */\n\nimport VNode, { createTextVNode } from 'core/vdom/vnode'\nimport { isDef, isUndef, isPrimitive } from 'shared/util'\n\n// The template compiler attempts to minimize the need for normalization by\n// statically analyzing the template at compile time.\n//\n// For plain HTML markup, normalization can be completely skipped because the\n// generated render function is guaranteed to return Array<VNode>. There are\n// two cases where extra normalization is needed:\n\n// 1. When the children contains components - because a functional component\n// may return an Array instead of a single root. In this case, just a simple\n// normalization is needed - if any child is an Array, we flatten the whole\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n// because functional components already normalize their own children.\nexport function simpleNormalizeChildren(children: any) {\n  for (let i = 0; i < children.length; i++) {\n    if (Array.isArray(children[i])) {\n      return Array.prototype.concat.apply([], children)\n    }\n  }\n  return children\n}\n\n// 2. When the children contains constructs that always generated nested Arrays,\n// e.g. <template>, <slot>, v-for, or when the children is provided by user\n// with hand-written render functions / JSX. In such cases a full normalization\n// is needed to cater to all possible types of children values.\nexport function normalizeChildren(children: any): ?Array<VNode> {\n  return isPrimitive(children)\n    ? [createTextVNode(children)]\n    : Array.isArray(children)\n    ? normalizeArrayChildren(children)\n    : undefined\n}\n\nfunction normalizeArrayChildren(\n  children: any,\n  nestedIndex?: string,\n): Array<VNode> {\n  const res = []\n  let i, c, last\n  for (i = 0; i < children.length; i++) {\n    c = children[i]\n    if (isUndef(c) || typeof c === 'boolean') continue\n    last = res[res.length - 1]\n    //  nested\n    if (Array.isArray(c)) {\n      res.push.apply(\n        res,\n        normalizeArrayChildren(c, `${nestedIndex || ''}_${i}`),\n      )\n    } else if (isPrimitive(c)) {\n      if (isDef(last) && isDef(last.text)) {\n        ;(last: any).text += String(c)\n      } else if (c !== '') {\n        // convert primitive to vnode\n        res.push(createTextVNode(c))\n      }\n    } else {\n      if (isDef(c.text) && isDef(last) && isDef(last.text)) {\n        res[res.length - 1] = createTextVNode(last.text + c.text)\n      } else {\n        // default key for nested array children (likely generated by v-for)\n        if (isDef(c.tag) && isUndef(c.key) && isDef(nestedIndex)) {\n          c.key = `__vlist${(nestedIndex: any)}_${i}__`\n        }\n        res.push(c)\n      }\n    }\n  }\n  return res\n}\n"
  },
  {
    "path": "src/core/vdom/helpers/resolve-async-component.js",
    "content": "/* @flow */\n\nimport { warn, once, isDef, isUndef, isTrue, isObject } from 'core/util/index'\n\nfunction ensureCtor(comp, base) {\n  return isObject(comp) ? base.extend(comp) : comp\n}\n\nexport function resolveAsyncComponent(\n  factory: Function,\n  baseCtor: Class<Component>,\n  context: Component,\n): Class<Component> | void {\n  if (isTrue(factory.error) && isDef(factory.errorComp)) {\n    return factory.errorComp\n  }\n\n  if (isDef(factory.resolved)) {\n    return factory.resolved\n  }\n\n  if (isTrue(factory.loading) && isDef(factory.loadingComp)) {\n    return factory.loadingComp\n  }\n\n  if (isDef(factory.contexts)) {\n    // already pending\n    factory.contexts.push(context)\n  } else {\n    const contexts = (factory.contexts = [context])\n    let sync = true\n\n    const forceRender = () => {\n      for (let i = 0, l = contexts.length; i < l; i++) {\n        contexts[i].$forceUpdate()\n      }\n    }\n\n    const resolve = once((res: Object | Class<Component>) => {\n      // cache resolved\n      factory.resolved = ensureCtor(res, baseCtor)\n      // invoke callbacks only if this is not a synchronous resolve\n      // (async resolves are shimmed as synchronous during SSR)\n      if (!sync) {\n        forceRender()\n      }\n    })\n\n    const reject = once(reason => {\n      process.env.NODE_ENV !== 'production' &&\n        warn(\n          `Failed to resolve async component: ${String(factory)}` +\n            (reason ? `\\nReason: ${reason}` : ''),\n        )\n      if (isDef(factory.errorComp)) {\n        factory.error = true\n        forceRender()\n      }\n    })\n\n    const res = factory(resolve, reject)\n\n    if (isObject(res)) {\n      if (typeof res.then === 'function') {\n        // () => Promise\n        if (isUndef(factory.resolved)) {\n          res.then(resolve, reject)\n        }\n      } else if (\n        isDef(res.component) &&\n        typeof res.component.then === 'function'\n      ) {\n        res.component.then(resolve, reject)\n\n        if (isDef(res.error)) {\n          factory.errorComp = ensureCtor(res.error, baseCtor)\n        }\n\n        if (isDef(res.loading)) {\n          factory.loadingComp = ensureCtor(res.loading, baseCtor)\n          if (res.delay === 0) {\n            factory.loading = true\n          } else {\n            setTimeout(() => {\n              if (isUndef(factory.resolved) && isUndef(factory.error)) {\n                factory.loading = true\n                forceRender()\n              }\n            }, res.delay || 200)\n          }\n        }\n\n        if (isDef(res.timeout)) {\n          setTimeout(() => {\n            reject(\n              process.env.NODE_ENV !== 'production'\n                ? `timeout (${res.timeout}ms)`\n                : null,\n            )\n          }, res.timeout)\n        }\n      }\n    }\n\n    sync = false\n    // return in case resolved synchronously\n    return factory.loading ? factory.loadingComp : factory.resolved\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/helpers/update-listeners.js",
    "content": "/* @flow */\n\nimport { warn } from 'core/util/index'\nimport { cached, isUndef } from 'shared/util'\n\nconst normalizeEvent = cached((name: string): {\n  name: string,\n  once: boolean,\n  capture: boolean,\n  passive: boolean,\n} => {\n  const passive = name.charAt(0) === '&'\n  name = passive ? name.slice(1) : name\n  const once = name.charAt(0) === '~' // Prefixed last, checked first\n  name = once ? name.slice(1) : name\n  const capture = name.charAt(0) === '!'\n  name = capture ? name.slice(1) : name\n  return {\n    name,\n    once,\n    capture,\n    passive,\n  }\n})\n\nexport function createFnInvoker(fns: Function | Array<Function>): Function {\n  function invoker() {\n    const fns = invoker.fns\n    if (Array.isArray(fns)) {\n      for (let i = 0; i < fns.length; i++) {\n        fns[i].apply(null, arguments)\n      }\n    } else {\n      // return handler return value for single handlers\n      return fns.apply(null, arguments)\n    }\n  }\n  invoker.fns = fns\n  return invoker\n}\n\nexport function updateListeners(\n  on: Object,\n  oldOn: Object,\n  add: Function,\n  remove: Function,\n  vm: Component,\n) {\n  let name, cur, old, event\n  for (name in on) {\n    cur = on[name]\n    old = oldOn[name]\n    event = normalizeEvent(name)\n    if (isUndef(cur)) {\n      process.env.NODE_ENV !== 'production' &&\n        warn(\n          `Invalid handler for event \"${event.name}\": got ` + String(cur),\n          vm,\n        )\n    } else if (isUndef(old)) {\n      if (isUndef(cur.fns)) {\n        cur = on[name] = createFnInvoker(cur)\n      }\n      add(event.name, cur, event.once, event.capture, event.passive)\n    } else if (cur !== old) {\n      old.fns = cur\n      on[name] = old\n    }\n  }\n  for (name in oldOn) {\n    if (isUndef(on[name])) {\n      event = normalizeEvent(name)\n      remove(event.name, oldOn[name], event.capture)\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/modules/directives.js",
    "content": "/* @flow */\n\nimport { emptyNode } from 'core/vdom/patch'\nimport { resolveAsset, handleError } from 'core/util/index'\nimport { mergeVNodeHook } from 'core/vdom/helpers/index'\n\nexport default {\n  create: updateDirectives,\n  update: updateDirectives,\n  destroy: function unbindDirectives(vnode: VNodeWithData) {\n    updateDirectives(vnode, emptyNode)\n  },\n}\n\nfunction updateDirectives(oldVnode: VNodeWithData, vnode: VNodeWithData) {\n  if (oldVnode.data.directives || vnode.data.directives) {\n    _update(oldVnode, vnode)\n  }\n}\n\nfunction _update(oldVnode, vnode) {\n  const isCreate = oldVnode === emptyNode\n  const isDestroy = vnode === emptyNode\n  const oldDirs = normalizeDirectives(\n    oldVnode.data.directives,\n    oldVnode.context,\n  )\n  const newDirs = normalizeDirectives(vnode.data.directives, vnode.context)\n\n  const dirsWithInsert = []\n  const dirsWithPostpatch = []\n\n  let key, oldDir, dir\n  for (key in newDirs) {\n    oldDir = oldDirs[key]\n    dir = newDirs[key]\n    if (!oldDir) {\n      // new directive, bind\n      callHook(dir, 'bind', vnode, oldVnode)\n      if (dir.def && dir.def.inserted) {\n        dirsWithInsert.push(dir)\n      }\n    } else {\n      // existing directive, update\n      dir.oldValue = oldDir.value\n      callHook(dir, 'update', vnode, oldVnode)\n      if (dir.def && dir.def.componentUpdated) {\n        dirsWithPostpatch.push(dir)\n      }\n    }\n  }\n\n  if (dirsWithInsert.length) {\n    const callInsert = () => {\n      for (let i = 0; i < dirsWithInsert.length; i++) {\n        callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode)\n      }\n    }\n    if (isCreate) {\n      mergeVNodeHook(\n        vnode.data.hook || (vnode.data.hook = {}),\n        'insert',\n        callInsert,\n      )\n    } else {\n      callInsert()\n    }\n  }\n\n  if (dirsWithPostpatch.length) {\n    mergeVNodeHook(\n      vnode.data.hook || (vnode.data.hook = {}),\n      'postpatch',\n      () => {\n        for (let i = 0; i < dirsWithPostpatch.length; i++) {\n          callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode)\n        }\n      },\n    )\n  }\n\n  if (!isCreate) {\n    for (key in oldDirs) {\n      if (!newDirs[key]) {\n        // no longer present, unbind\n        callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy)\n      }\n    }\n  }\n}\n\nconst emptyModifiers = Object.create(null)\n\nfunction normalizeDirectives(\n  dirs: ?Array<VNodeDirective>,\n  vm: Component,\n): { [key: string]: VNodeDirective } {\n  const res = Object.create(null)\n  if (!dirs) {\n    return res\n  }\n  let i, dir\n  for (i = 0; i < dirs.length; i++) {\n    dir = dirs[i]\n    if (!dir.modifiers) {\n      dir.modifiers = emptyModifiers\n    }\n    res[getRawDirName(dir)] = dir\n    dir.def = resolveAsset(vm.$options, 'directives', dir.name, true)\n  }\n  return res\n}\n\nfunction getRawDirName(dir: VNodeDirective): string {\n  return (\n    dir.rawName || `${dir.name}.${Object.keys(dir.modifiers || {}).join('.')}`\n  )\n}\n\nfunction callHook(dir, hook, vnode, oldVnode, isDestroy) {\n  const fn = dir.def && dir.def[hook]\n  if (fn) {\n    try {\n      fn(vnode.elm, dir, vnode, oldVnode, isDestroy)\n    } catch (e) {\n      handleError(e, vnode.context, `directive ${dir.name} ${hook} hook`)\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/modules/index.js",
    "content": "import directives from './directives'\nimport ref from './ref'\n\nexport default [ref, directives]\n"
  },
  {
    "path": "src/core/vdom/modules/ref.js",
    "content": "/* @flow */\n\nimport { remove } from 'shared/util'\n\nexport default {\n  create(_: any, vnode: VNodeWithData) {\n    registerRef(vnode)\n  },\n  update(oldVnode: VNodeWithData, vnode: VNodeWithData) {\n    if (oldVnode.data.ref !== vnode.data.ref) {\n      registerRef(oldVnode, true)\n      registerRef(vnode)\n    }\n  },\n  destroy(vnode: VNodeWithData) {\n    registerRef(vnode, true)\n  },\n}\n\nexport function registerRef(vnode: VNodeWithData, isRemoval: ?boolean) {\n  const key = vnode.data.ref\n  if (!key) return\n\n  const vm = vnode.context\n  const ref = vnode.componentInstance || vnode.elm\n  const refs = vm.$refs\n  if (isRemoval) {\n    if (Array.isArray(refs[key])) {\n      remove(refs[key], ref)\n    } else if (refs[key] === ref) {\n      refs[key] = undefined\n    }\n  } else {\n    if (vnode.data.refInFor) {\n      if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {\n        refs[key].push(ref)\n      } else {\n        refs[key] = [ref]\n      }\n    } else {\n      refs[key] = ref\n    }\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/patch.js",
    "content": "/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT License\n * https://github.com/paldepind/snabbdom/blob/master/LICENSE\n *\n * modified by Evan You (@yyx990803)\n *\n\n/*\n * Not type-checking this because this file is perf-critical and the cost\n * of making flow understand it is not worth it.\n */\n\nimport VNode from './vnode'\nimport config from '../config'\nimport { SSR_ATTR } from 'shared/constants'\nimport { registerRef } from './modules/ref'\nimport { activeInstance } from '../instance/lifecycle'\n\nimport {\n  warn,\n  isDef,\n  isUndef,\n  isTrue,\n  makeMap,\n  isPrimitive,\n} from '../util/index'\n\nexport const emptyNode = new VNode('', {}, [])\n\nconst hooks = ['create', 'activate', 'update', 'remove', 'destroy']\n\nfunction sameVnode(a, b) {\n  return (\n    a.key === b.key &&\n    a.tag === b.tag &&\n    a.isComment === b.isComment &&\n    isDef(a.data) === isDef(b.data) &&\n    sameInputType(a, b)\n  )\n}\n\n// Some browsers do not support dynamically changing type for <input>\n// so they need to be treated as different nodes\nfunction sameInputType(a, b) {\n  if (a.tag !== 'input') return true\n  let i\n  const typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type\n  const typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type\n  return typeA === typeB\n}\n\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\n  let i, key\n  const map = {}\n  for (i = beginIdx; i <= endIdx; ++i) {\n    key = children[i].key\n    if (isDef(key)) map[key] = i\n  }\n  return map\n}\n\nexport function createPatchFunction(backend) {\n  let i, j\n  const cbs = {}\n\n  const { modules, nodeOps } = backend\n\n  for (i = 0; i < hooks.length; ++i) {\n    cbs[hooks[i]] = []\n    for (j = 0; j < modules.length; ++j) {\n      if (isDef(modules[j][hooks[i]])) {\n        cbs[hooks[i]].push(modules[j][hooks[i]])\n      }\n    }\n  }\n\n  function emptyNodeAt(elm) {\n    return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)\n  }\n\n  function createRmCb(childElm, listeners) {\n    function remove() {\n      if (--remove.listeners === 0) {\n        removeNode(childElm)\n      }\n    }\n    remove.listeners = listeners\n    return remove\n  }\n\n  function removeNode(el) {\n    const parent = nodeOps.parentNode(el)\n    // element may have already been removed due to v-html / v-text\n    if (isDef(parent)) {\n      nodeOps.removeChild(parent, el)\n    }\n  }\n\n  let inPre = 0\n  function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested) {\n    vnode.isRootInsert = !nested // for transition enter check\n    if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {\n      return\n    }\n\n    const data = vnode.data\n    const children = vnode.children\n    const tag = vnode.tag\n    if (isDef(tag)) {\n      if (process.env.NODE_ENV !== 'production') {\n        if (data && data.pre) {\n          inPre++\n        }\n        if (\n          !inPre &&\n          !vnode.ns &&\n          !(\n            config.ignoredElements.length &&\n            config.ignoredElements.indexOf(tag) > -1\n          ) &&\n          config.isUnknownElement(tag)\n        ) {\n          warn(\n            'Unknown custom element: <' +\n              tag +\n              '> - did you ' +\n              'register the component correctly? For recursive components, ' +\n              'make sure to provide the \"name\" option.',\n            vnode.context,\n          )\n        }\n      }\n      vnode.elm = vnode.ns\n        ? nodeOps.createElementNS(vnode.ns, tag)\n        : nodeOps.createElement(tag, vnode)\n      setScope(vnode)\n\n      /* istanbul ignore if */\n      if (__WEEX__) {\n        // in Weex, the default insertion order is parent-first.\n        // List items can be optimized to use children-first insertion\n        // with append=\"tree\".\n        const appendAsTree = isDef(data) && isTrue(data.appendAsTree)\n        if (!appendAsTree) {\n          if (isDef(data)) {\n            invokeCreateHooks(vnode, insertedVnodeQueue)\n          }\n          insert(parentElm, vnode.elm, refElm)\n        }\n        createChildren(vnode, children, insertedVnodeQueue)\n        if (appendAsTree) {\n          if (isDef(data)) {\n            invokeCreateHooks(vnode, insertedVnodeQueue)\n          }\n          insert(parentElm, vnode.elm, refElm)\n        }\n      } else {\n        createChildren(vnode, children, insertedVnodeQueue)\n        if (isDef(data)) {\n          invokeCreateHooks(vnode, insertedVnodeQueue)\n        }\n        insert(parentElm, vnode.elm, refElm)\n      }\n\n      if (process.env.NODE_ENV !== 'production' && data && data.pre) {\n        inPre--\n      }\n    } else if (isTrue(vnode.isComment)) {\n      vnode.elm = nodeOps.createComment(vnode.text)\n      insert(parentElm, vnode.elm, refElm)\n    } else {\n      vnode.elm = nodeOps.createTextNode(vnode.text)\n      insert(parentElm, vnode.elm, refElm)\n    }\n  }\n\n  function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {\n    let i = vnode.data\n    if (isDef(i)) {\n      const isReactivated = isDef(vnode.componentInstance) && i.keepAlive\n      if (isDef((i = i.hook)) && isDef((i = i.init))) {\n        i(vnode, false /* hydrating */, parentElm, refElm)\n      }\n      // after calling the init hook, if the vnode is a child component\n      // it should've created a child instance and mounted it. the child\n      // component also has set the placeholder vnode's elm.\n      // in that case we can just return the element and be done.\n      if (isDef(vnode.componentInstance)) {\n        initComponent(vnode, insertedVnodeQueue)\n        if (isTrue(isReactivated)) {\n          reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm)\n        }\n        return true\n      }\n    }\n  }\n\n  function initComponent(vnode, insertedVnodeQueue) {\n    if (isDef(vnode.data.pendingInsert)) {\n      insertedVnodeQueue.push.apply(\n        insertedVnodeQueue,\n        vnode.data.pendingInsert,\n      )\n    }\n    vnode.elm = vnode.componentInstance.$el\n    if (isPatchable(vnode)) {\n      invokeCreateHooks(vnode, insertedVnodeQueue)\n      setScope(vnode)\n    } else {\n      // empty component root.\n      // skip all element-related modules except for ref (#3455)\n      registerRef(vnode)\n      // make sure to invoke the insert hook\n      insertedVnodeQueue.push(vnode)\n    }\n  }\n\n  function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {\n    let i\n    // hack for #4339: a reactivated component with inner transition\n    // does not trigger because the inner node's created hooks are not called\n    // again. It's not ideal to involve module-specific logic in here but\n    // there doesn't seem to be a better way to do it.\n    let innerNode = vnode\n    while (innerNode.componentInstance) {\n      innerNode = innerNode.componentInstance._vnode\n      if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {\n        for (i = 0; i < cbs.activate.length; ++i) {\n          cbs.activate[i](emptyNode, innerNode)\n        }\n        insertedVnodeQueue.push(innerNode)\n        break\n      }\n    }\n    // unlike a newly created component,\n    // a reactivated keep-alive component doesn't insert itself\n    insert(parentElm, vnode.elm, refElm)\n  }\n\n  function insert(parent, elm, ref) {\n    if (isDef(parent)) {\n      if (isDef(ref)) {\n        if (ref.parentNode === parent) {\n          nodeOps.insertBefore(parent, elm, ref)\n        }\n      } else {\n        nodeOps.appendChild(parent, elm)\n      }\n    }\n  }\n\n  function createChildren(vnode, children, insertedVnodeQueue) {\n    if (Array.isArray(children)) {\n      for (let i = 0; i < children.length; ++i) {\n        createElm(children[i], insertedVnodeQueue, vnode.elm, null, true)\n      }\n    } else if (isPrimitive(vnode.text)) {\n      nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text))\n    }\n  }\n\n  function isPatchable(vnode) {\n    while (vnode.componentInstance) {\n      vnode = vnode.componentInstance._vnode\n    }\n    return isDef(vnode.tag)\n  }\n\n  function invokeCreateHooks(vnode, insertedVnodeQueue) {\n    for (let i = 0; i < cbs.create.length; ++i) {\n      cbs.create[i](emptyNode, vnode)\n    }\n    i = vnode.data.hook // Reuse variable\n    if (isDef(i)) {\n      if (isDef(i.create)) i.create(emptyNode, vnode)\n      if (isDef(i.insert)) insertedVnodeQueue.push(vnode)\n    }\n  }\n\n  // set scope id attribute for scoped CSS.\n  // this is implemented as a special case to avoid the overhead\n  // of going through the normal attribute patching process.\n  function setScope(vnode) {\n    let i\n    let ancestor = vnode\n    while (ancestor) {\n      if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {\n        nodeOps.setAttribute(vnode.elm, i, '')\n      }\n      ancestor = ancestor.parent\n    }\n    // for slot content they should also get the scopeId from the host instance.\n    if (\n      isDef((i = activeInstance)) &&\n      i !== vnode.context &&\n      isDef((i = i.$options._scopeId))\n    ) {\n      nodeOps.setAttribute(vnode.elm, i, '')\n    }\n  }\n\n  function addVnodes(\n    parentElm,\n    refElm,\n    vnodes,\n    startIdx,\n    endIdx,\n    insertedVnodeQueue,\n  ) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm)\n    }\n  }\n\n  function invokeDestroyHook(vnode) {\n    let i, j\n    const data = vnode.data\n    if (isDef(data)) {\n      if (isDef((i = data.hook)) && isDef((i = i.destroy))) i(vnode)\n      for (i = 0; i < cbs.destroy.length; ++i) cbs.destroy[i](vnode)\n    }\n    if (isDef((i = vnode.children))) {\n      for (j = 0; j < vnode.children.length; ++j) {\n        invokeDestroyHook(vnode.children[j])\n      }\n    }\n  }\n\n  function removeVnodes(parentElm, vnodes, startIdx, endIdx) {\n    for (; startIdx <= endIdx; ++startIdx) {\n      const ch = vnodes[startIdx]\n      if (isDef(ch)) {\n        if (isDef(ch.tag)) {\n          removeAndInvokeRemoveHook(ch)\n          invokeDestroyHook(ch)\n        } else {\n          // Text node\n          removeNode(ch.elm)\n        }\n      }\n    }\n  }\n\n  function removeAndInvokeRemoveHook(vnode, rm) {\n    if (isDef(rm) || isDef(vnode.data)) {\n      let i\n      const listeners = cbs.remove.length + 1\n      if (isDef(rm)) {\n        // we have a recursively passed down rm callback\n        // increase the listeners count\n        rm.listeners += listeners\n      } else {\n        // directly removing\n        rm = createRmCb(vnode.elm, listeners)\n      }\n      // recursively invoke hooks on child component root node\n      if (\n        isDef((i = vnode.componentInstance)) &&\n        isDef((i = i._vnode)) &&\n        isDef(i.data)\n      ) {\n        removeAndInvokeRemoveHook(i, rm)\n      }\n      for (i = 0; i < cbs.remove.length; ++i) {\n        cbs.remove[i](vnode, rm)\n      }\n      if (isDef((i = vnode.data.hook)) && isDef((i = i.remove))) {\n        i(vnode, rm)\n      } else {\n        rm()\n      }\n    } else {\n      removeNode(vnode.elm)\n    }\n  }\n\n  function updateChildren(\n    parentElm,\n    oldCh,\n    newCh,\n    insertedVnodeQueue,\n    removeOnly,\n  ) {\n    let oldStartIdx = 0\n    let newStartIdx = 0\n    let oldEndIdx = oldCh.length - 1\n    let oldStartVnode = oldCh[0]\n    let oldEndVnode = oldCh[oldEndIdx]\n    let newEndIdx = newCh.length - 1\n    let newStartVnode = newCh[0]\n    let newEndVnode = newCh[newEndIdx]\n    let oldKeyToIdx, idxInOld, elmToMove, refElm\n\n    // removeOnly is a special flag used only by <transition-group>\n    // to ensure removed elements stay in correct relative positions\n    // during leaving transitions\n    const canMove = !removeOnly\n\n    while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n      if (isUndef(oldStartVnode)) {\n        oldStartVnode = oldCh[++oldStartIdx] // Vnode has been moved left\n      } else if (isUndef(oldEndVnode)) {\n        oldEndVnode = oldCh[--oldEndIdx]\n      } else if (sameVnode(oldStartVnode, newStartVnode)) {\n        patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue)\n        oldStartVnode = oldCh[++oldStartIdx]\n        newStartVnode = newCh[++newStartIdx]\n      } else if (sameVnode(oldEndVnode, newEndVnode)) {\n        patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue)\n        oldEndVnode = oldCh[--oldEndIdx]\n        newEndVnode = newCh[--newEndIdx]\n      } else if (sameVnode(oldStartVnode, newEndVnode)) {\n        // Vnode moved right\n        patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue)\n        canMove &&\n          nodeOps.insertBefore(\n            parentElm,\n            oldStartVnode.elm,\n            nodeOps.nextSibling(oldEndVnode.elm),\n          )\n        oldStartVnode = oldCh[++oldStartIdx]\n        newEndVnode = newCh[--newEndIdx]\n      } else if (sameVnode(oldEndVnode, newStartVnode)) {\n        // Vnode moved left\n        patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue)\n        canMove &&\n          nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm)\n        oldEndVnode = oldCh[--oldEndIdx]\n        newStartVnode = newCh[++newStartIdx]\n      } else {\n        if (isUndef(oldKeyToIdx))\n          oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx)\n        idxInOld = isDef(newStartVnode.key)\n          ? oldKeyToIdx[newStartVnode.key]\n          : null\n        if (isUndef(idxInOld)) {\n          // New element\n          createElm(\n            newStartVnode,\n            insertedVnodeQueue,\n            parentElm,\n            oldStartVnode.elm,\n          )\n          newStartVnode = newCh[++newStartIdx]\n        } else {\n          elmToMove = oldCh[idxInOld]\n          /* istanbul ignore if */\n          if (process.env.NODE_ENV !== 'production' && !elmToMove) {\n            warn(\n              'It seems there are duplicate keys that is causing an update error. ' +\n                'Make sure each v-for item has a unique key.',\n            )\n          }\n          if (sameVnode(elmToMove, newStartVnode)) {\n            patchVnode(elmToMove, newStartVnode, insertedVnodeQueue)\n            oldCh[idxInOld] = undefined\n            canMove &&\n              nodeOps.insertBefore(\n                parentElm,\n                newStartVnode.elm,\n                oldStartVnode.elm,\n              )\n            newStartVnode = newCh[++newStartIdx]\n          } else {\n            // same key but different element. treat as new element\n            createElm(\n              newStartVnode,\n              insertedVnodeQueue,\n              parentElm,\n              oldStartVnode.elm,\n            )\n            newStartVnode = newCh[++newStartIdx]\n          }\n        }\n      }\n    }\n    if (oldStartIdx > oldEndIdx) {\n      refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm\n      addVnodes(\n        parentElm,\n        refElm,\n        newCh,\n        newStartIdx,\n        newEndIdx,\n        insertedVnodeQueue,\n      )\n    } else if (newStartIdx > newEndIdx) {\n      removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx)\n    }\n  }\n\n  function patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly) {\n    if (oldVnode === vnode) {\n      return\n    }\n    // reuse element for static trees.\n    // note we only do this if the vnode is cloned -\n    // if the new node is not cloned it means the render functions have been\n    // reset by the hot-reload-api and we need to do a proper re-render.\n    if (\n      isTrue(vnode.isStatic) &&\n      isTrue(oldVnode.isStatic) &&\n      vnode.key === oldVnode.key &&\n      (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))\n    ) {\n      vnode.elm = oldVnode.elm\n      vnode.componentInstance = oldVnode.componentInstance\n      return\n    }\n    let i\n    const data = vnode.data\n    if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {\n      i(oldVnode, vnode)\n    }\n    const elm = (vnode.elm = oldVnode.elm)\n    const oldCh = oldVnode.children\n    const ch = vnode.children\n    if (isDef(data) && isPatchable(vnode)) {\n      for (i = 0; i < cbs.update.length; ++i) cbs.update[i](oldVnode, vnode)\n      if (isDef((i = data.hook)) && isDef((i = i.update))) i(oldVnode, vnode)\n    }\n    if (isUndef(vnode.text)) {\n      if (isDef(oldCh) && isDef(ch)) {\n        if (oldCh !== ch)\n          updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly)\n      } else if (isDef(ch)) {\n        if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, '')\n        addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue)\n      } else if (isDef(oldCh)) {\n        removeVnodes(elm, oldCh, 0, oldCh.length - 1)\n      } else if (isDef(oldVnode.text)) {\n        nodeOps.setTextContent(elm, '')\n      }\n    } else if (oldVnode.text !== vnode.text) {\n      nodeOps.setTextContent(elm, vnode.text)\n    }\n    if (isDef(data)) {\n      if (isDef((i = data.hook)) && isDef((i = i.postpatch))) i(oldVnode, vnode)\n    }\n  }\n\n  function invokeInsertHook(vnode, queue, initial) {\n    // delay insert hooks for component root nodes, invoke them after the\n    // element is really inserted\n    if (isTrue(initial) && isDef(vnode.parent)) {\n      vnode.parent.data.pendingInsert = queue\n    } else {\n      for (let i = 0; i < queue.length; ++i) {\n        queue[i].data.hook.insert(queue[i])\n      }\n    }\n  }\n\n  let bailed = false\n  // list of modules that can skip create hook during hydration because they\n  // are already rendered on the client or has no need for initialization\n  const isRenderedModule = makeMap(\n    'attrs,style,class,staticClass,staticStyle,key',\n  )\n\n  // Note: this is a browser-only function so we can assume elms are DOM nodes.\n  function hydrate(elm, vnode, insertedVnodeQueue) {\n    if (process.env.NODE_ENV !== 'production') {\n      if (!assertNodeMatch(elm, vnode)) {\n        return false\n      }\n    }\n    vnode.elm = elm\n    const { tag, data, children } = vnode\n    if (isDef(data)) {\n      if (isDef((i = data.hook)) && isDef((i = i.init)))\n        i(vnode, true /* hydrating */)\n      if (isDef((i = vnode.componentInstance))) {\n        // child component. it should have hydrated its own tree.\n        initComponent(vnode, insertedVnodeQueue)\n        return true\n      }\n    }\n    if (isDef(tag)) {\n      if (isDef(children)) {\n        // empty element, allow client to pick up and populate children\n        if (!elm.hasChildNodes()) {\n          createChildren(vnode, children, insertedVnodeQueue)\n        } else {\n          let childrenMatch = true\n          let childNode = elm.firstChild\n          for (let i = 0; i < children.length; i++) {\n            if (\n              !childNode ||\n              !hydrate(childNode, children[i], insertedVnodeQueue)\n            ) {\n              childrenMatch = false\n              break\n            }\n            childNode = childNode.nextSibling\n          }\n          // if childNode is not null, it means the actual childNodes list is\n          // longer than the virtual children list.\n          if (!childrenMatch || childNode) {\n            if (\n              process.env.NODE_ENV !== 'production' &&\n              typeof console !== 'undefined' &&\n              !bailed\n            ) {\n              bailed = true\n              console.warn('Parent: ', elm)\n              console.warn(\n                'Mismatching childNodes vs. VNodes: ',\n                elm.childNodes,\n                children,\n              )\n            }\n            return false\n          }\n        }\n      }\n      if (isDef(data)) {\n        for (const key in data) {\n          if (!isRenderedModule(key)) {\n            invokeCreateHooks(vnode, insertedVnodeQueue)\n            break\n          }\n        }\n      }\n    } else if (elm.data !== vnode.text) {\n      elm.data = vnode.text\n    }\n    return true\n  }\n\n  function assertNodeMatch(node, vnode) {\n    if (isDef(vnode.tag)) {\n      return (\n        vnode.tag.indexOf('vue-component') === 0 ||\n        vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())\n      )\n    } else {\n      return node.nodeType === (vnode.isComment ? 8 : 3)\n    }\n  }\n\n  return function patch(\n    oldVnode,\n    vnode,\n    hydrating,\n    removeOnly,\n    parentElm,\n    refElm,\n  ) {\n    if (isUndef(vnode)) {\n      if (isDef(oldVnode)) invokeDestroyHook(oldVnode)\n      return\n    }\n\n    let isInitialPatch = false\n    const insertedVnodeQueue = []\n\n    if (isUndef(oldVnode)) {\n      // empty mount (likely as component), create new root element\n      isInitialPatch = true\n      createElm(vnode, insertedVnodeQueue, parentElm, refElm)\n    } else {\n      const isRealElement = isDef(oldVnode.nodeType)\n      if (!isRealElement && sameVnode(oldVnode, vnode)) {\n        // patch existing root node\n        patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly)\n      } else {\n        if (isRealElement) {\n          // mounting to a real element\n          // check if this is server-rendered content and if we can perform\n          // a successful hydration.\n          if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {\n            oldVnode.removeAttribute(SSR_ATTR)\n            hydrating = true\n          }\n          if (isTrue(hydrating)) {\n            if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {\n              invokeInsertHook(vnode, insertedVnodeQueue, true)\n              return oldVnode\n            } else if (process.env.NODE_ENV !== 'production') {\n              warn(\n                'The client-side rendered virtual DOM tree is not matching ' +\n                  'server-rendered content. This is likely caused by incorrect ' +\n                  'HTML markup, for example nesting block-level elements inside ' +\n                  '<p>, or missing <tbody>. Bailing hydration and performing ' +\n                  'full client-side render.',\n              )\n            }\n          }\n          // either not server-rendered, or hydration failed.\n          // create an empty node and replace it\n          oldVnode = emptyNodeAt(oldVnode)\n        }\n        // replacing existing element\n        const oldElm = oldVnode.elm\n        const parentElm = nodeOps.parentNode(oldElm)\n        createElm(\n          vnode,\n          insertedVnodeQueue,\n          // extremely rare edge case: do not insert if old element is in a\n          // leaving transition. Only happens when combining transition +\n          // keep-alive + HOCs. (#4590)\n          oldElm._leaveCb ? null : parentElm,\n          nodeOps.nextSibling(oldElm),\n        )\n\n        if (isDef(vnode.parent)) {\n          // component root element replaced.\n          // update parent placeholder node element, recursively\n          let ancestor = vnode.parent\n          while (ancestor) {\n            ancestor.elm = vnode.elm\n            ancestor = ancestor.parent\n          }\n          if (isPatchable(vnode)) {\n            for (let i = 0; i < cbs.create.length; ++i) {\n              cbs.create[i](emptyNode, vnode.parent)\n            }\n          }\n        }\n\n        if (isDef(parentElm)) {\n          removeVnodes(parentElm, [oldVnode], 0, 0)\n        } else if (isDef(oldVnode.tag)) {\n          invokeDestroyHook(oldVnode)\n        }\n      }\n    }\n\n    invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch)\n    return vnode.elm\n  }\n}\n"
  },
  {
    "path": "src/core/vdom/vnode.js",
    "content": "/* @flow */\n\nexport default class VNode {\n  tag: string | void\n  data: VNodeData | void\n  children: ?Array<VNode>\n  text: string | void\n  elm: Node | void\n  ns: string | void\n  context: Component | void // rendered in this component's scope\n  functionalContext: Component | void // only for functional component root nodes\n  key: string | number | void\n  componentOptions: VNodeComponentOptions | void\n  componentInstance: Component | void // component instance\n  parent: VNode | void // component placeholder node\n  raw: boolean // contains raw HTML? (server only)\n  isStatic: boolean // hoisted static node\n  isRootInsert: boolean // necessary for enter transition check\n  isComment: boolean // empty comment placeholder?\n  isCloned: boolean // is a cloned node?\n  isOnce: boolean // is a v-once node?\n\n  constructor(\n    tag?: string,\n    data?: VNodeData,\n    children?: ?Array<VNode>,\n    text?: string,\n    elm?: Node,\n    context?: Component,\n    componentOptions?: VNodeComponentOptions,\n  ) {\n    this.tag = tag\n    this.data = data\n    this.children = children\n    this.text = text\n    this.elm = elm\n    this.ns = undefined\n    this.context = context\n    this.functionalContext = undefined\n    this.key = data && data.key\n    this.componentOptions = componentOptions\n    this.componentInstance = undefined\n    this.parent = undefined\n    this.raw = false\n    this.isStatic = false\n    this.isRootInsert = true\n    this.isComment = false\n    this.isCloned = false\n    this.isOnce = false\n  }\n\n  // DEPRECATED: alias for componentInstance for backwards compat.\n  /* istanbul ignore next */\n  get child(): Component | void {\n    return this.componentInstance\n  }\n}\n\nexport const createEmptyVNode = () => {\n  const node = new VNode()\n  node.text = ''\n  node.isComment = true\n  return node\n}\n\nexport function createTextVNode(val: string | number) {\n  return new VNode(undefined, undefined, undefined, String(val))\n}\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nexport function cloneVNode(vnode: VNode): VNode {\n  const cloned = new VNode(\n    vnode.tag,\n    vnode.data,\n    vnode.children,\n    vnode.text,\n    vnode.elm,\n    vnode.context,\n    vnode.componentOptions,\n  )\n  cloned.ns = vnode.ns\n  cloned.isStatic = vnode.isStatic\n  cloned.key = vnode.key\n  cloned.isCloned = true\n  return cloned\n}\n\nexport function cloneVNodes(vnodes: Array<VNode>): Array<VNode> {\n  const len = vnodes.length\n  const res = new Array(len)\n  for (let i = 0; i < len; i++) {\n    res[i] = cloneVNode(vnodes[i])\n  }\n  return res\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/BaseGenerator.js",
    "content": "import { COMMON, WEB, NATIVE } from '../config'\nimport { specialObserver } from '../helpers'\nimport { RENDER_HELPER_MODULE_NAME } from '../constants'\n\nclass BaseGenerator {\n  constructor(ast, options) {\n    this.ast = ast\n    this.variableDependency = []\n    this.slots = []\n    this.vueConfig = options.vueConfig || {}\n    this.uid = 0\n\n    specialObserver(COMMON, this.setVariableDependency.bind(this))\n    specialObserver(WEB, this.setVariableDependency.bind(this))\n    specialObserver(NATIVE, this.setVariableDependency.bind(this))\n\n    this.coreCode = this.genElement(this.ast).trim()\n  }\n\n  setSlots(name) {\n    if (this.slots.indexOf(name) === -1) {\n      this.slots.push(name)\n    }\n  }\n\n  setVariableDependency(variable) {\n    if (this.variableDependency.indexOf(variable) === -1) {\n      this.variableDependency.push(variable)\n    }\n  }\n\n  generate() {\n    const importCode = this.generateImport()\n    const renderCode = this.generateRender()\n\n    return `${importCode} \\n export default ${renderCode}`\n  }\n\n  generateImport() {\n    return this.genDependence()\n  }\n\n  generateRender() {\n    let render = `return ${this.coreCode}`\n    if (this.slots.length) {\n      const slot = `const ${COMMON.renderSlot.value} = ${\n        COMMON.renderSlot.name\n      }.call(this, [${this.slots.join(',')}], this.props.children)`\n      render = `${slot}\\n${render}`\n    }\n    render = `function render (vm) {${render}}`\n    return render\n  }\n\n  genDependence() {\n    let code = ``\n    const helperDependency = this.variableDependency.filter(\n      v => v !== COMMON.createElement && v !== COMMON.component && v.alias,\n    )\n    if (helperDependency.length) {\n      code += 'import { '\n      code += helperDependency.map(v => `${v.alias} as ${v.name}`).join(',')\n      code += ` } from '${RENDER_HELPER_MODULE_NAME}'\\n`\n    }\n    code += `import {\n      ${COMMON.createElement.alias} as ${COMMON.createElement.name},\n      ${COMMON.component.alias} as ${COMMON.component.name}\n    } from 'react'\\n`\n    if (this.variableDependency.indexOf(COMMON.directive) !== -1) {\n      code += `const ${COMMON.directive.component} = ${COMMON.directive.name}(${COMMON.component.name}, ${COMMON.createElement.name})\\n`\n    }\n    if (this.variableDependency.indexOf(WEB.emptyComponent) !== -1) {\n      code += `const ${WEB.emptyComponent.component} = ${WEB.emptyComponent.name}(${COMMON.component.name}, ${COMMON.createElement.name})\\n`\n    }\n    if (this.variableDependency.indexOf(WEB.transition) !== -1) {\n      code += `const ${WEB.transition.component} = ${WEB.transition.name}(${COMMON.component.name}, ${COMMON.createElement.name})\\n`\n    }\n    // if (this.variableDependency.indexOf(WEB.transitionGroup) !== -1) {\n    //   code += `const ${WEB.transitionGroup.component} = ${WEB.transitionGroup.name}(${COMMON.component.name}, ${COMMON.createElement.name})\\n`\n    // }\n    if (this.variableDependency.indexOf(WEB.inputComponent) !== -1) {\n      code += `const ${WEB.inputComponent.component} = ${WEB.inputComponent.name}(${COMMON.component.name}, ${COMMON.createElement.name})\\n`\n    }\n    return code\n  }\n}\n\nexport default BaseGenerator\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/NativeRenderGenerator.js",
    "content": "import RenderGenerator from './RenderGenerator'\n\nimport { camelize, capitalize } from 'shared/util'\n\nimport { genHandlers, genCustomEventHandlers } from '../modules/events'\nimport { NATIVE } from '../config'\nimport parseStyleText from '../modules/style'\nimport { isReservedTag, isBuildInTag } from '../util/index'\n\nimport { HELPER_HEADER } from '../constants'\n\nclass ReactNativeRenderGenerator extends RenderGenerator {\n  constructor(ast, options) {\n    super(ast, options)\n    this.isNative = true\n  }\n\n  /**\n   * override\n   */\n  genTag(ast) {\n    let tag = ast.tag\n\n    if (isBuildInTag(tag)) {\n      tag = `${tag}`\n    } else {\n      const c = tag\n        .split(':')\n        .map(v => `['${capitalize(camelize(v))}']`)\n        .join('')\n      tag = `vm.$options.components${c}`\n    }\n\n    return tag\n  }\n\n  /**\n   * override\n   * gen text expression\n   * @param {Object} ast\n   */\n  genTextExpression(ast) {\n    let code = super.genTextExpression(ast)\n    code = code.replace(/^\"\\\\n\\s*/, '\"').replace(/\\\\n\\s*\"$/, '\"')\n    return code\n  }\n\n  /**\n   * override\n   * gen text\n   * @param {Object} ast\n   */\n  genText(ast) {\n    let code = super.genText(ast)\n    code = code.replace(/^\"\\\\n\\s*/, '\"').replace(/\\\\n\\s*\"$/, '\"')\n    return code\n  }\n\n  /**\n   * override\n   */\n  genProps(ast) {\n    let code = []\n    ast.attrs = ast.attrs || []\n    if (ast.slotTarget !== undefined) {\n      this.genSlotTarget(ast)\n    }\n    if (ast.ref || ast.parent === undefined) {\n      const ref = this.genRef(ast)\n      if (ref) {\n        code.push(ref)\n      }\n    }\n    if (ast.key !== undefined) {\n      const key = this.genKey(ast)\n      if (key) {\n        code.push(key)\n      }\n    }\n    if (Array.isArray(ast.attrs)) {\n      const props = ast.attrs\n        .filter(v => {\n          return v.name !== 'class' && v.name !== 'style' && v.name !== 'v-pre'\n        })\n        .map(v => {\n          let name = v.name\n          name = camelize(name)\n          return `${name}: ${v.value}`\n        })\n      code = code.concat(props)\n    }\n\n    const styleProps = this.genNativeStyleProps(ast)\n    if (styleProps) {\n      code.push(styleProps)\n    }\n    const eventHandler = this.genEventHandler(ast)\n    if (eventHandler) {\n      code.push(eventHandler)\n    }\n    const nativeEventHandler = this.genNativeEventHandler(ast)\n    if (nativeEventHandler) {\n      code.push(nativeEventHandler)\n    }\n\n    return code\n  }\n\n  genTemplate(ast) {\n    if (ast.parent === undefined) {\n      return this.genElement(ast.children[0])\n    } else {\n      if (ast.children.length > 1) {\n        ast.tag = 'view'\n        return this.genElement(ast)\n      } else {\n        return this.genElement(ast.children[0])\n      }\n    }\n  }\n\n  genEventHandler(ast) {\n    let code = ''\n    if (ast.events) {\n      if (isReservedTag(ast.tag) || isBuildInTag(ast.tag)) {\n        code = genHandlers(ast.events, this.vueConfig)\n      } else {\n        code = genCustomEventHandlers(ast.events, this.vueConfig)\n      }\n    }\n    return code\n  }\n\n  genNativeEventHandler(ast) {\n    let code = ''\n    if (ast.nativeEvents && !isReservedTag(ast.tag)) {\n      code = `${HELPER_HEADER}nativeEvents: {${genHandlers(\n        ast.nativeEvents,\n        this.vueConfig,\n      )}}`\n    }\n    return code\n  }\n\n  // merge style & class\n  genNativeStyleProps(ast) {\n    const classProps = this.genClassProps(ast)\n\n    const styleProps = this.genStyleProps(ast)\n\n    // merge style and class props into style\n    return `style: ${NATIVE.mergeStyleAndClass.name}(${classProps}, ${styleProps})`\n  }\n\n  /**\n   * gen style props\n   * @param {Object} ast\n   */\n  genStyleProps(ast) {\n    const styleAttrsValue = ast.attrs\n      .filter(v => v.name === 'style')\n      .map(v => v.value)\n    const show =\n      ast.directives && ast.directives.filter(v => v.name === 'show')[0]\n    const topParent = this.isAstTopParent(ast)\n    if (styleAttrsValue.length === 0 && !show && !topParent) {\n      return\n    }\n    let staticStyle, dynamicStyle, showStyle\n    styleAttrsValue.forEach(v => {\n      if (/^\".*\"$/.test(v)) {\n        staticStyle = v.trim().replace(/;*\"$/, ';\"')\n      } else {\n        dynamicStyle = v\n      }\n    })\n    if (staticStyle) {\n      try {\n        staticStyle = JSON.stringify(parseStyleText(staticStyle))\n      } catch (e) {}\n    }\n    if (show) {\n      showStyle = `{display: ${show.value} ? '' : 'none'}`\n    }\n    return `${NATIVE.bindStyle.name}(${dynamicStyle}, ${staticStyle}, ${showStyle})`\n  }\n\n  /**\n   * gen class props\n   * @param {Object} ast\n   */\n  genClassProps(ast) {\n    const topParent = this.isAstTopParent(ast)\n    const classAttrsValue = ast.attrs\n      .filter(v => v.name === 'class')\n      .map(v => v.value)\n    if (classAttrsValue.length === 0 && !topParent) {\n      return\n    }\n    let staticClass, dynamicClass\n    classAttrsValue.forEach(v => {\n      if (/^\".*\"$/.test(v) || /^'.*'$/.test(v)) {\n        staticClass = v.trim() // .replace(/^\"(.*)\"$/, '$1')\n      } else {\n        dynamicClass = v\n      }\n    })\n    let objCode = '{'\n    if (staticClass) {\n      objCode += `staticClass: ${staticClass},`\n    }\n    if (dynamicClass) {\n      objCode += `dynamicClass: ${dynamicClass},`\n    }\n    if (topParent) {\n      objCode += `parentClass: this.props.style,`\n    }\n    objCode = `${objCode.replace(/,$/, '')}}`\n    return `${NATIVE.bindClass.name}.call(this, ${objCode})`\n  }\n\n  isAstTopParent(ast) {\n    if (ast.parent === undefined) {\n      return true\n    }\n    if (\n      ast.parent.tag === 'template' ||\n      ast.parent.tag === 'transition' ||\n      ast.parent.originTag === 'transition'\n    ) {\n      if (ast.parent.parent === undefined) {\n        return true\n      }\n    }\n    return false\n  }\n}\n\nexport default ReactNativeRenderGenerator\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/RenderGenerator.js",
    "content": "import changeCase from 'change-case'\nimport { camelize } from 'shared/util'\nimport { COMMON } from '../config'\nimport { HELPER_HEADER } from '../constants'\nimport { isReservedTag, isBooleanAttr } from '../util/index'\nimport BaseGenerator from './BaseGenerator'\nimport {\n  filterDirective,\n  filterDirectiveBindProps,\n  transformSpecialNewlines,\n} from 'vue-native/compiler/helpers'\nimport { parseText } from 'vue-native/compiler/parser/text-parser'\nimport propertyMap from 'vue-native/compiler/property/index'\n\nclass RenderGenerator extends BaseGenerator {\n  genElement(ast) {\n    // text\n    if (ast.type === 3) {\n      return this.genText(ast)\n    }\n\n    // text expression\n    if (ast.type === 2) {\n      return this.genTextExpression(ast)\n    }\n\n    // for\n    if (ast.for && !ast.forProcessed) {\n      return this.genFor(ast)\n    }\n\n    // if condition\n    if (ast.if && !ast.ifProcessed) {\n      return this.genIf(ast)\n    }\n\n    if (ast.tag === 'slot') {\n      return this.genSlot(ast)\n    }\n\n    if (ast.tag === 'template') {\n      return this.genTemplate(ast)\n    }\n\n    if (ast.tag === 'transition') {\n      return this.genTransition(ast)\n    }\n\n    if (ast.tag === 'transition-group') {\n      return this.genTransitionGroup(ast)\n    }\n\n    // for web platform, we wrapped node in a buildin component to prevent IME problem\n    if (this.isWebInput(ast)) {\n      return this.genIMEResolve(ast)\n    }\n\n    const s = `${COMMON.createElement.name}(`\n    const e = `)`\n\n    let tag = this.genTag(ast)\n\n    // for directive, we transform tag to a buildin component to achieve directive lifecycle\n    if (filterDirective(ast).length) {\n      tag = COMMON.directive.component\n    }\n\n    // for dynamic component eg: <component is=\"view\">\n    if (ast.tag === 'component') {\n      tag = `${COMMON.dynamicComponent.name}(vm, ${ast.component})`\n    }\n\n    let props = this.genProps(ast)\n    if (props.length) {\n      props = `{${props.join(',')}}`\n    } else {\n      props = 'null'\n    }\n\n    // for modifiers eg: @click.native\n    if (ast.parent === undefined) {\n      // props = `Object.assign({}, this.props.${HELPER_HEADER}nativeEvents, ${props})`\n      props = `${COMMON.mergeProps.name}.call(this, this.props.${HELPER_HEADER}nativeEvents, ${props})`\n    }\n\n    // for template $props eg: v-bind:$props\n    if (filterDirectiveBindProps(ast).length) {\n      props = `Object.assign({}, vm.$props, ${props})`\n      props = `${COMMON.handleProps.name}(${props}, '${ast.tag}')`\n    }\n\n    props = `,${props}`\n\n    let children = this.genChildren(ast)\n    if (children.length) {\n      children = `,${children.join(',')}`\n    }\n\n    return `${s}${tag}${props}${children}${e}`\n  }\n\n  /**\n   * gen children, include slot template generate\n   * @param {Object} ast\n   */\n  genChildren(ast) {\n    let children = []\n    if (ast.children && ast.children.length) {\n      children = children.concat(\n        ast.children.map(v => {\n          return this.genElement(v)\n        }),\n      )\n    }\n    if (ast.scopedSlots) {\n      children = children.concat(\n        Object.keys(ast.scopedSlots)\n          .map(v => ast.scopedSlots[v])\n          .map(v => {\n            const slotCode = this.genElement(v) || ''\n            const slotScope = v.slotScope\n            const render = `render: (${slotScope}) => ${slotCode.trim()}`\n            const type = `type: '${COMMON.template.type}'`\n            const slot = `'dataSlot': ${v.slotTarget}`\n            const code = `{${type},${render},${slot}}`\n            return code\n          }),\n      )\n    }\n    return children\n  }\n\n  /**\n   * gen text expression\n   * @param {Object} ast\n   */\n  genTextExpression(ast) {\n    return parseText(ast.text)\n  }\n\n  /**\n   * gen text\n   * @param {Object} ast\n   */\n  genText(ast) {\n    const text = transformSpecialNewlines(ast.text).replace(/[ \\t\\n]+/g, ' ')\n    return JSON.stringify(text)\n  }\n\n  /**\n   * gen if condition\n   * @param {Object} ast\n   */\n  genIf(ast) {\n    ast.ifProcessed = true\n    return this.genIfConditions(ast.ifConditions.slice())\n  }\n\n  genIfConditions(conditions) {\n    if (!conditions.length) {\n      return 'null'\n    }\n    const condition = conditions.shift()\n    let code\n    if (condition.exp) {\n      code = `(${condition.exp}) ?${this.genElement(\n        condition.block,\n      )} : ${this.genIfConditions(conditions)}`\n    } else {\n      code = `${this.genElement(condition.block)}`\n    }\n    return code\n  }\n\n  /**\n   * gen for\n   * @param {Object} ast\n   */\n  genFor(ast) {\n    const exp = ast.for\n    const alias = ast.alias\n    const iterator1 = ast.iterator1 ? `,${ast.iterator1}` : ''\n    const iterator2 = ast.iterator2 ? `,${ast.iterator2}` : ''\n\n    ast.forProcessed = true\n\n    const code = `${\n      COMMON.renderList.name\n    }(${exp}, function (${alias}${iterator1}${iterator2}){return ${this.genElement(\n      this.genKeyFor(ast),\n    )}}.bind(this))`\n    return code\n  }\n\n  /**\n   * gen slot\n   * @param {Object} ast\n   */\n  genSlot(ast) {\n    const name = ast.slotName\n    const props = []\n    this.setSlots(ast.slotName)\n    if (Array.isArray(ast.attrs)) {\n      ast.attrs.forEach(v => {\n        props.push(`${v.name}: ${v.value}`)\n      })\n    }\n    let code = `${COMMON.renderSlot.value}(${name}, {${props.join(',')}})`\n    this.genChildrenKey(ast)\n    const children = this.genChildren(ast)\n    if (children.length) {\n      code += ` || [${children.join(',')}]`\n    }\n    return code\n  }\n\n  /**\n   * gen a empty component\n   * @param {Object} ast\n   */\n  genTemplate(ast) {\n    return this.genElement(ast.children[0])\n  }\n\n  /**\n   * gen children key\n   * @param {Object} ast\n   */\n  genChildrenKey(ast) {\n    ast.children.forEach((v, i) => {\n      v.attrs = v.attrs || []\n      v.attrs.push({\n        name: 'key',\n        value: String(i),\n      })\n    })\n  }\n\n  /**\n   * gen transition helper, this function would be override by sub class\n   * @param {Object} ast\n   */\n  genTransition(ast) {\n    return this.genChildren(ast)\n  }\n\n  /**\n   * gen transition group helper, this function would be override by sub class\n   * @param {Object} ast\n   */\n  genTransitionGroup(ast) {\n    return this.genChildren(ast)\n  }\n\n  /**\n   * gen props, this funciton would be override by sub class\n   * @param {Object} ast\n   */\n  genProps(ast) {\n    let code = []\n    if (filterDirective(ast).length) {\n      const directives = this.genDirectives(ast)\n      if (directives) {\n        code.push(directives)\n      }\n      const directiveTag = this.genDirectiveTag(ast)\n      if (directiveTag) {\n        code.push(directiveTag)\n      }\n      const directiveContext = this.genDirectiveContext(ast)\n      if (directiveContext) {\n        code.push(directiveContext)\n      }\n    }\n    if (ast.slotTarget !== undefined) {\n      this.genSlotTarget(ast)\n    }\n    if (ast.ref || ast.parent === undefined) {\n      const ref = this.genRef(ast)\n      if (ref) {\n        code.push(ref)\n      }\n    }\n    if (ast.key !== undefined) {\n      const key = this.genKey(ast)\n      if (key) {\n        code.push(key)\n      }\n    }\n    if (Array.isArray(ast.attrsList)) {\n      ast.attrsList.forEach(v => {\n        if (v.name === 'v-bind' && /^\\{.*\\}$/.test(v.value)) {\n          try {\n            const matchVArr = v.value.match(/^\\{(.*)\\}$/)\n            if (matchVArr && matchVArr[1]) {\n              matchVArr[1].split(',').forEach(_v => {\n                const _vArr = _v.split(':')\n                if (_vArr.length === 2) {\n                  ast.attrs.push({\n                    name: _vArr[0].trim().replace(/'|\"/g, ''),\n                    value: _vArr[1].trim(),\n                  })\n                }\n              })\n            }\n          } catch (e) {\n            console.log('parse error for v-bind obj')\n          }\n        }\n      })\n    }\n    if (Array.isArray(ast.attrs)) {\n      const props = ast.attrs\n        .filter(v => {\n          return v.name !== 'class' && v.name !== 'style' && v.name !== 'v-pre'\n        })\n        .map(v => {\n          let value = v.value\n          let name = v.name\n          if (\n            name.indexOf('data-') === 0 ||\n            name.indexOf(HELPER_HEADER) === 0\n          ) {\n            return `'${name}': ${value}`\n          }\n          if (name === 'for') {\n            name = 'htmlFor'\n          }\n          if (isBooleanAttr(name)) {\n            if (value === '\"\"') {\n              value = 'true'\n            }\n          }\n          if (!isReservedTag(ast.tag)) {\n            name = camelize(name)\n          } else if (propertyMap[name]) {\n            name = propertyMap[name]\n          }\n          return `'${name}': ${value}`\n        })\n      code = code.concat(props)\n    }\n    return code\n  }\n\n  /**\n   * gen common directive, this function would be override by SubClass\n   */\n  genDirectives(ast) {\n    let code = []\n    ast.directives.forEach(v => {\n      code.push(\n        `{name:\"${v.name}\",directiveName:\"${changeCase.lowerCase(\n          changeCase.camelCase(v.name),\n        )}\",rawName:\"${v.rawName}\"${\n          v.value\n            ? `,value:(${v.value}),expression:${JSON.stringify(v.value)}`\n            : ''\n        }${v.arg ? `,arg:\"${v.arg}\"` : ''}${\n          v.modifiers ? `,modifiers:${JSON.stringify(v.modifiers)}` : ''\n        }}`,\n      )\n    })\n    code = `${COMMON.directive.name}: [${code.join(',')}]`\n    return code\n  }\n\n  genDirectiveTag(ast) {\n    let code = ''\n    code += `${COMMON.directive.tag}: ${this.genTag(ast)}`\n    return code\n  }\n\n  // eslint-disable-next-line no-unused-vars\n  genDirectiveContext(ast) {\n    let code = ''\n    code += `${COMMON.directive.context}: this`\n    return code\n  }\n\n  /**\n   * gen slot props\n   * @param {Object} ast\n   */\n  genSlotTarget(ast) {\n    ast.attrs = ast.attrs || []\n    ast.attrs.push({\n      name: 'dataSlot',\n      value: ast.slotTarget,\n    })\n  }\n\n  genKey(ast) {\n    return `key: ${ast.key}`\n  }\n\n  /**\n   * gen key in for iterator\n   * @param {Object} ast\n   */\n  genKeyFor(ast) {\n    if (!ast.key) {\n      const obj = {}\n      obj.name = 'key'\n      obj.value = 'arguments[1]'\n      ast.attrs = ast.attrs || []\n      ast.attrs.push(obj)\n    }\n    return ast\n  }\n\n  /**\n   * gen ref\n   */\n  genRef(ast) {\n    let code1 = ''\n    let code2 = ''\n    if (ast.ref) {\n      code1 = `this.setRef(ref, ${ast.ref}, ${ast.refInFor});`\n    }\n    if (ast.parent === undefined) {\n      // setRootRef for $el, this.props.setRef for transition component\n      code2 = `this.setRootRef(ref);this.props['${COMMON.setRef.name}'] && this.props['${COMMON.setRef.name}'](ref);`\n    }\n    return `ref: (ref) => {\n      ${code1}${code2}\n    }`\n  }\n\n  /**\n   * wrapped node in a buildin component to prevent IME problem\n   * @param {Object} ast\n   */\n  genIMEResolve(ast) {\n    ast.inputProcessed = true\n    return this.genElement(ast)\n  }\n\n  /**\n   * generate react tag, this funciton would be override by sub class\n   * @param {String} tag\n   */\n  genTag(ast) {\n    return ast.tag\n  }\n\n  /**\n   * for web platform, we wrapped node in a buildin component to prevent IME problem\n   * @param {Object} ast\n   */\n  isWebInput(ast) {\n    if (!ast.inputProcessed) {\n      if (ast.tag === 'textarea') {\n        return true\n      } else if (ast.tag === 'input') {\n        const type = ast.attrs.filter(v => v.name === 'type')[0]\n        if (type === undefined) {\n          return true\n        } else if (type.value === 'text' || type.value === 'password') {\n          return true\n        }\n      }\n    }\n    return false\n  }\n}\n\nexport default RenderGenerator\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/WebRenderGenerator.js",
    "content": "import { baseWarn } from 'compiler/helpers'\nimport { camelize, capitalize } from 'shared/util'\nimport RenderGenerator from './RenderGenerator'\nimport { WEB } from '../config'\nimport { HELPER_HEADER } from '../constants'\nimport {\n  genHandlers,\n  genCustomEventHandlers,\n  genTransitionEventHandlers,\n} from '../modules/events'\nimport parseStyleText from '../modules/style'\nimport {\n  model as genModelDirectives,\n  html as genHtmlDirectives,\n  text as genTextDirectives,\n} from '../directives/index'\nimport { isReservedTag, isBuildInTag } from '../util/index'\n\nclass ReactWebRenderGenerator extends RenderGenerator {\n  /**\n   * override\n   */\n  genTag(ast) {\n    let tag = ast.tag\n\n    if (isReservedTag(tag)) {\n      tag = `'${tag}'`\n    } else if (isBuildInTag(tag)) {\n      tag = `${tag}`\n    } else {\n      // Add support for react-router\n      //\n      if (tag === 'router-link') {\n        tag = 'touchable-opacity'\n      }\n      tag = `vm.$options.components['${capitalize(camelize(tag))}']`\n    }\n\n    return tag\n  }\n\n  /**\n   * override\n   */\n  genProps(ast) {\n    let code = []\n    code = code.concat(super.genProps(ast))\n    ast.attrs = ast.attrs || []\n    if (this.vueConfig.scopeId) {\n      code.push(`'${this.vueConfig.scopeId}': ''`)\n    }\n    const classProps = this.genClassProps(ast)\n    if (classProps) {\n      code.push(classProps)\n    }\n    const styleProps = this.genStyleProps(ast)\n    if (styleProps) {\n      code.push(styleProps)\n    }\n    const eventHandler = this.genEventHandler(ast)\n    if (eventHandler) {\n      code.push(eventHandler)\n    }\n    const nativeEventHandler = this.genNativeEventHandler(ast)\n    if (nativeEventHandler) {\n      code.push(nativeEventHandler)\n    }\n    return code\n  }\n\n  /**\n   * override\n   */\n  genTemplate(ast) {\n    if (ast.parent === undefined) {\n      return this.genElement(ast.children[0])\n    } else {\n      ast.tag = WEB.emptyComponent.component\n      return this.genElement(ast)\n    }\n  }\n\n  /**\n   * override\n   */\n  genTransition(ast) {\n    ast.originTag = ast.tag\n    ast.tag = WEB.transition.component\n    ast.attrs = ast.attrs || []\n    const obj = {\n      name: WEB.transition.collection,\n      value: '',\n    }\n    const arr = []\n    let i = 0\n    ast.children.forEach(v1 => {\n      if (v1.if) {\n        const conditionsArr = []\n        v1.ifProcessed = true\n        v1.ifConditions.forEach(v2 => {\n          conditionsArr.push(`{\n            index: ${i++},\n            exp: ${v2.block.else ? true : v2.exp},\n            element: ${this.genElement(v2.block)}\n          }`)\n        })\n        arr.push(`{\n          type: 'if',\n          conditions: [${conditionsArr.join(',')}]\n        }`)\n      } else if (\n        Array.isArray(v1.directives) &&\n        v1.directives.filter(v => v.name === 'show').length\n      ) {\n        v1.directives.forEach(v => {\n          if (v.name === 'show') {\n            arr.push(`{\n              index: ${i++},\n              type: 'show',\n              exp: ${v.value},\n              element: ${this.genElement(v1)}\n            }`)\n          }\n        })\n      } else if (v1.key) {\n        arr.push(`{\n          index: ${i++},\n          type: 'key',\n          exp: ${v1.key},\n          element: ${this.genElement(v1)}\n        }`)\n      } else if (v1.component !== undefined) {\n        arr.push(`{\n          index: ${i++},\n          type: 'component',\n          exp: ${v1.component},\n          element: ${this.genElement(v1)}\n        }`)\n      } else {\n        arr.push(`{\n          index: ${i++},\n          exp: ${v1.component},\n          element: ${this.genElement(v1)}\n        }`)\n      }\n    })\n    obj.value = `[${arr.join(',')}]`\n    ast.attrs.push(obj)\n    ast.children = []\n    return this.genElement(ast)\n  }\n\n  /**\n   * override unfinished\n   */\n  genTransitionGroup(ast) {\n    const node = {\n      tag: 'span',\n      children: ast.children,\n      parent: ast.parent,\n    }\n    return this.genElement(node)\n  }\n  _genTransitionGroup(ast) {\n    ast.tag = WEB.transitionGroup.component\n    ast.attrs = ast.attrs || []\n    const obj = {\n      name: WEB.transitionGroup.collection,\n      value: '',\n    }\n    const arr = []\n    ast.children.forEach(v1 => {\n      if (v1.if) {\n        const conditionsArr = []\n        v1.ifProcessed = true\n        v1.ifConditions.forEach(v2 => {\n          conditionsArr.push(`{\n            exp: ${v2.block.else ? true : v2.exp},\n            element: ${this.genElement(v2.block)}\n          }`)\n        })\n        arr.push(`{\n          type: 'if',\n          conditions: [${conditionsArr.join(',')}]\n        }`)\n      } else if (\n        Array.isArray(v1.directives) &&\n        v1.directives.filter(v => v.name === 'show').length\n      ) {\n        v1.directives.forEach(v => {\n          if (v.name === 'show') {\n            arr.push(`{\n              type: 'show',\n              exp: ${v.value},\n              element: ${this.genElement(v1)}\n            }`)\n          }\n        })\n      } else {\n        arr.push(`{\n          exp: true,\n          element: ${this.genElement(v1)}\n        }`)\n      }\n    })\n    obj.value = `[${arr.join(',')}]`\n    ast.attrs.push(obj)\n    ast.children = []\n    return this.genElement(ast)\n  }\n\n  /**\n   * gen class props\n   * @param {Object} ast\n   */\n  genClassProps(ast) {\n    let code = ''\n    const topParent = this.isAstTopParent(ast)\n    const classAttrsValue = ast.attrs\n      .filter(v => v.name === 'class')\n      .map(v => v.value)\n    if (classAttrsValue.length === 0 && !topParent) {\n      return code\n    }\n    let staticClass, dynamicClass\n    classAttrsValue.forEach(v => {\n      if (/^\".*\"$/.test(v) || /^'.*'$/.test(v)) {\n        staticClass = v.trim() // .replace(/^\"(.*)\"$/, '$1')\n      } else {\n        dynamicClass = v\n      }\n    })\n    if (staticClass) {\n      code += ` ${staticClass}`\n    }\n    if (dynamicClass) {\n      code = code.replace(/\"$/, ' \"')\n      code += ` + ${WEB.bindClass.name}(${dynamicClass})`\n    }\n    if (topParent) {\n      code += `+ ' ' + (this.props.className || '')`\n    }\n    code = `className: (${code.trim().replace(/^[\\s]*\\+[\\s]*/, '')}).trim()`\n    return code\n  }\n\n  /**\n   * gen style props\n   * @param {Object} ast\n   */\n  genStyleProps(ast) {\n    const styleAttrsValue = ast.attrs\n      .filter(v => v.name === 'style')\n      .map(v => v.value)\n    const show =\n      ast.directives && ast.directives.filter(v => v.name === 'show')[0]\n    const topParent = this.isAstTopParent(ast)\n    if (styleAttrsValue.length === 0 && !show && !topParent) {\n      return\n    }\n    let staticStyle, dynamicStyle, showStyle\n    styleAttrsValue.forEach(v => {\n      if (/^\".*\"$/.test(v)) {\n        staticStyle = v.trim().replace(/;*\"$/, ';\"')\n      } else {\n        dynamicStyle = v\n      }\n    })\n    let code = ''\n    if (staticStyle) {\n      try {\n        staticStyle = JSON.stringify(parseStyleText(staticStyle))\n      } catch (e) {}\n    }\n    if (show) {\n      showStyle = `{display: ${show.value} ? '' : 'none'}`\n    }\n    if (topParent) {\n      showStyle = `Object.assign({}, ${showStyle}, this.props.style)`\n    }\n    code = `${WEB.bindStyle.name}(${dynamicStyle}, ${staticStyle}, ${showStyle})`\n    code = `style: ${code.trim().replace(/^[\\s]*\\+[\\s]*/, '')}`\n    return code\n  }\n\n  /**\n   * override\n   * @param {Object} ast\n   */\n  genIMEResolve(ast) {\n    ast.attrs = ast.attrs || []\n    ast.attrs.push({\n      name: WEB.inputComponent.tag,\n      value: `'${ast.tag}'`,\n    })\n    ast.tag = WEB.inputComponent.component\n    return this.genElement(ast)\n  }\n\n  genDirectives(ast) {\n    const code = super.genDirectives(ast)\n    ast.directives.forEach(v => {\n      if (v.name === 'model') {\n        this.genModelDirectives(ast, v)\n      } else if (v.name === 'html') {\n        this.genHtmlDirectives(ast)\n      } else if (v.name === 'text') {\n        this.genTextDirectives(ast)\n      }\n    })\n    return code\n  }\n\n  genModelDirectives(ast, directive) {\n    return genModelDirectives(ast, directive, baseWarn)\n  }\n\n  genHtmlDirectives(ast) {\n    return genHtmlDirectives(ast)\n  }\n\n  genTextDirectives(ast) {\n    return genTextDirectives(ast)\n  }\n\n  genEventHandler(ast) {\n    let code = ''\n    if (ast.events) {\n      if (isReservedTag(ast.tag) || isBuildInTag(ast.tag)) {\n        if (ast.tag === WEB.transition.component) {\n          code = genTransitionEventHandlers(ast.events, this.vueConfig)\n        } else {\n          code = genHandlers(ast.events, this.vueConfig)\n        }\n      } else {\n        code = genCustomEventHandlers(ast.events, this.vueConfig)\n        // code = Object.keys(ast.events).map(k => {\n        //   return `'${COMMON.customEvent.name}${k}': ${ast.events[k].value}`\n        // }).join(',')\n      }\n    }\n    return code\n  }\n\n  genNativeEventHandler(ast) {\n    let code = ''\n    if (ast.nativeEvents && !isReservedTag(ast.tag)) {\n      code = `${HELPER_HEADER}nativeEvents: {${genHandlers(\n        ast.nativeEvents,\n        this.vueConfig,\n      )}}`\n    }\n    return code\n  }\n\n  isAstTopParent(ast) {\n    if (ast.parent === undefined) {\n      return true\n    }\n    if (\n      ast.parent.tag === 'template' ||\n      ast.parent.tag === 'transition' ||\n      ast.parent.originTag === 'transition'\n    ) {\n      if (ast.parent.parent === undefined) {\n        return true\n      }\n    }\n    return false\n  }\n}\n\nexport default ReactWebRenderGenerator\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/index.js",
    "content": "import WebRenderGenerator from './WebRenderGenerator'\nimport NativeRenderGenerator from './NativeRenderGenerator'\n\nexport { WebRenderGenerator, NativeRenderGenerator }\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/config.js",
    "content": "import {\n  TAB_INDENT,\n  CREATE_ELEMENT,\n  HELPER_HEADER,\n  COMPONENT,\n} from './constants'\n\nconst COMMON = {\n  createElement: {\n    name: `${HELPER_HEADER}${CREATE_ELEMENT}`,\n    alias: CREATE_ELEMENT,\n  },\n  component: {\n    name: `${HELPER_HEADER}${COMPONENT}`,\n    alias: COMPONENT,\n  },\n  renderSlot: {\n    name: `${HELPER_HEADER}renderSlot`,\n    value: `${HELPER_HEADER}slotSet`,\n    defaultSlot: `${HELPER_HEADER}defaultSlot`,\n    slotTag: `${HELPER_HEADER}slotTag`,\n    alias: 'renderSlot',\n  },\n  template: {\n    name: `${HELPER_HEADER}template`,\n    type: `${HELPER_HEADER}template`,\n    alias: 'template',\n  },\n  renderList: {\n    name: `${HELPER_HEADER}renderList`,\n    alias: 'renderList',\n  },\n  toNumber: {\n    name: `${HELPER_HEADER}toNumber`,\n    alias: 'toNumber',\n  },\n  checkKeyCodes: {\n    name: `${HELPER_HEADER}checkKeyCodes`,\n    alias: 'checkKeyCodes',\n  },\n  looseEqual: {\n    name: `${HELPER_HEADER}looseEqual`,\n    alias: 'looseEqual',\n  },\n  looseIndexOf: {\n    name: `${HELPER_HEADER}looseIndexOf`,\n    alias: 'looseIndexOf',\n  },\n  toString: {\n    name: `${HELPER_HEADER}toString`,\n    alias: '_toString',\n  },\n  resolveFilter: {\n    name: `${HELPER_HEADER}resolveFilter`,\n    alias: 'resolveFilter',\n  },\n  event: {\n    name: `${HELPER_HEADER}event`,\n    alias: 'event',\n  },\n  directive: {\n    name: `${HELPER_HEADER}buildDirective`,\n    alias: 'buildDirective',\n    component: `${HELPER_HEADER}directiveComponent`,\n    tag: `${HELPER_HEADER}directiveTag`,\n    context: `${HELPER_HEADER}directiveContext`,\n  },\n  dynamicComponent: {\n    name: `${HELPER_HEADER}dynamicComponent`,\n    alias: 'dynamicComponent',\n  },\n  setRef: {\n    name: `${HELPER_HEADER}setRef`,\n  },\n  customEvent: {\n    name: `${HELPER_HEADER}customEvent`,\n  },\n  handleProps: {\n    name: `${HELPER_HEADER}handleProps`,\n    alias: 'handleProps',\n  },\n  mergeProps: {\n    name: `${HELPER_HEADER}mergeProps`,\n    alias: 'mergeProps',\n  },\n}\n\nconst WEB = {\n  bindClass: {\n    name: `${HELPER_HEADER}bindClass`,\n    alias: `bindWebClass`,\n  },\n  bindStyle: {\n    name: `${HELPER_HEADER}bindStyle`,\n    alias: `bindWebStyle`,\n  },\n  emptyComponent: {\n    name: `${HELPER_HEADER}buildEmptyComponent`,\n    alias: 'buildWebEmptyComponent',\n    component: `${HELPER_HEADER}EmptyComponent`,\n  },\n  inputComponent: {\n    name: `${HELPER_HEADER}buildInputComponent`,\n    alias: 'buildWebInputComponent',\n    tag: `${HELPER_HEADER}inputComponentTag`,\n    component: `${HELPER_HEADER}InputComponent`,\n  },\n  transition: {\n    name: `${HELPER_HEADER}transition`,\n    alias: `buildWebTransition`,\n    component: `${HELPER_HEADER}transitionComponent`,\n    collection: `${HELPER_HEADER}transitionCollection`,\n  },\n  // unfinished\n  transitionGroup: {\n    name: `${HELPER_HEADER}transitionGroup`,\n    alias: `buildWebTransitionGroup`,\n    component: `${HELPER_HEADER}transitionGroupComponent`,\n    collection: `${HELPER_HEADER}transitionGroupCollection`,\n  },\n}\n\nconst NATIVE = {\n  bindClass: {\n    name: `${HELPER_HEADER}bindClass`,\n    alias: `bindNativeClass`,\n  },\n  bindStyle: {\n    name: `${HELPER_HEADER}bindStyle`,\n    alias: `bindNativeStyle`,\n  },\n  mergeStyleAndClass: {\n    name: HELPER_HEADER + 'mergeNativeStyleAndNativeClass',\n    alias: 'mergeNativeStyleAndNativeClass',\n  },\n}\n\nexport { COMMON, WEB, NATIVE, TAB_INDENT, CREATE_ELEMENT }\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/constants.js",
    "content": "const TAB_INDENT = '    '\nconst CREATE_ELEMENT = 'createElement'\nconst COMPONENT = 'Component'\nconst HELPER_HEADER = '__react__vue__'\nconst HELPER_HEADER_NATIVE = '__react__vue__native__'\nconst RENDER_HELPER_MODULE_NAME = 'vue-native-helper'\n\nexport {\n  TAB_INDENT,\n  CREATE_ELEMENT,\n  COMPONENT,\n  HELPER_HEADER,\n  HELPER_HEADER_NATIVE,\n  RENDER_HELPER_MODULE_NAME,\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/html.js",
    "content": "export default function html(ast) {\n  const obj = {}\n  const directive = ast.directives.filter(v => v.name === 'html')[0]\n  obj.name = 'dangerouslySetInnerHTML'\n  obj.value = `{__html: '${directive.value}'}`\n  ast.attrs = ast.attrs || []\n  ast.attrs.push(obj)\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/index.js",
    "content": "import model from './model'\nimport html from './html'\nimport text from './text'\n\nexport { model, html, text }\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/model.js",
    "content": "/* @flow */\n\nimport config from 'core/config'\nimport { addHandler, addAttr, getBindingAttr } from 'compiler/helpers'\nimport { genAssignmentCode } from 'compiler/directives/model'\nimport { COMMON, WEB } from '../config'\n\n// in some cases, the event used has to be determined at runtime\n// so we used some reserved tokens during compile.\n\nexport default function model(\n  el: ASTElement,\n  dir: ASTDirective,\n  warn: Function,\n): ?boolean {\n  const value = dir.value\n  const modifiers = dir.modifiers\n  const tag = el.tag\n  const type = el.attrsMap.type\n\n  if (process.env.NODE_ENV !== 'production') {\n    const dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type']\n    if (tag === 'input' && dynamicType) {\n      warn(\n        `<input :type=\"${dynamicType}\" v-model=\"${value}\">:\\n` +\n          `v-model does not support dynamic input types. Use v-if branches instead.`,\n      )\n    }\n    // inputs with type=\"file\" are read only and setting the input's\n    // value will throw an error.\n    if (tag === 'input' && type === 'file') {\n      warn(\n        `<${el.tag} v-model=\"${value}\" type=\"file\">:\\n` +\n          `File inputs are read only. Use a v-on:change listener instead.`,\n      )\n    }\n  }\n\n  if (tag === 'select') {\n    genSelect(el, value, modifiers)\n  } else if (tag === 'input' && type === 'checkbox') {\n    genCheckboxModel(el, value, modifiers)\n  } else if (tag === 'input' && type === 'radio') {\n    genRadioModel(el, value, modifiers)\n  } else if (\n    tag === 'input' ||\n    tag === 'textarea' ||\n    tag === WEB.inputComponent.component\n  ) {\n    genDefaultModel(el, value, modifiers)\n  } else if (!config.isReservedTag(tag)) {\n    genComponentModel(el, value, modifiers)\n    // component v-model doesn't need extra runtime\n    return false\n  } else if (process.env.NODE_ENV !== 'production') {\n    warn(\n      `<${el.tag} v-model=\"${value}\">: ` +\n        `v-model is not supported on this element type. ` +\n        \"If you are working with contenteditable, it's recommended to \" +\n        'wrap a library dedicated for that purpose inside a custom component.',\n    )\n  }\n\n  // ensure runtime directive metadata\n  return true\n}\n\nfunction genCheckboxModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n) {\n  const number = modifiers && modifiers.number\n  const valueBinding = getBindingAttr(el, 'value') || 'null'\n  const trueValueBinding = getBindingAttr(el, 'true-value') || 'true'\n  const falseValueBinding = getBindingAttr(el, 'false-value') || 'false'\n  addAttr(\n    el,\n    'checked',\n    `Array.isArray(${value})` +\n      `?${COMMON.looseIndexOf.name}(${value},${valueBinding})>-1` +\n      (trueValueBinding === 'true'\n        ? `:(${value})`\n        : `:${COMMON.looseEqual.name}(${value},${trueValueBinding})`),\n  )\n  addHandler(\n    el,\n    'change',\n    `var $$a=${value},` +\n      `$$el=$event.target,` +\n      `$$c=$$el.checked?(${trueValueBinding}):(${falseValueBinding});` +\n      `if(Array.isArray($$a)){` +\n      `var $$v=${\n        number ? COMMON.toNumber.name + '(' + valueBinding + ')' : valueBinding\n      },` +\n      `$$i=${COMMON.looseIndexOf.name}($$a,$$v);` +\n      `if($$c){$$i<0&&(${value}=$$a.concat($$v))}` +\n      `else{$$i>-1&&(${value}=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}` +\n      `}else{${genAssignmentCode(value, '$$c')}}`,\n    null,\n    true,\n  )\n}\n\nfunction genRadioModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n) {\n  const number = modifiers && modifiers.number\n  let valueBinding = getBindingAttr(el, 'value') || 'null'\n  valueBinding = number\n    ? `${COMMON.toNumber.name}(${valueBinding})`\n    : valueBinding\n  addAttr(el, 'checked', `${COMMON.looseEqual.name}(${value},${valueBinding})`)\n  addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true)\n}\n\nfunction genSelect(el: ASTElement, value: string, modifiers: ?ASTModifiers) {\n  const number = modifiers && modifiers.number\n  const selectedVal =\n    `Array.prototype.filter` +\n    `.call($event.target.options,function(o){return o.selected})` +\n    `.map(function(o){var val = \"_value\" in o ? o._value : o.value;` +\n    `return ${number ? COMMON.toNumber.name + '(val)' : 'val'}})`\n\n  const assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'\n  let code = `var $$selectedVal = ${selectedVal};`\n  code = `${code} ${genAssignmentCode(value, assignment)}`\n  addAttr(el, 'value', `(${value}) == null ? '' : (${value})`)\n  addHandler(el, 'change', code, null, true)\n}\n\nfunction genDefaultModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n): ?boolean {\n  const type = el.attrsMap.type\n  const { lazy, number, trim } = modifiers || {}\n\n  let valueExpression = '$event.target.value'\n  if (trim) {\n    valueExpression = `$event.target.value.trim()`\n  }\n  if (number) {\n    valueExpression = `${COMMON.toNumber.name}(${valueExpression})`\n  }\n\n  const code = genAssignmentCode(value, valueExpression)\n  // const needCompositionGuard = !lazy && type !== 'range'\n  // if (needCompositionGuard) {\n  //   code = `if($event.target.composing)return;${code}`\n  // }\n\n  addAttr(el, 'value', `(${value}) == null ? '' : (${value})`)\n  if (lazy) {\n    addHandler(el, 'blur', code, null, true)\n  } else {\n    addHandler(el, 'change', code, null, true)\n  }\n  if (trim || number || type === 'number') {\n    addHandler(el, 'blur', 'this.forceUpdate()')\n  }\n}\n\nfunction genComponentModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n) {\n  const { number, trim } = modifiers || {}\n\n  const baseValueExpression = 'arguments[0]'\n  let valueExpression = baseValueExpression\n  if (trim) {\n    valueExpression =\n      `(typeof ${baseValueExpression} === 'string'` +\n      `? ${baseValueExpression}.trim()` +\n      `: ${baseValueExpression})`\n  }\n  if (number) {\n    valueExpression = `${COMMON.toNumber.name}(${valueExpression})`\n  }\n\n  // let valueExpression = 'value'\n  // if (trim) {\n  //   valueExpression = `value.trim()`\n  // }\n  // if (number) {\n  //   valueExpression = `${COMMON.toNumber.name}(${valueExpression})`\n  // }\n\n  let code = genAssignmentCode(value, valueExpression)\n  code = `function () {${code}}`\n\n  addAttr(el, 'value', `(${value}) == null ? '' : (${value})`)\n  addHandler(el, 'input', code, null, true)\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/text.js",
    "content": "export default function text(ast) {\n  const children = []\n  const directive = ast.directives.filter(v => v.name === 'text')[0]\n  children.push({\n    type: 2,\n    text: `{{ ${directive.value} }}`,\n  })\n  ast.children = children\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/helpers.js",
    "content": "import { isUnaryTag } from './util/index'\n\nexport function specialObserver(obj, cb) {\n  for (const key in obj) {\n    const val = obj[key]\n    if (typeof val === 'string') {\n      Object.defineProperty(obj, key, {\n        enumerable: true,\n        configurable: true,\n        get() {\n          cb && cb(obj)\n          return val\n        },\n      })\n    } else {\n      specialObserver(val, cb)\n    }\n  }\n}\n\nexport function handleUnaryTag(ast) {\n  if (!ast.children) {\n    return\n  }\n  if (isUnaryTag(ast.tag)) {\n    let unaryTagChildren = ast.children.shift()\n    while (unaryTagChildren) {\n      handleUnaryTag(unaryTagChildren)\n      ast.parent.children.push(unaryTagChildren)\n      unaryTagChildren = ast.children.shift()\n    }\n  } else {\n    let length = ast.children.length\n    while (length--) {\n      handleUnaryTag(ast.children[length])\n    }\n  }\n}\n\nexport function filterDirective(ast) {\n  const arr = ['show', 'bind']\n  if (Array.isArray(ast.directives)) {\n    return ast.directives.filter(v => arr.indexOf(v.name) === -1)\n  } else {\n    return []\n  }\n}\n\nexport function filterDirectiveBindProps(ast) {\n  if (Array.isArray(ast.directives)) {\n    return ast.directives.filter(v => v.name === 'bind' && v.value === '$props')\n  } else {\n    return []\n  }\n}\n\nexport function transformSpecialNewlines(text) {\n  return text.replace(/\\u2028/g, '\\\\u2028').replace(/\\u2029/g, '\\\\u2029')\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/index.js",
    "content": "export * from './web'\nexport * from './native'\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/modules/events.js",
    "content": "import changeCase from 'change-case'\nimport { COMMON } from '../config'\n\nconst fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/\nconst simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['.*?']|\\[\".*?\"]|\\[\\d+]|\\[[A-Za-z_$][\\w$]*])*\\s*$/\nconst EVENT_ACTION = [\n  'composition',\n  'key',\n  'context',\n  'double',\n  'drag',\n  'mouse',\n  'touch',\n  'can',\n  'play',\n  'duration',\n  'loaded',\n  'meta',\n  'load',\n  'rate',\n  'time',\n  'volume',\n  'animation',\n  'transition',\n]\n\nconst addSeparateLine = function(eventName) {\n  EVENT_ACTION.forEach(v => {\n    eventName = eventName.replace(v, v + '-')\n  })\n  return eventName\n}\n\nlet uid = 0\n\n// keyCode aliases\nlet keyCodes = {\n  esc: 27,\n  tab: 9,\n  enter: 13,\n  space: 32,\n  up: 38,\n  left: 37,\n  right: 39,\n  down: 40,\n  delete: [8, 46],\n}\n\n// #4868: modifiers that prevent the execution of the listener\n// need to explicitly return null so that we can determine whether to remove\n// the listener for .once\nconst genGuard = condition => `if(${condition})return null;`\n\nconst modifierCode = {\n  stop: '$event.stopPropagation();',\n  prevent: '$event.preventDefault();',\n  self: genGuard(`$event.target !== $event.currentTarget`),\n  ctrl: genGuard(`!$event.ctrlKey`),\n  shift: genGuard(`!$event.shiftKey`),\n  alt: genGuard(`!$event.altKey`),\n  meta: genGuard(`!$event.metaKey`),\n  left: genGuard(`'button' in $event && $event.button !== 0`),\n  middle: genGuard(`'button' in $event && $event.button !== 1`),\n  right: genGuard(`'button' in $event && $event.button !== 2`),\n}\n\nfunction genHandlers(events, options) {\n  let res = ''\n  if (options.keyCodes) {\n    keyCodes = Object.assign({}, keyCodes, options.keyCodes)\n  }\n  for (let name in events) {\n    const handler = events[name]\n    // #5330: warn click.right, since right clicks do not actually fire click events.\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      name === 'click' &&\n      handler &&\n      handler.modifiers &&\n      handler.modifiers.right\n    ) {\n      console.warn(\n        `Use \"contextmenu\" instead of \"click.right\" since right clicks ` +\n          `do not actually fire \"click\" events.`,\n      )\n    }\n    if (name.indexOf('!') === 0 || name.indexOf('~!') === 0) {\n      name += 'Capture'\n    }\n    let eventHandler = genHandler(name, handler)\n    if (name.indexOf('~') === 0) {\n      eventHandler = `this.setEventOnce(function once_${++uid}(event){(${eventHandler})(event)})`\n    }\n    eventHandler = `${COMMON.event.name}(${eventHandler})`\n    res += `on${changeCase.pascalCase(addSeparateLine(name))}: ${eventHandler},`\n  }\n  res = res.replace(/,$/, '')\n  return res\n}\n\nfunction genCustomEventHandlers(events, options) {\n  let res = ''\n  if (options.keyCodes) {\n    keyCodes = Object.assign({}, keyCodes, options.keyCodes)\n  }\n  for (let name in events) {\n    const handler = events[name]\n    // #5330: warn click.right, since right clicks do not actually fire click events.\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      name === 'click' &&\n      handler &&\n      handler.modifiers &&\n      handler.modifiers.right\n    ) {\n      console.warn(\n        `Use \"contextmenu\" instead of \"click.right\" since right clicks ` +\n          `do not actually fire \"click\" events.`,\n      )\n    }\n    if (name.indexOf('!') === 0 || name.indexOf('~!') === 0) {\n      name += 'Capture'\n    }\n    let eventHandler = genCustomHandler(name, handler)\n    if (name.indexOf('~') === 0) {\n      eventHandler = `this.setEventOnce(function once_${++uid}(event){(${eventHandler})(event)})`\n    }\n    eventHandler = `${COMMON.event.name}(${eventHandler})`\n    res += `'${COMMON.customEvent.name}${name}': ${eventHandler},`\n  }\n  res = res.replace(/,$/, '')\n  return res\n}\n\nfunction genTransitionEventHandlers(events) {\n  let res = ''\n  for (const name in events) {\n    const handler = events[name]\n    let eventHandler = genTransitionEventHandler(name, handler)\n    if (name.indexOf('~') === 0) {\n      eventHandler = `this.setEventOnce(function once_${++uid}(event){(${eventHandler})(event)})`\n    }\n    eventHandler = `${COMMON.event.name}(${eventHandler})`\n    res += `on${changeCase.pascalCase(addSeparateLine(name))}: ${eventHandler},`\n  }\n  res = res.replace(/,$/, '')\n  return res\n}\n\nfunction genHandler(name, handler) {\n  if (!handler) {\n    return 'function(){}'\n  }\n\n  if (Array.isArray(handler)) {\n    return `[${handler.map(handler => genHandler(name, handler)).join(',')}]`\n  }\n\n  const isMethodPath = simplePathRE.test(handler.value)\n  const isFunctionExpression = fnExpRE.test(handler.value)\n\n  const handlerCode = isMethodPath\n    ? handler.value + '($event)'\n    : isFunctionExpression\n    ? `(${handler.value})($event)`\n    : handler.value\n\n  if (!handler.modifiers) {\n    return `({nativeEvent: $event}) => {${handlerCode}}`\n    // return isMethodPath || isFunctionExpression\n    //   ? handler.value\n    //   : `({nativeEvent: $event}) => {${handler.value}}` // inline statement\n  } else {\n    let code = ''\n    let genModifierCode = ''\n    const keys = []\n    for (const key in handler.modifiers) {\n      if (modifierCode[key]) {\n        genModifierCode += modifierCode[key]\n        // left/right\n        if (keyCodes[key]) {\n          keys.push(key)\n        }\n      } else {\n        keys.push(key)\n      }\n    }\n    if (keys.length) {\n      code += genKeyFilter(keys)\n    }\n    // Make sure modifiers like prevent and stop get executed after key filtering\n    if (genModifierCode) {\n      code += genModifierCode\n    }\n    return `({nativeEvent: $event}) => {${code}${handlerCode}}`\n  }\n}\n\nfunction genCustomHandler(name, handler) {\n  if (!handler) {\n    return 'function(){}'\n  }\n\n  if (Array.isArray(handler)) {\n    return `[${handler.map(handler => genHandler(name, handler)).join(',')}]`\n  }\n\n  const isMethodPath = simplePathRE.test(handler.value)\n  const isFunctionExpression = fnExpRE.test(handler.value)\n\n  const handlerCode = isMethodPath\n    ? handler.value + '.apply(this, arguments)'\n    : isFunctionExpression\n    ? `(${handler.value}).apply(this, arguments)`\n    : handler.value\n\n  if (!handler.modifiers) {\n    return `function ($event) {${handlerCode}}.bind(this)`\n  } else {\n    let code = ''\n    let genModifierCode = ''\n    const keys = []\n    for (const key in handler.modifiers) {\n      if (modifierCode[key]) {\n        genModifierCode += modifierCode[key]\n        // left/right\n        if (keyCodes[key]) {\n          keys.push(key)\n        }\n      } else {\n        keys.push(key)\n      }\n    }\n    if (keys.length) {\n      code += genKeyFilter(keys)\n    }\n    // Make sure modifiers like prevent and stop get executed after key filtering\n    if (genModifierCode) {\n      code += genModifierCode\n    }\n    return `function ($event) {${code}${handlerCode}}.bind(this)`\n  }\n}\n\nfunction genTransitionEventHandler(name, handler) {\n  if (!handler) {\n    return 'function(){}'\n  }\n\n  if (Array.isArray(handler)) {\n    return `[${handler\n      .map(handler => genTransitionEventHandler(name, handler))\n      .join(',')}]`\n  }\n\n  const isMethodPath = simplePathRE.test(handler.value)\n  const isFunctionExpression = fnExpRE.test(handler.value)\n\n  const handlerCode = isMethodPath\n    ? handler.value + '.apply(this, arguments)'\n    : isFunctionExpression\n    ? `(${handler.value}).apply(this, arguments)`\n    : handler.value\n  return `function () {${handlerCode}}.bind(this)`\n}\n\nfunction genKeyFilter(keys) {\n  return `if(!('button' in $event)&&${keys\n    .map(genFilterCode)\n    .join('&&')})return null;`\n}\n\nfunction genFilterCode(key) {\n  const keyVal = parseInt(key, 10)\n  if (keyVal) {\n    return `$event.keyCode!==${keyVal}`\n  }\n  const alias = keyCodes[key]\n  return `${COMMON.checkKeyCodes.name}(vm, $event.keyCode,${JSON.stringify(\n    key,\n  )}${alias ? ',' + JSON.stringify(alias) : ''})`\n}\n\nexport { genHandlers, genCustomEventHandlers, genTransitionEventHandlers }\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/modules/style.js",
    "content": "import changeCase from 'change-case'\n\nexport default function parseStyleText(cssText) {\n  const res = {}\n  const listDelimiter = /;(?![^(]*\\))/g\n  const propertyDelimiter = /:(.+)/\n  cssText.split(listDelimiter).forEach(function(item) {\n    if (item) {\n      const tmp = item.split(propertyDelimiter)\n      if (tmp.length > 1) {\n        let val = tmp[1].trim()\n        if (isNaN(val) === false) {\n          val = parseFloat(val)\n        }\n        res[changeCase.camelCase(tmp[0].trim())] = val\n      }\n    }\n  })\n  return res\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/native.js",
    "content": "import _ from 'lodash'\n\nimport { parse, processAttrs } from 'compiler/parser/index'\n\nimport { NativeRenderGenerator } from 'vue-native/compiler/codegen/index'\n\nexport function nativeCompiler(template, options) {\n  let ast\n  let importCode = ''\n  let renderCode = '() => null'\n  options = Object.assign(\n    {\n      preserveWhitespace: false,\n    },\n    options,\n  )\n  template = template.trim()\n  if (template) {\n    ast = parse(template, options)\n    let importObj = { imports: [] }\n    traverse(ast, options, importObj)\n    let imports = importObj.imports\n    const renderer = new NativeRenderGenerator(ast, options)\n    importCode = renderer.generateImport()\n    renderCode = renderer.generateRender()\n    // Remove extra commas\n    renderCode = renderCode.replace(/\\},{2,}/g, '},')\n    renderCode = renderCode.replace(/\\),{2,}/g, '),')\n    // Add imports of the render props missing from main import\n    let requiredImports = []\n    imports.forEach(customImport => {\n      if (importCode.indexOf(customImport) === -1) {\n        requiredImports.push(customImport)\n      }\n    })\n    let requiredImportsString = requiredImports.join(',')\n    if (requiredImportsString) {\n      importCode = importCode.replace(\n        /\\} from 'vue-native-helper'/g,\n        `, ${requiredImportsString} } from 'vue-native-helper'`,\n      )\n    }\n  }\n  return {\n    ast,\n    importCode,\n    renderCode,\n  }\n}\n\nfunction traverse(ast, options, importObj, parent = null, childIndex) {\n  // Check for render-prop and render-prop-fn within child, if yes then add that as a prop\n  //\n  if (\n    ast.attrsMap &&\n    (ast.attrsMap['render-prop'] || ast.attrsMap['render-prop-fn']) &&\n    ast.parent\n  ) {\n    let slotname = ast.attrsMap['render-prop'] || ast.attrsMap['render-prop-fn']\n    if (slotname && ast.parent) {\n      // Get modules imported for slots\n      let importModules = processAttrs(ast, options, true)\n      importObj.imports = _.union(importObj.imports, importModules)\n      if (parent) {\n        delete parent.children[childIndex]\n      }\n    }\n  }\n  if (ast.children) {\n    ast.children.forEach((child, index) => {\n      if (child.ifConditions) {\n        child.ifConditions.forEach((condition, conditionIdx) => {\n          traverse(condition.block, options, importObj, child, conditionIdx)\n        })\n      }\n      traverse(child, options, importObj, ast, index)\n    })\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/parser/filter-parser.js",
    "content": "/* @flow */\nimport { COMMON } from 'vue-native/compiler/config'\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/\n\nexport function parseFilters(exp: string): string {\n  let inSingle = false\n  let inDouble = false\n  let inTemplateString = false\n  let inRegex = false\n  let curly = 0\n  let square = 0\n  let paren = 0\n  let lastFilterIndex = 0\n  let c, prev, i, expression, filters\n\n  for (i = 0; i < exp.length; i++) {\n    prev = c\n    c = exp.charCodeAt(i)\n    if (inSingle) {\n      if (c === 0x27 && prev !== 0x5c) inSingle = false\n    } else if (inDouble) {\n      if (c === 0x22 && prev !== 0x5c) inDouble = false\n    } else if (inTemplateString) {\n      if (c === 0x60 && prev !== 0x5c) inTemplateString = false\n    } else if (inRegex) {\n      if (c === 0x2f && prev !== 0x5c) inRegex = false\n    } else if (\n      c === 0x7c && // pipe\n      exp.charCodeAt(i + 1) !== 0x7c &&\n      exp.charCodeAt(i - 1) !== 0x7c &&\n      !curly &&\n      !square &&\n      !paren\n    ) {\n      if (expression === undefined) {\n        // first filter, end of expression\n        lastFilterIndex = i + 1\n        expression = exp.slice(0, i).trim()\n      } else {\n        pushFilter()\n      }\n    } else {\n      switch (c) {\n        case 0x22:\n          inDouble = true\n          break // \"\n        case 0x27:\n          inSingle = true\n          break // '\n        case 0x60:\n          inTemplateString = true\n          break // `\n        case 0x28:\n          paren++\n          break // (\n        case 0x29:\n          paren--\n          break // )\n        case 0x5b:\n          square++\n          break // [\n        case 0x5d:\n          square--\n          break // ]\n        case 0x7b:\n          curly++\n          break // {\n        case 0x7d:\n          curly--\n          break // }\n      }\n      if (c === 0x2f) {\n        // /\n        let j = i - 1\n        let p\n        // find first non-whitespace prev char\n        for (; j >= 0; j--) {\n          p = exp.charAt(j)\n          if (p !== ' ') break\n        }\n        if (!p || !validDivisionCharRE.test(p)) {\n          inRegex = true\n        }\n      }\n    }\n  }\n\n  if (expression === undefined) {\n    expression = exp.slice(0, i).trim()\n  } else if (lastFilterIndex !== 0) {\n    pushFilter()\n  }\n\n  function pushFilter() {\n    ;(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim())\n    lastFilterIndex = i + 1\n  }\n\n  if (filters) {\n    for (i = 0; i < filters.length; i++) {\n      expression = wrapFilter(expression, filters[i])\n    }\n  }\n\n  return expression\n}\n\nfunction wrapFilter(exp: string, filter: string): string {\n  const i = filter.indexOf('(')\n  if (i < 0) {\n    // _f: resolveFilter\n    return `${COMMON.resolveFilter.name}.call(vm, \"${filter}\")(${exp})`\n  } else {\n    const name = filter.slice(0, i)\n    const args = filter.slice(i + 1)\n    return `${COMMON.resolveFilter.name}.call(vm, \"${name}\")(${exp},${args}`\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/parser/text-parser.js",
    "content": "import { cached } from 'shared/util'\nimport { parseFilters } from './filter-parser'\nimport { COMMON } from 'vue-native/compiler/config'\n\nconst defaultTagRE = /\\{\\{((?:.|\\n)+?)\\}\\}/g\nconst regexEscapeRE = /[-.*+?^${}()|[\\]\\/\\\\]/g\n\nconst buildRegex = cached(delimiters => {\n  const open = delimiters[0].replace(regexEscapeRE, '\\\\$&')\n  const close = delimiters[1].replace(regexEscapeRE, '\\\\$&')\n  return new RegExp(open + '((?:.|\\\\n)+?)' + close, 'g')\n})\n\nexport function parseText(text, delimiters) {\n  const tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE\n  if (!tagRE.test(text)) {\n    return\n  }\n  const tokens = []\n  let lastIndex = (tagRE.lastIndex = 0)\n  let match, index\n  while ((match = tagRE.exec(text))) {\n    index = match.index\n    // push text token\n    if (index > lastIndex) {\n      tokens.push(JSON.stringify(text.slice(lastIndex, index)))\n    }\n    // tag token\n    const exp = parseFilters(match[1].trim())\n    tokens.push(`${COMMON.toString.name}(${exp})`)\n    lastIndex = index + match[0].length\n  }\n  if (lastIndex < text.length) {\n    tokens.push(JSON.stringify(text.slice(lastIndex)))\n  }\n  return tokens.join('+')\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/ARIADOMPropertyConfig.js",
    "content": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nvar ARIADOMPropertyConfig = {\n  Properties: {\n    // Global States and Properties\n    'aria-current': 0, // state\n    'aria-details': 0,\n    'aria-disabled': 0, // state\n    'aria-hidden': 0, // state\n    'aria-invalid': 0, // state\n    'aria-keyshortcuts': 0,\n    'aria-label': 0,\n    'aria-roledescription': 0,\n    // Widget Attributes\n    'aria-autocomplete': 0,\n    'aria-checked': 0,\n    'aria-expanded': 0,\n    'aria-haspopup': 0,\n    'aria-level': 0,\n    'aria-modal': 0,\n    'aria-multiline': 0,\n    'aria-multiselectable': 0,\n    'aria-orientation': 0,\n    'aria-placeholder': 0,\n    'aria-pressed': 0,\n    'aria-readonly': 0,\n    'aria-required': 0,\n    'aria-selected': 0,\n    'aria-sort': 0,\n    'aria-valuemax': 0,\n    'aria-valuemin': 0,\n    'aria-valuenow': 0,\n    'aria-valuetext': 0,\n    // Live Region Attributes\n    'aria-atomic': 0,\n    'aria-busy': 0,\n    'aria-live': 0,\n    'aria-relevant': 0,\n    // Drag-and-Drop Attributes\n    'aria-dropeffect': 0,\n    'aria-grabbed': 0,\n    // Relationship Attributes\n    'aria-activedescendant': 0,\n    'aria-colcount': 0,\n    'aria-colindex': 0,\n    'aria-colspan': 0,\n    'aria-controls': 0,\n    'aria-describedby': 0,\n    'aria-errormessage': 0,\n    'aria-flowto': 0,\n    'aria-labelledby': 0,\n    'aria-owns': 0,\n    'aria-posinset': 0,\n    'aria-rowcount': 0,\n    'aria-rowindex': 0,\n    'aria-rowspan': 0,\n    'aria-setsize': 0,\n  },\n  DOMAttributeNames: {},\n  DOMPropertyNames: {},\n}\n\nexport default ARIADOMPropertyConfig\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/EventConstant.js",
    "content": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n/**\n * Types of raw signals from the browser caught at the top level.\n */\nvar topLevelTypes = {\n  topAbort: null,\n  topAnimationEnd: null,\n  topAnimationIteration: null,\n  topAnimationStart: null,\n  topBlur: null,\n  topCanPlay: null,\n  topCanPlayThrough: null,\n  topChange: null,\n  topClick: null,\n  topCompositionEnd: null,\n  topCompositionStart: null,\n  topCompositionUpdate: null,\n  topContextMenu: null,\n  topCopy: null,\n  topCut: null,\n  topDoubleClick: null,\n  topDrag: null,\n  topDragEnd: null,\n  topDragEnter: null,\n  topDragExit: null,\n  topDragLeave: null,\n  topDragOver: null,\n  topDragStart: null,\n  topDrop: null,\n  topDurationChange: null,\n  topEmptied: null,\n  topEncrypted: null,\n  topEnded: null,\n  topError: null,\n  topFocus: null,\n  topInput: null,\n  topInvalid: null,\n  topKeyDown: null,\n  topKeyPress: null,\n  topKeyUp: null,\n  topLoad: null,\n  topLoadedData: null,\n  topLoadedMetadata: null,\n  topLoadStart: null,\n  topMouseDown: null,\n  topMouseMove: null,\n  topMouseOut: null,\n  topMouseOver: null,\n  topMouseUp: null,\n  topPaste: null,\n  topPause: null,\n  topPlay: null,\n  topPlaying: null,\n  topProgress: null,\n  topRateChange: null,\n  topReset: null,\n  topScroll: null,\n  topSeeked: null,\n  topSeeking: null,\n  topSelectionChange: null,\n  topStalled: null,\n  topSubmit: null,\n  topSuspend: null,\n  topTextInput: null,\n  topTimeUpdate: null,\n  topTouchCancel: null,\n  topTouchEnd: null,\n  topTouchMove: null,\n  topTouchStart: null,\n  topTransitionEnd: null,\n  topVolumeChange: null,\n  topWaiting: null,\n  topWheel: null,\n}\n\nvar EventConstants = {\n  topLevelTypes: topLevelTypes,\n}\n\nexport default EventConstants\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/HTMLDOMPropertyConfig.js",
    "content": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\nvar MUST_USE_PROPERTY = 0x1\nvar HAS_BOOLEAN_VALUE = 0x4\nvar HAS_NUMERIC_VALUE = 0x8\nvar HAS_POSITIVE_NUMERIC_VALUE = 0x10 | 0x8\nvar HAS_OVERLOADED_BOOLEAN_VALUE = 0x20\nvar ATTRIBUTE_NAME_CHAR =\n  ':A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040'\nvar HTMLDOMPropertyConfig = {\n  isCustomAttribute: RegExp.prototype.test.bind(\n    new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'),\n  ),\n  Properties: {\n    /**\n     * Standard Properties\n     */\n    accept: 0,\n    acceptCharset: 0,\n    accessKey: 0,\n    action: 0,\n    allowFullScreen: HAS_BOOLEAN_VALUE,\n    allowTransparency: 0,\n    alt: 0,\n    // specifies target context for links with `preload` type\n    as: 0,\n    async: HAS_BOOLEAN_VALUE,\n    autoComplete: 0,\n    /**\n     * react-vue change\n     */\n    // autoFocus is polyfilled/normalized by AutoFocusUtils\n    autoFocus: HAS_BOOLEAN_VALUE,\n    autoPlay: HAS_BOOLEAN_VALUE,\n    capture: HAS_BOOLEAN_VALUE,\n    cellPadding: 0,\n    cellSpacing: 0,\n    charSet: 0,\n    challenge: 0,\n    checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    cite: 0,\n    classID: 0,\n    className: 0,\n    cols: HAS_POSITIVE_NUMERIC_VALUE,\n    colSpan: 0,\n    content: 0,\n    contentEditable: 0,\n    contextMenu: 0,\n    controls: HAS_BOOLEAN_VALUE,\n    coords: 0,\n    crossOrigin: 0,\n    data: 0, // For `<object />` acts as `src`.\n    dateTime: 0,\n    default: HAS_BOOLEAN_VALUE,\n    defer: HAS_BOOLEAN_VALUE,\n    dir: 0,\n    disabled: HAS_BOOLEAN_VALUE,\n    download: HAS_OVERLOADED_BOOLEAN_VALUE,\n    draggable: 0,\n    encType: 0,\n    form: 0,\n    formAction: 0,\n    formEncType: 0,\n    formMethod: 0,\n    formNoValidate: HAS_BOOLEAN_VALUE,\n    formTarget: 0,\n    frameBorder: 0,\n    headers: 0,\n    height: 0,\n    hidden: HAS_BOOLEAN_VALUE,\n    high: 0,\n    href: 0,\n    hrefLang: 0,\n    htmlFor: 0,\n    httpEquiv: 0,\n    icon: 0,\n    id: 0,\n    inputMode: 0,\n    integrity: 0,\n    is: 0,\n    keyParams: 0,\n    keyType: 0,\n    kind: 0,\n    label: 0,\n    lang: 0,\n    list: 0,\n    loop: HAS_BOOLEAN_VALUE,\n    low: 0,\n    manifest: 0,\n    marginHeight: 0,\n    marginWidth: 0,\n    max: 0,\n    maxLength: 0,\n    media: 0,\n    mediaGroup: 0,\n    method: 0,\n    min: 0,\n    minLength: 0,\n    // Caution; `option.selected` is not updated if `select.multiple` is\n    // disabled with `removeAttribute`.\n    multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    name: 0,\n    nonce: 0,\n    noValidate: HAS_BOOLEAN_VALUE,\n    open: HAS_BOOLEAN_VALUE,\n    optimum: 0,\n    pattern: 0,\n    placeholder: 0,\n    playsInline: HAS_BOOLEAN_VALUE,\n    poster: 0,\n    preload: 0,\n    profile: 0,\n    radioGroup: 0,\n    readOnly: HAS_BOOLEAN_VALUE,\n    referrerPolicy: 0,\n    rel: 0,\n    required: HAS_BOOLEAN_VALUE,\n    reversed: HAS_BOOLEAN_VALUE,\n    role: 0,\n    rows: HAS_POSITIVE_NUMERIC_VALUE,\n    rowSpan: HAS_NUMERIC_VALUE,\n    sandbox: 0,\n    scope: 0,\n    scoped: HAS_BOOLEAN_VALUE,\n    scrolling: 0,\n    seamless: HAS_BOOLEAN_VALUE,\n    selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n    shape: 0,\n    size: HAS_POSITIVE_NUMERIC_VALUE,\n    sizes: 0,\n    span: HAS_POSITIVE_NUMERIC_VALUE,\n    spellCheck: 0,\n    src: 0,\n    srcDoc: 0,\n    srcLang: 0,\n    srcSet: 0,\n    start: HAS_NUMERIC_VALUE,\n    step: 0,\n    style: 0,\n    summary: 0,\n    tabIndex: 0,\n    target: 0,\n    title: 0,\n    // Setting .type throws on non-<input> tags\n    type: 0,\n    useMap: 0,\n    value: 0,\n    width: 0,\n    wmode: 0,\n    wrap: 0,\n\n    /**\n     * RDFa Properties\n     */\n    about: 0,\n    datatype: 0,\n    inlist: 0,\n    prefix: 0,\n    // property is also supported for OpenGraph in meta tags.\n    property: 0,\n    resource: 0,\n    typeof: 0,\n    vocab: 0,\n\n    /**\n     * Non-standard Properties\n     */\n    // autoCapitalize and autoCorrect are supported in Mobile Safari for\n    // keyboard hints.\n    autoCapitalize: 0,\n    autoCorrect: 0,\n    // autoSave allows WebKit/Blink to persist values of input fields on page reloads\n    autoSave: 0,\n    // color is for Safari mask-icon link\n    color: 0,\n    // itemProp, itemScope, itemType are for\n    // Microdata support. See http://schema.org/docs/gs.html\n    itemProp: 0,\n    itemScope: HAS_BOOLEAN_VALUE,\n    itemType: 0,\n    // itemID and itemRef are for Microdata support as well but\n    // only specified in the WHATWG spec document. See\n    // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api\n    itemID: 0,\n    itemRef: 0,\n    // results show looking glass icon and recent searches on input\n    // search fields in WebKit/Blink\n    results: 0,\n    // IE-only attribute that specifies security restrictions on an iframe\n    // as an alternative to the sandbox attribute on IE<10\n    security: 0,\n    // IE-only attribute that controls focus behavior\n    unselectable: 0,\n  },\n  DOMAttributeNames: {\n    acceptCharset: 'accept-charset',\n    className: 'class',\n    htmlFor: 'for',\n    httpEquiv: 'http-equiv',\n  },\n  DOMPropertyNames: {},\n  DOMMutationMethods: {\n    value: function(node, value) {\n      if (value == null) {\n        return node.removeAttribute('value')\n      }\n\n      // Number inputs get special treatment due to some edge cases in\n      // Chrome. Let everything else assign the value attribute as normal.\n      // https://github.com/facebook/react/issues/7253#issuecomment-236074326\n      if (node.type !== 'number' || node.hasAttribute('value') === false) {\n        node.setAttribute('value', '' + value)\n      } else if (\n        node.validity &&\n        !node.validity.badInput &&\n        node.ownerDocument.activeElement !== node\n      ) {\n        // Don't assign an attribute if validation reports bad\n        // input. Chrome will clear the value. Additionally, don't\n        // operate on inputs that have focus, otherwise Chrome might\n        // strip off trailing decimal places and cause the user's\n        // cursor position to jump to the beginning of the input.\n        //\n        // In ReactDOMInput, we have an onBlur event that will trigger\n        // this function again when focus is lost.\n        node.setAttribute('value', '' + value)\n      }\n    },\n  },\n}\n\nexport default HTMLDOMPropertyConfig\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/ReactProps.js",
    "content": "var reactProps = {\n  children: true,\n  dangerouslySetInnerHTML: true,\n  key: true,\n  ref: true,\n\n  autoFocus: true,\n  defaultValue: true,\n  valueLink: true,\n  defaultChecked: true,\n  checkedLink: true,\n  innerHTML: true,\n  suppressContentEditableWarning: true,\n  onFocusIn: true,\n  onFocusOut: true,\n}\n\nexport default reactProps\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/SVGDOMPropertyConfig.js",
    "content": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\nvar NS = {\n  xlink: 'http://www.w3.org/1999/xlink',\n  xml: 'http://www.w3.org/XML/1998/namespace',\n}\n\n// We use attributes for everything SVG so let's avoid some duplication and run\n// code instead.\n// The following are all specified in the HTML config already so we exclude here.\n// - class (as className)\n// - color\n// - height\n// - id\n// - lang\n// - max\n// - media\n// - method\n// - min\n// - name\n// - style\n// - target\n// - type\n// - width\nvar ATTRS = {\n  accentHeight: 'accent-height',\n  accumulate: 0,\n  additive: 0,\n  alignmentBaseline: 'alignment-baseline',\n  allowReorder: 'allowReorder',\n  alphabetic: 0,\n  amplitude: 0,\n  arabicForm: 'arabic-form',\n  ascent: 0,\n  attributeName: 'attributeName',\n  attributeType: 'attributeType',\n  autoReverse: 'autoReverse',\n  azimuth: 0,\n  baseFrequency: 'baseFrequency',\n  baseProfile: 'baseProfile',\n  baselineShift: 'baseline-shift',\n  bbox: 0,\n  begin: 0,\n  bias: 0,\n  by: 0,\n  calcMode: 'calcMode',\n  capHeight: 'cap-height',\n  clip: 0,\n  clipPath: 'clip-path',\n  clipRule: 'clip-rule',\n  clipPathUnits: 'clipPathUnits',\n  colorInterpolation: 'color-interpolation',\n  colorInterpolationFilters: 'color-interpolation-filters',\n  colorProfile: 'color-profile',\n  colorRendering: 'color-rendering',\n  contentScriptType: 'contentScriptType',\n  contentStyleType: 'contentStyleType',\n  cursor: 0,\n  cx: 0,\n  cy: 0,\n  d: 0,\n  decelerate: 0,\n  descent: 0,\n  diffuseConstant: 'diffuseConstant',\n  direction: 0,\n  display: 0,\n  divisor: 0,\n  dominantBaseline: 'dominant-baseline',\n  dur: 0,\n  dx: 0,\n  dy: 0,\n  edgeMode: 'edgeMode',\n  elevation: 0,\n  enableBackground: 'enable-background',\n  end: 0,\n  exponent: 0,\n  externalResourcesRequired: 'externalResourcesRequired',\n  fill: 0,\n  fillOpacity: 'fill-opacity',\n  fillRule: 'fill-rule',\n  filter: 0,\n  filterRes: 'filterRes',\n  filterUnits: 'filterUnits',\n  floodColor: 'flood-color',\n  floodOpacity: 'flood-opacity',\n  focusable: 0,\n  fontFamily: 'font-family',\n  fontSize: 'font-size',\n  fontSizeAdjust: 'font-size-adjust',\n  fontStretch: 'font-stretch',\n  fontStyle: 'font-style',\n  fontVariant: 'font-variant',\n  fontWeight: 'font-weight',\n  format: 0,\n  from: 0,\n  fx: 0,\n  fy: 0,\n  g1: 0,\n  g2: 0,\n  glyphName: 'glyph-name',\n  glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n  glyphOrientationVertical: 'glyph-orientation-vertical',\n  glyphRef: 'glyphRef',\n  gradientTransform: 'gradientTransform',\n  gradientUnits: 'gradientUnits',\n  hanging: 0,\n  horizAdvX: 'horiz-adv-x',\n  horizOriginX: 'horiz-origin-x',\n  ideographic: 0,\n  imageRendering: 'image-rendering',\n  in: 0,\n  in2: 0,\n  intercept: 0,\n  k: 0,\n  k1: 0,\n  k2: 0,\n  k3: 0,\n  k4: 0,\n  kernelMatrix: 'kernelMatrix',\n  kernelUnitLength: 'kernelUnitLength',\n  kerning: 0,\n  keyPoints: 'keyPoints',\n  keySplines: 'keySplines',\n  keyTimes: 'keyTimes',\n  lengthAdjust: 'lengthAdjust',\n  letterSpacing: 'letter-spacing',\n  lightingColor: 'lighting-color',\n  limitingConeAngle: 'limitingConeAngle',\n  local: 0,\n  markerEnd: 'marker-end',\n  markerMid: 'marker-mid',\n  markerStart: 'marker-start',\n  markerHeight: 'markerHeight',\n  markerUnits: 'markerUnits',\n  markerWidth: 'markerWidth',\n  mask: 0,\n  maskContentUnits: 'maskContentUnits',\n  maskUnits: 'maskUnits',\n  mathematical: 0,\n  mode: 0,\n  numOctaves: 'numOctaves',\n  offset: 0,\n  opacity: 0,\n  operator: 0,\n  order: 0,\n  orient: 0,\n  orientation: 0,\n  origin: 0,\n  overflow: 0,\n  overlinePosition: 'overline-position',\n  overlineThickness: 'overline-thickness',\n  paintOrder: 'paint-order',\n  panose1: 'panose-1',\n  pathLength: 'pathLength',\n  patternContentUnits: 'patternContentUnits',\n  patternTransform: 'patternTransform',\n  patternUnits: 'patternUnits',\n  pointerEvents: 'pointer-events',\n  points: 0,\n  pointsAtX: 'pointsAtX',\n  pointsAtY: 'pointsAtY',\n  pointsAtZ: 'pointsAtZ',\n  preserveAlpha: 'preserveAlpha',\n  preserveAspectRatio: 'preserveAspectRatio',\n  primitiveUnits: 'primitiveUnits',\n  r: 0,\n  radius: 0,\n  refX: 'refX',\n  refY: 'refY',\n  renderingIntent: 'rendering-intent',\n  repeatCount: 'repeatCount',\n  repeatDur: 'repeatDur',\n  requiredExtensions: 'requiredExtensions',\n  requiredFeatures: 'requiredFeatures',\n  restart: 0,\n  result: 0,\n  rotate: 0,\n  rx: 0,\n  ry: 0,\n  scale: 0,\n  seed: 0,\n  shapeRendering: 'shape-rendering',\n  slope: 0,\n  spacing: 0,\n  specularConstant: 'specularConstant',\n  specularExponent: 'specularExponent',\n  speed: 0,\n  spreadMethod: 'spreadMethod',\n  startOffset: 'startOffset',\n  stdDeviation: 'stdDeviation',\n  stemh: 0,\n  stemv: 0,\n  stitchTiles: 'stitchTiles',\n  stopColor: 'stop-color',\n  stopOpacity: 'stop-opacity',\n  strikethroughPosition: 'strikethrough-position',\n  strikethroughThickness: 'strikethrough-thickness',\n  string: 0,\n  stroke: 0,\n  strokeDasharray: 'stroke-dasharray',\n  strokeDashoffset: 'stroke-dashoffset',\n  strokeLinecap: 'stroke-linecap',\n  strokeLinejoin: 'stroke-linejoin',\n  strokeMiterlimit: 'stroke-miterlimit',\n  strokeOpacity: 'stroke-opacity',\n  strokeWidth: 'stroke-width',\n  surfaceScale: 'surfaceScale',\n  systemLanguage: 'systemLanguage',\n  tableValues: 'tableValues',\n  targetX: 'targetX',\n  targetY: 'targetY',\n  textAnchor: 'text-anchor',\n  textDecoration: 'text-decoration',\n  textRendering: 'text-rendering',\n  textLength: 'textLength',\n  to: 0,\n  transform: 0,\n  u1: 0,\n  u2: 0,\n  underlinePosition: 'underline-position',\n  underlineThickness: 'underline-thickness',\n  unicode: 0,\n  unicodeBidi: 'unicode-bidi',\n  unicodeRange: 'unicode-range',\n  unitsPerEm: 'units-per-em',\n  vAlphabetic: 'v-alphabetic',\n  vHanging: 'v-hanging',\n  vIdeographic: 'v-ideographic',\n  vMathematical: 'v-mathematical',\n  values: 0,\n  vectorEffect: 'vector-effect',\n  version: 0,\n  vertAdvY: 'vert-adv-y',\n  vertOriginX: 'vert-origin-x',\n  vertOriginY: 'vert-origin-y',\n  viewBox: 'viewBox',\n  viewTarget: 'viewTarget',\n  visibility: 0,\n  widths: 0,\n  wordSpacing: 'word-spacing',\n  writingMode: 'writing-mode',\n  x: 0,\n  xHeight: 'x-height',\n  x1: 0,\n  x2: 0,\n  xChannelSelector: 'xChannelSelector',\n  xlinkActuate: 'xlink:actuate',\n  xlinkArcrole: 'xlink:arcrole',\n  xlinkHref: 'xlink:href',\n  xlinkRole: 'xlink:role',\n  xlinkShow: 'xlink:show',\n  xlinkTitle: 'xlink:title',\n  xlinkType: 'xlink:type',\n  xmlBase: 'xml:base',\n  xmlns: 0,\n  xmlnsXlink: 'xmlns:xlink',\n  xmlLang: 'xml:lang',\n  xmlSpace: 'xml:space',\n  y: 0,\n  y1: 0,\n  y2: 0,\n  yChannelSelector: 'yChannelSelector',\n  z: 0,\n  zoomAndPan: 'zoomAndPan',\n}\n\nvar SVGDOMPropertyConfig = {\n  Properties: {},\n  DOMAttributeNamespaces: {\n    xlinkActuate: NS.xlink,\n    xlinkArcrole: NS.xlink,\n    xlinkHref: NS.xlink,\n    xlinkRole: NS.xlink,\n    xlinkShow: NS.xlink,\n    xlinkTitle: NS.xlink,\n    xlinkType: NS.xlink,\n    xmlBase: NS.xml,\n    xmlLang: NS.xml,\n    xmlSpace: NS.xml,\n  },\n  DOMAttributeNames: {},\n}\n\nObject.keys(ATTRS).forEach(function(key) {\n  SVGDOMPropertyConfig.Properties[key] = 0\n  if (ATTRS[key]) {\n    SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key]\n  }\n})\n\nexport default SVGDOMPropertyConfig\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/index.js",
    "content": "import ARIADOMPropertyConfig from './ARIADOMPropertyConfig'\nimport HTMLDOMPropertyConfig from './HTMLDOMPropertyConfig'\nimport SVGDOMPropertyConfig from './SVGDOMPropertyConfig'\nimport EventConstant from './EventConstant'\nimport ReactProps from './ReactProps'\n\nconst propertyMap = {}\n\nObject.keys(ARIADOMPropertyConfig.Properties).forEach(v => {\n  propertyMap[v.toLowerCase()] = v\n})\n\nObject.keys(HTMLDOMPropertyConfig.Properties).forEach(v => {\n  propertyMap[v.toLowerCase()] = v\n})\n\nObject.keys(SVGDOMPropertyConfig.DOMAttributeNames).forEach(v => {\n  propertyMap[SVGDOMPropertyConfig.DOMAttributeNames[v]] = v\n})\n\nObject.keys(EventConstant.topLevelTypes)\n  .map(v => {\n    return v.replace(/^top/, 'on')\n  })\n  .forEach(v => {\n    propertyMap[v.toLowerCase()] = v\n  })\n\nObject.keys(ReactProps).map(v => {\n  propertyMap[v.toLowerCase()] = v\n})\n\nexport default propertyMap\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/util/attrs.js",
    "content": "/* @flow */\n\nimport { makeMap } from 'shared/util'\n\n// these are reserved for web because they are directly compiled away\n// during template compilation\nexport const isReservedAttr = makeMap('style,class')\n\n// attributes that should be using props for binding\nconst acceptValue = makeMap('input,textarea,option,select')\nexport const mustUseProp = (\n  tag: string,\n  type: ?string,\n  attr: string,\n): boolean => {\n  return (\n    (attr === 'value' && acceptValue(tag) && type !== 'button') ||\n    (attr === 'selected' && tag === 'option') ||\n    (attr === 'checked' && tag === 'input') ||\n    (attr === 'muted' && tag === 'video')\n  )\n}\n\nexport const isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck')\n\nexport const isBooleanAttr = makeMap(\n  'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n    'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n    'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n    'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n    'required,reversed,scoped,seamless,selected,sortable,translate,' +\n    'truespeed,typemustmatch,visible',\n)\n\nexport const xlinkNS = 'http://www.w3.org/1999/xlink'\n\nexport const isXlink = (name: string): boolean => {\n  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n}\n\nexport const getXlinkProp = (name: string): string => {\n  return isXlink(name) ? name.slice(6, name.length) : ''\n}\n\nexport const isFalsyAttrValue = (val: any): boolean => {\n  return val == null || val === false\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/util/element.js",
    "content": "/* @flow */\n\nimport { inBrowser } from 'core/util/env'\nimport { makeMap } from 'shared/util'\nimport { COMMON, WEB } from 'vue-native/compiler/config'\n\nexport const namespaceMap = {\n  svg: 'http://www.w3.org/2000/svg',\n  math: 'http://www.w3.org/1998/Math/MathML',\n}\n\nexport const isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n    'link,meta,param,source,track,wbr',\n)\n\nexport const isHTMLTag = makeMap(\n  'html,body,base,head,link,meta,style,title,' +\n    'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n    'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +\n    'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n    's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n    'embed,object,param,source,canvas,script,noscript,del,ins,' +\n    'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n    'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n    'output,progress,select,textarea,' +\n    'details,dialog,menu,menuitem,summary,' +\n    'content,element,shadow,template',\n)\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nexport const isSVG = makeMap(\n  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\n    'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n    'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n  true,\n)\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nexport const canBeLeftOpenTag = makeMap(\n  'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',\n)\n\n// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\nexport const isNonPhrasingTag = makeMap(\n  'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n    'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n    'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n    'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n    'title,tr,track',\n)\n\nconst buildInTags = [\n  COMMON.directive.component,\n  COMMON.dynamicComponent.name,\n  WEB.transition.component,\n  WEB.transitionGroup.component,\n  WEB.emptyComponent.component,\n  WEB.inputComponent.component,\n]\n\nexport const isBuildInTag = makeMap(buildInTags.join(','))\n\nexport const isPreTag = (tag: ?string): boolean => tag === 'pre'\n\nexport const isReservedTag = (tag: string): ?boolean => {\n  return isHTMLTag(tag) || isSVG(tag)\n}\n\nexport function getTagNamespace(tag: string): ?string {\n  if (isSVG(tag)) {\n    return 'svg'\n  }\n  // basic support for MathML\n  // note it doesn't support other MathML elements being component roots\n  if (tag === 'math') {\n    return 'math'\n  }\n}\n\nconst unknownElementCache = Object.create(null)\nexport function isUnknownElement(tag: string): boolean {\n  /* istanbul ignore if */\n  if (!inBrowser) {\n    return true\n  }\n  if (isReservedTag(tag)) {\n    return false\n  }\n  tag = tag.toLowerCase()\n  /* istanbul ignore if */\n  if (unknownElementCache[tag] != null) {\n    return unknownElementCache[tag]\n  }\n  const el = document.createElement(tag)\n  if (tag.indexOf('-') > -1) {\n    // http://stackoverflow.com/a/28210364/1070244\n    return (unknownElementCache[tag] =\n      el.constructor === window.HTMLUnknownElement ||\n      el.constructor === window.HTMLElement)\n  } else {\n    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/util/index.js",
    "content": "export * from './attrs'\nexport * from './element'\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/web.js",
    "content": "import { parse } from 'compiler/parser/index'\n\nimport { WebRenderGenerator } from 'vue-native/compiler/codegen/index'\n\nimport {\n  isPreTag,\n  isUnaryTag,\n  canBeLeftOpenTag,\n  isReservedTag,\n  getTagNamespace,\n} from './util/index'\n\nconst baseOptions = {\n  expectHTML: true,\n  isPreTag,\n  isUnaryTag,\n  canBeLeftOpenTag,\n  isReservedTag,\n  getTagNamespace,\n}\n\nexport function compile(template, options) {\n  let ast\n  let code\n  template = template.trim()\n  if (template) {\n    ast = parse(template, Object.assign({}, baseOptions, options))\n    const renderer = new WebRenderGenerator(ast, options)\n    code = renderer.generate()\n  } else {\n    code = 'export default () => null'\n  }\n  return {\n    ast,\n    code,\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/compiler.js",
    "content": "/* @flow */\n\nexport { parseComponent } from 'sfc/parser'\nexport * from './compiler/index.js'\n"
  },
  {
    "path": "src/platforms/vue-native/index.js",
    "content": "/** @flow */\n\nimport Vue from './runtime/index'\nimport observer from './observer'\n\nVue.observer = observer\n\nexport default Vue\n"
  },
  {
    "path": "src/platforms/vue-native/observer.js",
    "content": "/**\n * Reference to mobx https://github.com/mobxjs/mobx-react-vue/blob/master/src/observer.js\n */\n\nimport React from 'react'\nimport Watcher from 'core/observer/watcher'\n\nexport default function observer(componentClass) {\n  if (\n    typeof componentClass === 'function' &&\n    (!componentClass.prototype || !componentClass.prototype.render) &&\n    !componentClass.isReactClass &&\n    // eslint-disable-next-line no-prototype-builtins\n    !React.Component.isPrototypeOf(componentClass)\n  ) {\n    class ObserverComponent extends React.Component {\n      render() {\n        return componentClass.call(this, this.props, this.context)\n      }\n    }\n    ObserverComponent.displayName =\n      componentClass.displayName || componentClass.name\n    ObserverComponent.contextTypes = componentClass.contextTypes\n    ObserverComponent.propTypes = componentClass.propTypes\n    ObserverComponent.defaultProps = componentClass.defaultProps\n    return observer(ObserverComponent)\n  }\n\n  if (!componentClass) {\n    throw new Error(\"Please pass a valid component to 'observer'\")\n  }\n\n  const target = componentClass.prototype || componentClass\n  mixinLifecycleEvents(target)\n  return componentClass\n}\n\nfunction mixinLifecycleEvents(target) {\n  for (const key in lifecycleMixin) {\n    if (\n      key === 'shouldComponentUpdate' &&\n      typeof target.shouldComponentUpdate === 'function'\n    ) {\n      continue\n    }\n    patch(target, key)\n  }\n}\n\nconst lifecycleMixin = {\n  UNSAFE_componentWillMount() {\n    const cb = this.forceUpdate.bind(this)\n    const render = this.render.bind(this)\n    const watcher = new Watcher({ _watchers: [] }, render, cb, { lazy: true })\n    this.render = watcher.get.bind(watcher)\n    watcher.lazy = false\n    watcher.run = cb\n    this.$vuewatcher = watcher\n  },\n  componentWillUnmount() {\n    this.$vuewatcher.teardown()\n  },\n  shouldComponentUpdate(nextProps, nextState) {\n    if (this.state !== nextState) {\n      return true\n    }\n    return isObjectShallowModified(this.props, nextProps)\n  },\n}\n\nfunction patch(target, funcName) {\n  const base = target[funcName]\n  const mixinFunc = lifecycleMixin[funcName]\n  target[funcName] = !base\n    ? function() {\n        return mixinFunc.apply(this, arguments)\n      }\n    : function() {\n        mixinFunc.apply(this, arguments)\n        return base.apply(this, arguments)\n      }\n}\n\nfunction isObjectShallowModified(prev, next) {\n  if (\n    prev == null ||\n    next == null ||\n    typeof prev !== 'object' ||\n    typeof next !== 'object'\n  ) {\n    return prev !== next\n  }\n  const keys = Object.keys(prev)\n  if (keys.length !== Object.keys(next).length) {\n    return true\n  }\n  let key\n  for (let i = keys.length - 1; i >= 0; i--) {\n    key = keys[i]\n    if (next[key] !== prev[key]) {\n      return true\n    }\n  }\n  return false\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildComponent.js",
    "content": "import {\n  isObjectShallowModified,\n  mergeCssModule,\n  handleComponents,\n  handleDirectives,\n  getSlots,\n  pascalCaseTag,\n  filterCustomEvent,\n} from './util'\n\nexport function buildComponent(render, options, config) {\n  const { Component, PropTypes, Vue, cssModules } = config\n  if (cssModules) {\n    options.computed = mergeCssModule(options.computed, cssModules)\n  }\n  class ReactVueComponent extends Component {\n    constructor(props) {\n      super(props)\n      this._ref = null\n      this.eventOnceUid = []\n      this.newDirectiveData = {}\n      this.oldDirectiveData = {}\n      this.vm = {}\n      this.beforeMount = []\n      this.mounted = []\n      this.beforeUpdate = []\n      this.updated = []\n      this.beforeDestroy = []\n    }\n\n    /**\n     * children can access parent instance by 'this.context.owner'\n     */\n    getChildContext() {\n      return {\n        owner: this,\n      }\n    }\n\n    /**\n     * for event modifiers v-on:xxx.once\n     */\n    setEventOnce(fn) {\n      const name = fn.name\n      return event => {\n        if (this.eventOnceUid.indexOf(name) === -1) {\n          this.eventOnceUid.push(name)\n          fn(event)\n        }\n      }\n    }\n\n    setRootRef(ref) {\n      if (ref) {\n        ref = ref._ref || ref\n        this._ref = ref\n        this.vm.$el = this._ref\n      }\n    }\n\n    setRef(ref, text, inFor) {\n      if (ref) {\n        // for buildin component, we set ref to his hold node directly\n        // it means the buildin componet would be the end of $refs chain\n        ref = ref.vm || ref._ref || ref\n        if (inFor === true) {\n          if (!this.vm.$refs[text]) {\n            this.vm.$refs[text] = []\n          }\n          this.vm.$refs[text].push(ref)\n        } else {\n          this.vm.$refs[text] = ref\n        }\n        this.$refs = this.vm.$refs\n      }\n    }\n\n    buildVM(options) {\n      // set this property to prevent runtime error in vue\n      render._withStripped = true\n\n      const vueOptions = {\n        render: render,\n        propsData: this.props,\n        parent: this.context.owner ? this.context.owner.vm : undefined,\n      }\n\n      const reactVueOptions = {\n        reactVueSlots: getSlots(this.props.children),\n        reactVueForceUpdate: this.forceUpdate.bind(this),\n        reactVueCustomEvent: filterCustomEvent(this.props),\n      }\n\n      Object.assign(options, vueOptions, reactVueOptions)\n\n      const vm = new Vue(options)\n\n      vm.$options.directives = handleDirectives(vm.$options.directives)\n      vm.$options.components = handleComponents(vm.$options.components)\n\n      /**\n       * for ignoredElements\n       */\n      Vue.config.ignoredElements.forEach(name => {\n        const _name = pascalCaseTag(name)\n        if (vm.$options.components[_name] === undefined) {\n          vm.$options.components[_name] = name\n        }\n      })\n\n      return vm\n    }\n\n    UNSAFE_componentWillMount() {\n      this.vm = this.buildVM(options)\n\n      this.beforeMount = this.vm.$options.beforeMount || []\n      this.mounted = this.vm.$options.mounted || []\n      this.beforeUpdate = this.vm.$options.beforeUpdate || []\n      this.updated = this.vm.$options.updated || []\n      this.beforeDestroy = this.vm.$options.beforeDestroy || []\n\n      this.beforeMount.forEach(v => v.call(this.vm))\n    }\n\n    componentDidMount() {\n      this.vm.$nextTick(() => this.mounted.forEach(v => v.call(this.vm)))\n    }\n    UNSAFE_componentWillUpdate() {\n      this.beforeUpdate.forEach(v => v.call(this.vm))\n    }\n    componentDidUpdate() {\n      this.updated.forEach(v => v.call(this.vm))\n    }\n    componentWillUnmount() {\n      this.beforeDestroy.forEach(v => v.call(this.vm))\n    }\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.vm._props && Object.assign(this.vm._props, nextProps)\n      this.vm.$slots = getSlots(nextProps.children)\n    }\n    shouldComponentUpdate(nextProps) {\n      return isObjectShallowModified(this.props, nextProps)\n    }\n    render() {\n      return render ? render.call(this, this.vm._renderProxy) : null\n    }\n  }\n  ReactVueComponent.childContextTypes = {\n    owner: PropTypes.object,\n  }\n  ReactVueComponent.contextTypes = {\n    owner: PropTypes.object,\n  }\n\n  ReactVueComponent.options = options\n\n  return ReactVueComponent\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildDirective.js",
    "content": "import { COMMON } from 'vue-native/compiler/config'\n\nimport { handleProps } from '../render-helpers/handleProps'\n\nimport { buildMixin } from './buildMixin'\n\nfunction triggerDirective(newData, oldData, vm, ref) {\n  let directive, binding, args\n\n  const vnode = {\n    context: vm,\n  }\n\n  if (newData) {\n    directive = vm.$options.directives[newData.directiveName]\n  } else if (oldData) {\n    directive = vm.$options.directives[oldData.directiveName]\n  }\n\n  if (!directive) {\n    return\n  }\n\n  if (newData && oldData) {\n    // update\n    binding = {\n      name: newData.name,\n      value: newData.value,\n      oldValue: oldData.value,\n      expression: newData.expression,\n      arg: newData.arg,\n      modifiers: newData.modifiers,\n    }\n    args = [ref, binding, vnode]\n    if (typeof directive === 'function') {\n      directive.apply(vm, args)\n    } else if (typeof directive.update === 'function') {\n      directive.update.apply(vm, args)\n    }\n  } else if (newData && !oldData) {\n    // bind\n    binding = {\n      name: newData.name,\n      value: newData.value,\n      expression: newData.expression,\n      arg: newData.arg,\n      modifiers: newData.modifiers,\n    }\n    args = [ref, binding, vnode]\n    if (typeof directive === 'function') {\n      directive.apply(vm, args)\n    } else if (typeof directive.bind === 'function') {\n      directive.bind.apply(vm, args)\n    }\n  } else if (!newData && oldData) {\n    // unbind\n    binding = {\n      name: oldData.name,\n      value: oldData.value,\n      expression: oldData.expression,\n      arg: oldData.arg,\n      modifiers: oldData.modifiers,\n    }\n    args = [ref, binding, vnode]\n    if (typeof directive.unbind === 'function') {\n      directive.unbind.apply(vm, args)\n    }\n  }\n}\n\nexport function buildDirective(Component, createElement) {\n  return class Directive extends buildMixin.apply(this, arguments) {\n    constructor(props) {\n      super(props)\n      // set vm from parent context that\n      // this.vm = props[COMMON.directive.context].vm\n      this.state = {\n        props: handleProps(props, props[COMMON.directive.tag]),\n      }\n    }\n    setDirectiveLifeCycle(newProps, oldProps) {\n      let context\n      let newDirectives = []\n      let oldDirectives = []\n      if (oldProps) {\n        context = oldProps[COMMON.directive.context]\n        oldDirectives = oldProps[COMMON.directive.name]\n      }\n      if (newProps) {\n        context = newProps[COMMON.directive.context]\n        newDirectives = newProps[COMMON.directive.name]\n      }\n      const newDirectivesClone = newDirectives.slice()\n      const oldDirectivesClone = oldDirectives.slice()\n      if (Array.isArray(newDirectives) && Array.isArray(oldDirectives)) {\n        newDirectives.forEach((newDirective, newIndex) => {\n          oldDirectives.forEach((oldDirective, oldIndex) => {\n            if (newDirective.name === oldDirective.name) {\n              newDirectivesClone.splice(newIndex, 1, undefined)\n              oldDirectivesClone.splice(oldIndex, 1, undefined)\n              triggerDirective(\n                newDirective,\n                oldDirective,\n                context.vm,\n                this._ref,\n              ) // update\n            }\n          })\n        })\n        newDirectivesClone.forEach(v => {\n          // bind\n          v && triggerDirective(v, null, context.vm, this._ref)\n        })\n        oldDirectivesClone.forEach(v => {\n          // unbind\n          v && triggerDirective(null, v, context.vm, this._ref)\n        })\n      }\n    }\n    getDirectiveName(props) {\n      if (props[COMMON.directive.name]) {\n        return props[COMMON.directive.name].map(v => v.name)\n      } else {\n        return []\n      }\n    }\n    buildInHandle(props) {\n      const names = this.getDirectiveName(props)\n      const stateProps = this.buildStateProps(props)\n      if (names.indexOf('model') !== -1) {\n        const onChangeFn =\n          stateProps.onChange || stateProps.onInput || function() {}\n        stateProps.onChange = event => {\n          this.setState({\n            props: Object.assign({}, this.state.props, {\n              value: event.target.value,\n            }),\n          })\n          return onChangeFn(event)\n        }\n      }\n      this.setState({\n        props: handleProps(stateProps, props[COMMON.directive.tag]),\n      })\n    }\n    UNSAFE_componentWillMount() {\n      this.buildInHandle(this.props)\n    }\n    componentDidMount() {\n      this.setDirectiveLifeCycle(this.props)\n    }\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.buildInHandle(nextProps)\n      this.setDirectiveLifeCycle(nextProps, this.props)\n    }\n    componentWillUnmount() {\n      this.setDirectiveLifeCycle(null, this.props)\n    }\n    render() {\n      return createElement(\n        this.props[COMMON.directive.tag],\n        this.state.props,\n        this.state.props.children,\n      )\n    }\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildInputComponent.js",
    "content": "import { WEB } from 'vue-native/compiler/config'\n\nimport { buildMixin } from './buildMixin'\n\nimport { handleProps } from '../render-helpers/handleProps'\n\nexport function buildInputComponent(Component, createElement) {\n  return class Input extends buildMixin.apply(this, arguments) {\n    constructor(props) {\n      super(props)\n      this.state = {\n        props: {},\n      }\n    }\n    buildStateProps(props) {\n      const stateProps = super.buildStateProps(props)\n\n      const onChangeFn =\n        stateProps.onChange || stateProps.onInput || function() {}\n      stateProps.onChange = event => {\n        this.setState({\n          props: Object.assign({}, this.state.props, {\n            value: event.target.value,\n          }),\n        })\n        return onChangeFn(event)\n      }\n\n      return handleProps(stateProps, props[WEB.inputComponent.tag])\n    }\n    setStateProps(props) {\n      const stateProps = this.buildStateProps(props)\n      this.setState({\n        props: stateProps,\n      })\n    }\n    UNSAFE_componentWillMount() {\n      this.setStateProps(this.props)\n    }\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.setStateProps(nextProps)\n    }\n    render() {\n      return createElement(\n        this.props[WEB.inputComponent.tag],\n        this.state.props,\n        this.state.props.children,\n      )\n    }\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildMixin.js",
    "content": "export function buildMixin(Component) {\n  return class Mixin extends Component {\n    constructor(props) {\n      super(props)\n      /**\n       * for vue, every component should have a ref to represent node element\n       */\n      this._ref = null\n    }\n\n    setRef(ref) {\n      if (ref) {\n        if (ref._reactInternalInstance && ref.vm === undefined) {\n          this._ref = ref._ref || ref\n        } else {\n          this._ref = ref.vm || ref\n        }\n      }\n    }\n\n    buildStateProps(props) {\n      const stateProps = Object.assign({}, props)\n      const originRef = stateProps.ref\n      stateProps.ref = ref => {\n        this.setRef(ref)\n        if (typeof originRef === 'function') {\n          return originRef(ref)\n        } else {\n          return ref\n        }\n      }\n\n      return stateProps\n    }\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildNativeComponent.js",
    "content": "import { deprecatedPackages } from 'shared/constants'\n\nimport {\n  isObjectShallowModified,\n  handleComponents,\n  handleDirectives,\n  getSlots,\n  pascalCaseTag,\n  filterCustomEvent,\n} from './util'\n\nexport function buildNativeComponent(render, options, config) {\n  const { Component, PropTypes, Vue, ReactNative, css } = config\n  if (!Vue.ReactNativeInjected) {\n    Vue.ReactNativeInjected = true\n    Object.keys(ReactNative).map(k => {\n      if (/^[A-Z]/.test(k) && deprecatedPackages.indexOf(k) === -1) {\n        try {\n          Vue.component(k, ReactNative[k])\n        } catch (e) {}\n      }\n    })\n  }\n  class ReactVueComponent extends Component {\n    constructor(props) {\n      super(props)\n      this._ref = null\n      this.eventOnceUid = []\n      this.newDirectiveData = {}\n      this.oldDirectiveData = {}\n      this.vm = {}\n      this.beforeMount = []\n      this.mounted = []\n      this.beforeUpdate = []\n      this.updated = []\n      this.beforeDestroy = []\n      this.css = ReactNative.StyleSheet.create(css)\n    }\n\n    /**\n     * children can access parent instance by 'this.context.owner'\n     */\n    getChildContext() {\n      return {\n        owner: this,\n      }\n    }\n\n    /**\n     * for event modifiers v-on:xxx.once\n     */\n    setEventOnce(fn) {\n      const name = fn.name\n      return event => {\n        if (this.eventOnceUid.indexOf(name) === -1) {\n          this.eventOnceUid.push(name)\n          fn(event)\n        }\n      }\n    }\n\n    setRootRef(ref) {\n      if (ref) {\n        ref = ref._ref || ref\n        this._ref = ref\n        this.vm.$el = this._ref\n      }\n    }\n\n    setRef(ref, text, inFor) {\n      if (ref) {\n        // for buildin component, we set ref to his hold node directly\n        // it means the buildin componet would be the end of $refs chain\n        ref = ref.vm || ref._ref || ref\n        if (inFor === true) {\n          if (!this.vm.$refs[text]) {\n            this.vm.$refs[text] = []\n          }\n          this.vm.$refs[text].push(ref)\n        } else {\n          this.vm.$refs[text] = ref\n        }\n        this.$refs = this.vm.$refs\n      }\n    }\n\n    buildVM(options) {\n      // set this property to prevent runtime error in vue\n      render._withStripped = true\n\n      const vueOptions = {\n        render: render,\n        propsData: this.props,\n        parent: this.context.owner ? this.context.owner.vm : undefined,\n      }\n\n      const reactVueOptions = {\n        reactVueSlots: getSlots(this.props.children),\n        reactVueForceUpdate: this.forceUpdate.bind(this),\n        reactVueCustomEvent: filterCustomEvent(this.props),\n      }\n\n      Object.assign(options, vueOptions, reactVueOptions)\n\n      const vm = new Vue(options)\n\n      vm.$options.directives = handleDirectives(vm.$options.directives)\n      vm.$options.components = handleComponents(vm.$options.components)\n\n      /**\n       * for ignoredElements\n       */\n      Vue.config.ignoredElements.forEach(name => {\n        const _name = pascalCaseTag(name)\n        if (vm.$options.components[_name] === undefined) {\n          vm.$options.components[_name] = name\n        }\n      })\n\n      return vm\n    }\n\n    UNSAFE_componentWillMount() {\n      this.vm = this.buildVM(options)\n\n      this.beforeMount = this.vm.$options.beforeMount || []\n      this.mounted = this.vm.$options.mounted || []\n      this.beforeUpdate = this.vm.$options.beforeUpdate || []\n      this.updated = this.vm.$options.updated || []\n      this.beforeDestroy = this.vm.$options.beforeDestroy || []\n\n      this.beforeMount.forEach(v => v.call(this.vm))\n    }\n\n    componentDidMount() {\n      setTimeout(() => {\n        this.mounted.forEach(v => v.call(this.vm))\n      }, 0)\n    }\n    UNSAFE_componentWillUpdate() {\n      this.beforeUpdate.forEach(v => v.call(this.vm))\n    }\n    componentDidUpdate() {\n      this.updated.forEach(v => v.call(this.vm))\n    }\n    componentWillUnmount() {\n      this.beforeDestroy.forEach(v => v.call(this.vm))\n      this.vm.$destroy()\n    }\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.vm._props && Object.assign(this.vm._props, nextProps)\n      this.vm.$slots = getSlots(nextProps.children)\n    }\n    shouldComponentUpdate(nextProps) {\n      return isObjectShallowModified(this.props, nextProps)\n    }\n    render() {\n      return render ? render.call(this, this.vm._renderProxy) : null\n    }\n  }\n  ReactVueComponent.childContextTypes = {\n    owner: PropTypes.object,\n  }\n  ReactVueComponent.contextTypes = {\n    owner: PropTypes.object,\n  }\n\n  ReactVueComponent.options = options\n\n  return ReactVueComponent\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildWebEmptyComponent.js",
    "content": "export function buildWebEmptyComponent(Component, createElement) {\n  return class EmptyComponent extends Component {\n    constructor(props) {\n      super(props)\n      this._ref = null\n      this.state = {\n        props: {},\n      }\n    }\n    setRef(ref) {\n      this._ref = ref\n    }\n    buildStateProps(props) {\n      const stateProps = Object.assign({}, props)\n      const originRef = stateProps.ref\n      stateProps.ref = ref => {\n        this.setRef(ref)\n        if (typeof originRef === 'function') {\n          return originRef(ref)\n        } else {\n          return ref\n        }\n      }\n      return stateProps\n    }\n    UNSAFE_componentWillMount() {\n      this.setState({\n        props: this.buildStateProps(this.props),\n      })\n    }\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.setState({\n        props: this.buildStateProps(nextProps),\n      })\n    }\n    unwrap(wrapper) {\n      if (wrapper.parentNode) {\n        const docFrag = document.createDocumentFragment()\n        while (wrapper.firstChild) {\n          const child = wrapper.removeChild(wrapper.firstChild)\n          docFrag.appendChild(child)\n        }\n        wrapper.parentNode.replaceChild(docFrag, wrapper)\n      }\n    }\n    componentDidMount() {\n      // this.unwrap(this._ref)\n    }\n    componentDidUpdate() {\n      // this.unwrap(this._ref)\n    }\n    render() {\n      const { tag, children } = this.state.props\n      return createElement(tag || 'view', this.state.props, children)\n    }\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildWebInputComponent.js",
    "content": "import { buildInputComponent } from './buildInputComponent'\n\nconst buildWebInputComponent = buildInputComponent\n\nexport { buildWebInputComponent }\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildWebTransition.js",
    "content": "import { addClass, removeClass } from 'web/runtime/class-util.js'\nimport {\n  nextFrame,\n  resolveTransition,\n  whenTransitionEnds,\n  getTransitionInfo,\n} from 'web/runtime/transition-util'\nimport { isIE9, warn } from 'core/util/index'\nimport { once, isDef, isUndef, isObject, toNumber } from 'shared/util'\nimport { WEB, COMMON } from 'vue-native/compiler/config'\nimport { buildWebEmptyComponent } from './buildWebEmptyComponent'\n// import {\n//   isObjectShallowModified\n// } from './util'\n\nfunction filterCollection(collection) {\n  const result = []\n  collection.forEach(v => {\n    if (v.type === 'if') {\n      const _result = v.conditions\n        .filter(_v => _v.exp)\n        .map(_v => {\n          return {\n            type: 'if',\n            index: _v.index,\n            element: _v.element,\n            exp: _v.exp,\n          }\n        })\n      if (_result.length) {\n        result.push(_result[0])\n      }\n    } else {\n      result.push(v)\n    }\n  })\n  if (result.length > 1) {\n    console.warn(\n      `<transition> can only be used on a single element. Use <transition-group> for lists.`,\n    )\n  }\n  return result\n}\n\n/**\n * Normalize a transition hook's argument length. The hook may be:\n * - a merged hook (invoker) with the original in .fns\n * - a wrapped component method (check ._length)\n * - a plain function (.length)\n */\nfunction getHookArgumentsLength(fn) {\n  if (isUndef(fn)) {\n    return false\n  }\n  const invokerFns = fn.fns\n  if (isDef(invokerFns)) {\n    // invoker\n    return getHookArgumentsLength(\n      Array.isArray(invokerFns) ? invokerFns[0] : invokerFns,\n    )\n  } else {\n    return (fn._length || fn.length) > 1\n  }\n}\n\n// only used in dev mode\nfunction checkDuration(val, name) {\n  if (typeof val !== 'number') {\n    warn(\n      `<transition> explicit ${name} duration is not a valid number - ` +\n        `got ${JSON.stringify(val)}.`,\n    )\n  } else if (isNaN(val)) {\n    warn(\n      `<transition> explicit ${name} duration is NaN - ` +\n        'the duration expression might be incorrect.',\n    )\n  }\n}\n\nfunction isValidDuration(val) {\n  return typeof val === 'number' && !isNaN(val)\n}\n\nfunction addTransitionClass(ref, className) {\n  addClass(ref, className)\n}\n\nfunction removeTransitionClass(ref, className) {\n  removeClass(ref, className)\n}\n\n/**\n * check whether animation should be updated\n * for performance it does not used for under component\n * but in the future we would be used\n * @param {Object} prev props\n * @param {Object} next props\n */\n// function checkTransitionStateChanged (prev, next) {\n//   let result = true\n//   try {\n//     const prevCollection = prev[WEB.transition.collection]\n//     const nextCollection = next[WEB.transition.collection]\n//     result = prevCollection.filter((pV, i) => {\n//       const nV = nextCollection[i]\n//       let result = false\n//       if (pV.exp !== nV.exp ||\n//         pV.index !== nV.index ||\n//         pV.element.className !== nV.element.className ||\n//         pV.element.style !== nV.element.style) {\n//         result = true\n//       }\n//       return result\n//     }).length > 0\n//   } catch (e) {\n//     result = true\n//   }\n//   return result\n// }\n\nexport function enter({ el, cb }) {\n  const {\n    css,\n    type,\n    enterClass,\n    enterToClass,\n    enterActiveClass,\n    appearClass,\n    appearToClass,\n    appearActiveClass,\n    onBeforeEnter,\n    onEnter,\n    onAfterEnter,\n    onEnterCancelled,\n    onBeforeAppear,\n    appear,\n    onAppear,\n    onAfterAppear,\n    onAppearCancelled,\n    duration,\n  } = this.transitionResolved\n\n  const isAppear = this.isAppear\n\n  if (isUndef(el)) {\n    return\n  }\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  if (isDef(el._enterCb) || el.nodeType !== 1) {\n    return\n  }\n\n  const startClass = isAppear && appearClass ? appearClass : enterClass\n  const activeClass =\n    isAppear && appearActiveClass ? appearActiveClass : enterActiveClass\n  const toClass = isAppear && appearToClass ? appearToClass : enterToClass\n\n  const beforeEnterHook = isAppear\n    ? onBeforeAppear || onBeforeEnter\n    : onBeforeEnter\n  const enterHook = isAppear ? onAppear || onEnter : onEnter\n  const afterEnterHook = isAppear ? onAfterAppear || onAfterEnter : onAfterEnter\n  const enterCancelledHook = isAppear\n    ? onAppearCancelled || onEnterCancelled\n    : onEnterCancelled\n\n  const explicitEnterDuration = toNumber(\n    isObject(duration) ? duration.enter : duration,\n  )\n\n  if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {\n    checkDuration(explicitEnterDuration, 'enter')\n  }\n\n  const expectsCSS = css !== false && !isIE9\n  const userWantsControl = getHookArgumentsLength(enterHook)\n\n  const _cb = (el._enterCb = once(() => {\n    if (expectsCSS) {\n      removeTransitionClass(el, activeClass)\n      removeTransitionClass(el, toClass)\n    }\n    cb && cb()\n    if (_cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass)\n      }\n      enterCancelledHook && enterCancelledHook(el)\n    } else {\n      afterEnterHook && afterEnterHook(el)\n    }\n    el._enterCb = null\n  }))\n\n  beforeEnterHook && beforeEnterHook(el)\n\n  if (expectsCSS) {\n    addTransitionClass(el, startClass)\n    addTransitionClass(el, activeClass)\n\n    nextFrame(() => {\n      removeTransitionClass(el, startClass)\n      addTransitionClass(el, toClass)\n      if (!_cb.cancelled && !userWantsControl) {\n        if (isValidDuration(explicitEnterDuration)) {\n          setTimeout(_cb, explicitEnterDuration)\n        } else {\n          whenTransitionEnds(el, type || getTransitionInfo(el).type, _cb)\n        }\n      }\n    })\n  }\n\n  nextFrame(() => enterHook && enterHook(el, _cb))\n\n  if (!expectsCSS && !userWantsControl) {\n    _cb()\n  }\n}\n\nexport function leave({ el, cb }) {\n  const {\n    css,\n    type,\n    leaveClass,\n    leaveToClass,\n    leaveActiveClass,\n    onBeforeLeave,\n    onLeave,\n    onAfterLeave,\n    onLeaveCancelled,\n    duration,\n  } = this.transitionResolved\n\n  if (isUndef(el)) {\n    return\n  }\n\n  if (isDef(el._leaveCb) || el.nodeType !== 1) {\n    return\n  }\n\n  const expectsCSS = css !== false && !isIE9\n  const userWantsControl = getHookArgumentsLength(onLeave)\n\n  const explicitLeaveDuration = toNumber(\n    isObject(duration) ? duration.leave : duration,\n  )\n\n  if (process.env.NODE_ENV !== 'production' && explicitLeaveDuration != null) {\n    checkDuration(explicitLeaveDuration, 'leave')\n  }\n\n  const _cb = (el._leaveCb = once(() => {\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveActiveClass)\n      removeTransitionClass(el, leaveToClass)\n    }\n    cb && cb()\n    if (_cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass)\n      }\n      onLeaveCancelled && onLeaveCancelled(el)\n    } else {\n      onAfterLeave && onAfterLeave(el)\n    }\n    el._leaveCb = null\n  }))\n\n  onBeforeLeave && onBeforeLeave(el)\n  if (expectsCSS) {\n    addTransitionClass(el, leaveClass)\n    addTransitionClass(el, leaveActiveClass)\n\n    nextFrame(() => {\n      removeTransitionClass(el, leaveClass)\n      addTransitionClass(el, leaveToClass)\n      if (!_cb.cancelled && !userWantsControl) {\n        if (isValidDuration(explicitLeaveDuration)) {\n          setTimeout(_cb, explicitLeaveDuration)\n        } else {\n          whenTransitionEnds(el, type || getTransitionInfo(el).type, _cb)\n        }\n      }\n    })\n  }\n  onLeave && onLeave(el, _cb)\n  if (!expectsCSS && !userWantsControl && !onLeave) {\n    _cb()\n  }\n}\n\nexport function buildWebTransition(Component, createElement) {\n  const EmptyComponent = buildWebEmptyComponent(Component, createElement)\n  class Transition extends Component {\n    constructor(props) {\n      super(props)\n      this._ref = null\n      this._refs = {}\n      this.transitionResolved = {}\n      this._shouldComponentUpdateTransitionResult = false\n      this.isAppear = false\n      this.state = {\n        transObj: {},\n        animated: true,\n        tagKey: null,\n      }\n    }\n\n    setRef(ref, key) {\n      if (!ref) {\n        return\n      }\n      this._ref = ref._ref || ref\n      this._refs[key] = this._ref\n    }\n\n    resolveData(props, type) {\n      const target = filterCollection(props[WEB.transition.collection])[0]\n      if (target) {\n        const element = target.element\n        const _props = {}\n        for (const key in element.props) {\n          _props[key] = element.props[key]\n        }\n\n        let key = target.index\n        if (element.key != null) {\n          key = element.key + key\n        }\n        if (target.type === 'component') {\n          const targetExp = target.exp\n          const thisTarget = this.state.transObj[this.state.tagKey]\n          const thisExp = thisTarget && thisTarget.exp\n          if (targetExp !== thisExp) {\n            key = this.state.tagKey === 0 ? 1 : 0\n          }\n        }\n        _props.key = _props.key || key\n\n        const setRef = ref => {\n          this.setRef(ref, _props.key)\n          element.ref && element.ref(ref)\n        }\n        if (target.type === 'component') {\n          _props[COMMON.setRef.name] = setRef\n        } else {\n          _props.ref = setRef\n        }\n\n        const transObj = Object.assign({}, this.state.transObj)\n        transObj[_props.key] = Object.assign({}, target, {\n          props: _props,\n        })\n        return {\n          transObj: transObj,\n          animated: true,\n          tagKey: _props.key,\n        }\n      } else if (type === 'update') {\n        const tagKey = this.state.tagKey\n        const transition = this.state.transObj[tagKey]\n        // someone want to hide and his prev state is show\n        if (transition) {\n          const transObj = {}\n          transObj[tagKey] = Object.assign({}, transition, {\n            exp: transition.exp ? !transition.exp : transition.exp,\n          })\n          return {\n            animated: true,\n            transObj: transObj,\n            tagKey: tagKey,\n          }\n        }\n      }\n    }\n\n    UNSAFE_componentWillMount() {\n      this.transitionResolved = resolveTransition(this.props)\n      this.isAppear = true\n      const state = this.resolveData(this.props)\n      state && this.setState(state)\n    }\n\n    componentDidMount() {\n      this.resolveEnterTransition({\n        el: this._refs[this.state.tagKey],\n      })\n    }\n\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.transitionResolved = resolveTransition(nextProps)\n      this.isAppear = false\n      const nextState = this.resolveData(nextProps, 'update')\n\n      if (nextState) {\n        this._shouldComponentUpdateTransitionResult = this._shouldComponentUpdateTransition(\n          nextProps,\n          nextState,\n        )\n        this.setState(nextState)\n      }\n\n      if (this._shouldComponentUpdateTransitionResult) {\n        Object.keys(this._refs).forEach(k => {\n          const el = this._refs[k]\n          if (isDef(el._leaveCb)) {\n            el._leaveCb.cancelled = true\n            el._leaveCb()\n          }\n          if (isDef(el._enterCb)) {\n            el._enterCb.cancelled = true\n            el._enterCb()\n          }\n        })\n      }\n    }\n\n    _shouldComponentUpdateTransition(nextProps, nextState) {\n      if (\n        Object.keys(nextState.transObj).length !==\n        Object.keys(this.state.transObj).length\n      ) {\n        return true\n      }\n      if (nextState.tagKey === this.state.tagKey) {\n        const nextTransition = nextState.transObj[nextState.tagKey]\n        const transition = this.state.transObj[this.state.tagKey]\n        if (nextTransition && transition) {\n          return transition.exp !== nextTransition.exp\n        }\n      }\n      return true\n    }\n\n    resolveEnterTransition(option) {\n      enter.call(this, option)\n    }\n\n    resolveLeaveTransition(option) {\n      leave.call(this, option)\n    }\n\n    componentDidUpdate(prevProps, prevState) {\n      if (\n        this.state.animated === false ||\n        this._shouldComponentUpdateTransitionResult === false\n      ) {\n        return\n      }\n      if (this.state.tagKey === prevState.tagKey) {\n        // same element\n        const ref = this._refs[this.state.tagKey]\n        const transition = this.state.transObj[this.state.tagKey]\n        if (ref && transition) {\n          if (transition.type === 'show') {\n            ref.style.display = ''\n            if (transition.exp === false) {\n              this.resolveLeaveTransition({\n                el: ref,\n                cb: () => {\n                  ref.style.display = 'none'\n                },\n              })\n            } else if (transition.exp === true) {\n              this.resolveEnterTransition({\n                el: ref,\n              })\n            }\n          } else if (transition.type === 'if') {\n            if (transition.exp === false) {\n              const transObj = Object.assign({}, this.state.transObj)\n              delete transObj[prevState.tagKey]\n              this.resolveLeaveTransition({\n                el: ref,\n                cb: () => {\n                  this.setState({\n                    transObj: transObj,\n                    animated: false,\n                  })\n                },\n              })\n            } else if (transition.exp === true) {\n              this.resolveEnterTransition({\n                el: ref,\n              })\n            }\n          }\n        }\n      } else {\n        const enterRef = this._refs[this.state.tagKey]\n        const leaveRef = this._refs[prevState.tagKey]\n        const transObj = Object.assign({}, this.state.transObj)\n        delete transObj[prevState.tagKey]\n        this.resolveEnterTransition({\n          el: enterRef,\n        })\n        this.resolveLeaveTransition({\n          el: leaveRef,\n          cb: () => {\n            this.setState({\n              transObj: transObj,\n              animated: false,\n            })\n          },\n        })\n      }\n    }\n\n    render() {\n      const transObj = this.state.transObj\n      const tag = this.props.tag || EmptyComponent\n      return createElement(\n        tag,\n        null,\n        Object.keys(transObj).map(k => {\n          const type = transObj[k].element.type\n          const props = transObj[k].props\n          const children = props.children\n          return createElement(type, props, children)\n        }),\n      )\n    }\n  }\n  return Transition\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/index.js",
    "content": "export { buildComponent } from './buildComponent'\nexport { buildDirective } from './buildDirective'\nexport { buildWebTransition } from './buildWebTransition'\nexport { buildWebEmptyComponent } from './buildWebEmptyComponent'\nexport { buildWebInputComponent } from './buildWebInputComponent'\nexport { buildNativeComponent } from './buildNativeComponent'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/util.js",
    "content": "import { COMMON } from 'vue-native/compiler/config'\n\nexport function isObjectShallowModified(prev, next) {\n  // if (prev == null || next == null || typeof prev !== 'object' || typeof next !== 'object') {\n  //   return prev !== next\n  // }\n  // const keys = Object.keys(prev)\n  // if (keys.length !== Object.keys(next).length) {\n  //   return true\n  // }\n  // let key\n  // for (let i = keys.length - 1; i >= 0; i--) {\n  //   key = keys[i]\n  //   if (next[key] !== prev[key]) {\n  //     return true\n  //   }\n  // }\n  // return false\n  if (prev.children !== undefined || next.children !== undefined) {\n    return true\n  }\n  for (const k in next) {\n    if (typeof next[k] !== 'object') {\n      if (next[k] !== prev[k]) {\n        return true\n      }\n    }\n  }\n  return false\n}\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nexport function hasOwn(obj, key) {\n  return hasOwnProperty.call(obj, key)\n}\n\nexport function mergeCssModule(computed, cssModules) {\n  const _computed = Object.create(computed || null)\n  Object.keys(cssModules).forEach(function(key) {\n    var module = cssModules[key]\n    _computed[key] = function() {\n      return module\n    }\n  })\n  return _computed\n}\n\nexport function pascalCaseTag(tag) {\n  return tag\n    .split('-')\n    .map(v => v.replace(/^[a-z]/, s => s.toUpperCase()))\n    .join('')\n}\n\n/**\n * for options {components}\n * @param {Object} components\n */\n\nexport function handleComponents(components) {\n  for (const k in components) {\n    if (hasOwn(components, k)) {\n      components[pascalCaseTag(k)] = components[k]\n      const c = components[k]\n      if (c.name) {\n        components[pascalCaseTag(c.name)] = components[k]\n      }\n    }\n  }\n  return components\n}\n\nexport function handleDirectives(directives) {\n  const obj = {}\n  for (const k in directives) {\n    obj[k.toLowerCase().replace(/[^a-z]/g, '')] = directives[k]\n  }\n  return obj\n}\n\n/**\n * for 'this.$solts'\n * @param {this.props.children} children\n */\nexport function getSlots(children) {\n  const slots = {}\n  if (children == null) {\n    return slots\n  }\n  if (!Array.isArray(children)) {\n    children = [children]\n  }\n  children = children.filter(v => v != null)\n  children.forEach(v => {\n    if (typeof v === 'string' || typeof v === 'number' || v === null) {\n      slots.default = slots.default || []\n      slots.default.push(v)\n    } else if (v.type === COMMON.template.type) {\n      // data-slot renamed to dataSlot to fix named slot issue\n      slots[v['dataSlot']] = slots[v['dataSlot']] || []\n      slots[v['dataSlot']].push(v.render)\n    } else if (v.props) {\n      const dataSlot = v.props['dataSlot']\n      if (dataSlot == null) {\n        slots.default = slots.default || []\n        slots.default.push(v)\n      } else {\n        slots[dataSlot] = slots[dataSlot] || []\n        slots[dataSlot].push(v)\n      }\n    }\n  })\n  return slots\n}\n\nexport function filterCustomEvent(props) {\n  return Object.keys(props)\n    .filter(v => {\n      return v.indexOf(COMMON.customEvent.name) === 0\n    })\n    .map(v => {\n      return {\n        name: v.replace(COMMON.customEvent.name, ''),\n        handle: props[v],\n      }\n    })\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/directives/index.js",
    "content": "import model from './model'\n\nexport default {\n  model,\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/directives/model.js",
    "content": "import { looseEqual, looseIndexOf } from 'shared/util'\nimport { warn } from 'core/util/index'\n\nfunction setSelected(el, binding, vm) {\n  const value = binding.value\n  const isMultiple = el.multiple\n  if (isMultiple && !Array.isArray(value)) {\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        `<select multiple v-model=\"${binding.expression}\"> ` +\n          `expects an Array value for its binding, but got ${Object.prototype.toString\n            .call(value)\n            .slice(8, -1)}`,\n        vm,\n      )\n    return\n  }\n  let selected, option\n  for (let i = 0, l = el.options.length; i < l; i++) {\n    option = el.options[i]\n    if (isMultiple) {\n      selected = looseIndexOf(value, option.value) > -1\n      if (option.selected !== selected) {\n        option.selected = selected\n      }\n    } else {\n      if (looseEqual(option.value, value)) {\n        if (el.selectedIndex !== i) {\n          el.selectedIndex = i\n        }\n        return\n      }\n    }\n  }\n  if (!isMultiple) {\n    el.selectedIndex = -1\n  }\n}\n\nfunction setCheckBox(el, binding) {\n  let value = binding.value\n  try {\n    value = JSON.parse(value)\n  } catch (e) {}\n  if (value) {\n    el.setAttribute('checked', value)\n  } else {\n    el.removeAttribute('checked')\n  }\n}\n\nexport default {\n  bind(el, binding) {\n    if (el.tagName) {\n      const lowerTagName = el.tagName.toLowerCase()\n      if (lowerTagName === 'select') {\n        setSelected(el, binding, this)\n      } else if (lowerTagName === 'input') {\n        if (el.getAttribute('type') === 'checkbox') {\n          setCheckBox(el, binding)\n        }\n      }\n    }\n  },\n  update(el, binding) {\n    if (el.tagName) {\n      const lowerTagName = el.tagName.toLowerCase()\n      if (lowerTagName === 'select') {\n        setSelected(el, binding, this)\n      } else if (lowerTagName === 'input') {\n        if (el.getAttribute('type') === 'checkbox') {\n          setCheckBox(el, binding)\n        }\n      }\n    }\n  },\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/helpers.js",
    "content": "import platformDirectives from './directives/index.js'\n\nexport { platformDirectives }\nexport * from './render-helpers/index.js'\n// export * from './buildComponent.js'\nexport * from './components/index.js'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/index.js",
    "content": "import Vue from 'core/index'\n\nimport { lifeCycleMixin } from './lifeCycle'\nimport { renderMixin } from './render'\n\nlifeCycleMixin(Vue)\nrenderMixin(Vue)\n\nexport default Vue\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/lifeCycle.js",
    "content": "// @flow\n\nimport { remove } from 'core/util/index'\n\nexport function lifeCycleMixin(Vue: Class<Component>) {\n  Vue.prototype.$destroy = function() {\n    const vm: Component = this\n    if (vm._isBeingDestroyed) {\n      return\n    }\n    // callHook(vm, 'beforeDestroy')\n    vm._isBeingDestroyed = true\n    // remove self from parent\n    const parent = vm.$parent\n    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {\n      remove(parent.$children, vm)\n    }\n    // teardown watchers\n    if (vm._watcher) {\n      vm._watcher.teardown()\n    }\n    let i = vm._watchers.length\n    while (i--) {\n      vm._watchers[i].teardown()\n    }\n    // remove reference from data ob\n    // frozen object may not have observer.\n    if (vm._data.__ob__) {\n      vm._data.__ob__.vmCount--\n    }\n    // call the last hook...\n    vm._isDestroyed = true\n    // invoke destroy hooks on current rendered tree\n    // vm.__patch__(vm._vnode, null)\n    // fire destroyed hook\n    // callHook(vm, 'destroyed')\n    // turn off all instance listeners.\n    vm.$off()\n    // remove __vue__ reference\n    if (vm.$el) {\n      vm.$el.__vue__ = null\n    }\n    // remove reference to DOM nodes (prevents leak)\n    vm.$options._parentElm = vm.$options._refElm = null\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindNativeClass.js",
    "content": "function classBinding(c) {\n  const type = Object.prototype.toString.call(c)\n  if (type === '[object Object]') {\n    return Object.keys(c).filter(k => {\n      return !!c[k]\n    })\n  } else if (type === '[object Array]') {\n    return c\n      .map(v => {\n        return classBinding(v)\n      })\n      .reduce((acc, val) => {\n        return acc.concat(val)\n      }, [])\n  }\n  return c\n}\n\nexport function bindNativeClass(obj) {\n  let arr = []\n  const style = []\n  if (obj.dynamicClass) {\n    arr = arr.concat(classBinding(obj.dynamicClass))\n  }\n  if (obj.staticClass) {\n    arr = arr.concat(obj.staticClass.split(/\\s+/))\n  }\n  arr.forEach(v => {\n    // commit cf4d099 change moved here\n    style.push(this.css[v])\n  })\n  if (obj.parentClass) {\n    style.push(obj.parentClass)\n  }\n  return style\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindNativeStyle.js",
    "content": "export function bindNativeStyle(styleBinding, staticStyle, showStyle) {\n  if (styleBinding === undefined) {\n    styleBinding = {}\n  }\n  staticStyle = Object.assign({}, staticStyle, showStyle)\n  if (staticStyle.display === '') {\n    delete showStyle.display\n  }\n  const type = Object.prototype.toString.call(styleBinding)\n  if (type === '[object Object]') {\n    return Object.assign({}, styleBinding, staticStyle)\n  } else if (type === '[object Array]') {\n    return styleBinding\n      .map(v => {\n        return bindNativeStyle(v, staticStyle, showStyle)\n      })\n      .reduce((acc, val) => Object.assign(acc, val), {})\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindWebClass.js",
    "content": "export function bindWebClass(c) {\n  const type = Object.prototype.toString.call(c)\n  if (type === '[object Object]') {\n    return Object.keys(c)\n      .filter(k => {\n        return !!c[k]\n      })\n      .join(' ')\n  } else if (type === '[object Array]') {\n    return c\n      .map(v => {\n        return bindWebClass(v)\n      })\n      .join(' ')\n  }\n  return c\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindWebStyle.js",
    "content": "import { cached, camelize } from 'shared/util'\n\nconst prefixes = ['Webkit', 'Moz', 'ms']\n\nlet testEl\nconst normalize = cached(function(prop) {\n  testEl = testEl || document.createElement('div')\n  prop = camelize(prop)\n  if (prop !== 'filter' && prop in testEl.style) {\n    return prop\n  }\n  const upper = prop.charAt(0).toUpperCase() + prop.slice(1)\n  for (let i = 0; i < prefixes.length; i++) {\n    const prefixed = prefixes[i] + upper\n    if (prefixed in testEl.style) {\n      return prefixed\n    }\n  }\n})\n\nexport function bindWebStyle(styleBinding, staticStyle, showStyle) {\n  if (styleBinding === undefined) {\n    styleBinding = {}\n  }\n  staticStyle = Object.assign({}, staticStyle, showStyle)\n  const type = Object.prototype.toString.call(styleBinding)\n  if (type === '[object Object]') {\n    const normalizedStyle = {}\n    styleBinding = Object.assign({}, styleBinding, staticStyle)\n    for (const key in styleBinding) {\n      normalizedStyle[normalize(key)] = styleBinding[key]\n    }\n    return normalizedStyle\n  } else if (type === '[object Array]') {\n    return styleBinding\n      .map(v => {\n        return bindWebStyle(v, staticStyle, showStyle)\n      })\n      .reduce((acc, val) => Object.assign(acc, val), {})\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/checkKeyCodes.js",
    "content": "/* @flow */\nimport { warn } from 'core/util/index'\n/**\n * Runtime helper for checking keyCodes.\n */\nexport function checkKeyCodes(\n  vm: Object,\n  eventKeyCode: number,\n  key: string,\n  builtInAlias: number | Array<number> | void,\n): boolean {\n  let configKeyCodes = {}\n  try {\n    configKeyCodes = vm.$options._base.config.keyCodes\n  } catch (e) {\n    warn(\n      'vue-native checkKeyCodes vm.$options._base.config.keyCodes catch error',\n    )\n  }\n  const keyCodes = configKeyCodes[key] || builtInAlias\n  if (Array.isArray(keyCodes)) {\n    return keyCodes.indexOf(eventKeyCode) === -1\n  } else {\n    return keyCodes !== eventKeyCode\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/directive.js",
    "content": "import { COMMON } from 'vue-native/compiler/config'\n\nfunction triggerDirective(newData, oldData, vm, ref) {\n  let directive\n  if (newData) {\n    directive = vm.$options.directives[newData.name]\n  } else if (oldData) {\n    directive = vm.$options.directives[oldData.name]\n  }\n  if (!directive) {\n    return\n  }\n  let binding\n  if (newData && oldData) {\n    // update\n    binding = {\n      name: newData.name,\n      value: newData.value,\n      oldValue: oldData.value,\n      expression: newData.expression,\n      arg: newData.arg,\n      modifiers: newData.modifiers,\n    }\n    const args = [ref, binding]\n    if (typeof directive === 'function') {\n      directive.apply(vm, args)\n    } else if (typeof directive.update === 'function') {\n      directive.update.apply(vm, args)\n    }\n  } else if (newData && !oldData) {\n    // bind\n    binding = {\n      name: newData.name,\n      value: newData.value,\n      expression: newData.expression,\n      arg: newData.arg,\n      modifiers: newData.modifiers,\n    }\n    const args = [ref, binding]\n    if (typeof directive === 'function') {\n      directive.apply(vm, args)\n    } else if (typeof directive.bind === 'function') {\n      directive.bind.apply(vm, args)\n    }\n  } else if (!newData && oldData) {\n    // unbind\n    binding = {\n      name: oldData.name,\n      value: oldData.value,\n      expression: oldData.expression,\n      arg: oldData.arg,\n      modifiers: oldData.modifiers,\n    }\n    const args = [ref, binding]\n    if (typeof directive.unbind === 'function') {\n      directive.unbind.apply(vm, args)\n    }\n  }\n}\n\nfunction isObjectShallowModified(prev, next) {\n  if (\n    prev == null ||\n    next == null ||\n    typeof prev !== 'object' ||\n    typeof next !== 'object'\n  ) {\n    return prev !== next\n  }\n  const keys = Object.keys(prev)\n  if (keys.length !== Object.keys(next).length) {\n    return true\n  }\n  let key\n  for (let i = keys.length - 1; i >= 0; i--) {\n    key = keys[i]\n    if (next[key] !== prev[key]) {\n      return true\n    }\n  }\n  return false\n}\n\nexport function directive(Component, createElement) {\n  return class DirectiveForm extends Component {\n    constructor(props) {\n      super(props)\n      this.state = {\n        formProps: {},\n      }\n      this.ref = null\n    }\n    directive(newProps, oldProps) {\n      let context\n      let newDirectives = []\n      let oldDirectives = []\n      if (oldProps) {\n        context = oldProps[COMMON.directive.context]\n        oldDirectives = oldProps[COMMON.directive.name]\n      }\n      if (newProps) {\n        context = newProps[COMMON.directive.context]\n        newDirectives = newProps[COMMON.directive.name]\n      }\n      const newDirectivesClone = newDirectives.slice()\n      const oldDirectivesClone = oldDirectives.slice()\n      if (Array.isArray(newDirectives) && Array.isArray(oldDirectives)) {\n        newDirectives.forEach((newDirective, newIndex) => {\n          oldDirectives.forEach((oldDirective, oldIndex) => {\n            if (newDirective.name === oldDirective.name) {\n              newDirectivesClone.splice(newIndex, 1, undefined)\n              oldDirectivesClone.splice(oldIndex, 1, undefined)\n              triggerDirective(newDirective, oldDirective, context.vm, this.ref) // update\n            }\n          })\n        })\n        newDirectivesClone.forEach(v => {\n          // bind\n          v && triggerDirective(v, null, context.vm, this.ref)\n        })\n        oldDirectivesClone.forEach(v => {\n          // unbind\n          v && triggerDirective(null, v, context.vm, this.ref)\n        })\n      }\n    }\n    handle(props) {\n      const obj = {}\n      for (const key in props) {\n        if (\n          key !== COMMON.directive.name &&\n          key !== COMMON.directive.tag &&\n          key !== COMMON.directive.context\n        ) {\n          obj[key] = props[key]\n        }\n      }\n      const refFn = obj.ref || function() {}\n      obj.ref = ref => {\n        this.ref = ref\n        return refFn(ref)\n      }\n      const onChangeFn = obj.onChange || function() {}\n      obj.onChange = event => {\n        this.setState({\n          formProps: Object.assign({}, this.state.formProps, {\n            value: event.target.value,\n          }),\n        })\n        return onChangeFn(event)\n      }\n      this.setState({\n        formProps: obj,\n      })\n    }\n    UNSAFE_componentWillMount() {\n      this.handle(this.props)\n    }\n    componentDidMount() {\n      this.directive(this.props)\n    }\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.handle(nextProps)\n      this.directive(nextProps, this.props)\n    }\n    componentWillUnmount() {\n      this.directive(null, this.props)\n    }\n    shouldComponentUpdate(nextProps) {\n      return isObjectShallowModified(this.props, nextProps)\n    }\n    render() {\n      return createElement(\n        this.props[COMMON.directive.tag],\n        this.state.formProps,\n        this.props.children,\n      )\n    }\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/dynamicComponent.js",
    "content": "import { pascalCaseTag } from '../components/util.js'\n\nexport function dynamicComponent(vm, name) {\n  let componentName\n  if (typeof name === 'string') {\n    componentName = vm.$options.components[pascalCaseTag(name)]\n  } else {\n    componentName = name\n  }\n  return componentName\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/event.js",
    "content": "export function event(fn) {\n  if (Array.isArray(fn)) {\n    return function() {\n      return fn.map(v => v.apply(this, arguments))\n    }\n  } else {\n    return fn\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/handleProps.js",
    "content": "import { HELPER_HEADER } from 'vue-native/compiler/constants'\nimport propertyMap from 'vue-native/compiler/property/index'\nimport { isReservedTag, isUnaryTag } from 'vue-native/compiler/util/index'\n\nexport function handleProps(props, tag) {\n  let handledProps = {}\n  if (typeof tag === 'string' && isReservedTag(tag)) {\n    for (const key in props) {\n      const prop = propertyMap[key.toLowerCase()]\n      if (\n        prop &&\n        props[key] !== undefined &&\n        key.indexOf(HELPER_HEADER) !== 0\n      ) {\n        handledProps[prop] = props[key]\n      }\n    }\n  } else {\n    handledProps = props\n  }\n  if (isUnaryTag(tag)) {\n    delete handledProps.children\n  }\n  return handledProps\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/index.js",
    "content": "/**\n * @flow\n */\nexport * from 'shared/util'\nexport { renderList } from './renderList'\nexport { renderSlot } from './renderSlot'\nexport { bindWebClass } from './bindWebClass'\nexport { bindNativeClass } from './bindNativeClass'\nexport { bindWebStyle } from './bindWebStyle'\nexport { bindNativeStyle } from './bindNativeStyle'\nexport { mergeNativeStyleAndNativeClass } from './mergeNativeStyleAndNativeClass'\nexport { checkKeyCodes } from './checkKeyCodes'\nexport { template } from './template'\nexport { event } from './event'\nexport { mergeCssModule } from './mergeCssModule'\nexport { dynamicComponent } from './dynamicComponent'\nexport { resolveFilter } from './resolveFilter'\nexport { handleProps } from './handleProps'\nexport { mergeProps } from './mergeProps'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/mergeCssModule.js",
    "content": "export function mergeCssModule(computed, cssModules) {\n  const _computed = Object.create(computed || null)\n  Object.keys(cssModules).forEach(function(key) {\n    var module = cssModules[key]\n    _computed[key] = function() {\n      return module\n    }\n  })\n  return _computed\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/mergeNativeStyleAndNativeClass.js",
    "content": "export function mergeNativeStyleAndNativeClass(nativeClass, nativeStyle) {\n  let resultant = []\n  if (nativeClass) {\n    if (Object.prototype.toString.call(nativeClass) === '[object Array]') {\n      nativeClass.forEach(function(classObj) {\n        resultant.push(classObj)\n      })\n    } else if (\n      Object.prototype.toString.call(nativeClass) === '[object Object]'\n    ) {\n      resultant.push(nativeClass)\n    }\n  }\n  if (nativeStyle) {\n    if (Object.prototype.toString.call(nativeStyle) === '[object Array]') {\n      nativeStyle.forEach(function(classObj) {\n        resultant.push(classObj)\n      })\n    } else if (\n      Object.prototype.toString.call(nativeStyle) === '[object Object]'\n    ) {\n      resultant.push(nativeStyle)\n    }\n  }\n  return resultant\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/mergeProps.js",
    "content": "export function mergeProps() {\n  const args = Array.prototype.slice.call(arguments, 0).filter(v => v)\n  const obj = {}\n  args.forEach(o => {\n    Object.keys(o).forEach(k => {\n      if (!obj[k]) {\n        obj[k] = []\n      }\n      obj[k].push(o[k])\n    })\n  })\n  for (const k in obj) {\n    const l = obj[k].length\n    if (l === 1) {\n      obj[k] = obj[k][0]\n    } else if (l > 1) {\n      const _p = obj[k]\n      if (typeof _p[0] === 'function') {\n        obj[k] = function() {\n          for (let i = 0; i < l; i++) {\n            typeof _p[i] === 'function' && _p[i].apply(this, arguments)\n          }\n        }.bind(this)\n      } else {\n        obj[k] = obj[k][l - 1]\n      }\n    }\n  }\n  return obj\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/renderList.js",
    "content": "export { renderList } from 'core/instance/render-helpers/render-list'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/renderSlot.js",
    "content": "import { COMMON } from 'vue-native/compiler/config'\n\nexport function renderSlot(names, children) {\n  const hitSlot = {}\n  const defaultSlot = []\n  if (children == null) {\n    return () => {}\n  }\n  if (!Array.isArray(children)) {\n    children = [children]\n  }\n  children = children.filter(v => v != null)\n  children.forEach(v => {\n    if (v.type === COMMON.template.type) {\n      if (v['dataSlot'] === undefined) {\n        defaultSlot.push(v.render)\n      }\n      return\n    }\n    if (v.props === undefined || v.props['dataSlot'] === undefined) {\n      defaultSlot.push(v)\n    }\n  })\n  names.forEach(v => {\n    children.forEach(_v => {\n      if (typeof _v === 'string' || typeof _v === 'number') {\n        return\n      }\n      if (_v.type === COMMON.template.type) {\n        if (v === _v['dataSlot']) {\n          hitSlot[v] = _v.render\n        }\n        return\n      }\n      if (v === _v.props['dataSlot']) {\n        hitSlot[v] = _v\n      }\n      return\n    })\n  })\n  function render(name, props) {\n    let target\n    if (name === undefined) {\n      target = defaultSlot.length === 0 ? undefined : defaultSlot\n    } else {\n      target = hitSlot[name]\n    }\n    if (typeof target === 'function') {\n      return target(props)\n    } else if (Array.isArray(target)) {\n      return target.map(v => {\n        if (typeof v === 'function') {\n          return v(props)\n        } else {\n          return v\n        }\n      })\n    } else {\n      return target\n    }\n  }\n  return render\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/resolveFilter.js",
    "content": "export { resolveFilter } from 'core/instance/render-helpers/resolve-filter'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/template.js",
    "content": "export function template(props) {\n  return props.children\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/transitionGroupWeb.js",
    "content": "// unfinished\n\nexport function transitionGroupWeb(Component, createElement) {\n  return class TransitionGroup extends Component {\n    render() {\n      const tag = this.props.tag || 'span'\n      return createElement(tag, null)\n    }\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/transitionWeb.js",
    "content": "import { addClass, removeClass } from 'web/runtime/class-util.js'\nimport {\n  nextFrame,\n  resolveTransition,\n  whenTransitionEnds,\n  getTransitionInfo,\n} from 'web/runtime/transition-util'\nimport { isIE9, warn } from 'core/util/index'\nimport { once, isDef, isUndef, isObject, toNumber } from 'shared/util'\nimport { WEB, COMMON } from 'vue-native/compiler/config'\n\nfunction filterCollection(collection) {\n  const result = []\n  collection.forEach(v => {\n    if (v.type === 'if') {\n      const _result = v.conditions\n        .filter(_v => _v.exp)\n        .map(_v => {\n          return {\n            type: 'if',\n            index: _v.index,\n            element: _v.element,\n            exp: _v.exp,\n          }\n        })\n      if (_result.length) {\n        result.push(_result[0])\n      }\n    } else {\n      result.push(v)\n    }\n  })\n  if (result.length > 1) {\n    console.warn(\n      `<transition> can only be used on a single element. Use <transition-group> for lists.`,\n    )\n  }\n  return result\n}\n\n/**\n * Normalize a transition hook's argument length. The hook may be:\n * - a merged hook (invoker) with the original in .fns\n * - a wrapped component method (check ._length)\n * - a plain function (.length)\n */\nfunction getHookArgumentsLength(fn) {\n  if (isUndef(fn)) {\n    return false\n  }\n  const invokerFns = fn.fns\n  if (isDef(invokerFns)) {\n    // invoker\n    return getHookArgumentsLength(\n      Array.isArray(invokerFns) ? invokerFns[0] : invokerFns,\n    )\n  } else {\n    return (fn._length || fn.length) > 1\n  }\n}\n\n// only used in dev mode\nfunction checkDuration(val, name) {\n  if (typeof val !== 'number') {\n    warn(\n      `<transition> explicit ${name} duration is not a valid number - ` +\n        `got ${JSON.stringify(val)}.`,\n    )\n  } else if (isNaN(val)) {\n    warn(\n      `<transition> explicit ${name} duration is NaN - ` +\n        'the duration expression might be incorrect.',\n    )\n  }\n}\n\nfunction isValidDuration(val) {\n  return typeof val === 'number' && !isNaN(val)\n}\n\nfunction addTransitionClass(ref, className) {\n  addClass(ref, className)\n}\n\nfunction removeTransitionClass(ref, className) {\n  removeClass(ref, className)\n}\n\nexport function enter({ el, cb }) {\n  const {\n    css,\n    type,\n    enterClass,\n    enterToClass,\n    enterActiveClass,\n    appearClass,\n    appearToClass,\n    appearActiveClass,\n    onBeforeEnter,\n    onEnter,\n    onAfterEnter,\n    onEnterCancelled,\n    onBeforeAppear,\n    appear,\n    onAppear,\n    onAfterAppear,\n    onAppearCancelled,\n    duration,\n  } = this.transitionResolved\n\n  const isAppear = this.isAppear\n\n  if (isUndef(el)) {\n    return\n  }\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  if (isDef(el._enterCb) || el.nodeType !== 1) {\n    return\n  }\n\n  const startClass = isAppear && appearClass ? appearClass : enterClass\n  const activeClass =\n    isAppear && appearActiveClass ? appearActiveClass : enterActiveClass\n  const toClass = isAppear && appearToClass ? appearToClass : enterToClass\n\n  const beforeEnterHook = isAppear\n    ? onBeforeAppear || onBeforeEnter\n    : onBeforeEnter\n  const enterHook = isAppear ? onAppear || onEnter : onEnter\n  const afterEnterHook = isAppear ? onAfterAppear || onAfterEnter : onAfterEnter\n  const enterCancelledHook = isAppear\n    ? onAppearCancelled || onEnterCancelled\n    : onEnterCancelled\n\n  const explicitEnterDuration = toNumber(\n    isObject(duration) ? duration.enter : duration,\n  )\n\n  if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {\n    checkDuration(explicitEnterDuration, 'enter')\n  }\n\n  const expectsCSS = css !== false && !isIE9\n  const userWantsControl = getHookArgumentsLength(enterHook)\n\n  const _cb = (el._enterCb = once(() => {\n    if (expectsCSS) {\n      removeTransitionClass(el, activeClass)\n      removeTransitionClass(el, toClass)\n    }\n    cb && cb()\n    if (_cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass)\n      }\n      enterCancelledHook && enterCancelledHook(el)\n    } else {\n      afterEnterHook && afterEnterHook(el)\n    }\n    el._enterCb = null\n  }))\n\n  beforeEnterHook && beforeEnterHook(el)\n\n  if (expectsCSS) {\n    addTransitionClass(el, startClass)\n    addTransitionClass(el, activeClass)\n\n    nextFrame(() => {\n      removeTransitionClass(el, startClass)\n      addTransitionClass(el, toClass)\n      if (!_cb.cancelled && !userWantsControl) {\n        if (isValidDuration(explicitEnterDuration)) {\n          setTimeout(_cb, explicitEnterDuration)\n        } else {\n          whenTransitionEnds(el, type || getTransitionInfo(el).type, _cb)\n        }\n      }\n    })\n  }\n\n  nextFrame(() => enterHook && enterHook(el, _cb))\n\n  if (!expectsCSS && !userWantsControl) {\n    _cb()\n  }\n}\n\nexport function leave({ el, cb }) {\n  const {\n    css,\n    type,\n    leaveClass,\n    leaveToClass,\n    leaveActiveClass,\n    onBeforeLeave,\n    onLeave,\n    onAfterLeave,\n    onLeaveCancelled,\n    duration,\n  } = this.transitionResolved\n\n  if (isUndef(el)) {\n    return\n  }\n\n  if (isDef(el._leaveCb) || el.nodeType !== 1) {\n    return\n  }\n\n  const expectsCSS = css !== false && !isIE9\n  const userWantsControl = getHookArgumentsLength(onLeave)\n\n  const explicitLeaveDuration = toNumber(\n    isObject(duration) ? duration.leave : duration,\n  )\n\n  if (process.env.NODE_ENV !== 'production' && explicitLeaveDuration != null) {\n    checkDuration(explicitLeaveDuration, 'leave')\n  }\n\n  const _cb = (el._leaveCb = once(() => {\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveActiveClass)\n      removeTransitionClass(el, leaveToClass)\n    }\n    cb && cb()\n    if (_cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass)\n      }\n      onLeaveCancelled && onLeaveCancelled(el)\n    } else {\n      onAfterLeave && onAfterLeave(el)\n    }\n    el._leaveCb = null\n  }))\n\n  onBeforeLeave && onBeforeLeave(el)\n  if (expectsCSS) {\n    addTransitionClass(el, leaveClass)\n    addTransitionClass(el, leaveActiveClass)\n\n    nextFrame(() => {\n      removeTransitionClass(el, leaveClass)\n      addTransitionClass(el, leaveToClass)\n      if (!_cb.cancelled && !userWantsControl) {\n        if (isValidDuration(explicitLeaveDuration)) {\n          setTimeout(_cb, explicitLeaveDuration)\n        } else {\n          whenTransitionEnds(el, type || getTransitionInfo(el).type, _cb)\n        }\n      }\n    })\n  }\n  onLeave && onLeave(el, _cb)\n  if (!expectsCSS && !userWantsControl) {\n    _cb()\n  }\n}\n\nexport function transitionWeb(Component, createElement) {\n  class Transition extends Component {\n    constructor(props) {\n      super(props)\n      this._refs = {}\n      this.transitionResolved = {}\n      this._shouldComponentUpdateTransitionResult = false\n      this.isAppear = false\n      this.state = {\n        transObj: {},\n        animated: true,\n        tagKey: null,\n      }\n    }\n\n    setRef(ref, key) {\n      if (!ref) {\n        return\n      }\n      this._refs[key] = ref.ref || ref\n    }\n\n    resolveData(props, type) {\n      const target = filterCollection(props[WEB.transition.collection])[0]\n      if (target) {\n        const element = target.element\n        const _props = {}\n        for (const key in element.props) {\n          _props[key] = element.props[key]\n        }\n\n        let key = target.index\n        if (element.key != null) {\n          key = element.key + key\n        }\n        if (target.type === 'component') {\n          const targetExp = target.exp\n          const thisTarget = this.state.transObj[this.state.tagKey]\n          const thisExp = thisTarget && thisTarget.exp\n          if (targetExp !== thisExp) {\n            key = this.state.tagKey === 0 ? 1 : 0\n          }\n        }\n        _props.key = _props.key || key\n\n        const setRef = ref => {\n          this.setRef(ref, _props.key)\n          element.ref && element.ref(ref)\n        }\n        if (target.type === 'component') {\n          _props[COMMON.setRef.name] = setRef\n        } else {\n          _props.ref = setRef\n        }\n\n        const transObj = Object.assign({}, this.state.transObj)\n        transObj[_props.key] = Object.assign({}, target, {\n          props: _props,\n        })\n        return {\n          transObj: transObj,\n          animated: true,\n          tagKey: _props.key,\n        }\n      } else if (type === 'update') {\n        return this.triggerTransitionExp()\n      }\n    }\n\n    triggerTransitionExp() {\n      const tagKey = this.state.tagKey\n      const transition = this.state.transObj[tagKey]\n      // someone want to hide and his prev state is show\n      if (transition) {\n        const transObj = {}\n        transObj[tagKey] = Object.assign({}, transition, {\n          exp: !transition.exp,\n        })\n        return {\n          animated: true,\n          transObj: transObj,\n          tagKey: tagKey,\n        }\n      }\n    }\n\n    UNSAFE_componentWillMount() {\n      this.transitionResolved = resolveTransition(this.props)\n      this.isAppear = true\n      const state = this.resolveData(this.props)\n      state && this.setState(state)\n    }\n\n    componentDidMount() {\n      this.resolveEnterTransition({\n        el: this._refs[this.state.tagKey],\n      })\n    }\n\n    UNSAFE_componentWillReceiveProps(nextProps) {\n      this.transitionResolved = resolveTransition(nextProps)\n      this.isAppear = false\n      const nextState = this.resolveData(nextProps, 'update')\n      this._shouldComponentUpdateTransitionResult = nextState\n        ? this._shouldComponentUpdateTransition(nextProps, nextState)\n        : true\n      Object.keys(this._refs).forEach(k => {\n        const el = this._refs[k]\n        if (isDef(el._leaveCb)) {\n          el._leaveCb.cancelled = true\n          el._leaveCb()\n        }\n        if (isDef(el._enterCb)) {\n          el._enterCb.cancelled = true\n          el._enterCb()\n        }\n      })\n      nextState && this.setState(nextState)\n    }\n\n    _shouldComponentUpdateTransition(nextProps, nextState) {\n      if (\n        Object.keys(nextState.transObj).length !==\n        Object.keys(this.state.transObj).length\n      ) {\n        return true\n      }\n      if (nextState.tagKey === this.state.tagKey) {\n        const nextTransition = nextState.transObj[nextState.tagKey]\n        const transition = this.state.transObj[this.state.tagKey]\n        if (nextTransition && transition) {\n          return transition.exp !== nextTransition.exp\n        }\n      }\n      return true\n    }\n\n    // shouldComponentUpdate () {\n    //   return this._shouldComponentUpdateTransitionResult\n    // }\n\n    resolveEnterTransition(option) {\n      enter.call(this, option)\n    }\n\n    resolveLeaveTransition(option) {\n      leave.call(this, option)\n    }\n\n    componentDidUpdate(prevProps, prevState) {\n      if (\n        this.state.animated === false ||\n        this._shouldComponentUpdateTransition === false\n      ) {\n        return\n      }\n      if (this.state.tagKey === prevState.tagKey) {\n        // same element\n        const ref = this._refs[this.state.tagKey]\n        const transition = this.state.transObj[this.state.tagKey]\n        if (ref && transition) {\n          if (transition.type === 'show') {\n            if (transition.exp === false) {\n              this.resolveLeaveTransition({\n                el: ref,\n                cb: () => {\n                  ref.style.display = 'none'\n                },\n              })\n            } else if (transition.exp === true) {\n              ref.style.display = ''\n              this.resolveEnterTransition({\n                el: ref,\n              })\n            }\n          } else if (transition.type === 'if') {\n            if (transition.exp === false) {\n              const transObj = Object.assign({}, this.state.transObj)\n              delete transObj[prevState.tagKey]\n              this.resolveLeaveTransition({\n                el: ref,\n                cb: () => {\n                  this.setState({\n                    transObj: transObj,\n                    animated: false,\n                  })\n                },\n              })\n            } else if (transition.exp === true) {\n              this.resolveEnterTransition({\n                el: ref,\n              })\n            }\n          }\n        }\n      } else {\n        const enterRef = this._refs[this.state.tagKey]\n        const leaveRef = this._refs[prevState.tagKey]\n        const transObj = Object.assign({}, this.state.transObj)\n        delete transObj[prevState.tagKey]\n        this.resolveEnterTransition({\n          el: enterRef,\n        })\n        this.resolveLeaveTransition({\n          el: leaveRef,\n          cb: () => {\n            this.setState({\n              transObj: transObj,\n              animated: false,\n            })\n          },\n        })\n      }\n    }\n\n    render() {\n      const transObj = this.state.transObj\n      const tag = this.props.tag || 'null'\n      return createElement(\n        tag,\n        null,\n        Object.keys(transObj).map(k => {\n          const type = transObj[k].element.type\n          const props = transObj[k].props\n          const children = props.children\n          return createElement(type, props, children)\n        }),\n      )\n    }\n  }\n  return Transition\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render.js",
    "content": "// @flow\n\nimport { nextTick } from 'core/util/index'\n\nexport function renderMixin(Vue: Class<Component>) {\n  Vue.prototype.$nextTick = function(fn: Function) {\n    return nextTick(fn, this)\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/compiler.js",
    "content": "// const fs = require('fs')\nimport * as compiler from 'vue-native-template-compiler'\nimport cssParse from 'css-parse'\nimport { js_beautify as beautify } from 'js-beautify'\nimport sourceMap from 'source-map'\nimport hash from 'hash-sum'\nimport path from 'path'\nimport lineNumber from 'line-number'\nimport parse5 from 'parse5'\n\nimport constants from './util/constants'\nimport { addvm } from './util/addvm'\nimport { parseCss } from './util/parseCss'\n\nvar newLine = /\\r?\\n/g\n\nconst DEFAULT_OUTPUT = {\n  template: {\n    import: `import { Component as ${constants.COMPONENT} } from 'react'`,\n    render: `const ${constants.TEMPLATE_RENDER} = () => null`,\n  },\n  script: `const ${constants.SCRIPT_OPTIONS} = {}`,\n}\n\nexport function compileVueToRn(resource, filename = 'sfc.vue') {\n  const originalCodeString = resource.toString()\n  const parsedSFC = compiler.parseComponent(originalCodeString, { pad: 'line' })\n\n  let output = ''\n  let mappings = ''\n\n  // add react-vue import\n  output += `import ${constants.VUE}, { observer as ${constants.OBSERVER} } from 'vue-native-core'`\n  output += '\\n'\n\n  // // add react import\n  // output += `import ${constants.REACT} from 'react'`\n  // output += '\\n';\n\n  // add react-native import\n  output += `import ${constants.REACT_NATIVE} from 'react-native'`\n  output += '\\n'\n\n  // add prop-type import\n  output += `import ${constants.PROP_TYPE} from 'prop-types'`\n  output += '\\n'\n\n  // add component builder import\n  output += `import { buildNativeComponent as ${constants.BUILD_COMPONENT} } from 'vue-native-helper'`\n  output += '\\n'\n\n  // parse template\n  const template = parsedSFC.template\n\n  //Consider the start of template for debugging\n  //\n\n  let templateStartIndex = parsedSFC.template.start\n  let templateStartLineNumber = originalCodeString\n    .substring(0, templateStartIndex)\n    .split(newLine).length\n\n  // Get tags and location of tags from template\n  //\n  let templateASTNodes = []\n  const templateFragments = parse5.parseFragment(parsedSFC.template.content, {\n    sourceCodeLocationInfo: true,\n  })\n  if (templateFragments.childNodes) {\n    traverse(templateFragments, templateASTNodes)\n  }\n\n  let generatedTemplateCode = DEFAULT_OUTPUT.template\n  if (template) {\n    const templateContent = template.content.replace(/\\/\\/\\n/g, '').trim()\n    if (templateContent) {\n      generatedTemplateCode = parseTemplate(templateContent)\n    }\n  }\n\n  // add render dep import\n  output += generatedTemplateCode.import\n  output += '\\n'\n\n  // Record the start of the script content\n  //\n\n  // parse script\n  const script = parsedSFC.script\n\n  let generatedScriptCode = DEFAULT_OUTPUT.script\n  if (script) {\n    const scriptContentStartLine = getFirstValidLine(script.content)\n\n    const scriptContent = script.content\n      .split(newLine)\n      .slice(scriptContentStartLine)\n      .join('\\n')\n      .trim()\n    generatedScriptCode = parseScript(scriptContent)\n\n    mappings = generateSourceMap(originalCodeString, filename)\n  }\n\n  // add vue options\n  output += generatedScriptCode\n  output += '\\n\\n'\n\n  if (mappings) {\n    // Start of the script content of the original code\n    let exportDefaultIndex = originalCodeString.indexOf('export default')\n    let exportDefaultLineNumber = originalCodeString\n      .substring(0, exportDefaultIndex)\n      .split(newLine).length\n    let firstLineOfScript = getFirstValidLine(script.content) + 1\n    let scriptEndLine = script.content.split(newLine).length\n    var endLines = output.split(newLine).length - 1\n\n    let generatedCodeCursor = endLines\n\n    // Mapping from Bottom to Up from the endlines of script and generated code to first valid line of parsed script content\n    for (\n      let scriptCodeCursor = scriptEndLine;\n      scriptCodeCursor >= firstLineOfScript;\n      scriptCodeCursor--\n    ) {\n      //Skip export default line\n      if (scriptCodeCursor !== exportDefaultLineNumber) {\n        mappings.addMapping({\n          source: mappings._hashedFilename,\n          generated: {\n            line: generatedCodeCursor,\n            column: 0,\n          },\n          original: {\n            line: scriptCodeCursor,\n            column: 0,\n          },\n        })\n      }\n      generatedCodeCursor--\n    }\n  }\n\n  // add render funtion\n  let beautifiedRender = beautify(\n    addvm(generatedTemplateCode.render, { indent_size: 2 }),\n  )\n  output += beautifiedRender\n  output += '\\n\\n'\n\n  // Get last line of render code\n  //\n  let renderEndLine = beautifiedRender.split(newLine).length - 1\n\n  // Search Elements and postion based on render function\n  //\n  var reactVueElementRegex = /__react__vue__createElement/\n  let foundLines = lineNumber(beautifiedRender, reactVueElementRegex)\n\n  if (mappings) {\n    foundLines.forEach((line, index) => {\n      let renderJsLine = endLines + line.number\n      if (foundLines[index + 1]) {\n        for (let i = line.number; i < foundLines[index + 1].number; i++) {\n          // Add Mapping\n          if (templateASTNodes[index]) {\n            mappings.addMapping({\n              source: mappings._hashedFilename,\n              generated: {\n                line: renderJsLine++,\n                column: 0,\n              },\n              original: {\n                line:\n                  templateASTNodes[index].startTag.startLine +\n                  templateStartLineNumber,\n                column: 0,\n              },\n            })\n          }\n        }\n      } else if (templateASTNodes[index] && templateASTNodes[index].startTag) {\n        // Last Line\n        for (let i = line.number; i < renderEndLine; i++) {\n          // Add Mapping\n          mappings.addMapping({\n            source: mappings._hashedFilename,\n            generated: {\n              line: renderJsLine++,\n              column: 0,\n            },\n            original: {\n              line:\n                templateASTNodes[index].startTag.startLine +\n                templateStartLineNumber,\n              column: 0,\n            },\n          })\n        }\n      }\n    })\n  }\n\n  // parse css\n  const styles = parsedSFC.styles\n  let cssParsed = {}\n  styles.forEach(function(v) {\n    const cssAst = cssParse(v.content)\n    cssParsed = Object.assign({}, cssParsed, parseCss(cssAst))\n  })\n\n  // add css obj\n  output += `const ${constants.CSS} = ${JSON.stringify(cssParsed)}`\n  output += '\\n\\n'\n\n  // add builder\n  output += `const ${constants.COMPONENT_BUILDED} = ${constants.BUILD_COMPONENT}(${constants.TEMPLATE_RENDER}, ${constants.SCRIPT_OPTIONS}, {Component: ${constants.COMPONENT}, PropTypes: ${constants.PROP_TYPE}, Vue: ${constants.VUE}, ReactNative: ${constants.REACT_NATIVE}, css: ${constants.CSS}})`\n  output += '\\n\\n'\n\n  // export default\n  output += `export default ${constants.OBSERVER}(${constants.COMPONENT_BUILDED})`\n\n  // beautiful\n  // output = beautify(output, { indent_size: 2 });\n\n  return { output, mappings: mappings ? mappings.toJSON() : null }\n}\n\n// function remove(name) {\n//   fs.unlink(name.replace(FILTER, '.js'), function(err) {\n//     if (err) {\n//       throw err;\n//     }\n//   });\n// }\n\nfunction parseTemplate(code) {\n  const obj = compiler.nativeCompiler(code)\n  return {\n    import: obj.importCode,\n    render: `const ${constants.TEMPLATE_RENDER} = ${obj.renderCode}`,\n  }\n}\n\nfunction generateSourceMap(content, filePath) {\n  // hot-reload source map busting\n  var hashedFilename = path.basename(filePath) + '?' + hash(filePath + content)\n  var map = new sourceMap.SourceMapGenerator()\n  map.setSourceContent(hashedFilename, content)\n  map._hashedFilename = hashedFilename\n  return map\n}\n\nfunction parseScript(code) {\n  const s = `const ${constants.SCRIPT_OPTIONS} = `\n  code = code\n    .replace(/[\\s;]*module.exports[\\s]*=/, `\\n${s}`)\n    .replace(/[\\s;]*export[\\s]+default[\\s]*\\{/, `\\n${s} {`)\n  return code\n}\n\nfunction traverse(ast, nodes = []) {\n  if (ast.tagName) {\n    nodes.push(ast.sourceCodeLocation)\n  }\n  if (ast.childNodes) {\n    ast.childNodes.forEach(child => {\n      traverse(child, nodes)\n    })\n  }\n}\n\nfunction getFirstLineWithText(content, text) {\n  const contentByLine = content.split(newLine)\n  if (!content.includes(text)) {\n    return contentByLine.length\n  }\n  return contentByLine.findIndex(line => line.includes(text))\n}\n\nfunction getFirstLineWithoutText(content, text) {\n  const contentByLine = content.split(newLine)\n  if (!content.includes(text)) {\n    return 0\n  }\n  return contentByLine.findIndex(line => !line.includes(text))\n}\n\nfunction getFirstValidLine(content) {\n  const firstImport = getFirstLineWithText(content, 'import')\n  const firstExport = getFirstLineWithText(content, 'export')\n  const firstNonCommentedLine = getFirstLineWithoutText(content, '//')\n\n  return Math.min(firstImport, firstExport, firstNonCommentedLine)\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/index.js",
    "content": "import { compileVueToRn } from './compiler'\nimport { transform } from './transformerPlugin'\n\nexport default {\n  compileVueToRn,\n  transform,\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/transformerPlugin.js",
    "content": "import semver from 'semver'\nimport traverse from 'babel-traverse'\nimport { SourceMapConsumer } from 'source-map'\n\nimport { compileVueToRn as reactVueTemplateParser } from './compiler'\nimport { version as reactNativeVersionString } from 'react-native/package.json'\n\n// const reactNativeVersionString = require('react-native/package.json').version;\nconst reactNativeMinorVersion = semver(reactNativeVersionString).minor\n\nlet upstreamTransformer = null\nif (reactNativeMinorVersion >= 59) {\n  upstreamTransformer = require('metro-react-native-babel-transformer')\n} else if (reactNativeMinorVersion >= 56) {\n  upstreamTransformer = require('metro/src/reactNativeTransformer')\n} else if (reactNativeMinorVersion >= 52) {\n  upstreamTransformer = require('metro/src/transformer')\n} else if (reactNativeMinorVersion >= 47) {\n  upstreamTransformer = require('metro-bundler/src/transformer')\n} else if (reactNativeMinorVersion === 46) {\n  upstreamTransformer = require('metro-bundler/build/transformer')\n} else {\n  // handle RN <= 0.45\n  var oldUpstreamTransformer = require('react-native/packager/transformer')\n  upstreamTransformer = {\n    transform({ src, filename, options }) {\n      return oldUpstreamTransformer.transform(src, filename, options)\n    },\n  }\n}\n\nfunction sourceMapAstInPlace(sourceMap, babelAst) {\n  const consumer = new SourceMapConsumer(sourceMap)\n\n  traverse.cheap(babelAst, node => {\n    if (node.loc) {\n      const originalStart = consumer.originalPositionFor(node.loc.start)\n      // Removed the column mapping with original position as we have only mapped lines during generation\n      if (originalStart.line) {\n        node.loc.start.line = originalStart.line\n        // node.loc.start.column = originalStart.column\n      }\n      const originalEnd = consumer.originalPositionFor(node.loc.end)\n      if (originalEnd.line) {\n        node.loc.end.line = originalEnd.line\n        // node.loc.end.column = originalEnd.column\n      }\n    }\n  })\n}\n\nexport function transform({ src, filename, options }) {\n  if (typeof src === 'object') {\n    // handle RN >= 0.46\n    ;({ src, filename, options } = src)\n  }\n  const outputFile = reactVueTemplateParser(src)\n\n  if (!outputFile.output) {\n    return upstreamTransformer.transform({\n      src: outputFile,\n      filename,\n      options,\n    })\n  } else {\n    // Source Map support\n    const babelCompileResult = upstreamTransformer.transform({\n      src: outputFile.output,\n      filename,\n      options,\n    })\n    if (outputFile.mappings) {\n      sourceMapAstInPlace(outputFile.mappings, babelCompileResult.ast)\n    }\n    return babelCompileResult\n  }\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/addvm.js",
    "content": "import { transform } from 'babel-core'\nimport constants from './constants'\n\nconst names =\n  'Infinity,undefined,NaN,isFinite,isNaN,console,' +\n  'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n  'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n  'require,' + // for webpack\n  'arguments' // parsed as identifier but is a special keyword...\n\nconst hash = Object.create(null)\nnames.split(',').forEach(function(name) {\n  hash[name] = true\n})\n\nexport function addvm(code) {\n  const r = transform(code, {\n    plugins: [\n      function({ types: t }) {\n        return {\n          visitor: {\n            Identifier: function(path) {\n              if (\n                path.parent.type === 'ObjectProperty' &&\n                path.parent.key === path.node\n              )\n                return\n              if (\n                t.isDeclaration(path.parent.type) &&\n                path.parent.id === path.node\n              )\n                return\n              if (\n                t.isFunction(path.parent.type) &&\n                path.parent.params.indexOf(path.node) > -1\n              )\n                return\n              if (\n                path.parent.type === 'Property' &&\n                path.parent.key === path.node &&\n                !path.parent.computed\n              )\n                return\n              if (\n                path.parent.type === 'MemberExpression' &&\n                path.parent.property === path.node &&\n                !path.parent.computed\n              )\n                return\n              if (path.parent.type === 'ArrayPattern') return\n              if (path.parent.type === 'ImportSpecifier') return\n              if (path.scope.hasBinding(path.node.name)) return\n              if (hash[path.node.name]) return\n              if (path.node.name.indexOf(constants.HELPER_HEADER) === 0) return\n              path.node.name = `vm['${path.node.name}']`\n            },\n          },\n        }\n      },\n    ],\n  })\n  return r.code\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/constants.js",
    "content": "const HELPER_HEADER = '__react__vue__'\nconst SCRIPT_OPTIONS = `${HELPER_HEADER}options`\nconst TEMPLATE_RENDER = `${HELPER_HEADER}render`\nconst REACT_NATIVE = `${HELPER_HEADER}ReactNative`\nconst BUILD_COMPONENT = `${HELPER_HEADER}buildNativeComponent`\nconst COMPONENT_BUILDED = `${HELPER_HEADER}ComponentBuilded`\nconst VUE = `${HELPER_HEADER}Vue`\nconst REACT = `${HELPER_HEADER}React`\nconst COMPONENT = `${HELPER_HEADER}Component`\nconst PROP_TYPE = `${HELPER_HEADER}PropType`\nconst OBSERVER = `${HELPER_HEADER}observer`\nconst CSS = `${HELPER_HEADER}css`\n\nexport default {\n  HELPER_HEADER,\n  SCRIPT_OPTIONS,\n  TEMPLATE_RENDER,\n  REACT_NATIVE,\n  BUILD_COMPONENT,\n  COMPONENT_BUILDED,\n  VUE,\n  REACT,\n  COMPONENT,\n  PROP_TYPE,\n  OBSERVER,\n  CSS,\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/parseCss.js",
    "content": "import { parseTransform } from './parseTransform'\n\nconst camelizeRE = /-(\\w)/g\n\nfunction camelize(str) {\n  return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\n}\n\nfunction parseDeclarations(declarations) {\n  const declarationObj = {}\n\n  // Comments and @media blocks don't have declarations at the top level.\n  if (declarations) {\n    declarations.forEach(function(declaration) {\n      if (declaration.type === 'declaration') {\n        let value = declaration.value\n        if (/px$/.test(value)) {\n          value = parseFloat(value.replace(/px$/, ''))\n        } else if (\n          declaration.property !== 'font-weight' &&\n          isNaN(value) === false\n        ) {\n          value = parseFloat(value)\n        }\n        if (declaration.property === 'transform') {\n          value = parseTransform(value)\n        }\n        declarationObj[camelize(declaration.property)] = value\n      }\n    })\n  }\n\n  return declarationObj\n}\n\nexport function parseCss(ast) {\n  const obj = {}\n  if (ast.type === 'stylesheet') {\n    ast.stylesheet.rules.forEach(function(rule) {\n      const declarationObj = parseDeclarations(rule.declarations)\n      if (rule.selectors) {\n        rule.selectors.forEach(function(selector) {\n          if (selector.indexOf('.') === 0) {\n            obj[selector.replace(/^\\./, '')] = declarationObj\n          }\n        })\n      }\n    })\n  }\n  return obj\n}\n"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/parseTransform.js",
    "content": "const TRANSFORM_TRANSLATE_REGEX = /translate\\(([-+]?[\\d]*\\.?[\\d]+)(px)?,[\\s]+([-+]?[\\d]*\\.?[\\d]+)(px)?\\)/\nconst TRANSFORM_TRANSLATE_X_REGEX = /translateX\\(([-+]?[\\d]*\\.?[\\d]+)(px)?\\)/\nconst TRANSFORM_TRANSLATE_Y_REGEX = /translateY\\(([-+]?[\\d]*\\.?[\\d]+)(px)?\\)/\nconst TRANSFORM_ROTATE_REGEX = /rotate\\(([-+]?[\\d]*\\.?[\\d]+)deg\\)/\nconst TRANSFORM_ROTATE_X_REGEX = /rotateX\\(([-+]?[\\d]*\\.?[\\d]+)deg\\)/\nconst TRANSFORM_ROTATE_Y_REGEX = /rotateY\\(([-+]?[\\d]*\\.?[\\d]+)deg\\)/\nconst TRANSFORM_ROTATE_Z_REGEX = /rotateZ\\(([-+]?[\\d]*\\.?[\\d]+)deg\\)/\nconst TRANSFORM_SCALE_REGEX = /scale\\(([-+]?[\\d]*\\.?[\\d]+)\\)/\nconst TRANSFORM_SCALE_X_REGEX = /scaleX\\(([-+]?[\\d]*\\.?[\\d]+)\\)/\nconst TRANSFORM_SCALE_Y_REGEX = /scaleY\\(([-+]?[\\d]*\\.?[\\d]+)\\)/\nconst TRANSFORM_SKEW_X_REGEX = /skewX\\(([-+]?[\\d]*\\.?[\\d]+)deg\\)/\nconst TRANSFORM_SKEW_Y_REGEX = /skewY\\(([-+]?[\\d]*\\.?[\\d]+)deg\\)/\n\nexport function parseTransform(value) {\n  const arr = []\n  if (TRANSFORM_ROTATE_REGEX.test(value)) {\n    arr.push({\n      rotate: `${value.match(TRANSFORM_ROTATE_REGEX)[1]}deg`,\n    })\n  }\n  if (TRANSFORM_ROTATE_X_REGEX.test(value)) {\n    arr.push({\n      rotateX: `${value.match(TRANSFORM_ROTATE_X_REGEX)[1]}deg`,\n    })\n  }\n  if (TRANSFORM_ROTATE_Y_REGEX.test(value)) {\n    arr.push({\n      rotateY: `${value.match(TRANSFORM_ROTATE_Y_REGEX)[1]}deg`,\n    })\n  }\n  if (TRANSFORM_ROTATE_Z_REGEX.test(value)) {\n    arr.push({\n      rotateZ: `${value.match(TRANSFORM_ROTATE_Z_REGEX)[1]}deg`,\n    })\n  }\n  if (TRANSFORM_SKEW_X_REGEX.test(value)) {\n    arr.push({\n      skewX: `${value.match(TRANSFORM_SKEW_X_REGEX)[1]}deg`,\n    })\n  }\n  if (TRANSFORM_SKEW_Y_REGEX.test(value)) {\n    arr.push({\n      skewY: `${value.match(TRANSFORM_SKEW_Y_REGEX)[1]}deg`,\n    })\n  }\n  if (TRANSFORM_SCALE_REGEX.test(value)) {\n    let r = value.match(TRANSFORM_SCALE_REGEX)[1]\n    if (isNaN(r) === false) {\n      r = parseFloat(r)\n    }\n    arr.push({\n      scale: r,\n    })\n  }\n  if (TRANSFORM_SCALE_X_REGEX.test(value)) {\n    let r = value.match(TRANSFORM_SCALE_X_REGEX)[1]\n    if (isNaN(r) === false) {\n      r = parseFloat(r)\n    }\n    arr.push({\n      scaleX: r,\n    })\n  }\n  if (TRANSFORM_SCALE_Y_REGEX.test(value)) {\n    let r = value.match(TRANSFORM_SCALE_Y_REGEX)[1]\n    if (isNaN(r) === false) {\n      r = parseFloat(r)\n    }\n    arr.push({\n      scaleY: r,\n    })\n  }\n  if (TRANSFORM_TRANSLATE_REGEX.test(value)) {\n    const rs = value.match(TRANSFORM_TRANSLATE_REGEX)\n    let rx = rs[1]\n    let ry = rs[2]\n    if (isNaN(rx) === false) {\n      rx = parseFloat(rx)\n    }\n    if (isNaN(ry) === false) {\n      ry = parseFloat(ry)\n    }\n    arr.push({\n      translateX: rx,\n    })\n    arr.push({\n      translateY: ry,\n    })\n  }\n  if (TRANSFORM_TRANSLATE_X_REGEX.test(value)) {\n    let r = value.match(TRANSFORM_TRANSLATE_X_REGEX)[1]\n    if (isNaN(r) === false) {\n      r = parseFloat(r)\n    }\n    arr.push({\n      translateX: r,\n    })\n  }\n  if (TRANSFORM_TRANSLATE_Y_REGEX.test(value)) {\n    let r = value.match(TRANSFORM_TRANSLATE_Y_REGEX)[1]\n    if (isNaN(r) === false) {\n      r = parseFloat(r)\n    }\n    arr.push({\n      translateY: r,\n    })\n  }\n  return arr\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/directives/html.js",
    "content": "/* @flow */\n\nimport { addProp } from 'compiler/helpers'\n\nexport default function html(el: ASTElement, dir: ASTDirective) {\n  if (dir.value) {\n    addProp(el, 'innerHTML', `_s(${dir.value})`)\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/directives/index.js",
    "content": "import model from './model'\nimport text from './text'\nimport html from './html'\n\nexport default {\n  model,\n  text,\n  html,\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/directives/model.js",
    "content": "/* @flow */\n\nimport config from 'core/config'\nimport { addHandler, addProp, getBindingAttr } from 'compiler/helpers'\nimport { genComponentModel, genAssignmentCode } from 'compiler/directives/model'\n\nlet warn\n\n// in some cases, the event used has to be determined at runtime\n// so we used some reserved tokens during compile.\nexport const RANGE_TOKEN = '__r'\nexport const CHECKBOX_RADIO_TOKEN = '__c'\n\nexport default function model(\n  el: ASTElement,\n  dir: ASTDirective,\n  _warn: Function,\n): ?boolean {\n  warn = _warn\n  const value = dir.value\n  const modifiers = dir.modifiers\n  const tag = el.tag\n  const type = el.attrsMap.type\n\n  if (process.env.NODE_ENV !== 'production') {\n    const dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type']\n    if (tag === 'input' && dynamicType) {\n      warn(\n        `<input :type=\"${dynamicType}\" v-model=\"${value}\">:\\n` +\n          `v-model does not support dynamic input types. Use v-if branches instead.`,\n      )\n    }\n    // inputs with type=\"file\" are read only and setting the input's\n    // value will throw an error.\n    if (tag === 'input' && type === 'file') {\n      warn(\n        `<${el.tag} v-model=\"${value}\" type=\"file\">:\\n` +\n          `File inputs are read only. Use a v-on:change listener instead.`,\n      )\n    }\n  }\n\n  if (tag === 'select') {\n    genSelect(el, value, modifiers)\n  } else if (tag === 'input' && type === 'checkbox') {\n    genCheckboxModel(el, value, modifiers)\n  } else if (tag === 'input' && type === 'radio') {\n    genRadioModel(el, value, modifiers)\n  } else if (tag === 'input' || tag === 'textarea') {\n    genDefaultModel(el, value, modifiers)\n  } else if (!config.isReservedTag(tag)) {\n    genComponentModel(el, value, modifiers)\n    // component v-model doesn't need extra runtime\n    return false\n  } else if (process.env.NODE_ENV !== 'production') {\n    warn(\n      `<${el.tag} v-model=\"${value}\">: ` +\n        `v-model is not supported on this element type. ` +\n        \"If you are working with contenteditable, it's recommended to \" +\n        'wrap a library dedicated for that purpose inside a custom component.',\n    )\n  }\n\n  // ensure runtime directive metadata\n  return true\n}\n\nfunction genCheckboxModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n) {\n  const number = modifiers && modifiers.number\n  const valueBinding = getBindingAttr(el, 'value') || 'null'\n  const trueValueBinding = getBindingAttr(el, 'true-value') || 'true'\n  const falseValueBinding = getBindingAttr(el, 'false-value') || 'false'\n  addProp(\n    el,\n    'checked',\n    `Array.isArray(${value})` +\n      `?_i(${value},${valueBinding})>-1` +\n      (trueValueBinding === 'true'\n        ? `:(${value})`\n        : `:_q(${value},${trueValueBinding})`),\n  )\n  addHandler(\n    el,\n    CHECKBOX_RADIO_TOKEN,\n    `var $$a=${value},` +\n      '$$el=$event.target,' +\n      `$$c=$$el.checked?(${trueValueBinding}):(${falseValueBinding});` +\n      'if(Array.isArray($$a)){' +\n      `var $$v=${number ? '_n(' + valueBinding + ')' : valueBinding},` +\n      '$$i=_i($$a,$$v);' +\n      `if($$c){$$i<0&&(${value}=$$a.concat($$v))}` +\n      `else{$$i>-1&&(${value}=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}` +\n      `}else{${genAssignmentCode(value, '$$c')}}`,\n    null,\n    true,\n  )\n}\n\nfunction genRadioModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n) {\n  const number = modifiers && modifiers.number\n  let valueBinding = getBindingAttr(el, 'value') || 'null'\n  valueBinding = number ? `_n(${valueBinding})` : valueBinding\n  addProp(el, 'checked', `_q(${value},${valueBinding})`)\n  addHandler(\n    el,\n    CHECKBOX_RADIO_TOKEN,\n    genAssignmentCode(value, valueBinding),\n    null,\n    true,\n  )\n}\n\nfunction genSelect(el: ASTElement, value: string, modifiers: ?ASTModifiers) {\n  const number = modifiers && modifiers.number\n  const selectedVal =\n    `Array.prototype.filter` +\n    `.call($event.target.options,function(o){return o.selected})` +\n    `.map(function(o){var val = \"_value\" in o ? o._value : o.value;` +\n    `return ${number ? '_n(val)' : 'val'}})`\n\n  const assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'\n  let code = `var $$selectedVal = ${selectedVal};`\n  code = `${code} ${genAssignmentCode(value, assignment)}`\n  addHandler(el, 'change', code, null, true)\n}\n\nfunction genDefaultModel(\n  el: ASTElement,\n  value: string,\n  modifiers: ?ASTModifiers,\n): ?boolean {\n  const type = el.attrsMap.type\n  const { lazy, number, trim } = modifiers || {}\n  const needCompositionGuard = !lazy && type !== 'range'\n  const event = lazy ? 'change' : type === 'range' ? RANGE_TOKEN : 'input'\n\n  let valueExpression = '$event.target.value'\n  if (trim) {\n    valueExpression = `$event.target.value.trim()`\n  }\n  if (number) {\n    valueExpression = `_n(${valueExpression})`\n  }\n\n  let code = genAssignmentCode(value, valueExpression)\n  if (needCompositionGuard) {\n    code = `if($event.target.composing)return;${code}`\n  }\n\n  addProp(el, 'value', `(${value})`)\n  addHandler(el, event, code, null, true)\n  if (trim || number || type === 'number') {\n    addHandler(el, 'blur', '$forceUpdate()')\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/directives/text.js",
    "content": "/* @flow */\n\nimport { addProp } from 'compiler/helpers'\n\nexport default function text(el: ASTElement, dir: ASTDirective) {\n  if (dir.value) {\n    addProp(el, 'textContent', `_s(${dir.value})`)\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/index.js",
    "content": "/* @flow */\n\nimport { isUnaryTag, canBeLeftOpenTag } from './util'\nimport { genStaticKeys } from 'shared/util'\nimport { createCompiler } from 'compiler/index'\n\nimport modules from './modules/index'\nimport directives from './directives/index'\n\nimport {\n  isPreTag,\n  mustUseProp,\n  isReservedTag,\n  getTagNamespace,\n} from '../util/index'\n\nexport const baseOptions: CompilerOptions = {\n  expectHTML: true,\n  modules,\n  directives,\n  isPreTag,\n  isUnaryTag,\n  mustUseProp,\n  canBeLeftOpenTag,\n  isReservedTag,\n  getTagNamespace,\n  staticKeys: genStaticKeys(modules),\n}\n\nconst { compile, compileToFunctions } = createCompiler(baseOptions)\nexport { compile, compileToFunctions }\n"
  },
  {
    "path": "src/platforms/web/compiler/modules/class.js",
    "content": "/* @flow */\n\nimport { parseText } from 'compiler/parser/text-parser'\nimport { getAndRemoveAttr, getBindingAttr, baseWarn } from 'compiler/helpers'\n\nfunction transformNode(el: ASTElement, options: CompilerOptions) {\n  const warn = options.warn || baseWarn\n  const staticClass = getAndRemoveAttr(el, 'class')\n  if (process.env.NODE_ENV !== 'production' && staticClass) {\n    const expression = parseText(staticClass, options.delimiters)\n    if (expression) {\n      warn(\n        `class=\"${staticClass}\": ` +\n          'Interpolation inside attributes has been removed. ' +\n          'Use v-bind or the colon shorthand instead. For example, ' +\n          'instead of <div class=\"{{ val }}\">, use <div :class=\"val\">.',\n      )\n    }\n  }\n  if (staticClass) {\n    el.staticClass = JSON.stringify(staticClass)\n  }\n  const classBinding = getBindingAttr(el, 'class', false /* getStatic */)\n  if (classBinding) {\n    el.classBinding = classBinding\n  }\n}\n\nfunction genData(el: ASTElement): string {\n  let data = ''\n  if (el.staticClass) {\n    data += `staticClass:${el.staticClass},`\n  }\n  if (el.classBinding) {\n    data += `class:${el.classBinding},`\n  }\n  return data\n}\n\nexport default {\n  staticKeys: ['staticClass'],\n  transformNode,\n  genData,\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/modules/index.js",
    "content": "import klass from './class'\nimport style from './style'\n\nexport default [klass, style]\n"
  },
  {
    "path": "src/platforms/web/compiler/modules/style.js",
    "content": "/* @flow */\n\nimport { parseText } from 'compiler/parser/text-parser'\nimport { parseStyleText } from 'web/util/style'\nimport { getAndRemoveAttr, getBindingAttr, baseWarn } from 'compiler/helpers'\n\nfunction transformNode(el: ASTElement, options: CompilerOptions) {\n  const warn = options.warn || baseWarn\n  const staticStyle = getAndRemoveAttr(el, 'style')\n  if (staticStyle) {\n    /* istanbul ignore if */\n    if (process.env.NODE_ENV !== 'production') {\n      const expression = parseText(staticStyle, options.delimiters)\n      if (expression) {\n        warn(\n          `style=\"${staticStyle}\": ` +\n            'Interpolation inside attributes has been removed. ' +\n            'Use v-bind or the colon shorthand instead. For example, ' +\n            'instead of <div style=\"{{ val }}\">, use <div :style=\"val\">.',\n        )\n      }\n    }\n    el.staticStyle = JSON.stringify(parseStyleText(staticStyle))\n  }\n\n  const styleBinding = getBindingAttr(el, 'style', false /* getStatic */)\n  if (styleBinding) {\n    el.styleBinding = styleBinding\n  }\n}\n\nfunction genData(el: ASTElement): string {\n  let data = ''\n  if (el.staticStyle) {\n    data += `staticStyle:${el.staticStyle},`\n  }\n  if (el.styleBinding) {\n    data += `style:(${el.styleBinding}),`\n  }\n  return data\n}\n\nexport default {\n  staticKeys: ['staticStyle'],\n  transformNode,\n  genData,\n}\n"
  },
  {
    "path": "src/platforms/web/compiler/util.js",
    "content": "/* @flow */\n\nimport { makeMap } from 'shared/util'\n\nexport const isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +\n    'link,meta,param,source,track,wbr',\n)\n\n// Elements that you can, intentionally, leave open\n// (and which close themselves)\nexport const canBeLeftOpenTag = makeMap(\n  'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',\n)\n\n// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3\n// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content\nexport const isNonPhrasingTag = makeMap(\n  'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +\n    'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +\n    'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +\n    'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +\n    'title,tr,track',\n)\n"
  },
  {
    "path": "src/platforms/web/compiler.js",
    "content": "/* @flow */\n\nexport { parseComponent } from 'sfc/parser'\nexport { compile, compileToFunctions } from './compiler/index'\n"
  },
  {
    "path": "src/platforms/web/runtime/class-util.js",
    "content": "/* @flow */\n\n/**\n * Add class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nexport function addClass(el: HTMLElement, cls: ?string) {\n  /* istanbul ignore if */\n  if (!cls || !(cls = cls.trim())) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(c => el.classList.add(c))\n    } else {\n      el.classList.add(cls)\n    }\n  } else {\n    const cur = ` ${el.getAttribute('class') || ''} `\n    if (cur.indexOf(' ' + cls + ' ') < 0) {\n      el.setAttribute('class', (cur + cls).trim())\n    }\n  }\n}\n\n/**\n * Remove class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\nexport function removeClass(el: HTMLElement, cls: ?string) {\n  /* istanbul ignore if */\n  if (!cls || !(cls = cls.trim())) {\n    return\n  }\n\n  /* istanbul ignore else */\n  if (el.classList) {\n    if (cls.indexOf(' ') > -1) {\n      cls.split(/\\s+/).forEach(c => el.classList.remove(c))\n    } else {\n      el.classList.remove(cls)\n    }\n  } else {\n    let cur = ` ${el.getAttribute('class') || ''} `\n    const tar = ' ' + cls + ' '\n    while (cur.indexOf(tar) >= 0) {\n      cur = cur.replace(tar, ' ')\n    }\n    el.setAttribute('class', cur.trim())\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/components/index.js",
    "content": "import Transition from './transition'\nimport TransitionGroup from './transition-group'\n\nexport default {\n  Transition,\n  TransitionGroup,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/components/transition-group.js",
    "content": "/* @flow */\n\n// Provides transition support for list items.\n// supports move transitions using the FLIP technique.\n\n// Because the vdom's children update algorithm is \"unstable\" - i.e.\n// it doesn't guarantee the relative positioning of removed elements,\n// we force transition-group to update its children into two passes:\n// in the first pass, we remove all nodes that need to be removed,\n// triggering their leaving transition; in the second pass, we insert/move\n// into the final desired state. This way in the second pass removed\n// nodes will remain where they should be.\n\nimport { warn, extend } from 'core/util/index'\nimport { addClass, removeClass } from '../class-util'\nimport { transitionProps, extractTransitionData } from './transition'\n\nimport {\n  hasTransition,\n  getTransitionInfo,\n  transitionEndEvent,\n  addTransitionClass,\n  removeTransitionClass,\n} from '../transition-util'\n\nconst props = extend(\n  {\n    tag: String,\n    moveClass: String,\n  },\n  transitionProps,\n)\n\ndelete props.mode\n\nexport default {\n  props,\n\n  render(h: Function) {\n    const tag: string = this.tag || this.$vnode.data.tag || 'span'\n    const map: Object = Object.create(null)\n    const prevChildren: Array<VNode> = (this.prevChildren = this.children)\n    const rawChildren: Array<VNode> = this.$slots.default || []\n    const children: Array<VNode> = (this.children = [])\n    const transitionData: Object = extractTransitionData(this)\n\n    for (let i = 0; i < rawChildren.length; i++) {\n      const c: VNode = rawChildren[i]\n      if (c.tag) {\n        if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {\n          children.push(c)\n          map[c.key] = c\n          ;(c.data || (c.data = {})).transition = transitionData\n        } else if (process.env.NODE_ENV !== 'production') {\n          const opts: ?VNodeComponentOptions = c.componentOptions\n          const name: string = opts\n            ? opts.Ctor.options.name || opts.tag || ''\n            : c.tag\n          warn(`<transition-group> children must be keyed: <${name}>`)\n        }\n      }\n    }\n\n    if (prevChildren) {\n      const kept: Array<VNode> = []\n      const removed: Array<VNode> = []\n      for (let i = 0; i < prevChildren.length; i++) {\n        const c: VNode = prevChildren[i]\n        c.data.transition = transitionData\n        c.data.pos = c.elm.getBoundingClientRect()\n        if (map[c.key]) {\n          kept.push(c)\n        } else {\n          removed.push(c)\n        }\n      }\n      this.kept = h(tag, null, kept)\n      this.removed = removed\n    }\n\n    return h(tag, null, children)\n  },\n\n  beforeUpdate() {\n    // force removing pass\n    this.__patch__(\n      this._vnode,\n      this.kept,\n      false, // hydrating\n      true, // removeOnly (!important, avoids unnecessary moves)\n    )\n    this._vnode = this.kept\n  },\n\n  updated() {\n    const children: Array<VNode> = this.prevChildren\n    const moveClass: string = this.moveClass || (this.name || 'v') + '-move'\n    if (!children.length || !this.hasMove(children[0].elm, moveClass)) {\n      return\n    }\n\n    // we divide the work into three loops to avoid mixing DOM reads and writes\n    // in each iteration - which helps prevent layout thrashing.\n    children.forEach(callPendingCbs)\n    children.forEach(recordPosition)\n    children.forEach(applyTranslation)\n\n    // force reflow to put everything in position\n    const body: any = document.body\n    const f: number = body.offsetHeight // eslint-disable-line\n\n    children.forEach((c: VNode) => {\n      if (c.data.moved) {\n        var el: any = c.elm\n        var s: any = el.style\n        addTransitionClass(el, moveClass)\n        s.transform = s.WebkitTransform = s.transitionDuration = ''\n        el.addEventListener(\n          transitionEndEvent,\n          (el._moveCb = function cb(e) {\n            if (!e || /transform$/.test(e.propertyName)) {\n              el.removeEventListener(transitionEndEvent, cb)\n              el._moveCb = null\n              removeTransitionClass(el, moveClass)\n            }\n          }),\n        )\n      }\n    })\n  },\n\n  methods: {\n    hasMove(el: any, moveClass: string): boolean {\n      /* istanbul ignore if */\n      if (!hasTransition) {\n        return false\n      }\n      if (this._hasMove != null) {\n        return this._hasMove\n      }\n      // Detect whether an element with the move class applied has\n      // CSS transitions. Since the element may be inside an entering\n      // transition at this very moment, we make a clone of it and remove\n      // all other transition classes applied to ensure only the move class\n      // is applied.\n      const clone: HTMLElement = el.cloneNode()\n      if (el._transitionClasses) {\n        el._transitionClasses.forEach((cls: string) => {\n          removeClass(clone, cls)\n        })\n      }\n      addClass(clone, moveClass)\n      clone.style.display = 'none'\n      this.$el.appendChild(clone)\n      const info: Object = getTransitionInfo(clone)\n      this.$el.removeChild(clone)\n      return (this._hasMove = info.hasTransform)\n    },\n  },\n}\n\nfunction callPendingCbs(c: VNode) {\n  /* istanbul ignore if */\n  if (c.elm._moveCb) {\n    c.elm._moveCb()\n  }\n  /* istanbul ignore if */\n  if (c.elm._enterCb) {\n    c.elm._enterCb()\n  }\n}\n\nfunction recordPosition(c: VNode) {\n  c.data.newPos = c.elm.getBoundingClientRect()\n}\n\nfunction applyTranslation(c: VNode) {\n  const oldPos = c.data.pos\n  const newPos = c.data.newPos\n  const dx = oldPos.left - newPos.left\n  const dy = oldPos.top - newPos.top\n  if (dx || dy) {\n    c.data.moved = true\n    const s = c.elm.style\n    s.transform = s.WebkitTransform = `translate(${dx}px,${dy}px)`\n    s.transitionDuration = '0s'\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/components/transition.js",
    "content": "/* @flow */\n\n// Provides transition support for a single element/component.\n// supports transition mode (out-in / in-out)\n\nimport { warn } from 'core/util/index'\nimport { camelize, extend, isPrimitive } from 'shared/util'\nimport { mergeVNodeHook, getFirstComponentChild } from 'core/vdom/helpers/index'\n\nexport const transitionProps = {\n  name: String,\n  appear: Boolean,\n  css: Boolean,\n  mode: String,\n  type: String,\n  enterClass: String,\n  leaveClass: String,\n  enterToClass: String,\n  leaveToClass: String,\n  enterActiveClass: String,\n  leaveActiveClass: String,\n  appearClass: String,\n  appearActiveClass: String,\n  appearToClass: String,\n  duration: [Number, String, Object],\n}\n\n// in case the child is also an abstract component, e.g. <keep-alive>\n// we want to recursively retrieve the real component to be rendered\nfunction getRealChild(vnode: ?VNode): ?VNode {\n  const compOptions: ?VNodeComponentOptions = vnode && vnode.componentOptions\n  if (compOptions && compOptions.Ctor.options.abstract) {\n    return getRealChild(getFirstComponentChild(compOptions.children))\n  } else {\n    return vnode\n  }\n}\n\nexport function extractTransitionData(comp: Component): Object {\n  const data = {}\n  const options: ComponentOptions = comp.$options\n  // props\n  for (const key in options.propsData) {\n    data[key] = comp[key]\n  }\n  // events.\n  // extract listeners and pass them directly to the transition methods\n  const listeners: ?Object = options._parentListeners\n  for (const key in listeners) {\n    data[camelize(key)] = listeners[key]\n  }\n  return data\n}\n\nfunction placeholder(h: Function, rawChild: VNode): ?VNode {\n  if (/\\d-keep-alive$/.test(rawChild.tag)) {\n    return h('keep-alive', {\n      props: rawChild.componentOptions.propsData,\n    })\n  }\n}\n\nfunction hasParentTransition(vnode: VNode): ?boolean {\n  while ((vnode = vnode.parent)) {\n    if (vnode.data.transition) {\n      return true\n    }\n  }\n}\n\nfunction isSameChild(child: VNode, oldChild: VNode): boolean {\n  return oldChild.key === child.key && oldChild.tag === child.tag\n}\n\nexport default {\n  name: 'transition',\n  props: transitionProps,\n  abstract: true,\n\n  render(h: Function) {\n    let children: ?Array<VNode> = this.$slots.default\n    if (!children) {\n      return\n    }\n\n    // filter out text nodes (possible whitespaces)\n    children = children.filter((c: VNode) => c.tag)\n    /* istanbul ignore if */\n    if (!children.length) {\n      return\n    }\n\n    // warn multiple elements\n    if (process.env.NODE_ENV !== 'production' && children.length > 1) {\n      warn(\n        '<transition> can only be used on a single element. Use ' +\n          '<transition-group> for lists.',\n        this.$parent,\n      )\n    }\n\n    const mode: string = this.mode\n\n    // warn invalid mode\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      mode &&\n      mode !== 'in-out' &&\n      mode !== 'out-in'\n    ) {\n      warn('invalid <transition> mode: ' + mode, this.$parent)\n    }\n\n    const rawChild: VNode = children[0]\n\n    // if this is a component root node and the component's\n    // parent container node also has transition, skip.\n    if (hasParentTransition(this.$vnode)) {\n      return rawChild\n    }\n\n    // apply transition data to child\n    // use getRealChild() to ignore abstract components e.g. keep-alive\n    const child: ?VNode = getRealChild(rawChild)\n    /* istanbul ignore if */\n    if (!child) {\n      return rawChild\n    }\n\n    if (this._leaving) {\n      return placeholder(h, rawChild)\n    }\n\n    // ensure a key that is unique to the vnode type and to this transition\n    // component instance. This key will be used to remove pending leaving nodes\n    // during entering.\n    const id: string = `__transition-${this._uid}-`\n    child.key =\n      child.key == null\n        ? id + child.tag\n        : isPrimitive(child.key)\n        ? String(child.key).indexOf(id) === 0\n          ? child.key\n          : id + child.key\n        : child.key\n\n    const data: Object = ((\n      child.data || (child.data = {})\n    ).transition = extractTransitionData(this))\n    const oldRawChild: VNode = this._vnode\n    const oldChild: VNode = getRealChild(oldRawChild)\n\n    // mark v-show\n    // so that the transition module can hand over the control to the directive\n    if (\n      child.data.directives &&\n      child.data.directives.some(d => d.name === 'show')\n    ) {\n      child.data.show = true\n    }\n\n    if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {\n      // replace old child transition data with fresh one\n      // important for dynamic transitions!\n      const oldData: Object =\n        oldChild && (oldChild.data.transition = extend({}, data))\n      // handle transition mode\n      if (mode === 'out-in') {\n        // return placeholder node and queue update when leave finishes\n        this._leaving = true\n        mergeVNodeHook(oldData, 'afterLeave', () => {\n          this._leaving = false\n          this.$forceUpdate()\n        })\n        return placeholder(h, rawChild)\n      } else if (mode === 'in-out') {\n        let delayedLeave\n        const performLeave = () => {\n          delayedLeave()\n        }\n        mergeVNodeHook(data, 'afterEnter', performLeave)\n        mergeVNodeHook(data, 'enterCancelled', performLeave)\n        mergeVNodeHook(oldData, 'delayLeave', leave => {\n          delayedLeave = leave\n        })\n      }\n    }\n\n    return rawChild\n  },\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/directives/index.js",
    "content": "import model from './model'\nimport show from './show'\n\nexport default {\n  model,\n  show,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/directives/model.js",
    "content": "/**\n * Not type checking this file because flow doesn't like attaching\n * properties to Elements.\n */\n\nimport { looseEqual, looseIndexOf } from 'shared/util'\nimport { warn, isAndroid, isIE9, isIE, isEdge } from 'core/util/index'\n\n/* istanbul ignore if */\nif (isIE9) {\n  // http://www.matts411.com/post/internet-explorer-9-oninput/\n  document.addEventListener('selectionchange', () => {\n    const el = document.activeElement\n    if (el && el.vmodel) {\n      trigger(el, 'input')\n    }\n  })\n}\n\nexport default {\n  inserted(el, binding, vnode) {\n    if (vnode.tag === 'select') {\n      const cb = () => {\n        setSelected(el, binding, vnode.context)\n      }\n      cb()\n      /* istanbul ignore if */\n      if (isIE || isEdge) {\n        setTimeout(cb, 0)\n      }\n    } else if (\n      vnode.tag === 'textarea' ||\n      el.type === 'text' ||\n      el.type === 'password'\n    ) {\n      el._vModifiers = binding.modifiers\n      if (!binding.modifiers.lazy) {\n        // Safari < 10.2 & UIWebView doesn't fire compositionend when\n        // switching focus before confirming composition choice\n        // this also fixes the issue where some browsers e.g. iOS Chrome\n        // fires \"change\" instead of \"input\" on autocomplete.\n        el.addEventListener('change', onCompositionEnd)\n        if (!isAndroid) {\n          el.addEventListener('compositionstart', onCompositionStart)\n          el.addEventListener('compositionend', onCompositionEnd)\n        }\n        /* istanbul ignore if */\n        if (isIE9) {\n          el.vmodel = true\n        }\n      }\n    }\n  },\n  componentUpdated(el, binding, vnode) {\n    if (vnode.tag === 'select') {\n      setSelected(el, binding, vnode.context)\n      // in case the options rendered by v-for have changed,\n      // it's possible that the value is out-of-sync with the rendered options.\n      // detect such cases and filter out values that no longer has a matching\n      // option in the DOM.\n      const needReset = el.multiple\n        ? binding.value.some(v => hasNoMatchingOption(v, el.options))\n        : binding.value !== binding.oldValue &&\n          hasNoMatchingOption(binding.value, el.options)\n      if (needReset) {\n        trigger(el, 'change')\n      }\n    }\n  },\n}\n\nfunction setSelected(el, binding, vm) {\n  const value = binding.value\n  const isMultiple = el.multiple\n  if (isMultiple && !Array.isArray(value)) {\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        `<select multiple v-model=\"${binding.expression}\"> ` +\n          `expects an Array value for its binding, but got ${Object.prototype.toString\n            .call(value)\n            .slice(8, -1)}`,\n        vm,\n      )\n    return\n  }\n  let selected, option\n  for (let i = 0, l = el.options.length; i < l; i++) {\n    option = el.options[i]\n    if (isMultiple) {\n      selected = looseIndexOf(value, getValue(option)) > -1\n      if (option.selected !== selected) {\n        option.selected = selected\n      }\n    } else {\n      if (looseEqual(getValue(option), value)) {\n        if (el.selectedIndex !== i) {\n          el.selectedIndex = i\n        }\n        return\n      }\n    }\n  }\n  if (!isMultiple) {\n    el.selectedIndex = -1\n  }\n}\n\nfunction hasNoMatchingOption(value, options) {\n  for (let i = 0, l = options.length; i < l; i++) {\n    if (looseEqual(getValue(options[i]), value)) {\n      return false\n    }\n  }\n  return true\n}\n\nfunction getValue(option) {\n  return '_value' in option ? option._value : option.value\n}\n\nfunction onCompositionStart(e) {\n  e.target.composing = true\n}\n\nfunction onCompositionEnd(e) {\n  e.target.composing = false\n  trigger(e.target, 'input')\n}\n\nfunction trigger(el, type) {\n  const e = document.createEvent('HTMLEvents')\n  e.initEvent(type, true, true)\n  el.dispatchEvent(e)\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/directives/show.js",
    "content": "/* @flow */\n\nimport { isIE9 } from 'core/util/env'\nimport { enter, leave } from '../modules/transition'\n\n// recursively search for possible transition defined inside the component root\nfunction locateNode(vnode: VNode): VNodeWithData {\n  return vnode.componentInstance && (!vnode.data || !vnode.data.transition)\n    ? locateNode(vnode.componentInstance._vnode)\n    : vnode\n}\n\nexport default {\n  bind(el: any, { value }: VNodeDirective, vnode: VNodeWithData) {\n    vnode = locateNode(vnode)\n    const transition = vnode.data && vnode.data.transition\n    const originalDisplay = (el.__vOriginalDisplay =\n      el.style.display === 'none' ? '' : el.style.display)\n    if (value && transition && !isIE9) {\n      vnode.data.show = true\n      enter(vnode, () => {\n        el.style.display = originalDisplay\n      })\n    } else {\n      el.style.display = value ? originalDisplay : 'none'\n    }\n  },\n\n  update(el: any, { value, oldValue }: VNodeDirective, vnode: VNodeWithData) {\n    /* istanbul ignore if */\n    if (value === oldValue) return\n    vnode = locateNode(vnode)\n    const transition = vnode.data && vnode.data.transition\n    if (transition && !isIE9) {\n      vnode.data.show = true\n      if (value) {\n        enter(vnode, () => {\n          el.style.display = el.__vOriginalDisplay\n        })\n      } else {\n        leave(vnode, () => {\n          el.style.display = 'none'\n        })\n      }\n    } else {\n      el.style.display = value ? el.__vOriginalDisplay : 'none'\n    }\n  },\n\n  unbind(\n    el: any,\n    binding: VNodeDirective,\n    vnode: VNodeWithData,\n    oldVnode: VNodeWithData,\n    isDestroy: boolean,\n  ) {\n    if (!isDestroy) {\n      el.style.display = el.__vOriginalDisplay\n    }\n  },\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/index.js",
    "content": "/* @flow */\n\nimport Vue from 'core/index'\nimport config from 'core/config'\nimport { extend, noop } from 'shared/util'\nimport { mountComponent } from 'core/instance/lifecycle'\nimport { devtools, inBrowser, isChrome } from 'core/util/index'\n\nimport {\n  query,\n  mustUseProp,\n  isReservedTag,\n  isReservedAttr,\n  getTagNamespace,\n  isUnknownElement,\n} from 'web/util/index'\n\nimport { patch } from './patch'\nimport platformDirectives from './directives/index'\nimport platformComponents from './components/index'\n\n// install platform specific utils\nVue.config.mustUseProp = mustUseProp\nVue.config.isReservedTag = isReservedTag\nVue.config.isReservedAttr = isReservedAttr\nVue.config.getTagNamespace = getTagNamespace\nVue.config.isUnknownElement = isUnknownElement\n\n// install platform runtime directives & components\nextend(Vue.options.directives, platformDirectives)\nextend(Vue.options.components, platformComponents)\n\n// install platform patch function\nVue.prototype.__patch__ = inBrowser ? patch : noop\n\n// public mount method\nVue.prototype.$mount = function(\n  el?: string | Element,\n  hydrating?: boolean,\n): Component {\n  el = el && inBrowser ? query(el) : undefined\n  return mountComponent(this, el, hydrating)\n}\n\n// devtools global hook\n/* istanbul ignore next */\nsetTimeout(() => {\n  if (config.devtools) {\n    if (devtools) {\n      devtools.emit('init', Vue)\n    } else if (process.env.NODE_ENV !== 'production' && isChrome) {\n      console[console.info ? 'info' : 'log'](\n        'Download the Vue Devtools extension for a better development experience:\\n' +\n          'https://github.com/vuejs/vue-devtools',\n      )\n    }\n  }\n  if (\n    process.env.NODE_ENV !== 'production' &&\n    config.productionTip !== false &&\n    inBrowser &&\n    typeof console !== 'undefined'\n  ) {\n    console[console.info ? 'info' : 'log'](\n      `You are running Vue in development mode.\\n` +\n        `Make sure to turn on production mode when deploying for production.\\n` +\n        `See more tips at https://vuejs.org/guide/deployment.html`,\n    )\n  }\n}, 0)\n\nexport default Vue\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/attrs.js",
    "content": "/* @flow */\n\nimport { isIE9 } from 'core/util/env'\n\nimport { extend, isDef, isUndef } from 'shared/util'\n\nimport {\n  isXlink,\n  xlinkNS,\n  getXlinkProp,\n  isBooleanAttr,\n  isEnumeratedAttr,\n  isFalsyAttrValue,\n} from 'web/util/index'\n\nfunction updateAttrs(oldVnode: VNodeWithData, vnode: VNodeWithData) {\n  if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {\n    return\n  }\n  let key, cur, old\n  const elm = vnode.elm\n  const oldAttrs = oldVnode.data.attrs || {}\n  let attrs: any = vnode.data.attrs || {}\n  // clone observed objects, as the user probably wants to mutate it\n  if (isDef(attrs.__ob__)) {\n    attrs = vnode.data.attrs = extend({}, attrs)\n  }\n\n  for (key in attrs) {\n    cur = attrs[key]\n    old = oldAttrs[key]\n    if (old !== cur) {\n      setAttr(elm, key, cur)\n    }\n  }\n  // #4391: in IE9, setting type can reset value for input[type=radio]\n  /* istanbul ignore if */\n  if (isIE9 && attrs.value !== oldAttrs.value) {\n    setAttr(elm, 'value', attrs.value)\n  }\n  for (key in oldAttrs) {\n    if (isUndef(attrs[key])) {\n      if (isXlink(key)) {\n        elm.removeAttributeNS(xlinkNS, getXlinkProp(key))\n      } else if (!isEnumeratedAttr(key)) {\n        elm.removeAttribute(key)\n      }\n    }\n  }\n}\n\nfunction setAttr(el: Element, key: string, value: any) {\n  if (isBooleanAttr(key)) {\n    // set attribute for blank value\n    // e.g. <option disabled>Select one</option>\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key)\n    } else {\n      el.setAttribute(key, key)\n    }\n  } else if (isEnumeratedAttr(key)) {\n    el.setAttribute(\n      key,\n      isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true',\n    )\n  } else if (isXlink(key)) {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttributeNS(xlinkNS, getXlinkProp(key))\n    } else {\n      el.setAttributeNS(xlinkNS, key, value)\n    }\n  } else {\n    if (isFalsyAttrValue(value)) {\n      el.removeAttribute(key)\n    } else {\n      el.setAttribute(key, value)\n    }\n  }\n}\n\nexport default {\n  create: updateAttrs,\n  update: updateAttrs,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/class.js",
    "content": "/* @flow */\n\nimport { isDef, isUndef } from 'shared/util'\n\nimport { concat, stringifyClass, genClassForVnode } from 'web/util/index'\n\nfunction updateClass(oldVnode: any, vnode: any) {\n  const el = vnode.elm\n  const data: VNodeData = vnode.data\n  const oldData: VNodeData = oldVnode.data\n  if (\n    isUndef(data.staticClass) &&\n    isUndef(data.class) &&\n    (isUndef(oldData) ||\n      (isUndef(oldData.staticClass) && isUndef(oldData.class)))\n  ) {\n    return\n  }\n\n  let cls = genClassForVnode(vnode)\n\n  // handle transition classes\n  const transitionClass = el._transitionClasses\n  if (isDef(transitionClass)) {\n    cls = concat(cls, stringifyClass(transitionClass))\n  }\n\n  // set the class\n  if (cls !== el._prevClass) {\n    el.setAttribute('class', cls)\n    el._prevClass = cls\n  }\n}\n\nexport default {\n  create: updateClass,\n  update: updateClass,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/dom-props.js",
    "content": "/* @flow */\n\nimport { isDef, isUndef, extend, toNumber } from 'shared/util'\n\nfunction updateDOMProps(oldVnode: VNodeWithData, vnode: VNodeWithData) {\n  if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {\n    return\n  }\n  let key, cur\n  const elm: any = vnode.elm\n  const oldProps = oldVnode.data.domProps || {}\n  let props = vnode.data.domProps || {}\n  // clone observed objects, as the user probably wants to mutate it\n  if (isDef(props.__ob__)) {\n    props = vnode.data.domProps = extend({}, props)\n  }\n\n  for (key in oldProps) {\n    if (isUndef(props[key])) {\n      elm[key] = ''\n    }\n  }\n  for (key in props) {\n    cur = props[key]\n    // ignore children if the node has textContent or innerHTML,\n    // as these will throw away existing DOM nodes and cause removal errors\n    // on subsequent patches (#3360)\n    if (key === 'textContent' || key === 'innerHTML') {\n      if (vnode.children) vnode.children.length = 0\n      if (cur === oldProps[key]) continue\n    }\n\n    if (key === 'value') {\n      // store value as _value as well since\n      // non-string values will be stringified\n      elm._value = cur\n      // avoid resetting cursor position when value is the same\n      const strCur = cur == null ? '' : String(cur)\n      if (shouldUpdateValue(elm, vnode, strCur)) {\n        elm.value = strCur\n      }\n    } else {\n      elm[key] = cur\n    }\n  }\n}\n\n// check platforms/web/util/attrs.js acceptValue\ntype acceptValueElm = HTMLInputElement | HTMLSelectElement | HTMLOptionElement\n\nfunction shouldUpdateValue(\n  elm: acceptValueElm,\n  vnode: VNodeWithData,\n  checkVal: string,\n): boolean {\n  return (\n    !elm.composing &&\n    (vnode.tag === 'option' ||\n      isDirty(elm, checkVal) ||\n      isInputChanged(elm, checkVal))\n  )\n}\n\nfunction isDirty(elm: acceptValueElm, checkVal: string): boolean {\n  // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value\n  return document.activeElement !== elm && elm.value !== checkVal\n}\n\nfunction isInputChanged(elm: any, newVal: string): boolean {\n  const value = elm.value\n  const modifiers = elm._vModifiers // injected by v-model runtime\n  if ((isDef(modifiers) && modifiers.number) || elm.type === 'number') {\n    return toNumber(value) !== toNumber(newVal)\n  }\n  if (isDef(modifiers) && modifiers.trim) {\n    return value.trim() !== newVal.trim()\n  }\n  return value !== newVal\n}\n\nexport default {\n  create: updateDOMProps,\n  update: updateDOMProps,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/events.js",
    "content": "/* @flow */\n\nimport { isDef, isUndef } from 'shared/util'\nimport { updateListeners } from 'core/vdom/helpers/index'\nimport { isChrome, isIE, supportsPassive } from 'core/util/env'\nimport {\n  RANGE_TOKEN,\n  CHECKBOX_RADIO_TOKEN,\n} from 'web/compiler/directives/model'\n\n// normalize v-model event tokens that can only be determined at runtime.\n// it's important to place the event as the first in the array because\n// the whole point is ensuring the v-model callback gets called before\n// user-attached handlers.\nfunction normalizeEvents(on) {\n  let event\n  /* istanbul ignore if */\n  if (isDef(on[RANGE_TOKEN])) {\n    // IE input[type=range] only supports `change` event\n    event = isIE ? 'change' : 'input'\n    on[event] = [].concat(on[RANGE_TOKEN], on[event] || [])\n    delete on[RANGE_TOKEN]\n  }\n  if (isDef(on[CHECKBOX_RADIO_TOKEN])) {\n    // Chrome fires microtasks in between click/change, leads to #4521\n    event = isChrome ? 'click' : 'change'\n    on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || [])\n    delete on[CHECKBOX_RADIO_TOKEN]\n  }\n}\n\nlet target: HTMLElement\n\nfunction add(\n  event: string,\n  handler: Function,\n  once: boolean,\n  capture: boolean,\n  passive: boolean,\n) {\n  if (once) {\n    const oldHandler = handler\n    const _target = target // save current target element in closure\n    handler = function(ev) {\n      const res =\n        arguments.length === 1\n          ? oldHandler(ev)\n          : oldHandler.apply(null, arguments)\n      if (res !== null) {\n        remove(event, handler, capture, _target)\n      }\n    }\n  }\n  target.addEventListener(\n    event,\n    handler,\n    supportsPassive ? { capture, passive } : capture,\n  )\n}\n\nfunction remove(\n  event: string,\n  handler: Function,\n  capture: boolean,\n  _target?: HTMLElement,\n) {\n  ;(_target || target).removeEventListener(event, handler, capture)\n}\n\nfunction updateDOMListeners(oldVnode: VNodeWithData, vnode: VNodeWithData) {\n  if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {\n    return\n  }\n  const on = vnode.data.on || {}\n  const oldOn = oldVnode.data.on || {}\n  target = vnode.elm\n  normalizeEvents(on)\n  updateListeners(on, oldOn, add, remove, vnode.context)\n}\n\nexport default {\n  create: updateDOMListeners,\n  update: updateDOMListeners,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/index.js",
    "content": "import attrs from './attrs'\nimport klass from './class'\nimport events from './events'\nimport domProps from './dom-props'\nimport style from './style'\nimport transition from './transition'\n\nexport default [attrs, klass, events, domProps, style, transition]\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/style.js",
    "content": "/* @flow */\n\nimport { getStyle, normalizeStyleBinding } from 'web/util/style'\nimport { cached, camelize, extend, isDef, isUndef } from 'shared/util'\n\nconst cssVarRE = /^--/\nconst importantRE = /\\s*!important$/\nconst setProp = (el, name, val) => {\n  /* istanbul ignore if */\n  if (cssVarRE.test(name)) {\n    el.style.setProperty(name, val)\n  } else if (importantRE.test(val)) {\n    el.style.setProperty(name, val.replace(importantRE, ''), 'important')\n  } else {\n    const normalizedName = normalize(name)\n    if (Array.isArray(val)) {\n      // Support values array created by autoprefixer, e.g.\n      // {display: [\"-webkit-box\", \"-ms-flexbox\", \"flex\"]}\n      // Set them one by one, and the browser will only set those it can recognize\n      for (let i = 0, len = val.length; i < len; i++) {\n        el.style[normalizedName] = val[i]\n      }\n    } else {\n      el.style[normalizedName] = val\n    }\n  }\n}\n\nconst prefixes = ['Webkit', 'Moz', 'ms']\n\nlet testEl\nconst normalize = cached(function(prop) {\n  testEl = testEl || document.createElement('div')\n  prop = camelize(prop)\n  if (prop !== 'filter' && prop in testEl.style) {\n    return prop\n  }\n  const upper = prop.charAt(0).toUpperCase() + prop.slice(1)\n  for (let i = 0; i < prefixes.length; i++) {\n    const prefixed = prefixes[i] + upper\n    if (prefixed in testEl.style) {\n      return prefixed\n    }\n  }\n})\n\nfunction updateStyle(oldVnode: VNodeWithData, vnode: VNodeWithData) {\n  const data = vnode.data\n  const oldData = oldVnode.data\n\n  if (\n    isUndef(data.staticStyle) &&\n    isUndef(data.style) &&\n    isUndef(oldData.staticStyle) &&\n    isUndef(oldData.style)\n  ) {\n    return\n  }\n\n  let cur, name\n  const el: any = vnode.elm\n  const oldStaticStyle: any = oldData.staticStyle\n  const oldStyleBinding: any = oldData.normalizedStyle || oldData.style || {}\n\n  // if static style exists, stylebinding already merged into it when doing normalizeStyleData\n  const oldStyle = oldStaticStyle || oldStyleBinding\n\n  const style = normalizeStyleBinding(vnode.data.style) || {}\n\n  // store normalized style under a different key for next diff\n  // make sure to clone it if it's reactive, since the user likley wants\n  // to mutate it.\n  vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style\n\n  const newStyle = getStyle(vnode, true)\n\n  for (name in oldStyle) {\n    if (isUndef(newStyle[name])) {\n      setProp(el, name, '')\n    }\n  }\n  for (name in newStyle) {\n    cur = newStyle[name]\n    if (cur !== oldStyle[name]) {\n      // ie9 setting to null has no effect, must use empty string\n      setProp(el, name, cur == null ? '' : cur)\n    }\n  }\n}\n\nexport default {\n  create: updateStyle,\n  update: updateStyle,\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/modules/transition.js",
    "content": "/* @flow */\n\nimport { inBrowser, isIE9, warn } from 'core/util/index'\nimport { mergeVNodeHook } from 'core/vdom/helpers/index'\nimport { activeInstance } from 'core/instance/lifecycle'\n\nimport { once, isDef, isUndef, isObject, toNumber } from 'shared/util'\n\nimport {\n  nextFrame,\n  resolveTransition,\n  whenTransitionEnds,\n  addTransitionClass,\n  removeTransitionClass,\n} from '../transition-util'\n\nexport function enter(vnode: VNodeWithData, toggleDisplay: ?() => void) {\n  const el: any = vnode.elm\n\n  // call leave callback now\n  if (isDef(el._leaveCb)) {\n    el._leaveCb.cancelled = true\n    el._leaveCb()\n  }\n\n  const data = resolveTransition(vnode.data.transition)\n  if (isUndef(data)) {\n    return\n  }\n\n  /* istanbul ignore if */\n  if (isDef(el._enterCb) || el.nodeType !== 1) {\n    return\n  }\n\n  const {\n    css,\n    type,\n    enterClass,\n    enterToClass,\n    enterActiveClass,\n    appearClass,\n    appearToClass,\n    appearActiveClass,\n    beforeEnter,\n    enter,\n    afterEnter,\n    enterCancelled,\n    beforeAppear,\n    appear,\n    afterAppear,\n    appearCancelled,\n    duration,\n  } = (data: any)\n\n  // activeInstance will always be the <transition> component managing this\n  // transition. One edge case to check is when the <transition> is placed\n  // as the root node of a child component. In that case we need to check\n  // <transition>'s parent for appear check.\n  let context = activeInstance\n  let transitionNode = activeInstance.$vnode\n  while (transitionNode && transitionNode.parent) {\n    transitionNode = transitionNode.parent\n    context = transitionNode.context\n  }\n\n  const isAppear = !context._isMounted || !vnode.isRootInsert\n\n  if (isAppear && !appear && appear !== '') {\n    return\n  }\n\n  const startClass = isAppear && appearClass ? appearClass : enterClass\n  const activeClass =\n    isAppear && appearActiveClass ? appearActiveClass : enterActiveClass\n  const toClass = isAppear && appearToClass ? appearToClass : enterToClass\n\n  const beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter\n  const enterHook = isAppear\n    ? typeof appear === 'function'\n      ? appear\n      : enter\n    : enter\n  const afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter\n  const enterCancelledHook = isAppear\n    ? appearCancelled || enterCancelled\n    : enterCancelled\n\n  const explicitEnterDuration: any = toNumber(\n    isObject(duration) ? duration.enter : duration,\n  )\n\n  if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {\n    checkDuration(explicitEnterDuration, 'enter', vnode)\n  }\n\n  const expectsCSS = css !== false && !isIE9\n  const userWantsControl = getHookArgumentsLength(enterHook)\n\n  const cb = (el._enterCb = once(() => {\n    if (expectsCSS) {\n      removeTransitionClass(el, toClass)\n      removeTransitionClass(el, activeClass)\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, startClass)\n      }\n      enterCancelledHook && enterCancelledHook(el)\n    } else {\n      afterEnterHook && afterEnterHook(el)\n    }\n    el._enterCb = null\n  }))\n\n  if (!vnode.data.show) {\n    // remove pending leave element on enter by injecting an insert hook\n    mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', () => {\n      const parent = el.parentNode\n      const pendingNode =\n        parent && parent._pending && parent._pending[vnode.key]\n      if (\n        pendingNode &&\n        pendingNode.tag === vnode.tag &&\n        pendingNode.elm._leaveCb\n      ) {\n        pendingNode.elm._leaveCb()\n      }\n      enterHook && enterHook(el, cb)\n    })\n  }\n\n  // start enter transition\n  beforeEnterHook && beforeEnterHook(el)\n  if (expectsCSS) {\n    addTransitionClass(el, startClass)\n    addTransitionClass(el, activeClass)\n    nextFrame(() => {\n      addTransitionClass(el, toClass)\n      removeTransitionClass(el, startClass)\n      if (!cb.cancelled && !userWantsControl) {\n        if (isValidDuration(explicitEnterDuration)) {\n          setTimeout(cb, explicitEnterDuration)\n        } else {\n          whenTransitionEnds(el, type, cb)\n        }\n      }\n    })\n  }\n\n  if (vnode.data.show) {\n    toggleDisplay && toggleDisplay()\n    enterHook && enterHook(el, cb)\n  }\n\n  if (!expectsCSS && !userWantsControl) {\n    cb()\n  }\n}\n\nexport function leave(vnode: VNodeWithData, rm: Function) {\n  const el: any = vnode.elm\n\n  // call enter callback now\n  if (isDef(el._enterCb)) {\n    el._enterCb.cancelled = true\n    el._enterCb()\n  }\n\n  const data = resolveTransition(vnode.data.transition)\n  if (isUndef(data)) {\n    return rm()\n  }\n\n  /* istanbul ignore if */\n  if (isDef(el._leaveCb) || el.nodeType !== 1) {\n    return\n  }\n\n  const {\n    css,\n    type,\n    leaveClass,\n    leaveToClass,\n    leaveActiveClass,\n    beforeLeave,\n    leave,\n    afterLeave,\n    leaveCancelled,\n    delayLeave,\n    duration,\n  } = (data: any)\n\n  const expectsCSS = css !== false && !isIE9\n  const userWantsControl = getHookArgumentsLength(leave)\n\n  const explicitLeaveDuration: any = toNumber(\n    isObject(duration) ? duration.leave : duration,\n  )\n\n  if (process.env.NODE_ENV !== 'production' && explicitLeaveDuration != null) {\n    checkDuration(explicitLeaveDuration, 'leave', vnode)\n  }\n\n  const cb = (el._leaveCb = once(() => {\n    if (el.parentNode && el.parentNode._pending) {\n      el.parentNode._pending[vnode.key] = null\n    }\n    if (expectsCSS) {\n      removeTransitionClass(el, leaveToClass)\n      removeTransitionClass(el, leaveActiveClass)\n    }\n    if (cb.cancelled) {\n      if (expectsCSS) {\n        removeTransitionClass(el, leaveClass)\n      }\n      leaveCancelled && leaveCancelled(el)\n    } else {\n      rm()\n      afterLeave && afterLeave(el)\n    }\n    el._leaveCb = null\n  }))\n\n  if (delayLeave) {\n    delayLeave(performLeave)\n  } else {\n    performLeave()\n  }\n\n  function performLeave() {\n    // the delayed leave may have already been cancelled\n    if (cb.cancelled) {\n      return\n    }\n    // record leaving element\n    if (!vnode.data.show) {\n      ;(el.parentNode._pending || (el.parentNode._pending = {}))[\n        vnode.key\n      ] = vnode\n    }\n    beforeLeave && beforeLeave(el)\n    if (expectsCSS) {\n      addTransitionClass(el, leaveClass)\n      addTransitionClass(el, leaveActiveClass)\n      nextFrame(() => {\n        addTransitionClass(el, leaveToClass)\n        removeTransitionClass(el, leaveClass)\n        if (!cb.cancelled && !userWantsControl) {\n          if (isValidDuration(explicitLeaveDuration)) {\n            setTimeout(cb, explicitLeaveDuration)\n          } else {\n            whenTransitionEnds(el, type, cb)\n          }\n        }\n      })\n    }\n    leave && leave(el, cb)\n    if (!expectsCSS && !userWantsControl) {\n      cb()\n    }\n  }\n}\n\n// only used in dev mode\nfunction checkDuration(val, name, vnode) {\n  if (typeof val !== 'number') {\n    warn(\n      `<transition> explicit ${name} duration is not a valid number - ` +\n        `got ${JSON.stringify(val)}.`,\n      vnode.context,\n    )\n  } else if (isNaN(val)) {\n    warn(\n      `<transition> explicit ${name} duration is NaN - ` +\n        'the duration expression might be incorrect.',\n      vnode.context,\n    )\n  }\n}\n\nfunction isValidDuration(val) {\n  return typeof val === 'number' && !isNaN(val)\n}\n\n/**\n * Normalize a transition hook's argument length. The hook may be:\n * - a merged hook (invoker) with the original in .fns\n * - a wrapped component method (check ._length)\n * - a plain function (.length)\n */\nfunction getHookArgumentsLength(fn: Function): boolean {\n  if (isUndef(fn)) {\n    return false\n  }\n  const invokerFns = fn.fns\n  if (isDef(invokerFns)) {\n    // invoker\n    return getHookArgumentsLength(\n      Array.isArray(invokerFns) ? invokerFns[0] : invokerFns,\n    )\n  } else {\n    return (fn._length || fn.length) > 1\n  }\n}\n\nfunction _enter(_: any, vnode: VNodeWithData) {\n  if (vnode.data.show !== true) {\n    enter(vnode)\n  }\n}\n\nexport default inBrowser\n  ? {\n      create: _enter,\n      activate: _enter,\n      remove(vnode: VNode, rm: Function) {\n        /* istanbul ignore else */\n        if (vnode.data.show !== true) {\n          leave(vnode, rm)\n        } else {\n          rm()\n        }\n      },\n    }\n  : {}\n"
  },
  {
    "path": "src/platforms/web/runtime/node-ops.js",
    "content": "/* @flow */\n\nimport { namespaceMap } from 'web/util/index'\n\nexport function createElement(tagName: string, vnode: VNode): Element {\n  const elm = document.createElement(tagName)\n  if (tagName !== 'select') {\n    return elm\n  }\n  // false or null will remove the attribute but undefined will not\n  if (\n    vnode.data &&\n    vnode.data.attrs &&\n    vnode.data.attrs.multiple !== undefined\n  ) {\n    elm.setAttribute('multiple', 'multiple')\n  }\n  return elm\n}\n\nexport function createElementNS(namespace: string, tagName: string): Element {\n  return document.createElementNS(namespaceMap[namespace], tagName)\n}\n\nexport function createTextNode(text: string): Text {\n  return document.createTextNode(text)\n}\n\nexport function createComment(text: string): Comment {\n  return document.createComment(text)\n}\n\nexport function insertBefore(\n  parentNode: Node,\n  newNode: Node,\n  referenceNode: Node,\n) {\n  parentNode.insertBefore(newNode, referenceNode)\n}\n\nexport function removeChild(node: Node, child: Node) {\n  node.removeChild(child)\n}\n\nexport function appendChild(node: Node, child: Node) {\n  node.appendChild(child)\n}\n\nexport function parentNode(node: Node): ?Node {\n  return node.parentNode\n}\n\nexport function nextSibling(node: Node): ?Node {\n  return node.nextSibling\n}\n\nexport function tagName(node: Element): string {\n  return node.tagName\n}\n\nexport function setTextContent(node: Node, text: string) {\n  node.textContent = text\n}\n\nexport function setAttribute(node: Element, key: string, val: string) {\n  node.setAttribute(key, val)\n}\n"
  },
  {
    "path": "src/platforms/web/runtime/patch.js",
    "content": "/* @flow */\n\nimport * as nodeOps from 'web/runtime/node-ops'\nimport { createPatchFunction } from 'core/vdom/patch'\nimport baseModules from 'core/vdom/modules/index'\nimport platformModules from 'web/runtime/modules/index'\n\n// the directive module should be applied last, after all\n// built-in modules have been applied.\nconst modules = platformModules.concat(baseModules)\n\nexport const patch: Function = createPatchFunction({ nodeOps, modules })\n"
  },
  {
    "path": "src/platforms/web/runtime/transition-util.js",
    "content": "/* @flow */\n\nimport { inBrowser, isIE9 } from 'core/util/index'\nimport { addClass, removeClass } from './class-util'\nimport { remove, extend, cached } from 'shared/util'\n\nexport function resolveTransition(def?: string | Object): ?Object {\n  if (!def) {\n    return\n  }\n  /* istanbul ignore else */\n  if (typeof def === 'object') {\n    const res = {}\n    if (def.css !== false) {\n      extend(res, autoCssTransition(def.name || 'v'))\n    }\n    extend(res, def)\n    return res\n  } else if (typeof def === 'string') {\n    return autoCssTransition(def)\n  }\n}\n\nconst autoCssTransition: (name: string) => Object = cached(name => {\n  return {\n    enterClass: `${name}-enter`,\n    enterToClass: `${name}-enter-to`,\n    enterActiveClass: `${name}-enter-active`,\n    leaveClass: `${name}-leave`,\n    leaveToClass: `${name}-leave-to`,\n    leaveActiveClass: `${name}-leave-active`,\n  }\n})\n\nexport const hasTransition = inBrowser && !isIE9\nconst TRANSITION = 'transition'\nconst ANIMATION = 'animation'\n\n// Transition property/event sniffing\nexport let transitionProp = 'transition'\nexport let transitionEndEvent = 'transitionend'\nexport let animationProp = 'animation'\nexport let animationEndEvent = 'animationend'\nif (hasTransition) {\n  /* istanbul ignore if */\n  if (\n    window.ontransitionend === undefined &&\n    window.onwebkittransitionend !== undefined\n  ) {\n    transitionProp = 'WebkitTransition'\n    transitionEndEvent = 'webkitTransitionEnd'\n  }\n  if (\n    window.onanimationend === undefined &&\n    window.onwebkitanimationend !== undefined\n  ) {\n    animationProp = 'WebkitAnimation'\n    animationEndEvent = 'webkitAnimationEnd'\n  }\n}\n\n// binding to window is necessary to make hot reload work in IE in strict mode\nconst raf =\n  inBrowser && window.requestAnimationFrame\n    ? window.requestAnimationFrame.bind(window)\n    : setTimeout\n\nexport function nextFrame(fn: Function) {\n  raf(() => {\n    raf(fn)\n  })\n}\n\nexport function addTransitionClass(el: any, cls: string) {\n  ;(el._transitionClasses || (el._transitionClasses = [])).push(cls)\n  addClass(el, cls)\n}\n\nexport function removeTransitionClass(el: any, cls: string) {\n  if (el._transitionClasses) {\n    remove(el._transitionClasses, cls)\n  }\n  removeClass(el, cls)\n}\n\nexport function whenTransitionEnds(\n  el: Element,\n  expectedType: ?string,\n  cb: Function,\n) {\n  const { type, timeout, propCount } = getTransitionInfo(el, expectedType)\n  if (!type) return cb()\n  const event: string =\n    type === TRANSITION ? transitionEndEvent : animationEndEvent\n  let ended = 0\n  const end = () => {\n    el.removeEventListener(event, onEnd)\n    cb()\n  }\n  const onEnd = e => {\n    if (e.target === el) {\n      if (++ended >= propCount) {\n        end()\n      }\n    }\n  }\n  setTimeout(() => {\n    if (ended < propCount) {\n      end()\n    }\n  }, timeout + 1)\n  el.addEventListener(event, onEnd)\n}\n\nconst transformRE = /\\b(transform|all)(,|$)/\n\nexport function getTransitionInfo(\n  el: Element,\n  expectedType?: ?string,\n): {\n  type: ?string,\n  propCount: number,\n  timeout: number,\n  hasTransform: boolean,\n} {\n  const styles: any = window.getComputedStyle(el)\n  const transitionDelays: Array<string> = styles[\n    transitionProp + 'Delay'\n  ].split(', ')\n  const transitionDurations: Array<string> = styles[\n    transitionProp + 'Duration'\n  ].split(', ')\n  const transitionTimeout: number = getTimeout(\n    transitionDelays,\n    transitionDurations,\n  )\n  const animationDelays: Array<string> = styles[animationProp + 'Delay'].split(\n    ', ',\n  )\n  const animationDurations: Array<string> = styles[\n    animationProp + 'Duration'\n  ].split(', ')\n  const animationTimeout: number = getTimeout(\n    animationDelays,\n    animationDurations,\n  )\n\n  let type: ?string\n  let timeout = 0\n  let propCount = 0\n  /* istanbul ignore if */\n  if (expectedType === TRANSITION) {\n    if (transitionTimeout > 0) {\n      type = TRANSITION\n      timeout = transitionTimeout\n      propCount = transitionDurations.length\n    }\n  } else if (expectedType === ANIMATION) {\n    if (animationTimeout > 0) {\n      type = ANIMATION\n      timeout = animationTimeout\n      propCount = animationDurations.length\n    }\n  } else {\n    timeout = Math.max(transitionTimeout, animationTimeout)\n    type =\n      timeout > 0\n        ? transitionTimeout > animationTimeout\n          ? TRANSITION\n          : ANIMATION\n        : null\n    propCount = type\n      ? type === TRANSITION\n        ? transitionDurations.length\n        : animationDurations.length\n      : 0\n  }\n  const hasTransform: boolean =\n    type === TRANSITION && transformRE.test(styles[transitionProp + 'Property'])\n  return {\n    type,\n    timeout,\n    propCount,\n    hasTransform,\n  }\n}\n\nfunction getTimeout(delays: Array<string>, durations: Array<string>): number {\n  /* istanbul ignore next */\n  while (delays.length < durations.length) {\n    delays = delays.concat(delays)\n  }\n\n  return Math.max.apply(\n    null,\n    durations.map((d, i) => {\n      return toMs(d) + toMs(delays[i])\n    }),\n  )\n}\n\nfunction toMs(s: string): number {\n  return Number(s.slice(0, -1)) * 1000\n}\n"
  },
  {
    "path": "src/platforms/web/runtime-with-compiler.js",
    "content": "/* @flow */\n\nimport config from 'core/config'\nimport { warn, cached } from 'core/util/index'\nimport { mark, measure } from 'core/util/perf'\n\nimport Vue from './runtime/index'\nimport { query } from './util/index'\nimport { shouldDecodeNewlines } from './util/compat'\nimport { compileToFunctions } from './compiler/index'\n\nconst idToTemplate = cached(id => {\n  const el = query(id)\n  return el && el.innerHTML\n})\n\nconst mount = Vue.prototype.$mount\nVue.prototype.$mount = function(\n  el?: string | Element,\n  hydrating?: boolean,\n): Component {\n  el = el && query(el)\n\n  /* istanbul ignore if */\n  if (el === document.body || el === document.documentElement) {\n    process.env.NODE_ENV !== 'production' &&\n      warn(\n        `Do not mount Vue to <html> or <body> - mount to normal elements instead.`,\n      )\n    return this\n  }\n\n  const options = this.$options\n  // resolve template/el and convert to render function\n  if (!options.render) {\n    let template = options.template\n    if (template) {\n      if (typeof template === 'string') {\n        if (template.charAt(0) === '#') {\n          template = idToTemplate(template)\n          /* istanbul ignore if */\n          if (process.env.NODE_ENV !== 'production' && !template) {\n            warn(\n              `Template element not found or is empty: ${options.template}`,\n              this,\n            )\n          }\n        }\n      } else if (template.nodeType) {\n        template = template.innerHTML\n      } else {\n        if (process.env.NODE_ENV !== 'production') {\n          warn('invalid template option:' + template, this)\n        }\n        return this\n      }\n    } else if (el) {\n      template = getOuterHTML(el)\n    }\n    if (template) {\n      /* istanbul ignore if */\n      if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n        mark('compile')\n      }\n\n      const { render, staticRenderFns } = compileToFunctions(\n        template,\n        {\n          shouldDecodeNewlines,\n          delimiters: options.delimiters,\n        },\n        this,\n      )\n      options.render = render\n      options.staticRenderFns = staticRenderFns\n\n      /* istanbul ignore if */\n      if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n        mark('compile end')\n        measure(`${this._name} compile`, 'compile', 'compile end')\n      }\n    }\n  }\n  return mount.call(this, el, hydrating)\n}\n\n/**\n * Get outerHTML of elements, taking care\n * of SVG elements in IE as well.\n */\nfunction getOuterHTML(el: Element): string {\n  if (el.outerHTML) {\n    return el.outerHTML\n  } else {\n    const container = document.createElement('div')\n    container.appendChild(el.cloneNode(true))\n    return container.innerHTML\n  }\n}\n\nVue.compile = compileToFunctions\n\nexport default Vue\n"
  },
  {
    "path": "src/platforms/web/runtime.js",
    "content": "/* @flow */\n\nimport Vue from './runtime/index'\n\nexport default Vue\n"
  },
  {
    "path": "src/platforms/web/util/attrs.js",
    "content": "/* @flow */\n\nimport { makeMap } from 'shared/util'\n\n// these are reserved for web because they are directly compiled away\n// during template compilation\nexport const isReservedAttr = makeMap('style,class')\n\n// attributes that should be using props for binding\nconst acceptValue = makeMap('input,textarea,option,select')\nexport const mustUseProp = (\n  tag: string,\n  type: ?string,\n  attr: string,\n): boolean => {\n  return (\n    (attr === 'value' && acceptValue(tag) && type !== 'button') ||\n    (attr === 'selected' && tag === 'option') ||\n    (attr === 'checked' && tag === 'input') ||\n    (attr === 'muted' && tag === 'video')\n  )\n}\n\nexport const isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck')\n\nexport const isBooleanAttr = makeMap(\n  'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +\n    'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +\n    'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +\n    'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +\n    'required,reversed,scoped,seamless,selected,sortable,translate,' +\n    'truespeed,typemustmatch,visible',\n)\n\nexport const xlinkNS = 'http://www.w3.org/1999/xlink'\n\nexport const isXlink = (name: string): boolean => {\n  return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'\n}\n\nexport const getXlinkProp = (name: string): string => {\n  return isXlink(name) ? name.slice(6, name.length) : ''\n}\n\nexport const isFalsyAttrValue = (val: any): boolean => {\n  return val == null || val === false\n}\n"
  },
  {
    "path": "src/platforms/web/util/class.js",
    "content": "/* @flow */\n\nimport { isDef, isUndef, isObject } from 'shared/util'\n\nexport function genClassForVnode(vnode: VNode): string {\n  let data = vnode.data\n  let parentNode = vnode\n  let childNode = vnode\n  while (isDef(childNode.componentInstance)) {\n    childNode = childNode.componentInstance._vnode\n    if (childNode.data) {\n      data = mergeClassData(childNode.data, data)\n    }\n  }\n  while (isDef((parentNode = parentNode.parent))) {\n    if (parentNode.data) {\n      data = mergeClassData(data, parentNode.data)\n    }\n  }\n  return genClassFromData(data)\n}\n\nfunction mergeClassData(\n  child: VNodeData,\n  parent: VNodeData,\n): {\n  staticClass: string,\n  class: any,\n} {\n  return {\n    staticClass: concat(child.staticClass, parent.staticClass),\n    class: isDef(child.class) ? [child.class, parent.class] : parent.class,\n  }\n}\n\nfunction genClassFromData(data: Object): string {\n  const dynamicClass = data.class\n  const staticClass = data.staticClass\n  if (isDef(staticClass) || isDef(dynamicClass)) {\n    return concat(staticClass, stringifyClass(dynamicClass))\n  }\n  /* istanbul ignore next */\n  return ''\n}\n\nexport function concat(a: ?string, b: ?string): string {\n  return a ? (b ? a + ' ' + b : a) : b || ''\n}\n\nexport function stringifyClass(value: any): string {\n  if (isUndef(value)) {\n    return ''\n  }\n  if (typeof value === 'string') {\n    return value\n  }\n  let res = ''\n  if (Array.isArray(value)) {\n    let stringified\n    for (let i = 0, l = value.length; i < l; i++) {\n      if (isDef(value[i])) {\n        if (\n          isDef((stringified = stringifyClass(value[i]))) &&\n          stringified !== ''\n        ) {\n          res += stringified + ' '\n        }\n      }\n    }\n    return res.slice(0, -1)\n  }\n  if (isObject(value)) {\n    for (const key in value) {\n      if (value[key]) res += key + ' '\n    }\n    return res.slice(0, -1)\n  }\n  /* istanbul ignore next */\n  return res\n}\n"
  },
  {
    "path": "src/platforms/web/util/compat.js",
    "content": "/* @flow */\n\nimport { inBrowser } from 'core/util/index'\n\n// check whether current browser encodes a char inside attribute values\nfunction shouldDecode(content: string, encoded: string): boolean {\n  const div = document.createElement('div')\n  div.innerHTML = `<div a=\"${content}\">`\n  return div.innerHTML.indexOf(encoded) > 0\n}\n\n// #3663\n// IE encodes newlines inside attribute values while other browsers don't\nexport const shouldDecodeNewlines = inBrowser\n  ? shouldDecode('\\n', '&#10;')\n  : false\n"
  },
  {
    "path": "src/platforms/web/util/element.js",
    "content": "/* @flow */\n\nimport { inBrowser } from 'core/util/env'\nimport { makeMap } from 'shared/util'\n\nexport const namespaceMap = {\n  svg: 'http://www.w3.org/2000/svg',\n  math: 'http://www.w3.org/1998/Math/MathML',\n}\n\nexport const isHTMLTag = makeMap(\n  'html,body,base,head,link,meta,style,title,' +\n    'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +\n    'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +\n    'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +\n    's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +\n    'embed,object,param,source,canvas,script,noscript,del,ins,' +\n    'caption,col,colgroup,table,thead,tbody,td,th,tr,' +\n    'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +\n    'output,progress,select,textarea,' +\n    'details,dialog,menu,menuitem,summary,' +\n    'content,element,shadow,template',\n)\n\n// this map is intentionally selective, only covering SVG elements that may\n// contain child elements.\nexport const isSVG = makeMap(\n  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +\n    'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +\n    'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',\n  true,\n)\n\nexport const isPreTag = (tag: ?string): boolean => tag === 'pre'\n\nexport const isReservedTag = (tag: string): ?boolean => {\n  return isHTMLTag(tag) || isSVG(tag)\n}\n\nexport function getTagNamespace(tag: string): ?string {\n  if (isSVG(tag)) {\n    return 'svg'\n  }\n  // basic support for MathML\n  // note it doesn't support other MathML elements being component roots\n  if (tag === 'math') {\n    return 'math'\n  }\n}\n\nconst unknownElementCache = Object.create(null)\nexport function isUnknownElement(tag: string): boolean {\n  /* istanbul ignore if */\n  if (!inBrowser) {\n    return true\n  }\n  if (isReservedTag(tag)) {\n    return false\n  }\n  tag = tag.toLowerCase()\n  /* istanbul ignore if */\n  if (unknownElementCache[tag] != null) {\n    return unknownElementCache[tag]\n  }\n  const el = document.createElement(tag)\n  if (tag.indexOf('-') > -1) {\n    // http://stackoverflow.com/a/28210364/1070244\n    return (unknownElementCache[tag] =\n      el.constructor === window.HTMLUnknownElement ||\n      el.constructor === window.HTMLElement)\n  } else {\n    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/util/index.js",
    "content": "/* @flow */\n\nimport { warn } from 'core/util/index'\n\nexport * from './attrs'\nexport * from './class'\nexport * from './element'\n\n/**\n * Query an element selector if it's not an element already.\n */\nexport function query(el: string | Element): Element {\n  if (typeof el === 'string') {\n    const selected = document.querySelector(el)\n    if (!selected) {\n      process.env.NODE_ENV !== 'production' &&\n        warn('Cannot find element: ' + el)\n      return document.createElement('div')\n    }\n    return selected\n  } else {\n    return el\n  }\n}\n"
  },
  {
    "path": "src/platforms/web/util/style.js",
    "content": "/* @flow */\n\nimport { cached, extend, toObject } from 'shared/util'\n\nexport const parseStyleText = cached(function(cssText) {\n  const res = {}\n  const listDelimiter = /;(?![^(]*\\))/g\n  const propertyDelimiter = /:(.+)/\n  cssText.split(listDelimiter).forEach(function(item) {\n    if (item) {\n      var tmp = item.split(propertyDelimiter)\n      tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim())\n    }\n  })\n  return res\n})\n\n// merge static and dynamic style data on the same vnode\nfunction normalizeStyleData(data: VNodeData): ?Object {\n  const style = normalizeStyleBinding(data.style)\n  // static style is pre-processed into an object during compilation\n  // and is always a fresh object, so it's safe to merge into it\n  return data.staticStyle ? extend(data.staticStyle, style) : style\n}\n\n// normalize possible array / string values into Object\nexport function normalizeStyleBinding(bindingStyle: any): ?Object {\n  if (Array.isArray(bindingStyle)) {\n    return toObject(bindingStyle)\n  }\n  if (typeof bindingStyle === 'string') {\n    return parseStyleText(bindingStyle)\n  }\n  return bindingStyle\n}\n\n/**\n * parent component style should be after child's\n * so that parent component's style could override it\n */\nexport function getStyle(vnode: VNode, checkChild: boolean): Object {\n  const res = {}\n  let styleData\n\n  if (checkChild) {\n    let childNode = vnode\n    while (childNode.componentInstance) {\n      childNode = childNode.componentInstance._vnode\n      if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {\n        extend(res, styleData)\n      }\n    }\n  }\n\n  if ((styleData = normalizeStyleData(vnode.data))) {\n    extend(res, styleData)\n  }\n\n  let parentNode = vnode\n  while ((parentNode = parentNode.parent)) {\n    if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {\n      extend(res, styleData)\n    }\n  }\n  return res\n}\n"
  },
  {
    "path": "src/sfc/parser.js",
    "content": "/* @flow */\n\nimport deindent from 'de-indent'\nimport { parseHTML } from 'compiler/parser/html-parser'\nimport { makeMap } from 'shared/util'\n\nconst splitRE = /\\r?\\n/g\nconst replaceRE = /./g\nconst isSpecialTag = makeMap('script,style,template', true)\n\ntype Attribute = {\n  name: string,\n  value: string,\n}\n\n/**\n * Parse a single-file component (*.vue) file into an SFC Descriptor Object.\n */\nexport function parseComponent(\n  content: string,\n  options?: Object = {},\n): SFCDescriptor {\n  const sfc: SFCDescriptor = {\n    template: null,\n    script: null,\n    styles: [],\n    customBlocks: [],\n  }\n  let depth = 0\n  let currentBlock: ?(SFCBlock | SFCCustomBlock) = null\n\n  function start(\n    tag: string,\n    attrs: Array<Attribute>,\n    unary: boolean,\n    start: number,\n    end: number,\n  ) {\n    if (depth === 0) {\n      currentBlock = {\n        type: tag,\n        content: '',\n        start: end,\n        attrs: attrs.reduce((cumulated, { name, value }) => {\n          cumulated[name] = value || true\n          return cumulated\n        }, Object.create(null)),\n      }\n      if (isSpecialTag(tag)) {\n        checkAttrs(currentBlock, attrs)\n        if (tag === 'style') {\n          sfc.styles.push(currentBlock)\n        } else {\n          sfc[tag] = currentBlock\n        }\n      } else {\n        // custom blocks\n        sfc.customBlocks.push(currentBlock)\n      }\n    }\n    if (!unary) {\n      depth++\n    }\n  }\n\n  function checkAttrs(block: SFCBlock, attrs: Array<Attribute>) {\n    for (let i = 0; i < attrs.length; i++) {\n      const attr = attrs[i]\n      if (attr.name === 'lang') {\n        block.lang = attr.value\n      }\n      if (attr.name === 'scoped') {\n        block.scoped = true\n      }\n      if (attr.name === 'module') {\n        block.module = attr.value || true\n      }\n      if (attr.name === 'src') {\n        block.src = attr.value\n      }\n    }\n  }\n\n  // eslint-disable-next-line no-unused-vars\n  function end(tag: string, start: number, end: number) {\n    if (depth === 1 && currentBlock) {\n      currentBlock.end = start\n      let text = deindent(content.slice(currentBlock.start, currentBlock.end))\n      // pad content so that linters and pre-processors can output correct\n      // line numbers in errors and warnings\n      if (currentBlock.type !== 'template' && options.pad) {\n        text = padContent(currentBlock, options.pad) + text\n      }\n      currentBlock.content = text\n      currentBlock = null\n    }\n    depth--\n  }\n\n  function padContent(\n    block: SFCBlock | SFCCustomBlock,\n    pad: true | 'line' | 'space',\n  ) {\n    if (pad === 'space') {\n      return content.slice(0, block.start).replace(replaceRE, ' ')\n    } else {\n      const offset = content.slice(0, block.start).split(splitRE).length\n      const padChar = block.type === 'script' && !block.lang ? '//\\n' : '\\n'\n      return Array(offset).join(padChar)\n    }\n  }\n\n  parseHTML(content, {\n    start,\n    end,\n  })\n\n  return sfc\n}\n"
  },
  {
    "path": "src/shared/constants.js",
    "content": "export const SSR_ATTR = 'data-server-rendered'\n\n/**\n * List of soon to be deprecated packages in react native v0.63\n */\nexport const deprecatedPackages = [\n  'AlertIOS',\n  'AsyncStorage',\n  'CheckBox',\n  'Clipboard',\n  'DatePickerAndroid',\n  'DatePickerIOS',\n  'ImagePickerIOS',\n  'ImageStore',\n  'ListView',\n  'MaskedViewIOS',\n  'NetInfo',\n  'Picker',\n  'PickerIOS',\n  'ProgressBarAndroid',\n  'ProgressViewIOS',\n  'PushNotificationIOS',\n  'SegmentedControlIOS',\n  'Slider',\n  'StatusBarIOS',\n  'SwipeableListView',\n  'ViewPagerAndroid',\n  'WebView',\n  'DatePickerIOS',\n  'DatePickerAndroid',\n  'TimePickerAndroid',\n  'StatusBarIOS',\n]\n\nexport const ASSET_TYPES = ['component', 'directive', 'filter']\n\nexport const LIFECYCLE_HOOKS = [\n  'beforeCreate',\n  'created',\n  'beforeMount',\n  'mounted',\n  'beforeUpdate',\n  'updated',\n  'beforeDestroy',\n  'destroyed',\n  'activated',\n  'deactivated',\n]\n"
  },
  {
    "path": "src/shared/util.js",
    "content": "/* @flow */\n\n// these helpers produces better vm code in JS engines due to their\n// explicitness and function inlining\nexport function isUndef(v: any): boolean {\n  return v === undefined || v === null\n}\n\nexport function isDef(v: any): boolean {\n  return v !== undefined && v !== null\n}\n\nexport function isTrue(v: any): boolean {\n  return v === true\n}\n\n/**\n * Check if value is primitive\n */\nexport function isPrimitive(value: any): boolean {\n  return typeof value === 'string' || typeof value === 'number'\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 */\nexport function isObject(obj: mixed): boolean {\n  return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nconst toString = Object.prototype.toString\nconst OBJECT_STRING = '[object Object]'\nexport function isPlainObject(obj: any): boolean {\n  return toString.call(obj) === OBJECT_STRING\n}\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nexport function _toString(val: any): string {\n  return val == null\n    ? ''\n    : typeof val === 'object'\n    ? JSON.stringify(val, null, 2)\n    : String(val)\n}\n\n/**\n * Convert a input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nexport function toNumber(val: string): number | string {\n  const n = parseFloat(val)\n  return isNaN(n) ? val : n\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nexport function makeMap(\n  str: string,\n  expectsLowerCase?: boolean,\n): (key: string) => true | void {\n  const map = Object.create(null)\n  const list: Array<string> = str.split(',')\n  for (let i = 0; i < list.length; i++) {\n    map[list[i]] = true\n  }\n  return expectsLowerCase ? val => map[val.toLowerCase()] : val => map[val]\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nexport const isBuiltInTag = makeMap('slot,component', true)\n\n/**\n * Remove an item from an array\n */\nexport function remove(arr: Array<any>, item: any): Array<any> | void {\n  if (arr.length) {\n    const index = arr.indexOf(item)\n    if (index > -1) {\n      return arr.splice(index, 1)\n    }\n  }\n}\n\n/**\n * Check whether the object has the property.\n */\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nexport function hasOwn(obj: Object, key: string): boolean {\n  return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Create a cached version of a pure function.\n */\nexport function cached<F: Function>(fn: F): F {\n  const cache = Object.create(null)\n  return (function cachedFn(str: string) {\n    const hit = cache[str]\n    return hit || (cache[str] = fn(str))\n  }: any)\n}\n\n/**\n * Camelize a hyphen-delimited string.\n */\nconst camelizeRE = /-(\\w)/g\nexport const camelize = cached((str: string): string => {\n  return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))\n})\n\n/**\n * Capitalize a string.\n */\nexport const capitalize = cached((str: string): string => {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n})\n\n/**\n * Hyphenate a camelCase string.\n */\nconst hyphenateRE = /([^-])([A-Z])/g\nexport const hyphenate = cached((str: string): string => {\n  return str\n    .replace(hyphenateRE, '$1-$2')\n    .replace(hyphenateRE, '$1-$2')\n    .toLowerCase()\n})\n\n/**\n * Simple bind, faster than native\n */\nexport function bind(fn: Function, ctx: Object): Function {\n  function boundFn(a) {\n    const l: number = arguments.length\n    return l\n      ? l > 1\n        ? fn.apply(ctx, arguments)\n        : fn.call(ctx, a)\n      : fn.call(ctx)\n  }\n  // record original fn length\n  boundFn._length = fn.length\n  return boundFn\n}\n\n/**\n * Convert an Array-like object to a real Array.\n */\nexport function toArray(list: any, start?: number): Array<any> {\n  start = start || 0\n  let i = list.length - start\n  const ret: Array<any> = 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 */\nexport function extend(to: Object, _from: ?Object): Object {\n  for (const key in _from) {\n    to[key] = _from[key]\n  }\n  return to\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nexport function toObject(arr: Array<any>): Object {\n  const res = {}\n  for (let i = 0; i < arr.length; i++) {\n    if (arr[i]) {\n      extend(res, arr[i])\n    }\n  }\n  return res\n}\n\n/**\n * Perform no operation.\n */\nexport function noop() {}\n\n/**\n * Always return false.\n */\nexport const no = () => false\n\n/**\n * Return same value\n */\nexport const identity = (_: any) => _\n\n/**\n * Generate a static keys string from compiler modules.\n */\nexport function genStaticKeys(modules: Array<ModuleOptions>): string {\n  return modules\n    .reduce((keys, m) => {\n      return keys.concat(m.staticKeys || [])\n    }, [])\n    .join(',')\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 */\nexport function looseEqual(a: mixed, b: mixed): boolean {\n  const isObjectA = isObject(a)\n  const isObjectB = isObject(b)\n  if (isObjectA && isObjectB) {\n    try {\n      return JSON.stringify(a) === JSON.stringify(b)\n    } catch (e) {\n      // possible circular reference\n      return a === b\n    }\n  } else if (!isObjectA && !isObjectB) {\n    return String(a) === String(b)\n  } else {\n    return false\n  }\n}\n\nexport function looseIndexOf(arr: Array<mixed>, val: mixed): number {\n  for (let i = 0; i < arr.length; i++) {\n    if (looseEqual(arr[i], val)) return i\n  }\n  return -1\n}\n\n/**\n * Ensure a function is called only once.\n */\nexport function once(fn: Function): Function {\n  let called = false\n  return function() {\n    if (!called) {\n      called = true\n      fn.apply(this, arguments)\n    }\n  }\n}\n"
  },
  {
    "path": "types/index.d.ts",
    "content": "import * as V from \"./vue\";\nimport * as Options from \"./options\";\nimport * as Plugin from \"./plugin\";\nimport * as VNode from \"./vnode\";\n\n// `Vue` in `export = Vue` must be a namespace\n// All available types are exported via this namespace\ndeclare namespace Vue {\n  export type CreateElement = V.CreateElement;\n\n  export type Component = Options.Component;\n  export type AsyncComponent = Options.AsyncComponent;\n  export type ComponentOptions<V extends Vue> = Options.ComponentOptions<V>;\n  export type FunctionalComponentOptions = Options.FunctionalComponentOptions;\n  export type RenderContext = Options.RenderContext;\n  export type PropOptions = Options.PropOptions;\n  export type ComputedOptions<V extends Vue> = Options.ComputedOptions<V>;\n  export type WatchHandler<V extends Vue> = Options.WatchHandler<V, any>;\n  export type WatchOptions = Options.WatchOptions;\n  export type DirectiveFunction = Options.DirectiveFunction;\n  export type DirectiveOptions = Options.DirectiveOptions;\n\n  export type PluginFunction<T> = Plugin.PluginFunction<T>;\n  export type PluginObject<T> = Plugin.PluginObject<T>;\n\n  export type VNodeChildren = VNode.VNodeChildren;\n  export type VNodeChildrenArrayContents = VNode.VNodeChildrenArrayContents;\n  export type VNode = VNode.VNode;\n  export type VNodeComponentOptions = VNode.VNodeComponentOptions;\n  export type VNodeData = VNode.VNodeData;\n  export type VNodeDirective = VNode.VNodeDirective;\n}\n\n// TS cannot merge imported class with namespace, declare a subclass to bypass\ndeclare class Vue extends V.Vue {}\n\nexport = Vue;\n"
  },
  {
    "path": "types/options.d.ts",
    "content": "import { Vue, CreateElement } from \"./vue\";\nimport { VNode, VNodeData, VNodeDirective } from \"./vnode\";\n\ntype Constructor = {\n  new (...args: any[]): any;\n}\n\nexport type Component = typeof Vue | ComponentOptions<Vue> | FunctionalComponentOptions;\nexport type AsyncComponent = (\n  resolve: (component: Component) => void,\n  reject: (reason?: any) => void\n) => Promise<Component> | Component | void;\n\nexport interface ComponentOptions<V extends Vue> {\n  data?: Object | ((this: V) => Object);\n  props?: string[] | { [key: string]: PropOptions | Constructor | Constructor[] };\n  propsData?: Object;\n  computed?: { [key: string]: ((this: V) => any) | ComputedOptions<V> };\n  methods?: { [key: string]: (this: V, ...args: any[]) => any };\n  watch?: { [key: string]: ({ handler: WatchHandler<V, any> } & WatchOptions) | WatchHandler<V, any> | string };\n\n  el?: Element | String;\n  template?: string;\n  render?(this: V, createElement: CreateElement): VNode;\n  renderError?: (h: () => VNode, err: Error) => VNode;\n  staticRenderFns?: ((createElement: CreateElement) => VNode)[];\n\n  beforeCreate?(this: V): void;\n  created?(this: V): void;\n  beforeDestroy?(this: V): void;\n  destroyed?(this: V): void;\n  beforeMount?(this: V): void;\n  mounted?(this: V): void;\n  beforeUpdate?(this: V): void;\n  updated?(this: V): void;\n  activated?(this: V): void;\n  deactivated?(this: V): void;\n\n  directives?: { [key: string]: DirectiveOptions | DirectiveFunction };\n  components?: { [key: string]: Component | AsyncComponent };\n  transitions?: { [key: string]: Object };\n  filters?: { [key: string]: Function };\n\n  provide?: Object | (() => Object);\n  inject?: { [key: string]: string | symbol } | Array<string>;\n\n  model?: {\n    prop?: string;\n    event?: string;\n  };\n\n  parent?: Vue;\n  mixins?: (ComponentOptions<Vue> | typeof Vue)[];\n  name?: string;\n  extends?: ComponentOptions<Vue> | typeof Vue;\n  delimiters?: [string, string];\n}\n\nexport interface FunctionalComponentOptions {\n  props?: string[] | { [key: string]: PropOptions | Constructor | Constructor[] };\n  functional: boolean;\n  render(this: never, createElement: CreateElement, context: RenderContext): VNode;\n  name?: string;\n}\n\nexport interface RenderContext {\n  props: any;\n  children: VNode[];\n  slots(): any;\n  data: VNodeData;\n  parent: Vue;\n  injections: any\n}\n\nexport interface PropOptions {\n  type?: Constructor | Constructor[] | null;\n  required?: boolean;\n  default?: any;\n  validator?(value: any): boolean;\n}\n\nexport interface ComputedOptions<V> {\n  get?(this: V): any;\n  set?(this: V, value: any): void;\n  cache?: boolean;\n}\n\nexport type WatchHandler<V, T> = (this: V, val: T, oldVal: T) => void;\n\nexport interface WatchOptions {\n  deep?: boolean;\n  immediate?: boolean;\n}\n\nexport type DirectiveFunction = (\n  el: HTMLElement,\n  binding: VNodeDirective,\n  vnode: VNode,\n  oldVnode: VNode\n) => void;\n\nexport interface DirectiveOptions {\n  bind?: DirectiveFunction;\n  inserted?: DirectiveFunction;\n  update?: DirectiveFunction;\n  componentUpdated?: DirectiveFunction;\n  unbind?: DirectiveFunction;\n}\n"
  },
  {
    "path": "types/plugin.d.ts",
    "content": "import { Vue as _Vue } from \"./vue\";\n\nexport type PluginFunction<T> = (Vue: typeof _Vue, options?: T) => void;\n\nexport interface PluginObject<T> {\n  install: PluginFunction<T>;\n  [key: string]: any;\n}\n"
  },
  {
    "path": "types/test/augmentation-test.ts",
    "content": "import Vue = require(\"../index\");\n\ndeclare module \"../vue\" {\n  // add instance property and method\n  interface Vue {\n    $instanceProperty: string;\n    $instanceMethod(): void;\n  }\n\n  // add static property and method\n  namespace Vue {\n    const staticProperty: string;\n    function staticMethod(): void;\n  }\n}\n\n// augment ComponentOptions\ndeclare module \"../options\" {\n  interface ComponentOptions<V extends Vue> {\n    foo?: string;\n  }\n}\n\nconst vm = new Vue({\n  data: {\n    a: true\n  },\n  foo: \"foo\"\n});\n\nvm.$instanceProperty;\nvm.$instanceMethod();\n\nVue.staticProperty;\nVue.staticMethod();\n"
  },
  {
    "path": "types/test/options-test.ts",
    "content": "import Vue = require(\"../index\");\nimport { ComponentOptions, FunctionalComponentOptions } from \"../index\";\n\ninterface Component extends Vue {\n  a: number;\n}\n\nVue.component('component', {\n  data() {\n    this.$mount\n    this.a\n    return {\n      a: 1\n    }\n  },\n  props: {\n    size: Number,\n    name: {\n      type: String,\n      default: 0,\n      required: true,\n      validator(value) {\n        return value > 0;\n      }\n    }\n  },\n  propsData: {\n    msg: \"Hello\"\n  },\n  computed: {\n    aDouble(this: Component) {\n      return this.a * 2;\n    },\n    aPlus: {\n      get(this: Component) {\n        return this.a + 1;\n      },\n      set(this: Component, v: number) {\n        this.a = v - 1;\n      },\n      cache: false\n    }\n  },\n  methods: {\n    plus() {\n      this.a++;\n    }\n  },\n  watch: {\n    'a': function(val: number, oldVal: number) {\n      console.log(`new: ${val}, old: ${oldVal}`);\n    },\n    'b': 'someMethod',\n    'c': {\n      handler(val, oldVal) {\n        this.a = val\n      },\n      deep: true\n    }\n  },\n  el: \"#app\",\n  template: \"<div>{{ message }}</div>\",\n  render(createElement) {\n    return createElement(\"div\", {\n      attrs: {\n        id: \"foo\"\n      },\n      props: {\n        myProp: \"bar\"\n      },\n      domProps: {\n        innerHTML: \"baz\"\n      },\n      on: {\n        click: new Function\n      },\n      nativeOn: {\n        click: new Function\n      },\n      class: {\n        foo: true,\n        bar: false\n      },\n      style: {\n        color: 'red',\n        fontSize: '14px'\n      },\n      key: 'myKey',\n      ref: 'myRef'\n    }, [\n      createElement(),\n      createElement(\"div\", \"message\"),\n      createElement(Vue.component(\"component\")),\n      createElement({} as ComponentOptions<Vue>),\n      createElement({ functional: true }),\n\n      createElement(() => Vue.component(\"component\")),\n      createElement(() => ( {} as ComponentOptions<Vue> )),\n      createElement(() => {\n        return new Promise((resolve) => {\n          resolve({} as ComponentOptions<Vue>);\n        })\n      }),\n      createElement((resolve, reject) => {\n        resolve({} as ComponentOptions<Vue>);\n        reject();\n      }),\n\n      \"message\",\n\n      [createElement(\"div\", \"message\")]\n    ]);\n  },\n  staticRenderFns: [],\n\n  beforeCreate() {\n    this.a = 1;\n  },\n  created() {},\n  beforeDestroy() {},\n  destroyed() {},\n  beforeMount() {},\n  mounted() {},\n  beforeUpdate() {},\n  updated() {},\n  activated() {},\n  deactivated() {},\n\n  directives: {\n    a: {\n      bind() {},\n      inserted() {},\n      update() {},\n      componentMounted() {},\n      unbind() {}\n    },\n    b(el, binding, vnode, oldVnode) {\n      el.textContent;\n\n      binding.name;\n      binding.value;\n      binding.oldValue;\n      binding.expression;\n      binding.arg;\n      binding.modifiers[\"modifier\"];\n    }\n  },\n  components: {\n    a: Vue.component(\"\"),\n    b: {} as ComponentOptions<Vue>\n  },\n  transitions: {},\n  filters: {\n    double(value: number) {\n      return value * 2;\n    }\n  },\n  parent: new Vue,\n  mixins: [Vue.component(\"\"), ({} as ComponentOptions<Vue>)],\n  name: \"Component\",\n  extends: {} as ComponentOptions<Vue>,\n  delimiters: [\"${\", \"}\"]\n} as ComponentOptions<Component>);\n\nVue.component('component-with-scoped-slot', {\n  render (h) {\n    interface ScopedSlotProps {\n      msg: string\n    }\n\n    return h('div', [\n      h('child', [\n        // default scoped slot as children\n        (props: ScopedSlotProps) => [h('span', [props.msg])]\n      ]),\n      h('child', {\n        scopedSlots: {\n          // named scoped slot as vnode data\n          item: (props: ScopedSlotProps) => [h('span', [props.msg])]\n        }\n      })\n    ])\n  },\n  components: {\n    child: {\n      render (h) {\n        return h('div', [\n          this.$scopedSlots['default']({ msg: 'hi' }),\n          this.$scopedSlots['item']({ msg: 'hello' })\n        ])\n      }\n    } as ComponentOptions<Vue>\n  }\n} as ComponentOptions<Vue>)\n\nVue.component('functional-component', {\n  props: ['prop'],\n  functional: true,\n  render(createElement, context) {\n    context.props;\n    context.children;\n    context.slots();\n    context.data;\n    context.parent;\n    return createElement(\"div\", {}, context.children);\n  }\n} as FunctionalComponentOptions);\n\nVue.component(\"async-component\", (resolve, reject) => {\n  setTimeout(() => {\n    resolve(Vue.component(\"component\"));\n  }, 0);\n  return new Promise((resolve) => {\n    resolve({ functional: true } as FunctionalComponentOptions);\n  })\n});\n"
  },
  {
    "path": "types/test/plugin-test.ts",
    "content": "import Vue = require(\"../index\");\nimport { PluginFunction, PluginObject } from \"../index\";\n\nclass Option {\n  prefix: string;\n  suffix: string;\n}\n\nconst plugin: PluginObject<Option> = {\n  install(Vue, option) {\n    if (typeof option !== \"undefined\") {\n      const {prefix, suffix} = option;\n    }\n  }\n}\nconst installer: PluginFunction<Option> = function(Vue, option) { }\n\nVue.use(plugin, new Option);\nVue.use(installer, new Option);\n"
  },
  {
    "path": "types/test/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"lib\": [\n      \"es5\",\n      \"dom\",\n      \"es2015.promise\",\n      \"es2015.core\"\n    ],\n    \"module\": \"commonjs\",\n    \"noImplicitAny\": true,\n    \"strictNullChecks\": true,\n    \"noEmit\": true\n  },\n  \"files\": [\n    \"../index.d.ts\",\n    \"../options.d.ts\",\n    \"../plugin.d.ts\",\n    \"../vnode.d.ts\",\n    \"../vue.d.ts\",\n    \"options-test.ts\",\n    \"plugin-test.ts\",\n    \"vue-test.ts\",\n    \"augmentation-test.ts\"\n  ],\n  \"compileOnSave\": false\n}\n"
  },
  {
    "path": "types/test/vue-test.ts",
    "content": "import Vue = require(\"../index\");\n\nclass Test extends Vue {\n  a: number;\n\n  testProperties() {\n    this.$data;\n    this.$el;\n    this.$options;\n    this.$parent;\n    this.$root;\n    this.$children;\n    this.$refs;\n    this.$slots;\n    this.$isServer;\n  }\n\n  // test property reification\n  $refs: {\n    vue: Vue,\n    element: HTMLInputElement,\n    vues: Vue[],\n    elements: HTMLInputElement[]\n  }\n  testReification() {\n    this.$refs.vue.$data;\n    this.$refs.element.value;\n    this.$refs.vues[0].$data;\n    this.$refs.elements[0].value;\n  }\n\n  testMethods() {\n    this.$mount(\"#app\", false);\n    this.$forceUpdate();\n    this.$destroy();\n    this.$set({}, \"key\", \"value\");\n    this.$delete({}, \"key\");\n    this.$watch(\"a\", (val: number, oldVal: number) => {}, {\n      immediate: true,\n      deep: false\n    })();\n    this.$watch(() => this.a, (val: number) => {});\n    this.$on(\"\", () => {});\n    this.$once(\"\", () => {});\n    this.$off(\"\", () => {});\n    this.$emit(\"\", 1, 2, 3);\n    this.$nextTick(function() {\n      this.$nextTick;\n    });\n    this.$nextTick().then(() => {});\n    this.$createElement(\"div\", {}, \"message\");\n  }\n\n  static testConfig() {\n    const { config } = this;\n    config.silent;\n    config.optionMergeStrategies;\n    config.devtools;\n    config.errorHandler = (err, vm) => {\n      if (vm instanceof Test) {\n        vm.testProperties();\n        vm.testMethods();\n      }\n    };\n    config.keyCodes = { esc: 27 };\n  }\n\n  static testMethods() {\n    this.extend({\n      data() {\n        return {\n          msg: \"\"\n        };\n      }\n    });\n    this.nextTick(() => {});\n    this.nextTick().then(() => {});\n    this.set({}, \"\", \"\");\n    this.set([true, false, true], 1, true);\n    this.delete({}, \"\");\n    this.directive(\"\", {bind() {}});\n    this.filter(\"\", (value: number) => value);\n    this.component(\"\", { data: () => ({}) });\n    this.component(\"\", { functional: true });\n    this.use;\n    this.mixin(Test);\n    this.compile(\"<div>{{ message }}</div>\");\n  }\n}\n"
  },
  {
    "path": "types/typings.json",
    "content": "{\n  \"name\": \"vue\",\n  \"main\": \"index.d.ts\"\n}\n"
  },
  {
    "path": "types/vnode.d.ts",
    "content": "import { Vue } from \"./vue\";\n\nexport type ScopedSlot = (props: any) => VNodeChildrenArrayContents | string;\n\nexport type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string;\nexport interface VNodeChildrenArrayContents {\n  [x: number]: VNode | string | VNodeChildren;\n}\n\nexport interface VNode {\n  tag?: string;\n  data?: VNodeData;\n  children?: VNode[];\n  text?: string;\n  elm?: Node;\n  ns?: string;\n  context?: Vue;\n  key?: string | number;\n  componentOptions?: VNodeComponentOptions;\n  componentInstance?: Vue;\n  parent?: VNode;\n  raw?: boolean;\n  isStatic?: boolean;\n  isRootInsert: boolean;\n  isComment: boolean;\n}\n\nexport interface VNodeComponentOptions {\n  Ctor: typeof Vue;\n  propsData?: Object;\n  listeners?: Object;\n  children?: VNodeChildren;\n  tag?: string;\n}\n\nexport interface VNodeData {\n  key?: string | number;\n  slot?: string;\n  scopedSlots?: { [key: string]: ScopedSlot };\n  ref?: string;\n  tag?: string;\n  staticClass?: string;\n  class?: any;\n  staticStyle?: { [key: string]: any };\n  style?: Object[] | Object;\n  props?: { [key: string]: any };\n  attrs?: { [key: string]: any };\n  domProps?: { [key: string]: any };\n  hook?: { [key: string]: Function };\n  on?: { [key: string]: Function | Function[] };\n  nativeOn?: { [key: string]: Function | Function[] };\n  transition?: Object;\n  show?: boolean;\n  inlineTemplate?: {\n    render: Function;\n    staticRenderFns: Function[];\n  };\n  directives?: VNodeDirective[];\n  keepAlive?: boolean;\n}\n\nexport interface VNodeDirective {\n  readonly name: string;\n  readonly value: any;\n  readonly oldValue: any;\n  readonly expression: any;\n  readonly arg: string;\n  readonly modifiers: { [key: string]: boolean };\n}\n"
  },
  {
    "path": "types/vue.d.ts",
    "content": "import {\n  Component,\n  AsyncComponent,\n  ComponentOptions,\n  FunctionalComponentOptions,\n  WatchOptions,\n  WatchHandler,\n  DirectiveOptions,\n  DirectiveFunction\n} from \"./options\";\nimport { VNode, VNodeData, VNodeChildren, ScopedSlot } from \"./vnode\";\nimport { PluginFunction, PluginObject } from \"./plugin\";\n\nexport type CreateElement = {\n  // empty node\n  (): VNode;\n\n  // element or component name\n  (tag: string, children: VNodeChildren): VNode;\n  (tag: string, data?: VNodeData, children?: VNodeChildren): VNode;\n\n  // component constructor or options\n  (tag: Component, children: VNodeChildren): VNode;\n  (tag: Component, data?: VNodeData, children?: VNodeChildren): VNode;\n\n  // async component\n  (tag: AsyncComponent, children: VNodeChildren): VNode;\n  (tag: AsyncComponent, data?: VNodeData, children?: VNodeChildren): VNode;\n}\n\nexport declare class Vue {\n\n  constructor(options?: ComponentOptions<Vue>);\n\n  $data: Object;\n  readonly $el: HTMLElement;\n  readonly $options: ComponentOptions<this>;\n  readonly $parent: Vue;\n  readonly $root: Vue;\n  readonly $children: Vue[];\n  readonly $refs: { [key: string]: Vue | Element | Vue[] | Element[]};\n  readonly $slots: { [key: string]: VNode[] };\n  readonly $scopedSlots: { [key: string]: ScopedSlot };\n  readonly $isServer: boolean;\n  readonly $props: any;\n\n  $mount(elementOrSelector?: Element | String, hydrating?: boolean): this;\n  $forceUpdate(): void;\n  $destroy(): void;\n  $set: typeof Vue.set;\n  $delete: typeof Vue.delete;\n  $watch(\n    expOrFn: string,\n    callback: WatchHandler<this, any>,\n    options?: WatchOptions\n  ): (() => void);\n  $watch<T>(\n    expOrFn: (this: this) => T,\n    callback: WatchHandler<this, T>,\n    options?: WatchOptions\n  ): (() => void);\n  $on(event: string | string[], callback: Function): this;\n  $once(event: string, callback: Function): this;\n  $off(event?: string | string[], callback?: Function): this;\n  $emit(event: string, ...args: any[]): this;\n  $nextTick(callback: (this: this) => void): void;\n  $nextTick(): Promise<void>;\n  $createElement: CreateElement;\n\n  static config: {\n    silent: boolean;\n    optionMergeStrategies: any;\n    devtools: boolean;\n    productionTip: boolean;\n    performance: boolean;\n    errorHandler(err: Error, vm: Vue, info: string): void;\n    ignoredElements: string[];\n    keyCodes: { [key: string]: number };\n  }\n\n  static extend(options: ComponentOptions<Vue> | FunctionalComponentOptions): typeof Vue;\n  static nextTick(callback: () => void, context?: any[]): void;\n  static nextTick(): Promise<void>\n  static set<T>(object: Object, key: string, value: T): T;\n  static set<T>(array: T[], key: number, value: T): T;\n  static delete(object: Object, key: string): void;\n\n  static directive(\n    id: string,\n    definition?: DirectiveOptions | DirectiveFunction\n  ): DirectiveOptions;\n  static filter(id: string, definition?: Function): Function;\n  static component(id: string, definition?: Component | AsyncComponent): typeof Vue;\n\n  static use<T>(plugin: PluginObject<T> | PluginFunction<T>, options?: T): void;\n  static mixin(mixin: typeof Vue | ComponentOptions<Vue>): void;\n  static compile(template: string): {\n    render(createElement: typeof Vue.prototype.$createElement): VNode;\n    staticRenderFns: (() => VNode)[];\n  };\n}\n"
  }
]