[
  {
    "path": ".ctags-exclude",
    "content": "node_modules\nplatforms\nandroid17.d.ts\nios.d.ts\n*.js\nbin\n"
  },
  {
    "path": ".gitignore",
    "content": "npm-debug.log\n.DS_Store\n\n*.js.map\napp/**/*.js\ne2e/**/*.js\ne2e/reports/\nhooks/\nlib/\nnode_modules/\nplatforms/\ntmp/\ntypings/\nreport/\ntest-results.xml"
  },
  {
    "path": ".travis.yml",
    "content": "env:\n  global:\n    - ANDROID_PACKAGE='sampleGroceries.apk'\n    - ANDROID_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/platforms/android/app/build/outputs/apk/debug/\n    - ANDROID_SAUCE_STORAGE=\"https://saucelabs.com/rest/v1/storage/$SAUCE_USER/$ANDROID_PACKAGE?overwrite=true\"\n    - IOS_PACKAGE='sampleGroceries.zip'\n    - IOS_APP_NAME='sampleGroceries.app'\n    - IOS_PACKAGE_FOLDER=$TRAVIS_BUILD_DIR/platforms/ios/build/Debug-iphonesimulator\n    - IOS_SAUCE_STORAGE=\"https://saucelabs.com/rest/v1/storage/$SAUCE_USER/$IOS_PACKAGE?overwrite=true\"\nbranches:\n  only: \n    - master\nmatrix:\n  include:\n    - stage: \"Lint\"\n      language: node_js\n      os: linux\n      node_js: \"10\"\n      install: true\n      script: npm i && npm run tslint\n    - stage: \"Build\"\n      os: osx\n      env: \n        - BuildiOS=\"12\"\n        - Xcode=\"10.0\"\n      osx_image: xcode10\n      language: node_js \n      node_js: \"10\"\n      jdk: oraclejdk8\n      script:\n        - tns build ios --bundle --env.aot --env.uglify\n        - cd $IOS_PACKAGE_FOLDER && zip -r $IOS_PACKAGE $IOS_APP_NAME\n        - \"curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE --data-binary @$IOS_PACKAGE_FOLDER/$IOS_PACKAGE\"\n    - language: android\n      env:\n        - BuildAndroid=\"28\"\n      os: linux\n      jdk: oraclejdk8\n      before_install: nvm install 10\n      script:\n        - tns build android --bundle --env.aot --env.uglify --env.snapshot\n        - \"curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $ANDROID_SAUCE_STORAGE --data-binary @$ANDROID_PACKAGE_FOLDER/app-debug.apk\"\n    - stage: \"UI Tests\"\n      env:\n        - AndroidEmulator=\"23\"\n      language: node_js\n      os: linux\n      node_js: \"10\"\n      script:\n      #  - npm i -g appium@1.8.0\n        - npm i\n        - travis_retry npm run e2e -- --runType android23 --sauceLab --appPath $ANDROID_PACKAGE\n    - os: linux\n      env: \n        - iOS=\"11\"\n      language: node_js \n      node_js: \"10\"\n      script: \n      #  - npm i -g appium@1.8.0\n        - npm i\n        - travis_wait travis_retry npm run e2e -- --runType sim.iPhone8 --sauceLab --appPath $IOS_PACKAGE\nandroid:\n  components:\n    - tools\n    - platform-tools\n    - build-tools-28.0.3\n    - android-28\n    - extra-android-m2repository\n\nbefore_cache:\n    - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock\ncache:\n    directories:\n        - .nvm\n        - $HOME/.gradle/caches/\n        - $HOME/.gradle/wrapper/\n\ninstall:\n    - pip install six\n    - echo no | npm install -g nativescript@latest --ignore-scripts\n    - tns usage-reporting disable\n    - tns error-reporting disable\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n  \"version\": \"0.2.0\",\n  \"configurations\": [\n    {\n      \"type\": \"node\",\n      \"request\": \"launch\",\n      \"name\": \"Mocha Tests\",\n      \"program\": \"${workspaceFolder}/node_modules/mocha/bin/_mocha\",\n      \"args\": [\n        \"--runType\",\n        \"android23\",\n        \"--sauceLab\",\n        \"-v\",\n        \"--appPath\",\n        \"sampleGroceries.apk\",\n        \"--timeout\",\n        \"999999\",\n        \"-u\",\n        \"tdd\",\n        \"--timeout\",\n        \"999999\",\n        \"--colors\",\n        \"${workspaceFolder}/e2e\"\n      ],\n      \"internalConsoleOptions\": \"openOnSessionStart\"\n    },\n    {\n      \"name\": \"Sync on iOS\",\n      \"type\": \"nativescript\",\n      \"platform\": \"ios\",\n      \"request\": \"launch\",\n      \"appRoot\": \"${workspaceRoot}\",\n      \"sourceMaps\": true,\n      \"diagnosticLogging\": false,\n      \"emulator\": false,\n      \"rebuild\": false,\n      \"syncAllFiles\": false\n    },\n    {\n      \"name\": \"Launch on iOS\",\n      \"type\": \"nativescript\",\n      \"platform\": \"ios\",\n      \"request\": \"launch\",\n      \"appRoot\": \"${workspaceRoot}\",\n      \"sourceMaps\": true,\n      \"diagnosticLogging\": false,\n      \"emulator\": false,\n      \"rebuild\": true\n    },\n    {\n      \"name\": \"Attach on iOS\",\n      \"type\": \"nativescript\",\n      \"platform\": \"ios\",\n      \"request\": \"attach\",\n      \"appRoot\": \"${workspaceRoot}\",\n      \"sourceMaps\": true,\n      \"diagnosticLogging\": false,\n      \"emulator\": false\n    },\n    {\n      \"name\": \"Sync on Android\",\n      \"type\": \"nativescript\",\n      \"platform\": \"android\",\n      \"request\": \"launch\",\n      \"appRoot\": \"${workspaceRoot}\",\n      \"sourceMaps\": true,\n      \"diagnosticLogging\": false,\n      \"emulator\": false,\n      \"rebuild\": false\n    },\n    {\n      \"name\": \"Launch on Android\",\n      \"type\": \"nativescript\",\n      \"platform\": \"android\",\n      \"request\": \"launch\",\n      \"appRoot\": \"${workspaceRoot}\",\n      \"sourceMaps\": true,\n      \"diagnosticLogging\": false,\n      \"emulator\": false,\n      \"rebuild\": true\n    },\n    {\n      \"name\": \"Attach on Android\",\n      \"type\": \"nativescript\",\n      \"platform\": \"android\",\n      \"request\": \"attach\",\n      \"appRoot\": \"${workspaceRoot}\",\n      \"sourceMaps\": true,\n      \"diagnosticLogging\": false,\n      \"emulator\": false\n    }\n  ]\n}"
  },
  {
    "path": ".vscode/settings.json",
    "content": "// Place your settings in this file to overwrite default and user settings.\n{\n    \"files.exclude\": {\n        \"**/*.js\": { \"when\": \"$(basename).ts\" },\n        \"**/*.map\": { \"when\": \"$(basename).map\" }\n    }\n}"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# NativeScript Community Code of Conduct\n\nOur community members come from all walks of life and are all at different stages of their personal and professional journeys. To support everyone, we've prepared a short code of conduct. Our mission is best served in an environment that is friendly, safe, and accepting; free from intimidation or harassment.\n\nTowards this end, certain behaviors and practices will not be tolerated.\n\n## tl;dr\n\n- Be respectful. \n- We're here to help.\n- Abusive behavior is never tolerated. \n- Violations of this code may result in swift and permanent expulsion from the NativeScript community channels. \n\n## Administrators\n\n- Dan Wilson (@DanWilson on Slack)\n- Jen Looper (@jen.looper on Slack)\n- TJ VanToll (@tjvantoll on Slack)\n\n## Scope\n\nWe expect all members of the NativeScript community, including administrators, users, facilitators, and vendors to abide by this Code of Conduct at all times in our community venues, online and in person, and in one-on-one communications pertaining to NativeScript affairs.\n\nThis policy covers the usage of the NativeScript Slack community, as well as the NativeScript support forums, NativeScript GitHub repositories, the NativeScript website, and any NativeScript-related events. This Code of Conduct is in addition to, and does not in any way nullify or invalidate, any other terms or conditions related to use of NativeScript.\n\nThe definitions of various subjective terms such as \"discriminatory\", \"hateful\", or \"confusing\" will be decided at the sole discretion of the NativeScript administrators.\n\n## Friendly, Harassment-Free Space\n\nWe are committed to providing a friendly, safe, and welcoming environment for all, regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics.\n\nWe ask that you please respect that people have differences of opinion regarding technical choices, and acknowledge that every design or implementation choice carries a trade-off and numerous costs. There is seldom a single right answer. A difference of technology preferences is never a license to be rude.\n\nAny spamming, trolling, flaming, baiting, or other attention-stealing behaviour is not welcome, and will not be tolerated.\n\nHarassing other users of NativeScript is never tolerated, whether via public or private media.\n\nAvoid using offensive or harassing package names, nicknames, or other identifiers that might detract from a friendly, safe, and welcoming environment for all.\n\nHarassment includes, but is not limited to: harmful or prejudicial verbal or written comments related to gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics; inappropriate use of nudity, sexual images, and/or sexually explicit language in public spaces; threats of physical or non-physical harm; deliberate intimidation, stalking or following; harassing photography or recording; sustained disruption of talks or other events; inappropriate physical contact; and unwelcome sexual attention.\n\n## Acceptable Content\n\nThe NativeScript administrators reserve the right to make judgement calls about what is and isn't appropriate in published content. These are guidelines to help you be successful in our community.\n\nContent must contain something applicable to the previously stated goals of the NativeScript community. \"Spamming\", that is, publishing any form of content that is not applicable, is not allowed.\n\nContent must not contain illegal or infringing content. You should only publish content to NativeScript properties if you have the right to do so. This includes complying with all software license agreements or other intellectual property restrictions. For example, redistributing an MIT-licensed module with the copyright notice removed, would not be allowed. You will be responsible for any violation of laws or others’ intellectual property rights.\n\nContent must not be malware. For example, content (code, video, pictures, words, etc.) which is designed to maliciously exploit or damage computer systems, is not allowed.\n\nContent name, description, and other visible metadata must not include abusive, inappropriate, or harassing content.\n\n## Reporting Violations of this Code of Conduct\n\nIf you believe someone is harassing you or has otherwise violated this Code of Conduct, please contact the administrators and send us an abuse report. If this is the initial report of a problem, please include as much detail as possible. It is easiest for us to address issues when we have more context.\n\n## Consequences\n\nAll content published to the NativeScript community channels is hosted at the sole discretion of the NativeScript administrators.\n\nUnacceptable behavior from any community member, including sponsors, employees, customers, or others with decision-making authority, will not be tolerated.\n\nAnyone asked to stop unacceptable behavior is expected to comply immediately.\n\nIf a community member engages in unacceptable behavior, the NativeScript administrators may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event or service).\n\n## Addressing Grievances\n\nIf you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify the administrators. We will do our best to ensure that your grievance is handled appropriately.\n\nIn general, we will choose the course of action that we judge as being most in the interest of fostering a safe and friendly community.\n\n## Contact Info\nPlease contact Dan Wilson @DanWilson if you need to report a problem or address a grievance related to an abuse report.\n\nYou are also encouraged to contact us if you are curious about something that might be \"on the line\" between appropriate and inappropriate content. We are happy to provide guidance to help you be a successful part of our community.\n\n## Credit and License\n\nThis Code of Conduct borrows heavily from the WADE Code of Conduct, which is derived from the NodeBots Code of Conduct, which in turn borrows from the npm Code of Conduct, which was derived from the Stumptown Syndicate Citizen's Code of Conduct, and the Rust Project Code of Conduct.\n\nThis document may be reused under a Creative Commons Attribution-ShareAlike License."
  },
  {
    "path": "LICENSE",
    "content": "                                Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright (c) 2015-2019 Progress Software Corporation\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "# Groceries [![Build Status](https://travis-ci.org/NativeScript/sample-Groceries.svg?branch=master)](https://travis-ci.org/NativeScript/sample-Groceries)\n\nGroceries is a NativeScript-built iOS and Android app for managing grocery lists. You can learn how to build a version of this app from scratch using either our [JavaScript getting started guide](http://docs.nativescript.org/tutorial/chapter-0), or our [TypeScript and Angular getting started guide](http://docs.nativescript.org/angular/tutorial/ng-chapter-0).\n\n<!-- * [Download](#download) -->\n\n* [Screenshots](#screenshots)\n* [Development](#development)\n    * [Linting](#linting)\n    * [Unit testing](#unit-testing)\n    * [Travis CI](#travis)\n* [Contributors](#contributors)\n\n<h2 id=\"screenshots\">Screenshots</h2>\n\n![](assets/screenshots/ios-1.png)\n![](assets/screenshots/ios-2.png)\n![](assets/screenshots/ios-3.png)\n\n![](assets/screenshots/android-1.png)\n![](assets/screenshots/android-2.png)\n![](assets/screenshots/android-3.png)\n\n<h2 id=\"development\">Development</h2>\n\nThis app is built with the NativeScript CLI. Once you have the [CLI installed](https://docs.nativescript.org/start/quick-setup), start by cloning the repo:\n\n```\n$ git clone https://github.com/NativeScript/sample-Groceries.git\n$ cd sample-Groceries\n```\n\nFrom there you can use the `run` command to run Groceries on iOS:\n\n```\n$ tns run ios\n```\n\nAnd the same command to run Groceries on Android:\n\n```\n$ tns run android\n```\n\n<h3 id=\"linting\">Linting</h3>\n\nGroceries uses [tslint](https://www.npmjs.com/package/tslint) + [codelyzer](https://github.com/mgechev/codelyzer) rules to ensure the code follows the [angular style guide](https://angular.io/docs/ts/latest/guide/style-guide.html).\n\nYou can run the linter with the `tslint` npm script:\n```\n$ npm run tslint\n```\n\n<h3 id=\"unit-testing\">Unit Testing</h3>\n\nGroceries uses NativeScript’s [integrated unit test runner](http://docs.nativescript.org/core-concepts/testing) with [Jasmine](http://jasmine.github.io/). To run the tests for yourself use the `tns test` command:\n\n```\n$ tns test ios --emulator\n```\n\n```\n$ tns test android --emulator\n```\n\nFor more information on unit testing NativeScript apps, refer to the [NativeScript docs on the topic](http://docs.nativescript.org/core-concepts/testing).\n\n<h3 id=\"travis\">Travis CI</h3>\n\nGroceries uses [Travis CI](https://travis-ci.org/) to verify all tests pass on each commit. Refer to the [`.travis.yml` configuration file](https://github.com/NativeScript/sample-Groceries/blob/release/.travis.yml) for details.\n\n<h2 id=\"contributors\">Contributors</h2>\n\nThe following is a list of all the people that have helped build Groceries. Thanks for your contributions!\n\n[<img alt=\"tjvantoll\" src=\"https://avatars.githubusercontent.com/u/544280?v=3&s=117\" width=\"117\">](https://github.com/tjvantoll)[<img alt=\"hdeshev\" src=\"https://avatars.githubusercontent.com/u/63219?v=3&s=117\" width=\"117\">](https://github.com/hdeshev)[<img alt=\"vakrilov\" src=\"https://avatars.githubusercontent.com/u/4092076?v=3&s=117\" width=\"117\">](https://github.com/vakrilov)[<img alt=\"Mitko-Kerezov\" src=\"https://avatars.githubusercontent.com/u/6683316?v=3&s=117\" width=\"117\">](https://github.com/Mitko-Kerezov)[<img alt=\"jlooper\" src=\"https://avatars.githubusercontent.com/u/1450004?v=3&s=117\" width=\"117\">](https://github.com/jlooper)[<img alt=\"rosen-vladimirov\" src=\"https://avatars.githubusercontent.com/u/8351653?v=3&s=117\" width=\"117\">](https://github.com/rosen-vladimirov)\n\n[<img alt=\"SvetoslavTsenov\" src=\"https://avatars.githubusercontent.com/u/3598759?v=3&s=117\" width=\"117\">](https://github.com/SvetoslavTsenov)[<img alt=\"ligaz\" src=\"https://avatars.githubusercontent.com/u/19437?v=3&s=117\" width=\"117\">](https://github.com/ligaz)[<img alt=\"sis0k0\" src=\"https://avatars.githubusercontent.com/u/7893485?v=3&s=117\" width=\"117\">](https://github.com/sis0k0)[<img alt=\"wdulin\" src=\"https://avatars.githubusercontent.com/u/1111372?v=3&s=117\" width=\"117\">](https://github.com/wdulin)[<img alt=\"dtopuzov\" src=\"https://avatars.githubusercontent.com/u/6651651?v=3&s=117\" width=\"117\">](https://github.com/dtopuzov)[<img alt=\"nadyaA\" src=\"https://avatars.githubusercontent.com/u/6064810?v=3&s=117\" width=\"117\">](https://github.com/nadyaA)\n\n[<img alt=\"vchimev\" src=\"https://avatars.githubusercontent.com/u/12251337?v=3&s=117\" width=\"117\">](https://github.com/vchimev)[<img alt=\"covex-nn\" src=\"https://avatars.githubusercontent.com/u/110878?v=3&s=117\" width=\"117\">](https://github.com/covex-nn)[<img alt=\"bundyo\" src=\"https://avatars.githubusercontent.com/u/98318?v=3&s=117\" width=\"117\">](https://github.com/bundyo)[<img alt=\"EddyVerbruggen\" src=\"https://avatars.githubusercontent.com/u/1426370?v=3&s=117\" width=\"117\">](https://github.com/EddyVerbruggen)[<img alt=\"NathanWalker\" src=\"https://avatars.githubusercontent.com/u/457187?v=3&s=117\" width=\"117\">](https://github.com/NathanWalker)[<img alt=\"nsndeck\" src=\"https://avatars.githubusercontent.com/u/5665150?v=3&s=117\" width=\"117\">](https://github.com/nsndeck)\n\n[<img alt=\"tzraikov\" src=\"https://avatars.githubusercontent.com/u/3244426?v=3&s=117\" width=\"117\">](https://github.com/tzraikov)[<img alt=\"TsvetanMilanov\" src=\"https://avatars.githubusercontent.com/u/10463529?v=3&s=117\" width=\"117\">](https://github.com/TsvetanMilanov)[<img alt=\"bradmartin\" src=\"https://avatars.githubusercontent.com/u/6006148?v=3&s=117\" width=\"117\">](https://github.com/bradmartin)[<img alt=\"cmelo\" src=\"https://avatars.githubusercontent.com/u/872461?v=3&s=117\" width=\"117\">](https://github.com/cmelo)\n\n<!-- Note: The table above get generated with the following commands -->\n<!-- npm install -g github-contributors-list -->\n<!-- githubcontrib --owner NativeScript --repo sample-Groceries --cols 6 --sortOrder desc | pbcopy -->\n\n![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/sample-groceries?pixel)\n\n### Big Thanks\n\nCross-browser Testing Platform and Open Source Provided by [Sauce Labs](https://saucelabs.com).\n\n[<img alt=\"SauceLabs\" src=\"assets/sauceLabs/SauceLabs-white.svg\" width=\"200\">](https://saucelabs.com)\n"
  },
  {
    "path": "app/App_Resources/Android/app.gradle",
    "content": "// Add your native dependencies here:\n\n// Uncomment to add recyclerview-v7 dependency\n//dependencies {\n//\tcompile 'com.android.support:recyclerview-v7:+'\n//}\n\nandroid {  \n  defaultConfig {  \n    generatedDensities = []\n    applicationId = \"org.nativescript.groceries\" \n    \n    //override supported platforms\n    // ndk {\n    //       abiFilters.clear()\n    //   \t\tabiFilters \"armeabi-v7a\"\n \t\t// }\n  \n  }  \n  aaptOptions {  \n    additionalParameters \"--no-version-vectors\"  \n  }  \n} \n"
  },
  {
    "path": "app/App_Resources/Android/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tpackage=\"__PACKAGE__\"\n\tandroid:versionCode=\"1\"\n\tandroid:versionName=\"1.0\">\n\n\t<supports-screens\n\t\tandroid:smallScreens=\"true\"\n\t\tandroid:normalScreens=\"true\"\n\t\tandroid:largeScreens=\"true\"\n\t\tandroid:xlargeScreens=\"true\"/>\n\n\t<uses-sdk\n\t\tandroid:minSdkVersion=\"17\"\n\t\tandroid:targetSdkVersion=\"__APILEVEL__\"/>\n\n\t<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n\t<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\t<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n\t<uses-permission android:name=\"android.permission.INTERNET\"/>\n\n\t<application\n\t\tandroid:name=\"com.tns.NativeScriptApplication\"\n\t\tandroid:allowBackup=\"true\"\n\t\tandroid:icon=\"@drawable/icon\"\n\t\tandroid:label=\"@string/app_name\"\n\t\tandroid:theme=\"@style/AppTheme\">\n\n\t\t<activity\n\t\t\tandroid:name=\"com.tns.NativeScriptActivity\"\n\t\t\tandroid:label=\"@string/title_activity_kimera\"\n\t\t\tandroid:configChanges=\"keyboardHidden|orientation|screenSize\"\n\t\t\tandroid:theme=\"@style/LaunchScreenTheme\">\n\n\t\t\t<meta-data android:name=\"SET_THEME_ON_LAUNCH\" android:resource=\"@style/AppTheme\" />\n\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />\n\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />\n\t\t\t</intent-filter>\n\t\t</activity>\n\t\t<activity android:name=\"com.tns.ErrorReportActivity\"/>\n\t</application>\n</manifest>\n"
  },
  {
    "path": "app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml",
    "content": "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\" android:gravity=\"fill\">\n    <item>\n        <bitmap android:gravity=\"fill\" android:src=\"@drawable/background\" />\n    </item>\n    <item>\n        <bitmap android:gravity=\"center\" android:src=\"@drawable/logo\" />\n    </item>\n</layer-list>\n"
  },
  {
    "path": "app/App_Resources/Android/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"ns_primary\">#F5F5F5</color>\n\t<color name=\"ns_primaryDark\">#757575</color>\n\t<color name=\"ns_accent\">#33B5E5</color>\n    <color name=\"ns_blue\">#272734</color>\n</resources>"
  },
  {
    "path": "app/App_Resources/Android/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<resources>\r\n    <string name=\"app_name\">Groceries</string>\r\n    <string name=\"title_activity_kimera\">Groceries</string>\r\n</resources>"
  },
  {
    "path": "app/App_Resources/Android/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <!-- theme to use FOR launch screen-->\n    <style name=\"LaunchScreenThemeBase\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <item name=\"toolbarStyle\">@style/NativeScriptToolbarStyle</item>\n\n        <item name=\"colorPrimary\">@color/ns_primary</item>\n        <item name=\"colorPrimaryDark\">@color/ns_primaryDark</item>\n        <item name=\"colorAccent\">@color/ns_accent</item>\n\n        <item name=\"android:windowBackground\">@drawable/splash_screen</item>\n        \n        <item name=\"android:windowActionBarOverlay\">true</item>  \n        <item name=\"android:windowTranslucentStatus\">true</item>\n\n    </style>\n\n    <style name=\"LaunchScreenTheme\" parent=\"LaunchScreenThemeBase\">\n    </style>\n\n    <!-- theme to use AFTER launch screen is loaded-->\n    <style name=\"AppThemeBase\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <item name=\"toolbarStyle\">@style/NativeScriptToolbarStyle</item>\n\n        <item name=\"colorPrimary\">@color/ns_primary</item>\n        <item name=\"colorPrimaryDark\">@color/ns_primaryDark</item>\n        <item name=\"colorAccent\">@color/ns_accent</item>\n\n    </style>\n\n    <style name=\"AppTheme\" parent=\"AppThemeBase\">\n    </style>\n\n    <!-- theme for actioon-bar -->\n    <style name=\"NativeScriptToolbarStyleBase\" parent=\"Widget.AppCompat.Toolbar\">\n        <item name=\"android:background\">@color/ns_primary</item>\n        <item name=\"theme\">@style/ThemeOverlay.AppCompat.ActionBar</item>\n        <item name=\"popupTheme\">@style/ThemeOverlay.AppCompat</item>\n\n    </style>\n\n    <style name=\"NativeScriptToolbarStyle\" parent=\"NativeScriptToolbarStyleBase\">\n    </style>\n</resources> "
  },
  {
    "path": "app/App_Resources/Android/src/main/res/values-v21/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<color name=\"ns_accent\">#3d5afe</color>\n</resources>"
  },
  {
    "path": "app/App_Resources/Android/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <!-- Application theme -->\n    <style name=\"AppTheme\" parent=\"AppThemeBase\">\n        <item name=\"android:datePickerStyle\">@style/SpinnerDatePicker</item>\n        <item name=\"android:timePickerStyle\">@style/SpinnerTimePicker</item>\n    </style>\n\n    <!-- Default style for DatePicker - in spinner mode -->\n    <style name=\"SpinnerDatePicker\" parent=\"android:Widget.Material.Light.DatePicker\">\n        <item name=\"android:datePickerMode\">spinner</item>\n    </style>\n\n    <!-- Default style for TimePicker - in spinner mode -->\n    <style name=\"SpinnerTimePicker\" parent=\"android:Widget.Material.Light.TimePicker\">\n        <item name=\"android:timePickerMode\">spinner</item>\n    </style>\n\n    <style name=\"NativeScriptToolbarStyle\" parent=\"NativeScriptToolbarStyleBase\">\n        <item name=\"android:elevation\">4dp</item>\n    </style>    \n</resources>"
  },
  {
    "path": "app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-29.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-29@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-29@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-40@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-40@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"57x57\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-57.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"57x57\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-57@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"60x60\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-60@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"60x60\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"icon-60@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-29.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-29@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-40.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-40@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"50x50\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-50.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"50x50\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-50@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"72x72\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-72.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"72x72\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-72@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"76x76\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-76.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"76x76\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-76@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"83.5x83.5\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"icon-83.5@2x.png\",\n      \"scale\" : \"2x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "app/App_Resources/iOS/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"extent\" : \"full-screen\",\n      \"idiom\" : \"iphone\",\n      \"subtype\" : \"736h\",\n      \"filename\" : \"Default-736h@3x.png\",\n      \"minimum-system-version\" : \"8.0\",\n      \"orientation\" : \"portrait\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"extent\" : \"full-screen\",\n      \"idiom\" : \"iphone\",\n      \"subtype\" : \"736h\",\n      \"filename\" : \"Default-Landscape@3x.png\",\n      \"minimum-system-version\" : \"8.0\",\n      \"orientation\" : \"landscape\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"extent\" : \"full-screen\",\n      \"idiom\" : \"iphone\",\n      \"subtype\" : \"667h\",\n      \"filename\" : \"Default-667h@2x.png\",\n      \"minimum-system-version\" : \"8.0\",\n      \"orientation\" : \"portrait\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Default@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"minimum-system-version\" : \"7.0\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"extent\" : \"full-screen\",\n      \"idiom\" : \"iphone\",\n      \"subtype\" : \"retina4\",\n      \"filename\" : \"Default-568h@2x.png\",\n      \"minimum-system-version\" : \"7.0\",\n      \"orientation\" : \"portrait\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Portrait.png\",\n      \"extent\" : \"full-screen\",\n      \"minimum-system-version\" : \"7.0\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"landscape\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Landscape.png\",\n      \"extent\" : \"full-screen\",\n      \"minimum-system-version\" : \"7.0\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Portrait@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"minimum-system-version\" : \"7.0\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"landscape\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Landscape@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"minimum-system-version\" : \"7.0\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Default.png\",\n      \"extent\" : \"full-screen\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Default@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Default-568h@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"subtype\" : \"retina4\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"ipad\",\n      \"extent\" : \"to-status-bar\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Portrait.png\",\n      \"extent\" : \"full-screen\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"landscape\",\n      \"idiom\" : \"ipad\",\n      \"extent\" : \"to-status-bar\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"landscape\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Landscape.png\",\n      \"extent\" : \"full-screen\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"ipad\",\n      \"extent\" : \"to-status-bar\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"portrait\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Portrait@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"landscape\",\n      \"idiom\" : \"ipad\",\n      \"extent\" : \"to-status-bar\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"orientation\" : \"landscape\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Default-Landscape@2x.png\",\n      \"extent\" : \"full-screen\",\n      \"scale\" : \"2x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchScreen-AspectFill.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchScreen-AspectFill@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchScreen-Center.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchScreen-Center@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "app/App_Resources/iOS/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>Groceries</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>IPHONEOS_DEPLOYMENT_TARGET</key>\n\t<string>9.0</string>\n\t<key>CFBundleName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiresFullScreen</key>\n\t<true/>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "app/App_Resources/iOS/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"10116\" systemVersion=\"15F34\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"10085\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"Llm-lL-Icb\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"xb3-aO-Qok\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <imageView userInteractionEnabled=\"NO\" contentMode=\"scaleAspectFill\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" image=\"LaunchScreen.AspectFill\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"wtH-rr-YfP\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                            </imageView>\n                            <imageView userInteractionEnabled=\"NO\" contentMode=\"center\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" image=\"LaunchScreen.Center\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"s1z-aa-wYv\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                            </imageView>\n                        </subviews>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                        <constraints>\n                            <constraint firstItem=\"xb3-aO-Qok\" firstAttribute=\"top\" secondItem=\"wtH-rr-YfP\" secondAttribute=\"bottom\" id=\"5FO-pR-qKb\"/>\n                            <constraint firstItem=\"wtH-rr-YfP\" firstAttribute=\"top\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"top\" id=\"Awn-b8-xf1\"/>\n                            <constraint firstItem=\"s1z-aa-wYv\" firstAttribute=\"top\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"top\" id=\"CiP-yX-1sg\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"wtH-rr-YfP\" secondAttribute=\"trailing\" id=\"RXg-rW-UK8\"/>\n                            <constraint firstItem=\"s1z-aa-wYv\" firstAttribute=\"leading\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"leading\" id=\"agC-wa-3bd\"/>\n                            <constraint firstItem=\"wtH-rr-YfP\" firstAttribute=\"leading\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"leading\" id=\"cch-8E-tYu\"/>\n                            <constraint firstItem=\"xb3-aO-Qok\" firstAttribute=\"top\" secondItem=\"s1z-aa-wYv\" secondAttribute=\"bottom\" id=\"fNc-Ro-KaG\"/>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"s1z-aa-wYv\" secondAttribute=\"trailing\" id=\"qoI-OC-Zk7\"/>\n                        </constraints>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"510\" y=\"238\"/>\n        </scene>\n    </scenes>\n    <resources>\n        <image name=\"LaunchScreen.AspectFill\" width=\"768\" height=\"1024\"/>\n        <image name=\"LaunchScreen.Center\" width=\"40\" height=\"40\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "app/App_Resources/iOS/build.xcconfig",
    "content": "// You can add custom settings here\n// for example you can uncomment the following line to force distribution code signing\n// CODE_SIGN_IDENTITY = iPhone Distribution \n// To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html\n// DEVELOPMENT_TEAM = YOUR_TEAM_ID;\nASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\nASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;\n"
  },
  {
    "path": "app/app.component.ts",
    "content": "import { Component } from \"@angular/core\";\n\n@Component({\n  selector: \"gr-main\",\n  template: \"<page-router-outlet></page-router-outlet>\"\n})\nexport class AppComponent { }\n"
  },
  {
    "path": "app/app.css",
    "content": "@import url(\"./platform.css\");\n\nPage {\n  font-size: 15;\n  background-color: black;\n}\nActionBar {\n  background-color: black;\n  color: white;\n}\nTextField {\n  padding: 10;\n  font-size: 13;\n}\n.line-through {\n  text-decoration: line-through;\n}\n"
  },
  {
    "path": "app/app.module.ngfactory.d.ts",
    "content": "export const AppModuleNgFactory: any;"
  },
  {
    "path": "app/app.module.ts",
    "content": "import { NativeScriptModule } from \"nativescript-angular/nativescript.module\";\nimport { NgModule, NO_ERRORS_SCHEMA } from \"@angular/core\";\nimport { NativeScriptHttpClientModule } from \"nativescript-angular/http-client\";\nimport { NativeScriptRouterModule } from \"nativescript-angular/router\";\n\nimport { authProviders, appRoutes } from \"./app.routing\";\nimport { AppComponent } from \"./app.component\";\nimport { setStatusBarColors, BackendService, LoginService } from \"./shared\";\n\nimport { LoginModule } from \"./login/login.module\";\nimport { GroceriesModule } from \"./groceries/groceries.module\";\n\nsetStatusBarColors();\n\n@NgModule({\n  providers: [\n    BackendService,\n    LoginService,\n    authProviders\n  ],\n  imports: [\n    NativeScriptModule,\n    NativeScriptHttpClientModule,\n    NativeScriptRouterModule,\n    NativeScriptRouterModule.forRoot(appRoutes),\n    LoginModule,\n    GroceriesModule,\n  ],\n  declarations: [\n      AppComponent,\n  ],\n  bootstrap: [AppComponent],\n  schemas: [NO_ERRORS_SCHEMA]\n})\nexport class AppModule { }\n"
  },
  {
    "path": "app/app.routing.ts",
    "content": "import { AuthGuard } from \"./auth-guard.service\";\n\nexport const authProviders = [\n  AuthGuard\n];\n\nexport const appRoutes = [\n  { path: \"\", redirectTo: \"/groceries\", pathMatch: \"full\" }\n];\n"
  },
  {
    "path": "app/auth-guard.service.ts",
    "content": "import { Injectable } from \"@angular/core\";\nimport { Router, CanActivate } from \"@angular/router\";\n\nimport { BackendService } from \"./shared/backend.service\";\n\n@Injectable()\nexport class AuthGuard implements CanActivate {\n  constructor(private router: Router) { }\n\n  canActivate() {\n    if (BackendService.isLoggedIn()) {\n      return true;\n    }\n    else {\n      this.router.navigate([\"/login\"]);\n      return false;\n    }\n  }\n}\n\n"
  },
  {
    "path": "app/groceries/groceries-common.css",
    "content": ".background {\n  background-image: url(\"res://bg_inner\");\n  background-repeat: no-repeat;\n  background-position: center;\n  background-size: cover;\n}\n\n.action-bar-custom {\n  color: white;\n  margin-top: 26;\n  margin-bottom: 16;\n}\n.action-bar-custom Label {\n  font-size: 21;\n  font-weight: bold;\n}\n.action-bar-custom GridLayout {\n  height: 40;\n  padding-left: 15;\n  padding-right: 15;\n}\n.action-bar-custom GridLayout Image {\n  vertical-align: center;\n}\n\n.add-bar {\n  background-color: #CB1D00;\n  padding-left: 16;\n  padding-right: 16;\n  height: 50;\n}\n.add-bar-image-container {\n  height: 50;\n  vertical-align: center;\n  margin-left: -15;\n  padding-left: 15;\n  padding-right: 13;\n}\n.add-bar Image {\n  height: 20;\n}\nTextField {\n  color: white;\n  placeholder-color: white;\n  background-color: transparent;\n  font-size: 15;\n  border-width: 0;\n  padding: 0;\n  margin-left: 1;\n}\n.add-bar-recent-label {\n  vertical-align: center;\n  color: #311217;\n}\n.add-bar-recent-container {\n  height: 50;\n  padding-left: 10;\n  padding-right: 10;\n  margin-right: -10;\n  vertical-align: center;\n}\n.add-bar-recent-toggle {\n  color: #311217;\n}\n\nActivityIndicator {\n  horizontal-align: center;\n  vertical-align: center;\n}\n"
  },
  {
    "path": "app/groceries/groceries.component.android.css",
    "content": ".add-bar-recent-toggle {\n  text-transform: uppercase;\n}"
  },
  {
    "path": "app/groceries/groceries.component.html",
    "content": "<GridLayout #container\n  class=\"background\"\n  rows=\"auto, auto, *\">\n\n  <!-- Row 1: The custom action bar -->\n  <GridLayout\n    row=\"0\"\n    columns=\"44, *, auto\"\n    class=\"action-bar-custom\">\n    <Label\n      col=\"1\"\n      text=\"Groceries\"></Label>\n    \n    <!-- Wrap the image in a StackLayout to give it a bigger tap target -->\n    <GridLayout\n      col=\"2\"\n      (tap)=\"showMenu()\">\n      <Image\n        src=\"res://menu\"\n        stretch=\"none\"></Image>\n    </GridLayout>\n  </GridLayout>\n\n  <!-- Row 2: The text field to add groceries, and recent button -->\n  <GridLayout\n    row=\"1\"\n    columns=\"auto, *, auto\"\n    [backgroundColor]=\"isShowingRecent ? '#BBC169' : '#CB1D00'\"\n    class=\"add-bar\">\n    <StackLayout\n      class=\"add-bar-image-container\"\n      col=\"0\"\n      (tap)=\"add('button')\">\n      <Image\n        col=\"0\"\n        [src]=\"isShowingRecent ? 'res://recent' : 'res://add'\"></Image>\n    </StackLayout>\n    <TextField #groceryTextField\n      col=\"1\"\n      [(ngModel)]=\"grocery\"\n      (loaded)=\"handleAndroidFocus(groceryTextField, container)\"\n      [hint]=\"isAndroid ? 'ADD A GROCERY' : 'Add a grocery'\"\n      returnKeyType=\"done\"\n      *ngIf=\"!isShowingRecent\"\n      (returnPress)=\"add('textfield')\"></TextField>\n    <Label\n      col=\"1\"\n      text=\"Recent items\"\n      *ngIf=\"isShowingRecent\"\n      class=\"add-bar-recent-label\"></Label>\n   <StackLayout\n     col=\"2\"\n     class=\"add-bar-recent-container\"\n     (tap)=\"toggleRecent()\">\n     <Label\n       class=\"add-bar-recent-toggle\"\n       [text]=\"isShowingRecent ? 'Done' : 'Recent'\"></Label>\n    </StackLayout>\n  </GridLayout>\n\n  <!-- Row 3: The grocery list -->\n  <gr-grocery-list\n    [row]=\"2\"\n    (loading)=\"showActivityIndicator()\"\n    (loaded)=\"hideActivityIndicator()\"\n    [showDeleted]=\"isShowingRecent\"></gr-grocery-list>\n\n  <ActivityIndicator\n    [busy]=\"isLoading\"\n    row=\"2\"></ActivityIndicator>\n\n</GridLayout>\n"
  },
  {
    "path": "app/groceries/groceries.component.ios.css",
    "content": ".action-bar-custom {\n  margin-top: 12;\n}\n"
  },
  {
    "path": "app/groceries/groceries.component.ts",
    "content": "import { Component, ElementRef, OnInit, ViewChild } from \"@angular/core\";\nimport { Router } from \"@angular/router\";\nimport { action } from \"tns-core-modules/ui/dialogs\";\nimport { Page } from \"tns-core-modules/ui/page\";\nimport { TextField } from \"tns-core-modules/ui/text-field\";\nimport * as SocialShare from \"nativescript-social-share\";\n\nimport { GroceryService } from \"./shared\";\nimport { LoginService, alert } from \"../shared\";\n\n@Component({\n  selector: \"gr-groceries\",\n  moduleId: module.id,\n  templateUrl: \"./groceries.component.html\",\n  styleUrls: [\"./groceries-common.css\", \"./groceries.component.css\"],\n  providers: [GroceryService]\n})\nexport class GroceriesComponent implements OnInit {\n  grocery: string = \"\";\n  isShowingRecent = false;\n  isLoading = false;\n\n  @ViewChild(\"groceryTextField\", { static: false }) groceryTextField: ElementRef;\n\n  constructor(private router: Router,\n    private store: GroceryService,\n    private loginService: LoginService,\n    private page: Page) {}\n\n  ngOnInit() {\n    this.page.actionBarHidden = true;\n  }\n\n  // Prevent the first textfield from receiving focus on Android\n  // See http://stackoverflow.com/questions/5056734/android-force-edittext-to-remove-focus\n  handleAndroidFocus(textField, container) {\n    if (container.android) {\n      container.android.setFocusableInTouchMode(true);\n      container.android.setFocusable(true);\n      textField.android.clearFocus();\n    }\n  }\n\n  showActivityIndicator() {\n    this.isLoading = true;\n  }\n  hideActivityIndicator() {\n    this.isLoading = false;\n  }\n\n  add(target: string) {\n    // If showing recent groceries the add button should do nothing.\n    if (this.isShowingRecent) {\n      return;\n    }\n\n    let textField = <TextField>this.groceryTextField.nativeElement;\n\n    if (this.grocery.trim() === \"\") {\n      // If the user clicked the add button, and the textfield is empty,\n      // focus the text field and return.\n      if (target === \"button\") {\n        textField.focus();\n      } else {\n        // If the user clicked return with an empty text field show an error.\n        alert(\"Enter a grocery item\");\n      }\n      return;\n    }\n\n    // Dismiss the keyboard\n    // TODO: Is it better UX to dismiss the keyboard, or leave it up so the\n    // user can continue to add more groceries?\n    textField.dismissSoftInput();\n\n    this.showActivityIndicator();\n    this.store.add(this.grocery)\n      .subscribe(\n        () => {\n          this.grocery = \"\";\n          this.hideActivityIndicator();\n        },\n        () => {\n          alert(\"An error occurred while adding an item to your list.\");\n          this.hideActivityIndicator();\n        }\n      );\n  }\n\n  toggleRecent() {\n    this.isShowingRecent = !this.isShowingRecent;\n  }\n\n  showMenu() {\n    action({\n      message: \"What would you like to do?\",\n      actions: [\"Share\", \"Log Off\"],\n      cancelButtonText: \"Cancel\"\n    }).then((result) => {\n      if (result === \"Share\") {\n        this.share();\n      } else if (result === \"Log Off\") {\n        this.logoff();\n      }\n    });\n  }\n\n  share() {\n    let items = this.store.items.value;\n    let list = [];\n    for (let i = 0, size = items.length; i < size ; i++) {\n      list.push(items[i].name);\n    }\n    SocialShare.shareText(list.join(\", \").trim());\n  }\n\n  logoff() {\n    this.loginService.logoff();\n    this.router.navigate([\"/login\"]);\n  }\n}\n"
  },
  {
    "path": "app/groceries/groceries.module.ts",
    "content": "import { NativeScriptCommonModule } from \"nativescript-angular/common\";\nimport { NativeScriptFormsModule } from \"nativescript-angular/forms\";\nimport { NgModule, NO_ERRORS_SCHEMA } from \"@angular/core\";\nimport { groceriesRouting } from \"./groceries.routing\";\nimport { GroceriesComponent } from \"./groceries.component\";\nimport { GroceryListComponent } from \"./grocery-list/grocery-list.component\";\nimport { ItemStatusPipe } from \"./grocery-list/item-status.pipe\";\n\n@NgModule({\n  imports: [\n    NativeScriptFormsModule,\n    NativeScriptCommonModule,\n    groceriesRouting,\n  ],\n  declarations: [\n    GroceriesComponent,\n    GroceryListComponent,\n    ItemStatusPipe\n  ],\n  schemas: [NO_ERRORS_SCHEMA]\n})\nexport class GroceriesModule {}\n"
  },
  {
    "path": "app/groceries/groceries.routing.ts",
    "content": "import { ModuleWithProviders }  from \"@angular/core\";\nimport { Routes, RouterModule } from \"@angular/router\";\n\nimport { GroceriesComponent } from \"./groceries.component\";\nimport { AuthGuard } from \"../auth-guard.service\";\n\nconst groceriesRoutes: Routes = [\n  { path: \"groceries\", component: GroceriesComponent, canActivate: [AuthGuard] },\n];\nexport const groceriesRouting: ModuleWithProviders = RouterModule.forChild(groceriesRoutes);"
  },
  {
    "path": "app/groceries/grocery-list/grocery-list.component.css",
    "content": "ListView {\n  background-color: transparent;\n  opacity: 0;\n}\n.visible {\n  animation-name: show;\n  animation-duration: 1s;\n  animation-fill-mode: forwards;\n}\n@keyframes show {\n  from { opacity: 0; }\n  to { opacity: 1; }\n}\n.container {\n  background-color: white;\n  margin-top: 1;\n}\n.tap-target {\n  padding-top: 13;\n  padding-bottom: 13;\n  padding-left: 16;\n}\n.tap-target Label {\n  min-width: 200;\n}\n.check-box {\n  margin-right: 10;\n  height: 20;\n}\n.delete-container {\n  padding: 10 15;\n  vertical-align: middle;\n}\n.delete-container StackLayout {\n  padding: 5;\n}\n.delete-container Image {\n  height: 20;\n}\n"
  },
  {
    "path": "app/groceries/grocery-list/grocery-list.component.html",
    "content": "<ListView\n  [row]=\"row\"\n  [class.visible]=\"listLoaded\"\n  [items]=\"store.items | async | itemStatus:showDeleted\"\n  (itemLoading)=\"makeBackgroundTransparent($event)\" >\n  <ng-template let-item=\"item\">\n    <GridLayout\n      columns=\"*, auto\"\n      class=\"container\"\n      [opacity]=\"item.done ? '0.8' : '1'\">\n      <!-- Wrap in containers for bigger tap targets -->\n      <StackLayout\n        col=\"0\"\n        orientation=\"horizontal\"\n        class=\"tap-target\"\n        (tap)=\"toggleDone(item)\">\n        <Image\n          [src]=\"imageSource(item)\"\n          class=\"check-box\"></Image>\n        <Label\n          [text]=\"item.name\"\n          [class.line-through]=\"item.done && !item.deleted\"></Label>\n      </StackLayout>\n      <GridLayout\n        col=\"1\"\n        class=\"delete-container\"\n        (tap)=\"delete(item)\">\n        <StackLayout>\n          <Image src=\"res://delete\"></Image>\n        </StackLayout>\n      </GridLayout>\n    </GridLayout>\n  </ng-template>\n</ListView>"
  },
  {
    "path": "app/groceries/grocery-list/grocery-list.component.ts",
    "content": "import { Component, ChangeDetectionStrategy, EventEmitter, Input, Output, AfterViewInit } from \"@angular/core\";\n\nimport { Grocery, GroceryService } from \"../shared\";\nimport { alert } from \"../../shared\";\n\ndeclare var UIColor: any;\n\n@Component({\n  selector: \"gr-grocery-list\",\n  moduleId: module.id,\n  templateUrl: \"./grocery-list.component.html\",\n  styleUrls: [\"./grocery-list.component.css\"],\n  changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class GroceryListComponent implements AfterViewInit {\n  @Input() showDeleted: boolean;\n  @Input() row;\n  @Output() loading = new EventEmitter();\n  @Output() loaded = new EventEmitter();\n\n  public store: GroceryService;\n  listLoaded = false;\n\n  constructor(store: GroceryService) {\n      this.store = store;\n  }\n  ngAfterViewInit() {\n      this.load();\n  }\n  load() {\n    this.loading.next(\"\");\n    this.store.load()\n      .subscribe(\n        () => {\n          this.loaded.next(\"\");\n          this.listLoaded = true;\n        },\n        () => {\n          alert(\"An error occurred loading your grocery list.\");\n        }\n      );\n  }\n\n  // The following trick makes the background color of each cell\n  // in the UITableView transparent as it’s created.\n  makeBackgroundTransparent(args) {\n    let cell = args.ios;\n    if (cell) {\n      // support XCode 8\n      cell.backgroundColor = UIColor.clearColor;\n    }\n  }\n\n  imageSource(grocery) {\n    if (grocery.deleted) {\n      return \"res://add\";\n    }\n    return grocery.done ? \"res://checked\" : \"res://unchecked\";\n  }\n\n  toggleDone(grocery: Grocery) {\n    if (grocery.deleted) {\n      this.store.unsetDeleteFlag(grocery)\n        .subscribe(\n          () => { },\n          () => {\n            alert(\"An error occurred managing your grocery list.\");\n          }\n        );\n    } else {\n      this.store.toggleDoneFlag(grocery)\n        .subscribe(\n          () => { },\n          () => {\n            alert(\"An error occurred managing your grocery list.\");\n          }\n        );\n    }\n  }\n\n  delete(grocery: Grocery) {\n    this.loading.next(\"\");\n    let successHandler = () => this.loaded.next(\"\");\n    let errorHandler = () => {\n      alert(\"An error occurred while deleting an item from your list.\");\n      this.loaded.next(\"\");\n    };\n\n    if (grocery.deleted) {\n      this.store.permanentlyDelete(grocery)\n        .subscribe(successHandler, errorHandler);\n    } else {\n      this.store.setDeleteFlag(grocery)\n        .subscribe(successHandler, errorHandler);\n    }\n  }\n}\n\n"
  },
  {
    "path": "app/groceries/grocery-list/item-status.pipe.ts",
    "content": "import { Pipe, PipeTransform } from \"@angular/core\";\n\nimport { Grocery } from \"../shared\";\n\n@Pipe({\n  name: \"itemStatus\"\n})\nexport class ItemStatusPipe implements PipeTransform {\n  value: Array<Grocery> = [];\n  transform(items: Array<Grocery>, deleted: boolean) {\n    if (items instanceof Array) {\n      this.value = items.filter((grocery: Grocery) => {\n        return grocery.deleted === deleted;\n      });\n    }\n    return this.value;\n  }\n}"
  },
  {
    "path": "app/groceries/shared/grocery.model.ts",
    "content": "export class Grocery {\n  constructor(\n    public id: string,\n    public name: string,\n    public done: boolean,\n    public deleted: boolean\n  ) {}\n}"
  },
  {
    "path": "app/groceries/shared/grocery.service.ts",
    "content": "import { Injectable, NgZone } from \"@angular/core\";\nimport {\n  HttpClient,\n  HttpHeaders,\n  HttpErrorResponse,\n} from \"@angular/common/http\";\nimport { BehaviorSubject, throwError } from \"rxjs\";\nimport { map, catchError } from \"rxjs/operators\";\n\nimport { BackendService } from \"../../shared\";\nimport { Grocery } from \"./grocery.model\";\n\n@Injectable()\nexport class GroceryService {\n  items: BehaviorSubject<Array<Grocery>> = new BehaviorSubject([]);\n  private allItems: Array<Grocery> = [];\n  baseUrl = BackendService.baseUrl + \"appdata/\" + BackendService.appKey + \"/Groceries\";\n\n  constructor(private http: HttpClient, private zone: NgZone) { }\n\n  load() {\n    return this.http.get(this.baseUrl, {\n      headers: this.getCommonHeaders()\n    })\n    .pipe(\n      map((data: any[]) => {\n        this.allItems = data\n          .sort((a, b) => {\n            return a._kmd.lmt > b._kmd.lmt ? -1 : 1;\n          })\n          .map(\n            grocery => new Grocery(\n              grocery._id,\n              grocery.Name,\n              grocery.Done || false,\n              grocery.Deleted || false\n          )\n        );\n        this.publishUpdates();\n      }),\n      catchError(this.handleErrors)\n    );\n  }\n\n  add(name: string) {\n    return this.http.post(\n      this.baseUrl,\n      JSON.stringify({ Name: name }),\n      { headers: this.getCommonHeaders() }\n    )\n    .pipe(\n      map((data: any) => {\n        this.allItems.unshift(new Grocery(data._id, name, false, false));\n        this.publishUpdates();\n      }),\n      catchError(this.handleErrors)\n    );\n  }\n\n  setDeleteFlag(item: Grocery) {\n    item.deleted = true;\n    return this.put(item)\n      .pipe(\n        map(data => {\n          item.done = false;\n          this.publishUpdates();\n        })\n      );\n  }\n\n  unsetDeleteFlag(item: Grocery) {\n    item.deleted = false;\n    return this.put(item)\n      .pipe(\n        map(data => {\n          item.done = false;\n          this.publishUpdates();\n        })\n      );\n  }\n\n\n  toggleDoneFlag(item: Grocery) {\n    item.done = !item.done;\n    this.publishUpdates();\n    return this.put(item);\n  }\n\n  permanentlyDelete(item: Grocery) {\n    return this.http\n      .delete(\n        this.baseUrl + \"/\" + item.id,\n        { headers: this.getCommonHeaders() }\n      )\n      .pipe(\n        map(data => {\n          let index = this.allItems.indexOf(item);\n          this.allItems.splice(index, 1);\n          this.publishUpdates();\n        }),\n        catchError(this.handleErrors)\n      );\n  }\n\n  private put(grocery: Grocery) {\n    return this.http.put(\n      this.baseUrl + \"/\" + grocery.id,\n      JSON.stringify({\n        Name: grocery.name,\n        Done: grocery.done,\n        Deleted: grocery.deleted\n      }),\n      { headers: this.getCommonHeaders() }\n    )\n    .pipe(catchError(this.handleErrors));\n  }\n\n  private publishUpdates() {\n    // Make sure all updates are published inside NgZone so that change detection is triggered if needed\n    this.zone.run(() => {\n      // must emit a *new* value (immutability!)\n      this.items.next([...this.allItems]);\n    });\n  }\n\n  private getCommonHeaders() {\n    return new HttpHeaders({\n      \"Content-Type\": \"application/json\",\n      \"Authorization\": \"Kinvey \" + BackendService.token,\n    });\n  }\n\n  private handleErrors(error: HttpErrorResponse) {\n    console.log(error);\n    return throwError(error);\n  }\n}\n"
  },
  {
    "path": "app/groceries/shared/index.ts",
    "content": "export { GroceryService } from \"./grocery.service\";\nexport { Grocery } from \"./grocery.model\";"
  },
  {
    "path": "app/login/login-common.css",
    "content": "/* Hide a bunch of things to setup the initial animations */\n.form-controls, .sign-up-stack {\n  opacity: 0;\n}\n\n.background {\n  background-image: url(\"res://bg_login\");\n  background-repeat: no-repeat;\n  background-size: cover;\n  background-position: center;\n}\n\n/* TODO: Assigning explicit heights and applying this margin shouldn’t be necessary. */\n.initial-container {\n  margin-top: 170;\n}\n.initial-logo {\n  horizontal-align: center;\n  margin-bottom: 10;\n}\n.initial-label {\n  color: white;\n  horizontal-align: center;\n  margin-bottom: 80;\n}\n.initial-button {\n  background-color: white;\n  color: #CB1D00;\n  height: 45;\n  width: 275;\n  vertical-align: center;\n}\n.initial-button-label {\n  horizontal-align: center;\n  font-weight: bold;\n}\n\n.main-container {\n  visibility: collapse;\n  opacity: 0;\n  margin-left: 30;\n  margin-right: 30;\n  background-color: white;\n}\n.main-label {\n  horizontal-align: center;\n  color: black;\n}\n\nImage {\n  margin-top: 5;\n  margin-bottom: 20;\n}\nButton, TextField {\n  margin-left: 16;\n  margin-right: 16;\n  margin-bottom: 10;\n}\nTextField {\n  color: black;\n  placeholder-color: #ACA6A7;\n}\nTextField.light {\n  color: #C4AFB4;\n  placeholder-color: #C4AFB4;\n}\n.submit-button {\n  background-color: #CB1D00;\n  color: white;\n  margin-top: 20;\n}\n\n.forgot-password-label {\n  font-size: 13;\n  margin-left: 20;\n  margin-bottom: 45;\n  color: black;\n}\n.sign-up-stack {\n  background-color: #311217;\n}\n.sign-up-stack Label {\n  color: white;\n  text-align: center;\n  font-size: 15;\n}\n\n.logo-container {\n  visibility: collapse;\n  horizontal-align: center;\n  opacity: 0;\n}\n"
  },
  {
    "path": "app/login/login.component.android.css",
    "content": ".main-container {\n  height: 360;\n  width: 275;\n}\n.initial-label {\n  font-size: 32;\n  letter-spacing: 0.35;\n}\n.main-label {\n  font-size: 28;\n  margin-top: 32;\n  margin-bottom: 32;\n  letter-spacing: 0.3;\n}\nTextField {\n  margin-bottom: 10;\n}\n.submit-button {\n  margin-top: 15;\n}\n.sign-up-stack Label {\n  padding-top: 5;\n  height: 200;\n  text-transform: uppercase;\n}\n.forgot-password-label {\n  font-size: 13;\n  text-transform: uppercase;\n}\n.logo-container Image {\n  top: 90;\n}"
  },
  {
    "path": "app/login/login.component.html",
    "content": "<GridLayout>\n\n  <GridLayout #background\n    scaleX=\"1.4\"\n    scaleY=\"1.4\"\n    class=\"background\"\n    (loaded)=\"startBackgroundAnimation(background)\"></GridLayout>\n\n  <StackLayout #initialContainer\n    class=\"initial-container\">\n    <Image\n      src=\"res://logo_login\"\n      stretch=\"none\"\n      class=\"initial-logo\"></Image>\n    <Label\n      text=\"GROCERIES\"\n      class=\"initial-label\"></Label>\n    <StackLayout\n      (tap)=\"showMainContent()\"\n      class=\"initial-button\">\n      <Label\n        text=\"Login\"\n        class=\"initial-button-label\"></Label>\n    </StackLayout>\n  </StackLayout>\n\n  <StackLayout #mainContainer\n    class=\"main-container\">\n    <Label\n      class=\"main-label\"\n      text=\"GROCERIES\"\n      [color]=\"isLoggingIn? 'black' : 'white'\"></Label>\n\n    <GridLayout #formControls\n      class=\"form-controls\"\n      rows=\"auto, auto\"\n      translateY=\"50\">\n      <TextField\n        hint=\"Email Address\"\n        keyboardType=\"email\"\n        returnKeyType=\"next\"\n        (returnPress)=\"focusPassword()\"\n        [(ngModel)]=\"user.email\"\n        [isEnabled]=\"!isAuthenticating\"\n        autocorrect=\"false\"\n        autocapitalizationType=\"none\"\n        [class.light]=\"!isLoggingIn\"\n        row=\"0\"></TextField>\n      <TextField #password\n        hint=\"Password\"\n        secure=\"true\"\n        returnKeyType=\"done\"\n        (returnPress)=\"submit()\"\n        [(ngModel)]=\"user.password\"\n        [isEnabled]=\"!isAuthenticating\"\n        [class.light]=\"!isLoggingIn\"\n        row=\"1\"></TextField>\n\n      <ActivityIndicator\n        [busy]=\"isAuthenticating\"\n        rowSpan=\"2\"></ActivityIndicator>\n    </GridLayout>\n\n    <Button\n      [text]=\"isLoggingIn ? 'Login' : 'Sign up'\"\n      [isEnabled]=\"!isAuthenticating\"\n      class=\"submit-button\"\n      (tap)=\"submit()\"></Button>\n\n    <Label\n      class=\"forgot-password-label\"\n      text=\"Forgot password?\"\n      (tap)=\"forgotPassword()\"\n      [visibility]=\"isLoggingIn ? 'visible' : 'hidden'\"></Label>\n\n    <StackLayout #signUpStack\n      class=\"sign-up-stack\"\n      (tap)=\"toggleDisplay()\"\n      translateY=\"50\">\n      <Label\n        [text]=\"isLoggingIn ? 'Sign up here' : 'Back to login'\"></Label>\n    </StackLayout>\n  </StackLayout>\n\n  <!-- The fruit logo that appears within the container -->\n  <AbsoluteLayout #logoContainer\n    class=\"logo-container\">\n    <Image\n      src=\"res://logo_login\"\n      stretch=\"none\"></Image>\n  </AbsoluteLayout>\n\n</GridLayout>\n"
  },
  {
    "path": "app/login/login.component.ios.css",
    "content": ".main-container {\n  height: 425;\n  width: 300;\n}\n.initial-label {\n  font-size: 40;\n  letter-spacing: 0.2;\n}\n.main-label {\n  color: #311217;\n  font-size: 32;\n  margin-top: 45;\n  margin-bottom: 52;\n  letter-spacing: 0.2;\n}\nTextField {\n  border-width: 1;\n  border-color: #6E595C;\n  margin-bottom: 20;\n}\n.submit-button {\n  height: 40;\n  margin-top: 15;\n}\n.sign-up-stack Label {\n  height: 48;\n}\n\n/* A height of zero ensures that the AbsoluteLayout container doesn’t steal taps\nfrom the various button and text field controls that sit behind it. */\n.logo-container {\n  height: 0;\n}\n.logo-container Image {\n  top: -250;\n}"
  },
  {
    "path": "app/login/login.component.ts",
    "content": "import { Component, ElementRef, OnInit, ViewChild } from \"@angular/core\";\nimport { Router } from \"@angular/router\";\nimport { Color } from \"tns-core-modules/color\";\nimport { connectionType, getConnectionType } from \"tns-core-modules/connectivity\";\nimport { Animation } from \"tns-core-modules/ui/animation\";\nimport { View } from \"tns-core-modules/ui/core/view\";\nimport { prompt } from \"tns-core-modules/ui/dialogs\";\nimport { Page } from \"tns-core-modules/ui/page\";\n\nimport { alert, LoginService, User } from \"../shared\";\n\n@Component({\n  selector: \"gr-login\",\n  moduleId: module.id,\n  templateUrl: \"./login.component.html\",\n  styleUrls: [\"./login-common.css\", \"./login.component.css\"],\n})\nexport class LoginComponent implements OnInit {\n  user: User;\n  isLoggingIn = true;\n  isAuthenticating = false;\n\n  @ViewChild(\"initialContainer\", { static: false }) initialContainer: ElementRef;\n  @ViewChild(\"mainContainer\", { static: false }) mainContainer: ElementRef;\n  @ViewChild(\"logoContainer\", { static: false }) logoContainer: ElementRef;\n  @ViewChild(\"formControls\", { static: false }) formControls: ElementRef;\n  @ViewChild(\"signUpStack\", { static: false }) signUpStack: ElementRef;\n  @ViewChild(\"password\", { static: false }) password: ElementRef;\n\n  constructor(private router: Router,\n    private userService: LoginService,\n    private page: Page) {\n    this.user = new User();\n    // this.page.className = \"login-page\";\n  }\n\n  ngOnInit() {\n    this.page.actionBarHidden = true;\n  }\n\n  focusPassword() {\n    this.password.nativeElement.focus();\n  }\n\n  startBackgroundAnimation(background) {\n    background.animate({\n      scale: { x: 1.0, y: 1.0 },\n      duration: 10000\n    });\n  }\n\n  submit() {\n    if (!this.user.isValidEmail()) {\n      alert(\"Enter a valid email address.\");\n      return;\n    }\n\n    this.isAuthenticating = true;\n    if (this.isLoggingIn) {\n      this.login();\n    } else {\n      this.signUp();\n    }\n  }\n\n  login() {\n    if (getConnectionType() === connectionType.none) {\n      alert(\"Groceries requires an internet connection to log in.\");\n      return;\n    }\n\n    this.userService.login(this.user)\n      .subscribe(\n        () => {\n          this.isAuthenticating = false;\n          this.router.navigate([\"/\"]);\n        },\n        (error) => {\n          alert(\"Unfortunately we could not find your account.\");\n          this.isAuthenticating = false;\n        }\n      );\n  }\n\n  signUp() {\n    if (getConnectionType() === connectionType.none) {\n      alert(\"Groceries requires an internet connection to register.\");\n      return;\n    }\n\n    this.userService.register(this.user)\n      .subscribe(\n        () => {\n          alert(\"Your account was successfully created.\");\n          this.isAuthenticating = false;\n          this.toggleDisplay();\n        },\n        (errorDetails) => {\n          if (errorDetails.error && errorDetails.error.error === \"UserAlreadyExists\") {\n            alert(\"This email address is already in use.\");\n          } else {\n            alert(\"Unfortunately we were unable to create your account.\");\n          }\n          this.isAuthenticating = false;\n        }\n      );\n  }\n\n  forgotPassword() {\n    prompt({\n      title: \"Forgot Password\",\n      message: \"Enter the email address you used to register for Groceries to reset your password.\",\n      defaultText: \"\",\n      okButtonText: \"Ok\",\n      cancelButtonText: \"Cancel\"\n    }).then((data) => {\n      if (data.result) {\n        this.userService.resetPassword(data.text.trim())\n          .subscribe(() => {\n            alert(\"Your password was successfully reset. Please check your email for instructions on choosing a new password.\");\n          }, () => {\n            alert(\"Unfortunately, an error occurred resetting your password.\");\n          });\n      }\n    });\n  }\n\n  toggleDisplay() {\n    this.isLoggingIn = !this.isLoggingIn;\n    let mainContainer = <View>this.mainContainer.nativeElement;\n    mainContainer.animate({\n      backgroundColor: this.isLoggingIn ? new Color(\"white\") : new Color(\"#301217\"),\n      duration: 200\n    });\n  }\n\n  showMainContent() {\n    let initialContainer = <View>this.initialContainer.nativeElement;\n    let mainContainer = <View>this.mainContainer.nativeElement;\n    let logoContainer = <View>this.logoContainer.nativeElement;\n    let formControls = <View>this.formControls.nativeElement;\n    let signUpStack = <View>this.signUpStack.nativeElement;\n    let animations = [];\n\n    // Fade out the initial content over one half second\n    initialContainer.animate({\n      opacity: 0,\n      duration: 500\n    }).then(function() {\n      // After the animation completes, hide the initial container and\n      // show the main container and logo. The main container and logo will\n      // not immediately appear because their opacity is set to 0 in CSS.\n      initialContainer.style.visibility = \"collapse\";\n      mainContainer.style.visibility = \"visible\";\n      logoContainer.style.visibility = \"visible\";\n\n      // Fade in the main container and logo over one half second.\n      animations.push({ target: mainContainer, opacity: 1, duration: 500 });\n      animations.push({ target: logoContainer, opacity: 1, duration: 500 });\n\n      // Slide up the form controls and sign up container.\n      animations.push({ target: signUpStack, translate: { x: 0, y: 0 }, opacity: 1, delay: 500, duration: 150 });\n      animations.push({ target: formControls, translate: { x: 0, y: 0 }, opacity: 1, delay: 650, duration: 150 });\n\n      // Kick off the animation queue\n      new Animation(animations, false).play();\n    });\n  }\n}\n"
  },
  {
    "path": "app/login/login.module.ts",
    "content": "import { NativeScriptCommonModule } from \"nativescript-angular/common\";\nimport { NativeScriptFormsModule } from \"nativescript-angular/forms\";\nimport { NgModule, NO_ERRORS_SCHEMA } from \"@angular/core\";\n\nimport { loginRouting } from \"./login.routing\";\nimport { LoginComponent } from \"./login.component\";\n\n@NgModule({\n  imports: [\n    NativeScriptFormsModule,\n    NativeScriptCommonModule,\n    loginRouting,\n  ],\n  declarations: [\n    LoginComponent\n  ],\n  schemas: [NO_ERRORS_SCHEMA]\n})\nexport class LoginModule { }\n"
  },
  {
    "path": "app/login/login.routing.ts",
    "content": "import { ModuleWithProviders }  from \"@angular/core\";\nimport { Routes, RouterModule } from \"@angular/router\";\n\nimport { LoginComponent } from \"./login.component\";\n\nconst loginRoutes: Routes = [\n  { path: \"login\", component: LoginComponent },\n];\nexport const loginRouting: ModuleWithProviders = RouterModule.forChild(loginRoutes);"
  },
  {
    "path": "app/main.aot.ts",
    "content": "// this import should be first in order to load some required settings (like globals and reflect-metadata)\nimport { platformNativeScript } from \"nativescript-angular/platform-static\";\n\nimport { AppModuleNgFactory } from \"./app.module.ngfactory\";\n\nplatformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);\n"
  },
  {
    "path": "app/main.ts",
    "content": "import { platformNativeScriptDynamic } from \"nativescript-angular/platform\";\nimport { AppModule } from \"./app.module\";\n\nplatformNativeScriptDynamic().bootstrapModule(AppModule);\n"
  },
  {
    "path": "app/package.json",
    "content": "{\n  \"android\": {\n    \"v8Flags\": \"--expose_gc\",\n    \"markingMode\": \"none\"\n  },\n  \"main\": \"main.js\"\n}\n"
  },
  {
    "path": "app/platform.android.css",
    "content": ""
  },
  {
    "path": "app/platform.ios.css",
    "content": "TextField {\n  border-width: 1;\n  border-color: black;\n}"
  },
  {
    "path": "app/shared/backend.service.ts",
    "content": "import { Injectable } from \"@angular/core\";\nimport { getString, setString } from \"tns-core-modules/application-settings\";\n\nconst tokenKey = \"token\";\n\nexport class BackendService {\n  static baseUrl = \"https://baas.kinvey.com/\";\n  static appKey = \"kid_HyHoT_REf\";\n  static appUserHeader = \"Basic a2lkX0h5SG9UX1JFZjo1MTkxMDJlZWFhMzQ0MzMyODFjN2MyODM3MGQ5OTIzMQ\";\n  static apiUrl = \"\";\n\n  static isLoggedIn(): boolean {\n    return !!getString(tokenKey);\n  }\n\n  static get token(): string {\n    return getString(tokenKey);\n  }\n\n  static set token(theToken: string) {\n    setString(tokenKey, theToken);\n  }\n}\n"
  },
  {
    "path": "app/shared/dialog-util.ts",
    "content": "import * as dialogsModule from \"tns-core-modules/ui/dialogs\";\n\nexport function alert(message: string) {\n  return dialogsModule.alert({\n    title: \"Groceries\",\n    okButtonText: \"OK\",\n    message: message\n  });\n}\n"
  },
  {
    "path": "app/shared/index.ts",
    "content": "export * from \"./backend.service\";\nexport * from \"./user.model\";\nexport * from \"./login.service\";\nexport * from \"./dialog-util\";\nexport * from \"./status-bar-util\";"
  },
  {
    "path": "app/shared/login.service.ts",
    "content": "import { Injectable } from \"@angular/core\";\nimport { HttpHeaders, HttpClient, HttpErrorResponse } from \"@angular/common/http\";\nimport { throwError } from \"rxjs\";\nimport { tap, catchError } from \"rxjs/operators\";\n\nimport { User } from \"./user.model\";\nimport { BackendService } from \"./backend.service\";\n\n@Injectable()\nexport class LoginService {\n  constructor(private http: HttpClient) { }\n\n  register(user: User) {\n    return this.http.post(\n      BackendService.baseUrl + \"user/\" + BackendService.appKey,\n      JSON.stringify({\n        username: user.email,\n        email: user.email,\n        password: user.password\n      }),\n      { headers: this.getCommonHeaders() }\n    )\n    .pipe(catchError(this.handleErrors));\n  }\n\n  login(user: User) {\n    return this.http.post(\n      BackendService.baseUrl + \"user/\" + BackendService.appKey + \"/login\",\n      JSON.stringify({\n        username: user.email,\n        password: user.password\n      }),\n      { headers: this.getCommonHeaders() }\n    )\n    .pipe(\n      tap((data: any) => {\n        BackendService.token = data._kmd.authtoken;\n      }),\n      catchError(this.handleErrors)\n    );\n  }\n\n  logoff() {\n    BackendService.token = \"\";\n  }\n\n  resetPassword(email) {\n    return this.http.post(\n      BackendService.baseUrl + \"rpc/\" + BackendService.appKey + \"/\" + email + \"/user-password-reset-initiate\",\n      {},\n      { headers: this.getCommonHeaders() }\n    ).pipe(catchError(this.handleErrors));\n  }\n\n  private getCommonHeaders() {\n    return new HttpHeaders({\n      \"Content-Type\": \"application/json\",\n      \"Authorization\": BackendService.appUserHeader,\n    });\n  }\n\n  private handleErrors(error: HttpErrorResponse) {\n    console.log(JSON.stringify(error));\n    return throwError(error);\n  }\n}\n"
  },
  {
    "path": "app/shared/status-bar-util.ts",
    "content": "import * as application from \"tns-core-modules/application\";\nimport * as platform from \"tns-core-modules/platform\";\n\ndeclare var android: any;\n\nexport function setStatusBarColors() {\n  // Make the Android status bar transparent.\n  // See http://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/\n  // for details on the technique used.\n  if (application.android && platform.device.sdkVersion >= \"21\") {\n    application.android.on(\"activityStarted\", () => {\n      const View = android.view.View;\n      const window = application.android.startActivity.getWindow();\n      window.setStatusBarColor(0x000000);\n\n      const decorView = window.getDecorView();\n      decorView.setSystemUiVisibility(\n        View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n    });\n  }\n}\n"
  },
  {
    "path": "app/shared/user.model.ts",
    "content": "const validator = require(\"email-validator\");\n\nexport class User {\n  email: string;\n  password: string;\n  isValidEmail() {\n    return validator.validate(this.email);\n  }\n}"
  },
  {
    "path": "app/tests/shared/user/user.spec.ts",
    "content": "import \"reflect-metadata\";\nimport { User } from \"../../../shared\";\n\ndeclare var describe: any;\ndeclare var expect: any;\ndeclare var it: any;\n\ndescribe(\"Email validation\", function() {\n  let user = new User();\n\n  it(\"Should reject an empty email address\", function () {\n    user.email = \"\";\n    expect(user.isValidEmail()).toBe(false);\n  });\n\n  it(\"Should reject a malformed email addresses\", function() {\n    user.email = \"nativescript\";\n    expect(user.isValidEmail()).toBe(false);\n\n    user.email = \"nativescript@\";\n    expect(user.isValidEmail()).toBe(false);\n\n    user.email = \"nativescript@isawesome\";\n    expect(user.isValidEmail()).toBe(false);\n  });\n\n  it(\"Should accept valid email addresses\", function() {\n    user.email = \"nativescript@isawesome.com\";\n    expect(user.isValidEmail()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "e2e/config/appium.capabilities.json",
    "content": "{\n    \"android19\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"4.4\",\n        \"deviceName\": \"Emulator-Api19-Default\",\n        \"avd\": \"Emulator-Api19-Default\",\n        \"lt\": 60000,\n        \"appActivity\": \"com.tns.NativeScriptActivity\",\n        \"newCommandTimeout\": 720,\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"android21\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"5.0\",\n        \"deviceName\": \"Emulator-Api21-Default\",\n        \"avd\": \"Emulator-Api21-Default\",\n        \"lt\": 60000,\n        \"appActivity\": \"com.tns.NativeScriptActivity\",\n        \"newCommandTimeout\": 720,\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"android23\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"6.0\",\n        \"deviceName\": \"Android Emulator\",\n        \"appiumVersion\": \"1.8.0\",\n        \"relaxed-security\": true,\n        \"noReset\": true,\n        \"resetKeyboard\": true,\n        \"app\": \"\"\n    },\n    \"android24\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"7.0\",\n        \"deviceName\": \"Emulator-Api24-Default\",\n        \"avd\": \"Emulator-Api24-Default\",\n        \"lt\": 60000,\n        \"appActivity\": \"com.tns.NativeScriptActivity\",\n        \"newCommandTimeout\": 720,\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"android25\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"7.1\",\n        \"deviceName\": \"Emulator-Api25-Google\",\n        \"avd\": \"Emulator-Api25-Google\",\n        \"lt\": 60000,\n        \"appActivity\": \"com.tns.NativeScriptActivity\",\n        \"newCommandTimeout\": 720,\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"android26\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"8.0\",\n        \"deviceName\": \"Emulator-Api26-Google\",\n        \"avd\": \"Emulator-Api26-Google\",\n        \"lt\": 60000,\n        \"newCommandTimeout\": 720,\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"sim.iPhone6.iOS100\": {\n        \"platformName\": \"iOS\",\n        \"platformVersion\": \"10.0\",\n        \"deviceName\": \"iPhone 6\",\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\",\n        \"density\": 2,\n        \"offsetPixels\": 33\n    },\n    \"sim.iPhone7\": {\n        \"platformName\": \"iOS\",\n        \"platformVersion\": \"11.2\",\n        \"deviceName\": \"iPhone 7\",\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"sim.iPhone8\": {\n        \"platformName\": \"iOS\",\n        \"platformVersion\": \"11.2\",\n        \"deviceName\": \"iPhone 8\",\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"sim.iPhoneX.iOS110\": {\n        \"platformName\": \"iOS\",\n        \"platformVersion\": \"11.0\",\n        \"deviceName\": \"iPhone X\",\n        \"noReset\": true,\n        \"fullReset\": false,\n        \"app\": \"\"\n    },\n    \"android23.local\": {\n        \"platformName\": \"Android\",\n        \"platformVersion\": \"6.0\",\n        \"deviceName\": \"Emulator-Api23-Default\",\n        \"noReset\": true,\n        \"appium-version\": \"1.7.1\"\n    }\n}"
  },
  {
    "path": "e2e/config/mocha.opts",
    "content": "--timeout 1000000\n--recursive e2e\n--exit"
  },
  {
    "path": "e2e/groceries.e2e.ts",
    "content": "import { AppiumDriver, createDriver, SearchOptions } from \"nativescript-dev-appium\";\nimport { expect } from \"chai\";\n\ndescribe(\"Groceries\", async function () {\n    let driver: AppiumDriver;\n    const loginButtonText = \"Login\";\n    const email = \"groceries@mailinator.com\";\n    const password = \"123\";\n    const fruit = \"apple\";\n    const recentButtonText = \"Recent\";\n    const doneButtonText = \"Done\";\n    const logOffButtonText = \"Log Off\";\n    const invalidEmail = \"groceries@mailinator\";\n    const invalidEmailWarningText = \"valid email\";\n    const okButtonText = \"OK\";\n    const cancelButtonText = \"Cancel\";\n    const signUpHereButtonText = \"Sign up here\";\n    const signUpButtonText = \"Sign up\";\n    const backToLoginButtonText = \"Back to login\";\n    const forgotPasswordButtonText = \"Forgot\";\n    const forgotPasswordFormText = \"reset\";\n\n    const clickOnCrossOrCheckboxBtn = async () => {\n        if (driver.isAndroid) {\n            // First image is the menu, second is the cross button. The rest are pairs checkbox/bin per list item.\n            const allImages = await driver.findElementsByClassName(driver.locators.image);\n            await allImages[2].click(); // Checkbox button\n        } else {\n            await driver.clickPoint(26, 160); // Checkbox button\n        }\n    };\n\n    const clickOnBinButton = async () => {\n        if (driver.isAndroid) {\n            // First image is the menu, second is the cross button. The rest are pairs checkbox/bin per list item.\n            const allImages = await driver.findElementsByClassName(driver.locators.image);\n            for (let i = 3; i < allImages.length; i = i + 2) {\n                await allImages[3].click(); // Bin button of the first list item\n            }\n        } else {\n            const allImages = await driver.findElementsByText(fruit);\n            for (let i = 0; i < allImages.length; i++) {\n                await driver.clickPoint(345, 166); // Bin button of the first list item\n            }\n        }\n    };\n\n    before(async () => {\n        driver = await createDriver();\n        driver.defaultWaitTime = 15000;\n    });\n\n    after(async () => {\n        if (driver.nsCapabilities.isSauceLab) {\n            driver.sessionId().then(function (sessionId) {\n                console.log(\"Report: https://saucelabs.com/beta/tests/\" + sessionId);\n            });\n        }\n        await driver.quit();\n        console.log(\"Driver quits!\");\n    });\n\n    it(\"should log in\", async () => {\n        const loginButton = await driver.findElementByText(loginButtonText, SearchOptions.exact);\n        await loginButton.click();\n        if (driver.isAndroid) {\n            const allFields = await driver.findElementsByClassName(driver.locators.getElementByName(\"textfield\"));\n            await allFields[0].sendKeys(email);\n            await allFields[1].sendKeys(password);\n            if (driver.nsCapabilities.isSauceLab) {\n                await driver.driver.hideDeviceKeyboard(\"Done\");\n            }\n        } else {\n            const usernameField = await driver.findElementByClassName(driver.locators.getElementByName(\"textfield\"));\n            await usernameField.sendKeys(email);\n            const passField = await driver.findElementByClassName(driver.locators.getElementByName(\"securetextfield\"));\n            await passField.sendKeys(password);\n            const done = await driver.findElementByText(\"Done\", SearchOptions.contains);\n            await done.click();\n        }\n        const loginBtn = await driver.findElementByText(loginButtonText, SearchOptions.exact);\n        await loginBtn.click();\n        const recentButton = await driver.findElementByText(recentButtonText, SearchOptions.exact);\n        expect(recentButton).to.exist;\n    });\n\n    it(\"should add element in the list\", async () => {\n        const addField = await driver.findElementByClassName(driver.locators.getElementByName(\"textfield\"));\n        await addField.sendKeys(fruit);\n        const allImages = await driver.findElementsByClassName(driver.locators.image); // First image is the menu, second is the cross adding to the list.\n        await allImages[1].click(); // Cross image button to add the item.\n        const appleItem = await driver.findElementByText(fruit);\n        expect(appleItem).to.exist;\n    });\n\n    it(\"should mark element as Done\", async () => {\n        await clickOnCrossOrCheckboxBtn();\n        const appleItem = await driver.findElementByText(fruit);\n        const isItemDone = await driver.compareElement(appleItem, \"itemDone\", 0.07);\n        expect(isItemDone).to.be.true;\n    });\n\n    it(\"should delete item from the list\", async () => {\n        await clickOnBinButton();\n        const appleListItemXpath = await driver.elementHelper.getXPathByText(fruit, SearchOptions.exact);\n        const appleItem = await driver.findElementByXPathIfExists(appleListItemXpath, 10000);\n        expect(appleItem).to.be.undefined;\n    });\n\n    it(\"should find deleted item in Recent\", async () => {\n        const recentButton = await driver.findElementByText(recentButtonText);\n        await recentButton.click();\n        const appleItem = await driver.findElementByText(fruit);\n        expect(appleItem).to.exist;\n    });\n\n    it(\"should return back an item from the Recent list\", async () => {\n        await clickOnCrossOrCheckboxBtn();\n        const doneButton = await driver.findElementByText(doneButtonText);\n        await doneButton.click();\n        const appleItem = await driver.findElementByText(fruit);\n        expect(appleItem).to.exist;\n    });\n\n    it(\"should delete item from the Groceries list and remove it from Recent\", async () => {\n        await clickOnBinButton();\n        const recentButton = await driver.findElementByText(recentButtonText);\n        await recentButton.click();\n\n        await clickOnBinButton();\n\n        const appleListItemXpath = await driver.elementHelper.getXPathByText(fruit, SearchOptions.contains);\n        const appleItem = await driver.findElementByXPathIfExists(appleListItemXpath, 10000);\n        expect(appleItem).to.be.undefined;\n    });\n\n    it(\"should log off\", async () => {\n        // First image is the menu, second is the clock/cross button. The rest are pairs checkbox/bin per list item.\n        await driver.sleep(2000);\n        const allImages = await driver.findElementsByClassName(driver.locators.image);\n        await allImages[0].click(); // Menu button\n        const logOffButton = await driver.findElementByText(logOffButtonText);\n        await logOffButton.click();\n        const loginButton = await driver.findElementByText(loginButtonText, SearchOptions.contains);\n        expect(loginButton).to.exist;\n    });\n\n    it(\"should warn for invalid email\", async () => {\n        const loginButton = await driver.findElementByText(loginButtonText, SearchOptions.exact);\n        await loginButton.click();\n        const usernameField = await driver.findElementByClassName(driver.locators.getElementByName(\"textfield\"));\n        await usernameField.sendKeys(invalidEmail);\n        if (driver.isAndroid) {\n            if (driver.nsCapabilities.isSauceLab) {\n                await driver.driver.hideDeviceKeyboard(\"Done\");\n            }\n        } else {\n            const done = await driver.findElementByText(\"Done\", SearchOptions.contains);\n            await done.click();\n        }\n        const loginBtn = await driver.findElementByText(loginButtonText, SearchOptions.exact);\n        await loginBtn.click();\n        const invalidEmailWarning = await driver.findElementByText(invalidEmailWarningText, SearchOptions.contains);\n        expect(invalidEmailWarning).to.exist;\n        const okButton = await driver.findElementByText(okButtonText);\n        await okButton.click();\n    });\n\n    it(\"should open sign up form\", async () => {\n        const signUpHereButton = await driver.findElementByText(signUpHereButtonText);\n        await signUpHereButton.click();\n        const signUpButton = await driver.findElementByText(signUpButtonText, SearchOptions.exact);\n        expect(signUpButton).to.exist;\n        const backToLoginButton = await driver.findElementByText(backToLoginButtonText);\n        await backToLoginButton.click();\n    });\n\n    it(\"should open Forgot password form\", async () => {\n        const forgotPasswordButton = await driver.findElementByText(forgotPasswordButtonText, SearchOptions.contains);\n        await forgotPasswordButton.click();\n        const forgotPasswordForm = await driver.findElementByText(forgotPasswordFormText, SearchOptions.contains);\n        expect(forgotPasswordForm).to.exist;\n        const cancelButton = await driver.findElementByText(cancelButtonText);\n        await cancelButton.click();\n    });\n});"
  },
  {
    "path": "e2e/setup.ts",
    "content": "import { startServer, stopServer } from \"nativescript-dev-appium\";\n\nbefore(\"start server\", async () => {\n    await startServer();\n});\n\nafter(\"stop server\", async () => {\n    await stopServer();\n});"
  },
  {
    "path": "e2e/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"module\": \"commonjs\",\n        \"target\": \"es6\",\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"importHelpers\": false,\n        \"types\": [\n            \"node\",\n            \"mocha\",\n            \"chai\"\n        ],\n        \"lib\": [\n            \"es2015\",\n            \"dom\"\n        ]\n    }\n}"
  },
  {
    "path": "karma.conf.js",
    "content": "module.exports = function (config) {\n  const options = {\n\n    // base path that will be used to resolve all patterns (eg. files, exclude)\n    basePath: '',\n\n\n    // frameworks to use\n    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n    frameworks: ['jasmine'],\n\n\n    // list of files / patterns to load in the browser\n    files: ['app/tests/**/*.*'],\n\n\n    // list of files to exclude\n    exclude: [\n    ],\n\n\n    // preprocess matching files before serving them to the browser\n    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor\n    preprocessors: {\n    },\n\n\n    // test results reporter to use\n    // possible values: 'dots', 'progress'\n    // available reporters: https://npmjs.org/browse/keyword/karma-reporter\n    reporters: ['progress'],\n\n\n    // web server port\n    port: 9876,\n\n\n    // enable / disable colors in the output (reporters and logs)\n    colors: true,\n\n\n    // level of logging\n    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG\n    logLevel: config.LOG_INFO,\n\n\n    // enable / disable watching file and executing tests whenever any file changes\n    autoWatch: true,\n\n\n    // start these browsers\n    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher\n    browsers: [],\n\n    customLaunchers: {\n      android: {\n        base: 'NS',\n        platform: 'android'\n      },\n      ios: {\n        base: 'NS',\n        platform: 'ios'\n      },\n      ios_simulator: {\n        base: 'NS',\n        platform: 'ios',\n        arguments: ['--emulator']\n      }\n    },\n\n    // Continuous Integration mode\n    // if true, Karma captures browsers, runs the tests and exits\n    singleRun: false\n  };\n\n  setWebpackPreprocessor(config, options);\n  setWebpack(config, options);\n\n  config.set(options);\n}\n\nfunction setWebpackPreprocessor(config, options) {\n  if (config && config.bundle) {\n    if (!options.preprocessors) {\n      options.preprocessors = {};\n    }\n\n    options.files.forEach(file => {\n      if (!options.preprocessors[file]) {\n        options.preprocessors[file] = [];\n      }\n      options.preprocessors[file].push('webpack');\n    });\n  }\n}\n\nfunction setWebpack(config, options) {\n  if (config && config.bundle) {\n    const env = {};\n    env[config.platform] = true;\n    env.sourceMap = config.debugBrk;\n    options.webpack = require('./webpack.config')(env);\n    delete options.webpack.entry;\n    delete options.webpack.output.libraryTarget;\n    const invalidPluginsForUnitTesting = [\"GenerateBundleStarterPlugin\", \"GenerateNativeScriptEntryPointsPlugin\"];\n    options.webpack.plugins = options.webpack.plugins.filter(p => !invalidPluginsForUnitTesting.includes(p.constructor.name));\n  }\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"sample-groceries\",\n  \"version\": \"1.0.0\",\n  \"description\": \"A NativeScript-built iOS and Android app for managing grocery lists\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/nativescript/sample-Groceries.git\"\n  },\n  \"keywords\": [\n    \"NativeScript\"\n  ],\n  \"author\": \"TJ VanToll <tj.vantoll@gmail.com> (https://www.tjvantoll.com/)\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/nativescript/sample-Groceries/issues\"\n  },\n  \"homepage\": \"https://github.com/nativescript/sample-Groceries/groceries\",\n  \"nativescript\": {\n    \"id\": \"org.nativescript.groceries\",\n    \"tns-android\": {\n      \"version\": \"6.0.1\"\n    },\n    \"tns-ios\": {\n      \"version\": \"6.0.2\"\n    }\n  },\n  \"scripts\": {\n    \"tslint\": \"tslint -p tsconfig.json\",\n    \"ns-bundle\": \"ns-bundle\",\n    \"start-android-bundle\": \"npm run ns-bundle --android --run-app\",\n    \"start-ios-bundle\": \"npm run ns-bundle --ios --run-app\",\n    \"build-android-bundle\": \"npm run ns-bundle --android --build-app\",\n    \"build-ios-bundle\": \"npm run ns-bundle --ios --build-app\",\n    \"publish-ios-bundle\": \"npm run ns-bundle --ios --publish-app\",\n    \"generate-android-snapshot\": \"generate-android-snapshot --targetArchs arm,arm64,ia32 --install\",\n    \"e2e\": \"tsc -p e2e && mocha --opts ./e2e/config/mocha.opts\",\n    \"watch-tests\": \"tsc -p e2e --watch\",\n    \"update-app-ng-deps\": \"update-app-ng-deps\",\n    \"ns-verify-bundle\": \"ns-verify-bundle\",\n    \"update-ns-webpack\": \"update-ns-webpack\"\n  },\n  \"dependencies\": {\n    \"@angular/common\": \"~8.2.0\",\n    \"@angular/compiler\": \"~8.2.0\",\n    \"@angular/core\": \"~8.2.0\",\n    \"@angular/forms\": \"~8.2.0\",\n    \"@angular/platform-browser\": \"~8.2.0\",\n    \"@angular/platform-browser-dynamic\": \"~8.2.0\",\n    \"@angular/router\": \"~8.2.0\",\n    \"email-validator\": \"^2.0.4\",\n    \"nativescript-angular\": \"~8.2.0\",\n    \"nativescript-iqkeyboardmanager\": \"~1.3.0\",\n    \"nativescript-social-share\": \"~1.5.1\",\n    \"nativescript-unit-test-runner\": \"0.7.0\",\n    \"reflect-metadata\": \"~0.1.8\",\n    \"rxjs\": \"^6.4.0\",\n    \"tns-core-modules\": \"~6.0.1\",\n    \"zone.js\": \"^0.9.1\"\n  },\n  \"devDependencies\": {\n    \"@angular/compiler-cli\": \"8.2.0\",\n    \"@ngtools/webpack\": \"8.2.0\",\n    \"@types/chai\": \"~4.1.7\",\n    \"@types/mocha\": \"~5.2.5\",\n    \"@types/node\": \"~10.12.18\",\n    \"babel-traverse\": \"6.26.0\",\n    \"babel-types\": \"6.26.0\",\n    \"babylon\": \"6.18.0\",\n    \"codelyzer\": \"^4.5.0\",\n    \"filewalker\": \"^0.1.3\",\n    \"jasmine-core\": \"^3.3.0\",\n    \"karma\": \"4.1.0\",\n    \"karma-jasmine\": \"2.0.1\",\n    \"karma-nativescript-launcher\": \"^0.4.0\",\n    \"karma-webpack\": \"3.0.5\",\n    \"lazy\": \"1.0.11\",\n    \"mocha\": \"~5.2.0\",\n    \"mocha-junit-reporter\": \"~1.18.0\",\n    \"mocha-multi\": \"~1.0.1\",\n    \"nativescript-dev-appium\": \"next\",\n    \"nativescript-dev-webpack\": \"~1.1.0\",\n    \"tslint\": \"^5.4.2\",\n    \"typescript\": \"~3.5.3\"\n  }\n}\n"
  },
  {
    "path": "references.d.ts",
    "content": "/// <reference path=\"./node_modules/tns-core-modules/tns-core-modules.d.ts\" /> Needed for autocompletion and compilation."
  },
  {
    "path": "tsconfig.esm.json",
    "content": "{\n    \"extends\": \"./tsconfig\",\n    \"compilerOptions\": {\n        \"module\": \"es2015\",\n        \"moduleResolution\": \"node\"\n    }\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"module\": \"commonjs\",\n        \"target\": \"es5\",\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"noEmitHelpers\": true,\n        \"noEmitOnError\": true,\n        \"lib\": [\n            \"dom\",\n            \"es6\",\n            \"es2015.iterable\"\n        ],\n        \"baseUrl\": \".\",\n        \"paths\": {\n            \"*\": [\n                \"./node_modules/tns-core-modules/*\",\n                \"./node_modules/*\"\n            ],\n            \"~/*\": [\n                \"app/*\"\n            ]\n        }\n    },\n    \"exclude\": [\n        \"node_modules\",\n        \"platforms\",\n        \"e2e\"\n    ]\n}"
  },
  {
    "path": "tsconfig.tns.json",
    "content": "{\n    \"extends\": \"./tsconfig\",\n    \"compilerOptions\": {\n        \"module\": \"es2015\",\n        \"moduleResolution\": \"node\"\n    }\n}\n"
  },
  {
    "path": "tslint.json",
    "content": "{\n    \"rulesDirectory\": [\n        \"node_modules/codelyzer\"\n    ],\n    \"rules\": {\n        \"class-name\": true,\n        \"comment-format\": [\n            true,\n            \"check-space\"\n        ],\n        \"indent\": [\n            true,\n            \"spaces\"\n        ],\n        \"no-duplicate-variable\": true,\n        \"no-eval\": true,\n        \"no-internal-module\": true,\n        \"no-trailing-whitespace\": true,\n        \"no-var-keyword\": true,\n        \"one-line\": [\n            true,\n            \"check-open-brace\",\n            \"check-whitespace\"\n        ],\n        \"quotemark\": [\n            true,\n            \"double\"\n        ],\n        \"semicolon\": [\n            true,\n            \"always\"\n        ],\n        \"triple-equals\": [\n            true,\n            \"allow-null-check\"\n        ],\n        \"typedef-whitespace\": [\n            true,\n            {\n                \"call-signature\": \"nospace\",\n                \"index-signature\": \"nospace\",\n                \"parameter\": \"nospace\",\n                \"property-declaration\": \"nospace\",\n                \"variable-declaration\": \"nospace\"\n            }\n        ],\n        \"variable-name\": [\n            true,\n            \"ban-keywords\"\n        ],\n        \"whitespace\": [\n            true,\n            \"check-branch\",\n            \"check-decl\",\n            \"check-operator\",\n            \"check-separator\",\n            \"check-type\"\n        ],\n\n        \"directive-selector\": [true, \"attribute\", \"gr\", \"camelCase\"],\n        \"component-selector\": [true, \"element\", \"gr\", \"kebab-case\"],\n        \"use-input-property-decorator\": true,\n        \"use-output-property-decorator\": true,\n        \"use-host-property-decorator\": true,\n        \"no-attribute-parameter-decorator\": true,\n        \"no-input-rename\": true,\n        \"no-output-rename\": true,\n        \"no-forward-ref\" :true,\n        \"use-life-cycle-interface\": true,\n        \"use-pipe-transform-interface\": true,\n        \"component-class-suffix\": true,\n        \"directive-class-suffix\": true,\n        \"import-destructuring-spacing\": true\n    }\n}\n"
  },
  {
    "path": "webpack.config.js",
    "content": "const { join, relative, resolve, sep, dirname } = require(\"path\");\n\nconst webpack = require(\"webpack\");\nconst nsWebpack = require(\"nativescript-dev-webpack\");\nconst nativescriptTarget = require(\"nativescript-dev-webpack/nativescript-target\");\nconst { nsReplaceBootstrap } = require(\"nativescript-dev-webpack/transformers/ns-replace-bootstrap\");\nconst { nsReplaceLazyLoader } = require(\"nativescript-dev-webpack/transformers/ns-replace-lazy-loader\");\nconst { nsSupportHmrNg } = require(\"nativescript-dev-webpack/transformers/ns-support-hmr-ng\");\nconst { getMainModulePath } = require(\"nativescript-dev-webpack/utils/ast-utils\");\nconst CleanWebpackPlugin = require(\"clean-webpack-plugin\");\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\nconst { BundleAnalyzerPlugin } = require(\"webpack-bundle-analyzer\");\nconst { NativeScriptWorkerPlugin } = require(\"nativescript-worker-loader/NativeScriptWorkerPlugin\");\nconst TerserPlugin = require(\"terser-webpack-plugin\");\nconst { getAngularCompilerPlugin } = require(\"nativescript-dev-webpack/plugins/NativeScriptAngularCompilerPlugin\");\nconst hashSalt = Date.now().toString();\n\nmodule.exports = env => {\n    // Add your custom Activities, Services and other Android app components here.\n    const appComponents = [\n        \"tns-core-modules/ui/frame\",\n        \"tns-core-modules/ui/frame/activity\",\n    ];\n\n    const platform = env && (env.android && \"android\" || env.ios && \"ios\");\n    if (!platform) {\n        throw new Error(\"You need to provide a target platform!\");\n    }\n\n    const AngularCompilerPlugin = getAngularCompilerPlugin(platform);\n    const projectRoot = __dirname;\n\n    // Default destination inside platforms/<platform>/...\n    const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));\n\n    const {\n        // The 'appPath' and 'appResourcesPath' values are fetched from\n        // the nsconfig.json configuration file.\n        appPath = \"src\",\n        appResourcesPath = \"App_Resources\",\n\n        // You can provide the following flags when running 'tns run android|ios'\n        aot, // --env.aot\n        snapshot, // --env.snapshot,\n        production, // --env.production\n        uglify, // --env.uglify\n        report, // --env.report\n        sourceMap, // --env.sourceMap\n        hiddenSourceMap, // --env.hiddenSourceMap\n        hmr, // --env.hmr,\n        unitTesting, // --env.unitTesting\n        verbose, // --env.verbose\n    } = env;\n\n    const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;\n    const externals = nsWebpack.getConvertedExternals(env.externals);\n    const appFullPath = resolve(projectRoot, appPath);\n    const appResourcesFullPath = resolve(projectRoot, appResourcesPath);\n    const tsConfigName = \"tsconfig.tns.json\";\n    const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;\n    const entryPath = `.${sep}${entryModule}`;\n    const entries = { bundle: entryPath };\n    const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf(\"tns-core-modules\") > -1);\n    if (platform === \"ios\" && !areCoreModulesExternal) {\n        entries[\"tns_modules/tns-core-modules/inspector_modules\"] = \"inspector_modules\";\n    };\n\n    const ngCompilerTransformers = [];\n    const additionalLazyModuleResources = [];\n    if (aot) {\n        ngCompilerTransformers.push(nsReplaceBootstrap);\n    }\n\n    if (hmr) {\n        ngCompilerTransformers.push(nsSupportHmrNg);\n    }\n\n    // when \"@angular/core\" is external, it's not included in the bundles. In this way, it will be used\n    // directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes\n    // fixes https://github.com/NativeScript/nativescript-cli/issues/4024\n    if (env.externals && env.externals.indexOf(\"@angular/core\") > -1) {\n        const appModuleRelativePath = getMainModulePath(resolve(appFullPath, entryModule), tsConfigName);\n        if (appModuleRelativePath) {\n            const appModuleFolderPath = dirname(resolve(appFullPath, appModuleRelativePath));\n            // include the lazy loader inside app module\n            ngCompilerTransformers.push(nsReplaceLazyLoader);\n            // include the new lazy loader path in the allowed ones\n            additionalLazyModuleResources.push(appModuleFolderPath);\n        }\n    }\n\n    const ngCompilerPlugin = new AngularCompilerPlugin({\n        hostReplacementPaths: nsWebpack.getResolver([platform, \"tns\"]),\n        platformTransformers: ngCompilerTransformers.map(t => t(() => ngCompilerPlugin, resolve(appFullPath, entryModule), projectRoot)),\n        mainPath: join(appFullPath, entryModule),\n        tsConfigPath: join(__dirname, tsConfigName),\n        skipCodeGeneration: !aot,\n        sourceMap: !!isAnySourceMapEnabled,\n        additionalLazyModuleResources: additionalLazyModuleResources\n    });\n\n    let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);\n\n    const itemsToClean = [`${dist}/**/*`];\n    if (platform === \"android\") {\n        itemsToClean.push(`${join(projectRoot, \"platforms\", \"android\", \"app\", \"src\", \"main\", \"assets\", \"snapshots\")}`);\n        itemsToClean.push(`${join(projectRoot, \"platforms\", \"android\", \"app\", \"build\", \"configurations\", \"nativescript-android-snapshot\")}`);\n    }\n\n    nsWebpack.processAppComponents(appComponents, platform);\n    const config = {\n        mode: production ? \"production\" : \"development\",\n        context: appFullPath,\n        externals,\n        watchOptions: {\n            ignored: [\n                appResourcesFullPath,\n                // Don't watch hidden files\n                \"**/.*\",\n            ]\n        },\n        target: nativescriptTarget,\n        entry: entries,\n        output: {\n            pathinfo: false,\n            path: dist,\n            sourceMapFilename,\n            libraryTarget: \"commonjs2\",\n            filename: \"[name].js\",\n            globalObject: \"global\",\n            hashSalt\n        },\n        resolve: {\n            extensions: [\".ts\", \".js\", \".scss\", \".css\"],\n            // Resolve {N} system modules from tns-core-modules\n            modules: [\n                resolve(__dirname, \"node_modules/tns-core-modules\"),\n                resolve(__dirname, \"node_modules\"),\n                \"node_modules/tns-core-modules\",\n                \"node_modules\",\n            ],\n            alias: {\n                '~': appFullPath\n            },\n            symlinks: true\n        },\n        resolveLoader: {\n            symlinks: false\n        },\n        node: {\n            // Disable node shims that conflict with NativeScript\n            \"http\": false,\n            \"timers\": false,\n            \"setImmediate\": false,\n            \"fs\": \"empty\",\n            \"__dirname\": false,\n        },\n        devtool: hiddenSourceMap ? \"hidden-source-map\" : (sourceMap ? \"inline-source-map\" : \"none\"),\n        optimization: {\n            runtimeChunk: \"single\",\n            splitChunks: {\n                cacheGroups: {\n                    vendor: {\n                        name: \"vendor\",\n                        chunks: \"all\",\n                        test: (module, chunks) => {\n                            const moduleName = module.nameForCondition ? module.nameForCondition() : '';\n                            return /[\\\\/]node_modules[\\\\/]/.test(moduleName) ||\n                                appComponents.some(comp => comp === moduleName);\n                        },\n                        enforce: true,\n                    },\n                }\n            },\n            minimize: !!uglify,\n            minimizer: [\n                new TerserPlugin({\n                    parallel: true,\n                    cache: true,\n                    sourceMap: isAnySourceMapEnabled,\n                    terserOptions: {\n                        output: {\n                            comments: false,\n                            semicolons: !isAnySourceMapEnabled\n                        },\n                        compress: {\n                            // The Android SBG has problems parsing the output\n                            // when these options are enabled\n                            'collapse_vars': platform !== \"android\",\n                            sequences: platform !== \"android\",\n                        }\n                    }\n                })\n            ],\n        },\n        module: {\n            rules: [\n                {\n                    include: join(appFullPath, entryPath),\n                    use: [\n                        // Require all Android app components\n                        platform === \"android\" && {\n                            loader: \"nativescript-dev-webpack/android-app-components-loader\",\n                            options: { modules: appComponents }\n                        },\n\n                        {\n                            loader: \"nativescript-dev-webpack/bundle-config-loader\",\n                            options: {\n                                angular: true,\n                                loadCss: !snapshot, // load the application css if in debug mode\n                                unitTesting,\n                                appFullPath,\n                                projectRoot,\n                                ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)\n                            }\n                        },\n                    ].filter(loader => !!loader)\n                },\n\n                { test: /\\.html$|\\.xml$/, use: \"raw-loader\" },\n\n                // tns-core-modules reads the app.css and its imports using css-loader\n                {\n                    test: /[\\/|\\\\]app\\.css$/,\n                    use: [\n                        \"nativescript-dev-webpack/style-hot-loader\",\n                        { loader: \"css-loader\", options: { url: false } }\n                    ]\n                },\n                {\n                    test: /[\\/|\\\\]app\\.scss$/,\n                    use: [\n                        \"nativescript-dev-webpack/style-hot-loader\",\n                        { loader: \"css-loader\", options: { url: false } },\n                        \"sass-loader\"\n                    ]\n                },\n\n                // Angular components reference css files and their imports using raw-loader\n                { test: /\\.css$/, exclude: /[\\/|\\\\]app\\.css$/, use: \"raw-loader\" },\n                { test: /\\.scss$/, exclude: /[\\/|\\\\]app\\.scss$/, use: [\"raw-loader\", \"resolve-url-loader\", \"sass-loader\"] },\n\n                {\n                    test: /(?:\\.ngfactory\\.js|\\.ngstyle\\.js|\\.ts)$/,\n                    use: [\n                        \"nativescript-dev-webpack/moduleid-compat-loader\",\n                        \"nativescript-dev-webpack/lazy-ngmodule-hot-loader\",\n                        \"@ngtools/webpack\",\n                    ]\n                },\n\n                // Mark files inside `@angular/core` as using SystemJS style dynamic imports.\n                // Removing this will cause deprecation warnings to appear.\n                {\n                    test: /[\\/\\\\]@angular[\\/\\\\]core[\\/\\\\].+\\.js$/,\n                    parser: { system: true },\n                },\n            ],\n        },\n        plugins: [\n            // Define useful constants like TNS_WEBPACK\n            new webpack.DefinePlugin({\n                \"global.TNS_WEBPACK\": \"true\",\n                \"process\": \"global.process\",\n            }),\n            // Remove all files from the out dir.\n            new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),\n            // Copy assets to out dir. Add your own globs as needed.\n            new CopyWebpackPlugin([\n                { from: { glob: \"fonts/**\" } },\n                { from: { glob: \"**/*.jpg\" } },\n                { from: { glob: \"**/*.png\" } },\n            ], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),\n            new nsWebpack.GenerateNativeScriptEntryPointsPlugin(\"bundle\"),\n            // For instructions on how to set up workers with webpack\n            // check out https://github.com/nativescript/worker-loader\n            new NativeScriptWorkerPlugin(),\n            ngCompilerPlugin,\n            // Does IPC communication with the {N} CLI to notify events when running in watch mode.\n            new nsWebpack.WatchStateLoggerPlugin(),\n        ],\n    };\n\n    if (report) {\n        // Generate report files for bundles content\n        config.plugins.push(new BundleAnalyzerPlugin({\n            analyzerMode: \"static\",\n            openAnalyzer: false,\n            generateStatsFile: true,\n            reportFilename: resolve(projectRoot, \"report\", `report.html`),\n            statsFilename: resolve(projectRoot, \"report\", `stats.json`),\n        }));\n    }\n\n    if (snapshot) {\n        config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({\n            chunk: \"vendor\",\n            angular: true,\n            requireModules: [\n                \"reflect-metadata\",\n                \"@angular/platform-browser\",\n                \"@angular/core\",\n                \"@angular/common\",\n                \"@angular/router\",\n                \"nativescript-angular/platform-static\",\n                \"nativescript-angular/router\",\n            ],\n            projectRoot,\n            webpackConfig: config,\n        }));\n    }\n\n    if (hmr) {\n        config.plugins.push(new webpack.HotModuleReplacementPlugin());\n    }\n\n    return config;\n};\n"
  }
]