diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7cc2780..1c1a096a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ + +## [1.3.8](https://github.com/Urigo/angular-meteor/compare/1.3.7...v1.3.8) (2016-03-28) + + +### Bug Fixes + +* **reactive:** empty collection on cursor change ([252d2d4](https://github.com/Urigo/angular-meteor/commit/252d2d4)) +* **viewmodel:** Scope and view model logics can now be used all together ([c78c507](https://github.com/Urigo/angular-meteor/commit/c78c507)) +* **viewmodel:** View model and scope can both use 'getReactively' ([dc0eb88](https://github.com/Urigo/angular-meteor/commit/dc0eb88)) +* commonjs support for es6 modules ([67a218f](https://github.com/Urigo/angular-meteor/commit/67a218f)) +* fix missing dependencies in npm ([ccf5eec](https://github.com/Urigo/angular-meteor/commit/ccf5eec)) + +### Features + +* meteor 1.3 compatible ([39cc970](https://github.com/Urigo/angular-meteor/commit/39cc970)) +* **$angularMeteorSettings:** suppress warnings ([a787c1d](https://github.com/Urigo/angular-meteor/commit/a787c1d)) + +### Performance Improvements + +* **reactive:** skip comparing on initial data ([21a1805](https://github.com/Urigo/angular-meteor/commit/21a1805)) + + + ## [1.3.7](https://github.com/Urigo/angular-meteor/compare/1.3.6...v1.3.7) (2016-02-28) diff --git a/bower.json b/bower.json index 55fd4c7c0..176fecf8a 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-meteor", "main": "./dist/angular-meteor.bundle.min.js", - "version": "1.3.7", + "version": "1.3.9", "homepage": "https://github.com/Urigo/angular-meteor", "authors": [ "Uri Goldshtein " diff --git a/dist/angular-meteor.bundle.js b/dist/angular-meteor.bundle.js index 779c5ab55..9d9791f09 100644 --- a/dist/angular-meteor.bundle.js +++ b/dist/angular-meteor.bundle.js @@ -9363,2236 +9363,2466 @@ var Promise = Package.promise.Promise; (function(){ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// // -// packages/angular-meteor-data/.npm/package/node_modules/angular-meteor/dist/angular-meteor.js // -// // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // -/*! angular-meteor v1.3.7 */ // 1 -/******/ (function(modules) { // webpackBootstrap // 2 -/******/ // The module cache // 3 -/******/ var installedModules = {}; // 4 - // 5 -/******/ // The require function // 6 -/******/ function __webpack_require__(moduleId) { // 7 - // 8 -/******/ // Check if module is in cache // 9 -/******/ if(installedModules[moduleId]) // 10 -/******/ return installedModules[moduleId].exports; // 11 - // 12 -/******/ // Create a new module (and put it into the cache) // 13 -/******/ var module = installedModules[moduleId] = { // 14 -/******/ exports: {}, // 15 -/******/ id: moduleId, // 16 -/******/ loaded: false // 17 -/******/ }; // 18 - // 19 -/******/ // Execute the module function // 20 -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); // 21 - // 22 -/******/ // Flag the module as loaded // 23 -/******/ module.loaded = true; // 24 - // 25 -/******/ // Return the exports of the module // 26 -/******/ return module.exports; // 27 -/******/ } // 28 - // 29 - // 30 -/******/ // expose the modules object (__webpack_modules__) // 31 -/******/ __webpack_require__.m = modules; // 32 - // 33 -/******/ // expose the module cache // 34 -/******/ __webpack_require__.c = installedModules; // 35 - // 36 -/******/ // __webpack_public_path__ // 37 -/******/ __webpack_require__.p = ""; // 38 - // 39 -/******/ // Load entry module and return exports // 40 -/******/ return __webpack_require__(0); // 41 -/******/ }) // 42 -/************************************************************************/ // 43 -/******/ ([ // 44 -/* 0 */ // 45 -/***/ function(module, exports, __webpack_require__) { // 46 - // 47 - 'use strict'; // 48 - // 49 - Object.defineProperty(exports, "__esModule", { // 50 - value: true // 51 - }); // 52 - exports.name = undefined; // 53 - // 54 - __webpack_require__(1); // 55 - // 56 - __webpack_require__(2); // 57 - // 58 - __webpack_require__(3); // 59 - // 60 - __webpack_require__(4); // 61 - // 62 - __webpack_require__(5); // 63 - // 64 - __webpack_require__(6); // 65 - // 66 - __webpack_require__(7); // 67 - // 68 - __webpack_require__(8); // 69 - // 70 - __webpack_require__(9); // 71 - // 72 - __webpack_require__(10); // 73 - // 74 - __webpack_require__(11); // 75 - // 76 - __webpack_require__(12); // 77 - // 78 - __webpack_require__(13); // 79 - // 80 - var _utils = __webpack_require__(14); // 81 - // 82 - var _mixer = __webpack_require__(15); // 83 - // 84 - var _scope = __webpack_require__(16); // 85 - // 86 - var _core = __webpack_require__(17); // 87 - // 88 - var _viewModel = __webpack_require__(18); // 89 - // 90 - var _reactive = __webpack_require__(19); // 91 - // 92 - var _templates = __webpack_require__(20); // 93 - // 94 - // legacy // 95 - // lib // 96 - var name = exports.name = 'angular-meteor'; // 97 - // 98 - // new // 99 - // 100 - // 101 - angular.module(name, [ // 102 - // new // 103 - _utils.name, _mixer.name, _scope.name, _core.name, _viewModel.name, _reactive.name, _templates.name, // 104 - // 105 - // legacy // 106 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// // +// packages/angular-meteor-data/.npm/package/node_modules/angular-meteor/dist/angular-meteor.js // +// // +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // +/*! angular-meteor v1.3.9 */ // 1 +(function webpackUniversalModuleDefinition(root, factory) { // 2 + if(typeof exports === 'object' && typeof module === 'object') // 3 + module.exports = factory(require("underscore"), require("jsondiffpatch")); // 4 + else if(typeof define === 'function' && define.amd) // 5 + define(["underscore", "jsondiffpatch"], factory); // 6 + else if(typeof exports === 'object') // 7 + exports["angularMeteor"] = factory(require("underscore"), require("jsondiffpatch")); // 8 + else // 9 + root["angularMeteor"] = factory(root["_"], root["jsondiffpatch"]); // 10 +})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_22__) { // 11 +return /******/ (function(modules) { // webpackBootstrap // 12 +/******/ // The module cache // 13 +/******/ var installedModules = {}; // 14 + // 15 +/******/ // The require function // 16 +/******/ function __webpack_require__(moduleId) { // 17 + // 18 +/******/ // Check if module is in cache // 19 +/******/ if(installedModules[moduleId]) // 20 +/******/ return installedModules[moduleId].exports; // 21 + // 22 +/******/ // Create a new module (and put it into the cache) // 23 +/******/ var module = installedModules[moduleId] = { // 24 +/******/ exports: {}, // 25 +/******/ id: moduleId, // 26 +/******/ loaded: false // 27 +/******/ }; // 28 + // 29 +/******/ // Execute the module function // 30 +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); // 31 + // 32 +/******/ // Flag the module as loaded // 33 +/******/ module.loaded = true; // 34 + // 35 +/******/ // Return the exports of the module // 36 +/******/ return module.exports; // 37 +/******/ } // 38 + // 39 + // 40 +/******/ // expose the modules object (__webpack_modules__) // 41 +/******/ __webpack_require__.m = modules; // 42 + // 43 +/******/ // expose the module cache // 44 +/******/ __webpack_require__.c = installedModules; // 45 + // 46 +/******/ // __webpack_public_path__ // 47 +/******/ __webpack_require__.p = ""; // 48 + // 49 +/******/ // Load entry module and return exports // 50 +/******/ return __webpack_require__(0); // 51 +/******/ }) // 52 +/************************************************************************/ // 53 +/******/ ([ // 54 +/* 0 */ // 55 +/***/ function(module, exports, __webpack_require__) { // 56 + // 57 + 'use strict'; // 58 + // 59 + Object.defineProperty(exports, "__esModule", { // 60 + value: true // 61 + }); // 62 + // 63 + __webpack_require__(1); // 64 + // 65 + __webpack_require__(4); // 66 + // 67 + __webpack_require__(5); // 68 + // 69 + __webpack_require__(6); // 70 + // 71 + __webpack_require__(7); // 72 + // 73 + __webpack_require__(8); // 74 + // 75 + __webpack_require__(9); // 76 + // 77 + __webpack_require__(10); // 78 + // 79 + __webpack_require__(11); // 80 + // 81 + __webpack_require__(12); // 82 + // 83 + __webpack_require__(13); // 84 + // 85 + __webpack_require__(14); // 86 + // 87 + __webpack_require__(15); // 88 + // 89 + var _utils = __webpack_require__(16); // 90 + // 91 + var _mixer = __webpack_require__(17); // 92 + // 93 + var _scope = __webpack_require__(18); // 94 + // 95 + var _core = __webpack_require__(19); // 96 + // 97 + var _viewModel = __webpack_require__(20); // 98 + // 99 + var _reactive = __webpack_require__(21); // 100 + // 101 + var _templates = __webpack_require__(23); // 102 + // 103 + // legacy // 104 + // lib // 105 + // 106 + // 107 + var name = 'angular-meteor'; // 108 + // 109 + // new // 110 + // 111 + exports.default = name; // 112 + // 113 + // 114 + angular.module(name, [ // 115 + // new // 116 + _utils.name, _mixer.name, _scope.name, _core.name, _viewModel.name, _reactive.name, _templates.name, // 117 + // 118 + // legacy // 119 'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).run([_mixer.Mixer, _core.Core, _viewModel.ViewModel, _reactive.Reactive, function ($Mixer, $$Core, $$ViewModel, $$Reactive) { - // Load all mixins // 108 - $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive); // 109 - }]) // 110 - // 111 - // legacy // 112 - // Putting all services under $meteor service for syntactic sugar // 113 + // Load all mixins // 121 + $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive); // 122 + }]) // 123 + // 124 + // legacy // 125 + // Putting all services under $meteor service for syntactic sugar // 126 .service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) { - var _this = this; // 115 - // 116 - this.collection = $meteorCollection; // 117 - this.collectionFS = $meteorCollectionFS; // 118 - this.object = $meteorObject; // 119 - this.subscribe = $meteorSubscribe.subscribe; // 120 - this.call = $meteorMethods.call; // 121 - this.session = $meteorSession; // 122 - this.autorun = $meteorUtils.autorun; // 123 - this.getCollectionByName = $meteorUtils.getCollectionByName; // 124 - this.getPicture = $meteorCamera.getPicture; // 125 - // 126 - // $meteorUser // 127 + var _this = this; // 128 + // 129 + this.collection = $meteorCollection; // 130 + this.collectionFS = $meteorCollectionFS; // 131 + this.object = $meteorObject; // 132 + this.subscribe = $meteorSubscribe.subscribe; // 133 + this.call = $meteorMethods.call; // 134 + this.session = $meteorSession; // 135 + this.autorun = $meteorUtils.autorun; // 136 + this.getCollectionByName = $meteorUtils.getCollectionByName; // 137 + this.getPicture = $meteorCamera.getPicture; // 138 + // 139 + // $meteorUser // 140 ['loginWithPassword', 'requireUser', 'requireValidUser', 'waitForUser', 'createUser', 'changePassword', 'forgotPassword', 'resetPassword', 'verifyEmail', 'loginWithMeteorDeveloperAccount', 'loginWithFacebook', 'loginWithGithub', 'loginWithGoogle', 'loginWithMeetup', 'loginWithTwitter', 'loginWithWeibo', 'logout', 'logoutOtherClients'].forEach(function (method) { - _this[method] = $meteorUser[method]; // 129 - }); // 130 - }]); // 131 - // 132 -/***/ }, // 133 -/* 1 */ // 134 -/***/ function(module, exports) { // 135 - // 136 - /*global // 137 - angular, _ // 138 - */ // 139 - // 140 - 'use strict'; // 141 - // 142 - // https://github.com/DAB0mB/get-updates // 143 - // 144 - (function () { // 145 - var module = angular.module('getUpdates', []); // 146 - // 147 - var utils = function () { // 148 - var rip = function rip(obj, level) { // 149 - if (level < 1) return {}; // 150 - // 151 - return _.reduce(obj, function (clone, v, k) { // 152 - v = _.isObject(v) ? rip(v, --level) : v; // 153 - clone[k] = v; // 154 - return clone; // 155 - }, {}); // 156 - }; // 157 - // 158 - var toPaths = function toPaths(obj) { // 159 - var keys = getKeyPaths(obj); // 160 - var values = getDeepValues(obj); // 161 - return _.object(keys, values); // 162 - }; // 163 - // 164 - var getKeyPaths = function getKeyPaths(obj) { // 165 - var keys = _.keys(obj).map(function (k) { // 166 - var v = obj[k]; // 167 - if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k; // 168 - // 169 - return getKeyPaths(v).map(function (subKey) { // 170 - return k + '.' + subKey; // 171 - }); // 172 - }); // 173 - // 174 - return _.flatten(keys); // 175 - }; // 176 - // 177 - var getDeepValues = function getDeepValues(obj, arr) { // 178 - arr = arr || []; // 179 - // 180 - _.values(obj).forEach(function (v) { // 181 - if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr); // 182 - }); // 183 - // 184 - return arr; // 185 - }; // 186 - // 187 - var flatten = function flatten(arr) { // 188 - return arr.reduce(function (flattened, v, i) { // 189 - if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v); // 190 - // 191 - return flattened; // 192 - }, []); // 193 - }; // 194 - // 195 - var setFilled = function setFilled(obj, k, v) { // 196 - if (!_.isEmpty(v)) obj[k] = v; // 197 - }; // 198 - // 199 - var assert = function assert(result, msg) { // 200 - if (!result) throwErr(msg); // 201 - }; // 202 - // 203 - var throwErr = function throwErr(msg) { // 204 - throw Error('get-updates error - ' + msg); // 205 - }; // 206 - // 207 - return { // 208 - rip: rip, // 209 - toPaths: toPaths, // 210 - getKeyPaths: getKeyPaths, // 211 - getDeepValues: getDeepValues, // 212 - setFilled: setFilled, // 213 - assert: assert, // 214 - throwErr: throwErr // 215 - }; // 216 - }(); // 217 - // 218 - var getDifference = function () { // 219 - var getDifference = function getDifference(src, dst, isShallow) { // 220 - var level; // 221 - // 222 - if (isShallow > 1) level = isShallow;else if (isShallow) level = 1; // 223 - // 224 - if (level) { // 225 - src = utils.rip(src, level); // 226 - dst = utils.rip(dst, level); // 227 - } // 228 - // 229 - return compare(src, dst); // 230 - }; // 231 - // 232 - var compare = function compare(src, dst) { // 233 - var srcKeys = _.keys(src); // 234 - var dstKeys = _.keys(dst); // 235 - // 236 - var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value(); // 237 - // 238 - return keys.reduce(function (diff, k) { // 239 - var srcValue = src[k]; // 240 - var dstValue = dst[k]; // 241 - // 242 - if (_.isDate(srcValue) && _.isDate(dstValue)) { // 243 - if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue; // 244 - } // 245 - // 246 - if (_.isObject(srcValue) && _.isObject(dstValue)) { // 247 - var valueDiff = getDifference(srcValue, dstValue); // 248 - utils.setFilled(diff, k, valueDiff); // 249 - } else if (srcValue !== dstValue) { // 250 - diff[k] = dstValue; // 251 - } // 252 - // 253 - return diff; // 254 - }, {}); // 255 - }; // 256 - // 257 - return getDifference; // 258 - }(); // 259 - // 260 - var getUpdates = function () { // 261 - var getUpdates = function getUpdates(src, dst, isShallow) { // 262 - utils.assert(_.isObject(src), 'first argument must be an object'); // 263 - utils.assert(_.isObject(dst), 'second argument must be an object'); // 264 - // 265 - var diff = getDifference(src, dst, isShallow); // 266 - var paths = utils.toPaths(diff); // 267 - // 268 - var set = createSet(paths); // 269 - var unset = createUnset(paths); // 270 - var pull = createPull(unset); // 271 - // 272 - var updates = {}; // 273 - utils.setFilled(updates, '$set', set); // 274 - utils.setFilled(updates, '$unset', unset); // 275 - utils.setFilled(updates, '$pull', pull); // 276 - // 277 - return updates; // 278 - }; // 279 - // 280 - var createSet = function createSet(paths) { // 281 - var undefinedKeys = getUndefinedKeys(paths); // 282 - return _.omit(paths, undefinedKeys); // 283 - }; // 284 - // 285 - var createUnset = function createUnset(paths) { // 286 - var undefinedKeys = getUndefinedKeys(paths); // 287 - var unset = _.pick(paths, undefinedKeys); // 288 - // 289 - return _.reduce(unset, function (result, v, k) { // 290 - result[k] = true; // 291 - return result; // 292 - }, {}); // 293 - }; // 294 - // 295 - var createPull = function createPull(unset) { // 296 - var arrKeyPaths = _.keys(unset).map(function (k) { // 297 - var split = k.match(/(.*)\.\d+$/); // 298 - return split && split[1]; // 299 - }); // 300 - // 301 - return _.compact(arrKeyPaths).reduce(function (pull, k) { // 302 - pull[k] = null; // 303 - return pull; // 304 - }, {}); // 305 - }; // 306 - // 307 - var getUndefinedKeys = function getUndefinedKeys(obj) { // 308 - return _.keys(obj).filter(function (k) { // 309 - var v = obj[k]; // 310 - return _.isUndefined(v); // 311 - }); // 312 - }; // 313 - // 314 - return getUpdates; // 315 - }(); // 316 - // 317 - module.value('getUpdates', getUpdates); // 318 - })(); // 319 - // 320 -/***/ }, // 321 -/* 2 */ // 322 -/***/ function(module, exports) { // 323 - // 324 - /*global // 325 - angular, _, Package // 326 - */ // 327 - // 328 - 'use strict'; // 329 - // 330 - var _module = angular.module('diffArray', ['getUpdates']); // 331 - // 332 - _module.factory('diffArray', ['getUpdates', function (getUpdates) { // 333 - var LocalCollection = Package.minimongo.LocalCollection; // 334 - var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify; // 335 - var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse; // 336 - // 337 - // Calculates the differences between `lastSeqArray` and // 338 - // `seqArray` and calls appropriate functions from `callbacks`. // 339 - // Reuses Minimongo's diff algorithm implementation. // 340 - // XXX Should be replaced with the original diffArray function here: // 341 - // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152 // 342 - // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764 // 343 - function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) { // 344 - preventNestedDiff = !!preventNestedDiff; // 345 - // 346 + _this[method] = $meteorUser[method]; // 142 + }); // 143 + }]); // 144 + module.exports = exports['default']; // 145 + // 146 +/***/ }, // 147 +/* 1 */ // 148 +/***/ function(module, exports, __webpack_require__) { // 149 + // 150 + 'use strict'; // 151 + // 152 + var _underscore = __webpack_require__(2); // 153 + // 154 + var _underscore2 = _interopRequireDefault(_underscore); // 155 + // 156 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 157 + // 158 + 'use strict'; // 159 + // 160 + // https://github.com/DAB0mB/get-updates // 161 + /*global // 162 + angular, _ // 163 + */ // 164 + // 165 + (function () { // 166 + var module = angular.module('getUpdates', []); // 167 + // 168 + var utils = function () { // 169 + var rip = function rip(obj, level) { // 170 + if (level < 1) return {}; // 171 + // 172 + return _underscore2.default.reduce(obj, function (clone, v, k) { // 173 + v = _underscore2.default.isObject(v) ? rip(v, --level) : v; // 174 + clone[k] = v; // 175 + return clone; // 176 + }, {}); // 177 + }; // 178 + // 179 + var toPaths = function toPaths(obj) { // 180 + var keys = getKeyPaths(obj); // 181 + var values = getDeepValues(obj); // 182 + return _underscore2.default.object(keys, values); // 183 + }; // 184 + // 185 + var getKeyPaths = function getKeyPaths(obj) { // 186 + var keys = _underscore2.default.keys(obj).map(function (k) { // 187 + var v = obj[k]; // 188 + if (!_underscore2.default.isObject(v) || _underscore2.default.isEmpty(v) || _underscore2.default.isArray(v)) return k; + // 190 + return getKeyPaths(v).map(function (subKey) { // 191 + return k + '.' + subKey; // 192 + }); // 193 + }); // 194 + // 195 + return _underscore2.default.flatten(keys); // 196 + }; // 197 + // 198 + var getDeepValues = function getDeepValues(obj, arr) { // 199 + arr = arr || []; // 200 + // 201 + _underscore2.default.values(obj).forEach(function (v) { // 202 + if (!_underscore2.default.isObject(v) || _underscore2.default.isEmpty(v) || _underscore2.default.isArray(v)) arr.push(v);else getDeepValues(v, arr); + }); // 204 + // 205 + return arr; // 206 + }; // 207 + // 208 + var flatten = function flatten(arr) { // 209 + return arr.reduce(function (flattened, v, i) { // 210 + if (_underscore2.default.isArray(v) && !_underscore2.default.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v); + // 212 + return flattened; // 213 + }, []); // 214 + }; // 215 + // 216 + var setFilled = function setFilled(obj, k, v) { // 217 + if (!_underscore2.default.isEmpty(v)) obj[k] = v; // 218 + }; // 219 + // 220 + var assert = function assert(result, msg) { // 221 + if (!result) throwErr(msg); // 222 + }; // 223 + // 224 + var throwErr = function throwErr(msg) { // 225 + throw Error('get-updates error - ' + msg); // 226 + }; // 227 + // 228 + return { // 229 + rip: rip, // 230 + toPaths: toPaths, // 231 + getKeyPaths: getKeyPaths, // 232 + getDeepValues: getDeepValues, // 233 + setFilled: setFilled, // 234 + assert: assert, // 235 + throwErr: throwErr // 236 + }; // 237 + }(); // 238 + // 239 + var getDifference = function () { // 240 + var getDifference = function getDifference(src, dst, isShallow) { // 241 + var level; // 242 + // 243 + if (isShallow > 1) level = isShallow;else if (isShallow) level = 1; // 244 + // 245 + if (level) { // 246 + src = utils.rip(src, level); // 247 + dst = utils.rip(dst, level); // 248 + } // 249 + // 250 + return compare(src, dst); // 251 + }; // 252 + // 253 + var compare = function compare(src, dst) { // 254 + var srcKeys = _underscore2.default.keys(src); // 255 + var dstKeys = _underscore2.default.keys(dst); // 256 + // 257 + var keys = _underscore2.default.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value(); + // 259 + return keys.reduce(function (diff, k) { // 260 + var srcValue = src[k]; // 261 + var dstValue = dst[k]; // 262 + // 263 + if (_underscore2.default.isDate(srcValue) && _underscore2.default.isDate(dstValue)) { // 264 + if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue; // 265 + } // 266 + // 267 + if (_underscore2.default.isObject(srcValue) && _underscore2.default.isObject(dstValue)) { // 268 + var valueDiff = getDifference(srcValue, dstValue); // 269 + utils.setFilled(diff, k, valueDiff); // 270 + } else if (srcValue !== dstValue) { // 271 + diff[k] = dstValue; // 272 + } // 273 + // 274 + return diff; // 275 + }, {}); // 276 + }; // 277 + // 278 + return getDifference; // 279 + }(); // 280 + // 281 + var getUpdates = function () { // 282 + var getUpdates = function getUpdates(src, dst, isShallow) { // 283 + utils.assert(_underscore2.default.isObject(src), 'first argument must be an object'); // 284 + utils.assert(_underscore2.default.isObject(dst), 'second argument must be an object'); // 285 + // 286 + var diff = getDifference(src, dst, isShallow); // 287 + var paths = utils.toPaths(diff); // 288 + // 289 + var set = createSet(paths); // 290 + var unset = createUnset(paths); // 291 + var pull = createPull(unset); // 292 + // 293 + var updates = {}; // 294 + utils.setFilled(updates, '$set', set); // 295 + utils.setFilled(updates, '$unset', unset); // 296 + utils.setFilled(updates, '$pull', pull); // 297 + // 298 + return updates; // 299 + }; // 300 + // 301 + var createSet = function createSet(paths) { // 302 + var undefinedKeys = getUndefinedKeys(paths); // 303 + return _underscore2.default.omit(paths, undefinedKeys); // 304 + }; // 305 + // 306 + var createUnset = function createUnset(paths) { // 307 + var undefinedKeys = getUndefinedKeys(paths); // 308 + var unset = _underscore2.default.pick(paths, undefinedKeys); // 309 + // 310 + return _underscore2.default.reduce(unset, function (result, v, k) { // 311 + result[k] = true; // 312 + return result; // 313 + }, {}); // 314 + }; // 315 + // 316 + var createPull = function createPull(unset) { // 317 + var arrKeyPaths = _underscore2.default.keys(unset).map(function (k) { // 318 + var split = k.match(/(.*)\.\d+$/); // 319 + return split && split[1]; // 320 + }); // 321 + // 322 + return _underscore2.default.compact(arrKeyPaths).reduce(function (pull, k) { // 323 + pull[k] = null; // 324 + return pull; // 325 + }, {}); // 326 + }; // 327 + // 328 + var getUndefinedKeys = function getUndefinedKeys(obj) { // 329 + return _underscore2.default.keys(obj).filter(function (k) { // 330 + var v = obj[k]; // 331 + return _underscore2.default.isUndefined(v); // 332 + }); // 333 + }; // 334 + // 335 + return getUpdates; // 336 + }(); // 337 + // 338 + module.value('getUpdates', getUpdates); // 339 + })(); // 340 + // 341 +/***/ }, // 342 +/* 2 */ // 343 +/***/ function(module, exports, __webpack_require__) { // 344 + // 345 + 'use strict'; // 346 + // 347 + Object.defineProperty(exports, "__esModule", { // 348 + value: true // 349 + }); // 350 + // 351 + var _underscore = __webpack_require__(3); // 352 + // 353 + var _underscore2 = _interopRequireDefault(_underscore); // 354 + // 355 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 356 + // 357 + if (typeof _underscore2.default === 'undefined') { // 358 + if (typeof Package.underscore === 'undefined') { // 359 + throw new Error('underscore is missing'); // 360 + } // 361 + } // 362 + // 363 + exports.default = _underscore2.default || Package.underscore._; // 364 + module.exports = exports['default']; // 365 + // 366 +/***/ }, // 367 +/* 3 */ // 368 +/***/ function(module, exports) { // 369 + // 370 + module.exports = __WEBPACK_EXTERNAL_MODULE_3__; // 371 + // 372 +/***/ }, // 373 +/* 4 */ // 374 +/***/ function(module, exports, __webpack_require__) { // 375 + // 376 + 'use strict'; // 377 + // 378 + var _underscore = __webpack_require__(2); // 379 + // 380 + var _underscore2 = _interopRequireDefault(_underscore); // 381 + // 382 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 383 + // 384 + 'use strict'; /*global // 385 + angular, _, Package // 386 + */ // 387 + // 388 + var _module = angular.module('diffArray', ['getUpdates']); // 389 + // 390 + _module.factory('diffArray', ['getUpdates', function (getUpdates) { // 391 + var LocalCollection = Package.minimongo.LocalCollection; // 392 + var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify; // 393 + var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse; // 394 + // 395 + // Calculates the differences between `lastSeqArray` and // 396 + // `seqArray` and calls appropriate functions from `callbacks`. // 397 + // Reuses Minimongo's diff algorithm implementation. // 398 + // XXX Should be replaced with the original diffArray function here: // 399 + // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152 // 400 + // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764 // 401 + function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) { // 402 + preventNestedDiff = !!preventNestedDiff; // 403 + // 404 var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges; - // 348 - var oldObjIds = []; // 349 - var newObjIds = []; // 350 - var posOld = {}; // maps from idStringify'd ids // 351 - var posNew = {}; // ditto // 352 - var posCur = {}; // 353 - var lengthCur = lastSeqArray.length; // 354 - // 355 - _.each(seqArray, function (doc, i) { // 356 - newObjIds.push({ _id: doc._id }); // 357 - posNew[idStringify(doc._id)] = i; // 358 - }); // 359 - // 360 - _.each(lastSeqArray, function (doc, i) { // 361 - oldObjIds.push({ _id: doc._id }); // 362 - posOld[idStringify(doc._id)] = i; // 363 - posCur[idStringify(doc._id)] = i; // 364 - }); // 365 - // 366 - // Arrays can contain arbitrary objects. We don't diff the // 367 - // objects. Instead we always fire 'changedAt' callback on every // 368 - // object. The consumer of `observe-sequence` should deal with // 369 - // it appropriately. // 370 - diffFn(oldObjIds, newObjIds, { // 371 - addedBefore: function addedBefore(id, doc, before) { // 372 - var position = before ? posCur[idStringify(before)] : lengthCur; // 373 - // 374 - _.each(posCur, function (pos, id) { // 375 - if (pos >= position) posCur[id]++; // 376 - }); // 377 - // 378 - lengthCur++; // 379 - posCur[idStringify(id)] = position; // 380 - // 381 - callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before); // 382 - }, // 383 - // 384 - movedBefore: function movedBefore(id, before) { // 385 - var prevPosition = posCur[idStringify(id)]; // 386 - var position = before ? posCur[idStringify(before)] : lengthCur - 1; // 387 - // 388 - _.each(posCur, function (pos, id) { // 389 + // 406 + var oldObjIds = []; // 407 + var newObjIds = []; // 408 + var posOld = {}; // maps from idStringify'd ids // 409 + var posNew = {}; // ditto // 410 + var posCur = {}; // 411 + var lengthCur = lastSeqArray.length; // 412 + // 413 + _underscore2.default.each(seqArray, function (doc, i) { // 414 + newObjIds.push({ _id: doc._id }); // 415 + posNew[idStringify(doc._id)] = i; // 416 + }); // 417 + // 418 + _underscore2.default.each(lastSeqArray, function (doc, i) { // 419 + oldObjIds.push({ _id: doc._id }); // 420 + posOld[idStringify(doc._id)] = i; // 421 + posCur[idStringify(doc._id)] = i; // 422 + }); // 423 + // 424 + // Arrays can contain arbitrary objects. We don't diff the // 425 + // objects. Instead we always fire 'changedAt' callback on every // 426 + // object. The consumer of `observe-sequence` should deal with // 427 + // it appropriately. // 428 + diffFn(oldObjIds, newObjIds, { // 429 + addedBefore: function addedBefore(id, doc, before) { // 430 + var position = before ? posCur[idStringify(before)] : lengthCur; // 431 + // 432 + _underscore2.default.each(posCur, function (pos, id) { // 433 + if (pos >= position) posCur[id]++; // 434 + }); // 435 + // 436 + lengthCur++; // 437 + posCur[idStringify(id)] = position; // 438 + // 439 + callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before); // 440 + }, // 441 + // 442 + movedBefore: function movedBefore(id, before) { // 443 + var prevPosition = posCur[idStringify(id)]; // 444 + var position = before ? posCur[idStringify(before)] : lengthCur - 1; // 445 + // 446 + _underscore2.default.each(posCur, function (pos, id) { // 447 if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++; - }); // 391 - // 392 - posCur[idStringify(id)] = position; // 393 - // 394 - callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before); // 395 - }, // 396 - removed: function removed(id) { // 397 - var prevPosition = posCur[idStringify(id)]; // 398 - // 399 - _.each(posCur, function (pos, id) { // 400 - if (pos >= prevPosition) posCur[id]--; // 401 - }); // 402 - // 403 - delete posCur[idStringify(id)]; // 404 - lengthCur--; // 405 - // 406 - callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition); // 407 - } // 408 - }); // 409 - // 410 - _.each(posNew, function (pos, idString) { // 411 - if (!_.has(posOld, idString)) return; // 412 - // 413 - var id = idParse(idString); // 414 - var newItem = seqArray[pos] || {}; // 415 - var oldItem = lastSeqArray[posOld[idString]]; // 416 - var updates = getUpdates(oldItem, newItem, preventNestedDiff); // 417 - // 418 - if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem); // 419 - }); // 420 - } // 421 - // 422 - diffArray.shallow = function (lastSeqArray, seqArray, callbacks) { // 423 - return diffArray(lastSeqArray, seqArray, callbacks, true); // 424 - }; // 425 - // 426 - diffArray.deepCopyChanges = function (oldItem, newItem) { // 427 - var setDiff = getUpdates(oldItem, newItem).$set; // 428 - // 429 - _.each(setDiff, function (v, deepKey) { // 430 - setDeep(oldItem, deepKey, v); // 431 - }); // 432 - }; // 433 - // 434 - diffArray.deepCopyRemovals = function (oldItem, newItem) { // 435 - var unsetDiff = getUpdates(oldItem, newItem).$unset; // 436 - // 437 - _.each(unsetDiff, function (v, deepKey) { // 438 - unsetDeep(oldItem, deepKey); // 439 - }); // 440 - }; // 441 - // 442 - // Finds changes between two collections // 443 - diffArray.getChanges = function (newCollection, oldCollection, diffMethod) { // 444 - var changes = { added: [], removed: [], changed: [] }; // 445 - // 446 - diffMethod(oldCollection, newCollection, { // 447 - addedAt: function addedAt(id, item, index) { // 448 - changes.added.push({ item: item, index: index }); // 449 - }, // 450 - // 451 - removedAt: function removedAt(id, item, index) { // 452 - changes.removed.push({ item: item, index: index }); // 453 - }, // 454 - // 455 - changedAt: function changedAt(id, updates, index, oldItem) { // 456 - changes.changed.push({ selector: id, modifier: updates }); // 457 - }, // 458 - // 459 - movedTo: function movedTo(id, item, fromIndex, toIndex) { // 460 - // XXX do we need this? // 461 - } // 462 - }); // 463 - // 464 - return changes; // 465 - }; // 466 - // 467 - var setDeep = function setDeep(obj, deepKey, v) { // 468 - var split = deepKey.split('.'); // 469 - var initialKeys = _.initial(split); // 470 - var lastKey = _.last(split); // 471 - // 472 - initialKeys.reduce(function (subObj, k, i) { // 473 - var nextKey = split[i + 1]; // 474 - // 475 - if (isNumStr(nextKey)) { // 476 - if (subObj[k] === null) subObj[k] = []; // 477 - if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null); // 478 - } else if (subObj[k] === null || !isHash(subObj[k])) { // 479 - subObj[k] = {}; // 480 - } // 481 - // 482 - return subObj[k]; // 483 - }, obj); // 484 - // 485 - var deepObj = getDeep(obj, initialKeys); // 486 - deepObj[lastKey] = v; // 487 - return v; // 488 - }; // 489 - // 490 - var unsetDeep = function unsetDeep(obj, deepKey) { // 491 - var split = deepKey.split('.'); // 492 - var initialKeys = _.initial(split); // 493 - var lastKey = _.last(split); // 494 - var deepObj = getDeep(obj, initialKeys); // 495 - // 496 - if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey]; - }; // 498 - // 499 - var getDeep = function getDeep(obj, keys) { // 500 - return keys.reduce(function (subObj, k) { // 501 - return subObj[k]; // 502 - }, obj); // 503 - }; // 504 - // 505 - var isHash = function isHash(obj) { // 506 - return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype; // 507 - }; // 508 - // 509 - var isNumStr = function isNumStr(str) { // 510 - return str.match(/^\d+$/); // 511 - }; // 512 - // 513 - return diffArray; // 514 - }]); // 515 - // 516 -/***/ }, // 517 -/* 3 */ // 518 -/***/ function(module, exports) { // 519 - // 520 - 'use strict'; // 521 - // 522 - angular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', { // 523 - suppressWarnings: false // 524 - }); // 525 - // 526 -/***/ }, // 527 -/* 4 */ // 528 -/***/ function(module, exports) { // 529 - // 530 - 'use strict'; // 531 - // 532 + }); // 449 + // 450 + posCur[idStringify(id)] = position; // 451 + // 452 + callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before); // 453 + }, // 454 + removed: function removed(id) { // 455 + var prevPosition = posCur[idStringify(id)]; // 456 + // 457 + _underscore2.default.each(posCur, function (pos, id) { // 458 + if (pos >= prevPosition) posCur[id]--; // 459 + }); // 460 + // 461 + delete posCur[idStringify(id)]; // 462 + lengthCur--; // 463 + // 464 + callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition); // 465 + } // 466 + }); // 467 + // 468 + _underscore2.default.each(posNew, function (pos, idString) { // 469 + if (!_underscore2.default.has(posOld, idString)) return; // 470 + // 471 + var id = idParse(idString); // 472 + var newItem = seqArray[pos] || {}; // 473 + var oldItem = lastSeqArray[posOld[idString]]; // 474 + var updates = getUpdates(oldItem, newItem, preventNestedDiff); // 475 + // 476 + if (!_underscore2.default.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem); // 477 + }); // 478 + } // 479 + // 480 + diffArray.shallow = function (lastSeqArray, seqArray, callbacks) { // 481 + return diffArray(lastSeqArray, seqArray, callbacks, true); // 482 + }; // 483 + // 484 + diffArray.deepCopyChanges = function (oldItem, newItem) { // 485 + var setDiff = getUpdates(oldItem, newItem).$set; // 486 + // 487 + _underscore2.default.each(setDiff, function (v, deepKey) { // 488 + setDeep(oldItem, deepKey, v); // 489 + }); // 490 + }; // 491 + // 492 + diffArray.deepCopyRemovals = function (oldItem, newItem) { // 493 + var unsetDiff = getUpdates(oldItem, newItem).$unset; // 494 + // 495 + _underscore2.default.each(unsetDiff, function (v, deepKey) { // 496 + unsetDeep(oldItem, deepKey); // 497 + }); // 498 + }; // 499 + // 500 + // Finds changes between two collections // 501 + diffArray.getChanges = function (newCollection, oldCollection, diffMethod) { // 502 + var changes = { added: [], removed: [], changed: [] }; // 503 + // 504 + diffMethod(oldCollection, newCollection, { // 505 + addedAt: function addedAt(id, item, index) { // 506 + changes.added.push({ item: item, index: index }); // 507 + }, // 508 + // 509 + removedAt: function removedAt(id, item, index) { // 510 + changes.removed.push({ item: item, index: index }); // 511 + }, // 512 + // 513 + changedAt: function changedAt(id, updates, index, oldItem) { // 514 + changes.changed.push({ selector: id, modifier: updates }); // 515 + }, // 516 + // 517 + movedTo: function movedTo(id, item, fromIndex, toIndex) { // 518 + // XXX do we need this? // 519 + } // 520 + }); // 521 + // 522 + return changes; // 523 + }; // 524 + // 525 + var setDeep = function setDeep(obj, deepKey, v) { // 526 + var split = deepKey.split('.'); // 527 + var initialKeys = _underscore2.default.initial(split); // 528 + var lastKey = _underscore2.default.last(split); // 529 + // 530 + initialKeys.reduce(function (subObj, k, i) { // 531 + var nextKey = split[i + 1]; // 532 + // 533 + if (isNumStr(nextKey)) { // 534 + if (subObj[k] === null) subObj[k] = []; // 535 + if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null); // 536 + } else if (subObj[k] === null || !isHash(subObj[k])) { // 537 + subObj[k] = {}; // 538 + } // 539 + // 540 + return subObj[k]; // 541 + }, obj); // 542 + // 543 + var deepObj = getDeep(obj, initialKeys); // 544 + deepObj[lastKey] = v; // 545 + return v; // 546 + }; // 547 + // 548 + var unsetDeep = function unsetDeep(obj, deepKey) { // 549 + var split = deepKey.split('.'); // 550 + var initialKeys = _underscore2.default.initial(split); // 551 + var lastKey = _underscore2.default.last(split); // 552 + var deepObj = getDeep(obj, initialKeys); // 553 + // 554 + if (_underscore2.default.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey]; + }; // 556 + // 557 + var getDeep = function getDeep(obj, keys) { // 558 + return keys.reduce(function (subObj, k) { // 559 + return subObj[k]; // 560 + }, obj); // 561 + }; // 562 + // 563 + var isHash = function isHash(obj) { // 564 + return _underscore2.default.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype; // 565 + }; // 566 + // 567 + var isNumStr = function isNumStr(str) { // 568 + return str.match(/^\d+$/); // 569 + }; // 570 + // 571 + return diffArray; // 572 + }]); // 573 + // 574 +/***/ }, // 575 +/* 5 */ // 576 +/***/ function(module, exports) { // 577 + // 578 + 'use strict'; // 579 + // 580 + angular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', { // 581 + suppressWarnings: true // 582 + }); // 583 + // 584 +/***/ }, // 585 +/* 6 */ // 586 +/***/ function(module, exports) { // 587 + // 588 + 'use strict'; // 589 + // 590 angular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) { - var Router = (Package['iron:router'] || {}).Router; // 534 - if (!Router) return; // 535 - // 536 - var isLoaded = false; // 537 - // 538 - // Recompile after iron:router builds page // 539 - Router.onAfterAction(function (req, res, next) { // 540 - Tracker.afterFlush(function () { // 541 - if (isLoaded) return; // 542 - $compile($document)($rootScope); // 543 - if (!$rootScope.$$phase) $rootScope.$apply(); // 544 - isLoaded = true; // 545 - }); // 546 - }); // 547 - }]); // 548 - // 549 -/***/ }, // 550 -/* 5 */ // 551 -/***/ function(module, exports) { // 552 - // 553 - /*global // 554 - angular, _, Tracker, EJSON, FS, Mongo // 555 - */ // 556 - // 557 - 'use strict'; // 558 - // 559 - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; - // 561 - var angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']); // 562 - // 563 + var Router = (Package['iron:router'] || {}).Router; // 592 + if (!Router) return; // 593 + // 594 + var isLoaded = false; // 595 + // 596 + // Recompile after iron:router builds page // 597 + Router.onAfterAction(function (req, res, next) { // 598 + Tracker.afterFlush(function () { // 599 + if (isLoaded) return; // 600 + $compile($document)($rootScope); // 601 + if (!$rootScope.$$phase) $rootScope.$apply(); // 602 + isLoaded = true; // 603 + }); // 604 + }); // 605 + }]); // 606 + // 607 +/***/ }, // 608 +/* 7 */ // 609 +/***/ function(module, exports, __webpack_require__) { // 610 + // 611 + 'use strict'; // 612 + // 613 + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /*global + angular, _, Tracker, EJSON, FS, Mongo + */ + // 617 + var _underscore = __webpack_require__(2); // 618 + // 619 + var _underscore2 = _interopRequireDefault(_underscore); // 620 + // 621 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 622 + // 623 + 'use strict'; // 624 + // 625 + var angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']); // 626 + // 627 angularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) { - // 565 - var self = this; // 566 - // 567 - this.autorun = function (scope, fn) { // 568 + // 629 + var self = this; // 630 + // 631 + this.autorun = function (scope, fn) { // 632 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 570 - // wrapping around Deps.autorun // 571 - var comp = Tracker.autorun(function (c) { // 572 - fn(c); // 573 - // this is run immediately for the first call // 574 - // but after that, we need to $apply to start Angular digest // 575 - if (!c.firstRun) $timeout(angular.noop, 0); // 576 - }); // 577 - // 578 - // stop autorun when scope is destroyed // 579 - scope.$on('$destroy', function () { // 580 - comp.stop(); // 581 - }); // 582 - // 583 - // return autorun object so that it can be stopped manually // 584 - return comp; // 585 - }; // 586 - // 587 - // Borrowed from angularFire // 588 - // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454 // 589 - this.stripDollarPrefixedKeys = function (data) { // 590 - if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data; - // 592 - var out = _.isArray(data) ? [] : {}; // 593 - // 594 - _.each(data, function (v, k) { // 595 - if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v); // 596 - }); // 597 - // 598 - return out; // 599 - }; // 600 - // 601 - // Returns a callback which fulfills promise // 602 - this.fulfill = function (deferred, boundError, boundResult) { // 603 - return function (err, result) { // 604 + // 634 + // wrapping around Deps.autorun // 635 + var comp = Tracker.autorun(function (c) { // 636 + fn(c); // 637 + // this is run immediately for the first call // 638 + // but after that, we need to $apply to start Angular digest // 639 + if (!c.firstRun) $timeout(angular.noop, 0); // 640 + }); // 641 + // 642 + // stop autorun when scope is destroyed // 643 + scope.$on('$destroy', function () { // 644 + comp.stop(); // 645 + }); // 646 + // 647 + // return autorun object so that it can be stopped manually // 648 + return comp; // 649 + }; // 650 + // 651 + // Borrowed from angularFire // 652 + // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454 // 653 + this.stripDollarPrefixedKeys = function (data) { // 654 + if (!_underscore2.default.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data; + // 656 + var out = _underscore2.default.isArray(data) ? [] : {}; // 657 + // 658 + _underscore2.default.each(data, function (v, k) { // 659 + if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v); // 660 + }); // 661 + // 662 + return out; // 663 + }; // 664 + // 665 + // Returns a callback which fulfills promise // 666 + this.fulfill = function (deferred, boundError, boundResult) { // 667 + return function (err, result) { // 668 if (err) deferred.reject(boundError == null ? err : boundError);else if (typeof boundResult == "function") deferred.resolve(boundResult == null ? result : boundResult(result));else deferred.resolve(boundResult == null ? result : boundResult); - }; // 606 - }; // 607 - // 608 - // creates a function which invokes method with the given arguments and returns a promise // 609 - this.promissor = function (obj, method) { // 610 - return function () { // 611 - var deferred = $q.defer(); // 612 - var fulfill = self.fulfill(deferred); // 613 - var args = _.toArray(arguments).concat(fulfill); // 614 - obj[method].apply(obj, args); // 615 - return deferred.promise; // 616 - }; // 617 - }; // 618 - // 619 - // creates a $q.all() promise and call digestion loop on fulfillment // 620 - this.promiseAll = function (promises) { // 621 - var allPromise = $q.all(promises); // 622 - // 623 - allPromise.finally(function () { // 624 - // calls digestion loop with no conflicts // 625 - $timeout(angular.noop); // 626 - }); // 627 - // 628 - return allPromise; // 629 - }; // 630 - // 631 - this.getCollectionByName = function (string) { // 632 - return Mongo.Collection.get(string); // 633 - }; // 634 - // 635 - this.findIndexById = function (collection, doc) { // 636 - var foundDoc = _.find(collection, function (colDoc) { // 637 - // EJSON.equals used to compare Mongo.ObjectIDs and Strings. // 638 - return EJSON.equals(colDoc._id, doc._id); // 639 - }); // 640 - // 641 - return _.indexOf(collection, foundDoc); // 642 - }; // 643 - }]); // 644 - // 645 - angularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) { // 646 - Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) { // 647 - return $meteorUtils.autorun(this, fn); // 648 - }; // 649 - }]); // 650 - // 651 -/***/ }, // 652 -/* 6 */ // 653 -/***/ function(module, exports) { // 654 - // 655 - /*global // 656 - angular, Meteor // 657 - */ // 658 - // 659 - 'use strict'; // 660 - // 661 - var angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']); // 662 - // 663 + }; // 670 + }; // 671 + // 672 + // creates a function which invokes method with the given arguments and returns a promise // 673 + this.promissor = function (obj, method) { // 674 + return function () { // 675 + var deferred = $q.defer(); // 676 + var fulfill = self.fulfill(deferred); // 677 + var args = _underscore2.default.toArray(arguments).concat(fulfill); // 678 + obj[method].apply(obj, args); // 679 + return deferred.promise; // 680 + }; // 681 + }; // 682 + // 683 + // creates a $q.all() promise and call digestion loop on fulfillment // 684 + this.promiseAll = function (promises) { // 685 + var allPromise = $q.all(promises); // 686 + // 687 + allPromise.finally(function () { // 688 + // calls digestion loop with no conflicts // 689 + $timeout(angular.noop); // 690 + }); // 691 + // 692 + return allPromise; // 693 + }; // 694 + // 695 + this.getCollectionByName = function (string) { // 696 + return Mongo.Collection.get(string); // 697 + }; // 698 + // 699 + this.findIndexById = function (collection, doc) { // 700 + var foundDoc = _underscore2.default.find(collection, function (colDoc) { // 701 + // EJSON.equals used to compare Mongo.ObjectIDs and Strings. // 702 + return EJSON.equals(colDoc._id, doc._id); // 703 + }); // 704 + // 705 + return _underscore2.default.indexOf(collection, foundDoc); // 706 + }; // 707 + }]); // 708 + // 709 + angularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) { // 710 + Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) { // 711 + return $meteorUtils.autorun(this, fn); // 712 + }; // 713 + }]); // 714 + // 715 +/***/ }, // 716 +/* 8 */ // 717 +/***/ function(module, exports) { // 718 + // 719 + /*global // 720 + angular, Meteor // 721 + */ // 722 + // 723 + 'use strict'; // 724 + // 725 + var angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']); // 726 + // 727 angularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) { - // 665 - var self = this; // 666 - // 667 - this._subscribe = function (scope, deferred, args) { // 668 + // 729 + var self = this; // 730 + // 731 + this._subscribe = function (scope, deferred, args) { // 732 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 670 - var subscription = null; // 671 - var lastArg = args[args.length - 1]; // 672 - // 673 - // User supplied onStop callback // 674 - // save it for later use and remove // 675 - // from subscription arguments // 676 - if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) { // 677 - var _onStop = lastArg.onStop; // 678 - // 679 - args.pop(); // 680 - } // 681 - // 682 - args.push({ // 683 - onReady: function onReady() { // 684 - deferred.resolve(subscription); // 685 - }, // 686 - onStop: function onStop(err) { // 687 - if (!deferred.promise.$$state.status) { // 688 + // 734 + var subscription = null; // 735 + var lastArg = args[args.length - 1]; // 736 + // 737 + // User supplied onStop callback // 738 + // save it for later use and remove // 739 + // from subscription arguments // 740 + if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) { // 741 + var _onStop = lastArg.onStop; // 742 + // 743 + args.pop(); // 744 + } // 745 + // 746 + args.push({ // 747 + onReady: function onReady() { // 748 + deferred.resolve(subscription); // 749 + }, // 750 + onStop: function onStop(err) { // 751 + if (!deferred.promise.$$state.status) { // 752 if (err) deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped", "Subscription stopped by a call to stop method. Either by the client or by the server.")); - } else if (_onStop) // 690 - // After promise was resolved or rejected // 691 - // call user supplied onStop callback. // 692 - _onStop.apply(this, Array.prototype.slice.call(arguments)); // 693 - } // 694 - }); // 695 - // 696 - subscription = Meteor.subscribe.apply(scope, args); // 697 - // 698 - return subscription; // 699 - }; // 700 - // 701 - this.subscribe = function () { // 702 - var deferred = $q.defer(); // 703 - var args = Array.prototype.slice.call(arguments); // 704 - var subscription = null; // 705 - // 706 - self._subscribe(this, deferred, args); // 707 - // 708 - return deferred.promise; // 709 - }; // 710 - }]); // 711 - // 712 - angularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) { - Object.getPrototypeOf($rootScope).$meteorSubscribe = function () { // 714 - var deferred = $q.defer(); // 715 - var args = Array.prototype.slice.call(arguments); // 716 - // 717 - var subscription = $meteorSubscribe._subscribe(this, deferred, args); // 718 - // 719 - this.$on('$destroy', function () { // 720 - subscription.stop(); // 721 - }); // 722 - // 723 - return deferred.promise; // 724 - }; // 725 - }]); // 726 - // 727 -/***/ }, // 728 -/* 7 */ // 729 -/***/ function(module, exports) { // 730 - // 731 - /*global // 732 - angular, _, Tracker, check, Match, Mongo // 733 - */ // 734 - // 735 - 'use strict'; // 736 - // 737 + } else if (_onStop) // 754 + // After promise was resolved or rejected // 755 + // call user supplied onStop callback. // 756 + _onStop.apply(this, Array.prototype.slice.call(arguments)); // 757 + } // 758 + }); // 759 + // 760 + subscription = Meteor.subscribe.apply(scope, args); // 761 + // 762 + return subscription; // 763 + }; // 764 + // 765 + this.subscribe = function () { // 766 + var deferred = $q.defer(); // 767 + var args = Array.prototype.slice.call(arguments); // 768 + var subscription = null; // 769 + // 770 + self._subscribe(this, deferred, args); // 771 + // 772 + return deferred.promise; // 773 + }; // 774 + }]); // 775 + // 776 + angularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) { // 777 + Object.getPrototypeOf($rootScope).$meteorSubscribe = function () { // 778 + var deferred = $q.defer(); // 779 + var args = Array.prototype.slice.call(arguments); // 780 + // 781 + var subscription = $meteorSubscribe._subscribe(this, deferred, args); // 782 + // 783 + this.$on('$destroy', function () { // 784 + subscription.stop(); // 785 + }); // 786 + // 787 + return deferred.promise; // 788 + }; // 789 + }]); // 790 + // 791 +/***/ }, // 792 +/* 9 */ // 793 +/***/ function(module, exports, __webpack_require__) { // 794 + // 795 + 'use strict'; // 796 + // 797 + var _underscore = __webpack_require__(2); // 798 + // 799 + var _underscore2 = _interopRequireDefault(_underscore); // 800 + // 801 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 802 + // 803 + 'use strict'; /*global // 804 + angular, _, Tracker, check, Match, Mongo // 805 + */ // 806 + // 807 var angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']); - // 739 - // The reason angular meteor collection is a factory function and not something // 740 - // that inherit from array comes from here: // 741 - // http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ // 742 - // We went with the direct extensions approach. // 743 + // 809 + // The reason angular meteor collection is a factory function and not something // 810 + // that inherit from array comes from here: // 811 + // http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ // 812 + // We went with the direct extensions approach. // 813 angularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) { - // 745 - function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) { // 746 + // 815 + function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) { // 816 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 748 - var data = []; // 749 - // Server backup data to evaluate what changes come from client // 750 - // after each server update. // 751 - data._serverBackup = []; // 752 - // Array differ function. // 753 - data._diffArrayFunc = diffArrayFunc; // 754 - // Handler of the cursor observer. // 755 - data._hObserve = null; // 756 - // On new cursor autorun handler // 757 - // (autorun for reactive variables). // 758 - data._hNewCurAutorun = null; // 759 - // On new data autorun handler // 760 - // (autorun for cursor.fetch). // 761 - data._hDataAutorun = null; // 762 - // 763 - if (angular.isDefined(collection)) { // 764 - data.$$collection = collection; // 765 - } else { // 766 - var cursor = curDefFunc(); // 767 - data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name); // 768 - } // 769 - // 770 - _.extend(data, AngularMeteorCollection); // 771 - data._startCurAutorun(curDefFunc, autoClientSave); // 772 - // 773 - return data; // 774 - } // 775 - // 776 - AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) { // 777 - var self = this; // 778 - // 779 - self._hNewCurAutorun = Tracker.autorun(function () { // 780 - // When the reactive func gets recomputated we need to stop any previous // 781 - // observeChanges. // 782 - Tracker.onInvalidate(function () { // 783 - self._stopCursor(); // 784 - }); // 785 - // 786 - if (autoClientSave) self._setAutoClientSave(); // 787 - self._updateCursor(curDefFunc(), autoClientSave); // 788 - }); // 789 - }; // 790 - // 791 - AngularMeteorCollection.subscribe = function () { // 792 - $meteorSubscribe.subscribe.apply(this, arguments); // 793 - return this; // 794 - }; // 795 - // 796 - AngularMeteorCollection.save = function (docs, useUnsetModifier) { // 797 - // save whole collection // 798 - if (!docs) docs = this; // 799 - // save single doc // 800 - docs = [].concat(docs); // 801 - // 802 - var promises = docs.map(function (doc) { // 803 - return this._upsertDoc(doc, useUnsetModifier); // 804 - }, this); // 805 - // 806 - return $meteorUtils.promiseAll(promises); // 807 - }; // 808 - // 809 - AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) { // 810 - var deferred = $q.defer(); // 811 - var collection = this.$$collection; // 812 - var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); // 813 - // 814 - // delete $$hashkey // 815 - doc = $meteorUtils.stripDollarPrefixedKeys(doc); // 816 - var docId = doc._id; // 817 - var isExist = collection.findOne(docId); // 818 - // 819 - // update // 820 - if (isExist) { // 821 - // Deletes _id property (from the copy) so that // 822 - // it can be $set using update. // 823 - delete doc._id; // 824 - var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc }; // 825 - // NOTE: do not use #upsert() method, since it does not exist in some collections // 826 - collection.update(docId, modifier, createFulfill(function () { // 827 - return { _id: docId, action: 'updated' }; // 828 - })); // 829 - } // 830 - // insert // 831 - else { // 832 - collection.insert(doc, createFulfill(function (id) { // 833 - return { _id: id, action: 'inserted' }; // 834 - })); // 835 - } // 836 - // 837 - return deferred.promise; // 838 - }; // 839 - // 840 - // performs $pull operations parallely. // 841 - // used for handling splice operations returned from getUpdates() to prevent conflicts. // 842 - // see issue: https://github.com/Urigo/angular-meteor/issues/793 // 843 - AngularMeteorCollection._updateDiff = function (selector, update, callback) { // 844 - callback = callback || angular.noop; // 845 - var setters = _.omit(update, '$pull'); // 846 - var updates = [setters]; // 847 - // 848 - _.each(update.$pull, function (pull, prop) { // 849 - var puller = {}; // 850 - puller[prop] = pull; // 851 - updates.push({ $pull: puller }); // 852 - }); // 853 - // 854 - this._updateParallel(selector, updates, callback); // 855 - }; // 856 - // 857 - // performs each update operation parallely // 858 - AngularMeteorCollection._updateParallel = function (selector, updates, callback) { // 859 - var self = this; // 860 - var done = _.after(updates.length, callback); // 861 - // 862 - var next = function next(err, affectedDocsNum) { // 863 - if (err) return callback(err); // 864 - done(null, affectedDocsNum); // 865 - }; // 866 - // 867 - _.each(updates, function (update) { // 868 - self.$$collection.update(selector, update, next); // 869 - }); // 870 - }; // 871 - // 872 - AngularMeteorCollection.remove = function (keyOrDocs) { // 873 - var keys; // 874 - // 875 - // remove whole collection // 876 - if (!keyOrDocs) { // 877 - keys = _.pluck(this, '_id'); // 878 - } // 879 - // remove docs // 880 - else { // 881 - keyOrDocs = [].concat(keyOrDocs); // 882 - // 883 - keys = _.map(keyOrDocs, function (keyOrDoc) { // 884 - return keyOrDoc._id || keyOrDoc; // 885 - }); // 886 - } // 887 - // 888 - // Checks if all keys are correct. // 889 - check(keys, [Match.OneOf(String, Mongo.ObjectID)]); // 890 - // 891 - var promises = keys.map(function (key) { // 892 - return this._removeDoc(key); // 893 - }, this); // 894 - // 895 - return $meteorUtils.promiseAll(promises); // 896 - }; // 897 - // 898 - AngularMeteorCollection._removeDoc = function (id) { // 899 - var deferred = $q.defer(); // 900 - var collection = this.$$collection; // 901 - var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' }); // 902 - collection.remove(id, fulfill); // 903 - return deferred.promise; // 904 - }; // 905 - // 906 - AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) { // 907 - var self = this; // 908 - // XXX - consider adding an option for a non-orderd result for faster performance // 909 - if (self._hObserve) self._stopObserving(); // 910 - // 911 - self._hObserve = cursor.observe({ // 912 - addedAt: function addedAt(doc, atIndex) { // 913 - self.splice(atIndex, 0, doc); // 914 - self._serverBackup.splice(atIndex, 0, doc); // 915 - self._setServerUpdateMode(); // 916 - }, // 917 - // 918 - changedAt: function changedAt(doc, oldDoc, atIndex) { // 919 - diffArray.deepCopyChanges(self[atIndex], doc); // 920 - diffArray.deepCopyRemovals(self[atIndex], doc); // 921 - self._serverBackup[atIndex] = self[atIndex]; // 922 - self._setServerUpdateMode(); // 923 - }, // 924 - // 925 - movedTo: function movedTo(doc, fromIndex, toIndex) { // 926 - self.splice(fromIndex, 1); // 927 - self.splice(toIndex, 0, doc); // 928 - self._serverBackup.splice(fromIndex, 1); // 929 - self._serverBackup.splice(toIndex, 0, doc); // 930 - self._setServerUpdateMode(); // 931 - }, // 932 - // 933 - removedAt: function removedAt(oldDoc) { // 934 - var removedIndex = $meteorUtils.findIndexById(self, oldDoc); // 935 - // 936 - if (removedIndex != -1) { // 937 - self.splice(removedIndex, 1); // 938 - self._serverBackup.splice(removedIndex, 1); // 939 - self._setServerUpdateMode(); // 940 - } else { // 941 - // If it's been removed on client then it's already not in collection // 942 - // itself but still is in the _serverBackup. // 943 - removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc); // 944 - // 945 - if (removedIndex != -1) { // 946 - self._serverBackup.splice(removedIndex, 1); // 947 - } // 948 - } // 949 - } // 950 - }); // 951 - // 952 - self._hDataAutorun = Tracker.autorun(function () { // 953 - cursor.fetch(); // 954 - if (self._serverMode) self._unsetServerUpdateMode(autoClientSave); // 955 - }); // 956 - }; // 957 - // 958 - AngularMeteorCollection._stopObserving = function () { // 959 - this._hObserve.stop(); // 960 - this._hDataAutorun.stop(); // 961 - delete this._serverMode; // 962 - delete this._hUnsetTimeout; // 963 - }; // 964 - // 965 - AngularMeteorCollection._setServerUpdateMode = function (name) { // 966 - this._serverMode = true; // 967 - // To simplify server update logic, we don't follow // 968 - // updates from the client at the same time. // 969 - this._unsetAutoClientSave(); // 970 - }; // 971 - // 972 - // Here we use $timeout to combine multiple updates that go // 973 - // each one after another. // 974 - AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) { // 975 - var self = this; // 976 - // 977 - if (self._hUnsetTimeout) { // 978 - $timeout.cancel(self._hUnsetTimeout); // 979 - self._hUnsetTimeout = null; // 980 - } // 981 - // 982 - self._hUnsetTimeout = $timeout(function () { // 983 - self._serverMode = false; // 984 - // Finds updates that was potentially done from the client side // 985 - // and saves them. // 986 - var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc); // 987 - self._saveChanges(changes); // 988 - // After, continues following client updates. // 989 - if (autoClientSave) self._setAutoClientSave(); // 990 - }, 0); // 991 - }; // 992 - // 993 - AngularMeteorCollection.stop = function () { // 994 - this._stopCursor(); // 995 - this._hNewCurAutorun.stop(); // 996 - }; // 997 - // 998 - AngularMeteorCollection._stopCursor = function () { // 999 - this._unsetAutoClientSave(); // 1000 - // 1001 - if (this._hObserve) { // 1002 - this._hObserve.stop(); // 1003 - this._hDataAutorun.stop(); // 1004 - } // 1005 - // 1006 - this.splice(0); // 1007 - this._serverBackup.splice(0); // 1008 - }; // 1009 - // 1010 - AngularMeteorCollection._unsetAutoClientSave = function (name) { // 1011 - if (this._hRegAutoBind) { // 1012 - this._hRegAutoBind(); // 1013 - this._hRegAutoBind = null; // 1014 - } // 1015 - }; // 1016 - // 1017 - AngularMeteorCollection._setAutoClientSave = function () { // 1018 - var self = this; // 1019 - // 1020 - // Always unsets auto save to keep only one $watch handler. // 1021 - self._unsetAutoClientSave(); // 1022 - // 1023 - self._hRegAutoBind = $rootScope.$watch(function () { // 1024 - return self; // 1025 - }, function (nItems, oItems) { // 1026 - if (nItems === oItems) return; // 1027 - // 1028 - var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc); // 1029 - self._unsetAutoClientSave(); // 1030 - self._saveChanges(changes); // 1031 - self._setAutoClientSave(); // 1032 - }, true); // 1033 - }; // 1034 - // 1035 - AngularMeteorCollection._saveChanges = function (changes) { // 1036 - var self = this; // 1037 - // 1038 - // Saves added documents // 1039 - // Using reversed iteration to prevent indexes from changing during splice // 1040 - var addedDocs = changes.added.reverse().map(function (descriptor) { // 1041 - self.splice(descriptor.index, 1); // 1042 - return descriptor.item; // 1043 - }); // 1044 - // 1045 - if (addedDocs.length) self.save(addedDocs); // 1046 - // 1047 - // Removes deleted documents // 1048 - var removedDocs = changes.removed.map(function (descriptor) { // 1049 - return descriptor.item; // 1050 - }); // 1051 - // 1052 - if (removedDocs.length) self.remove(removedDocs); // 1053 - // 1054 - // Updates changed documents // 1055 - changes.changed.forEach(function (descriptor) { // 1056 - self._updateDiff(descriptor.selector, descriptor.modifier); // 1057 - }); // 1058 - }; // 1059 - // 1060 - return AngularMeteorCollection; // 1061 - }]); // 1062 - // 1063 + // 818 + var data = []; // 819 + // Server backup data to evaluate what changes come from client // 820 + // after each server update. // 821 + data._serverBackup = []; // 822 + // Array differ function. // 823 + data._diffArrayFunc = diffArrayFunc; // 824 + // Handler of the cursor observer. // 825 + data._hObserve = null; // 826 + // On new cursor autorun handler // 827 + // (autorun for reactive variables). // 828 + data._hNewCurAutorun = null; // 829 + // On new data autorun handler // 830 + // (autorun for cursor.fetch). // 831 + data._hDataAutorun = null; // 832 + // 833 + if (angular.isDefined(collection)) { // 834 + data.$$collection = collection; // 835 + } else { // 836 + var cursor = curDefFunc(); // 837 + data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name); // 838 + } // 839 + // 840 + _underscore2.default.extend(data, AngularMeteorCollection); // 841 + data._startCurAutorun(curDefFunc, autoClientSave); // 842 + // 843 + return data; // 844 + } // 845 + // 846 + AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) { // 847 + var self = this; // 848 + // 849 + self._hNewCurAutorun = Tracker.autorun(function () { // 850 + // When the reactive func gets recomputated we need to stop any previous // 851 + // observeChanges. // 852 + Tracker.onInvalidate(function () { // 853 + self._stopCursor(); // 854 + }); // 855 + // 856 + if (autoClientSave) self._setAutoClientSave(); // 857 + self._updateCursor(curDefFunc(), autoClientSave); // 858 + }); // 859 + }; // 860 + // 861 + AngularMeteorCollection.subscribe = function () { // 862 + $meteorSubscribe.subscribe.apply(this, arguments); // 863 + return this; // 864 + }; // 865 + // 866 + AngularMeteorCollection.save = function (docs, useUnsetModifier) { // 867 + // save whole collection // 868 + if (!docs) docs = this; // 869 + // save single doc // 870 + docs = [].concat(docs); // 871 + // 872 + var promises = docs.map(function (doc) { // 873 + return this._upsertDoc(doc, useUnsetModifier); // 874 + }, this); // 875 + // 876 + return $meteorUtils.promiseAll(promises); // 877 + }; // 878 + // 879 + AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) { // 880 + var deferred = $q.defer(); // 881 + var collection = this.$$collection; // 882 + var createFulfill = _underscore2.default.partial($meteorUtils.fulfill, deferred, null); // 883 + // 884 + // delete $$hashkey // 885 + doc = $meteorUtils.stripDollarPrefixedKeys(doc); // 886 + var docId = doc._id; // 887 + var isExist = collection.findOne(docId); // 888 + // 889 + // update // 890 + if (isExist) { // 891 + // Deletes _id property (from the copy) so that // 892 + // it can be $set using update. // 893 + delete doc._id; // 894 + var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc }; // 895 + // NOTE: do not use #upsert() method, since it does not exist in some collections // 896 + collection.update(docId, modifier, createFulfill(function () { // 897 + return { _id: docId, action: 'updated' }; // 898 + })); // 899 + } // 900 + // insert // 901 + else { // 902 + collection.insert(doc, createFulfill(function (id) { // 903 + return { _id: id, action: 'inserted' }; // 904 + })); // 905 + } // 906 + // 907 + return deferred.promise; // 908 + }; // 909 + // 910 + // performs $pull operations parallely. // 911 + // used for handling splice operations returned from getUpdates() to prevent conflicts. // 912 + // see issue: https://github.com/Urigo/angular-meteor/issues/793 // 913 + AngularMeteorCollection._updateDiff = function (selector, update, callback) { // 914 + callback = callback || angular.noop; // 915 + var setters = _underscore2.default.omit(update, '$pull'); // 916 + var updates = [setters]; // 917 + // 918 + _underscore2.default.each(update.$pull, function (pull, prop) { // 919 + var puller = {}; // 920 + puller[prop] = pull; // 921 + updates.push({ $pull: puller }); // 922 + }); // 923 + // 924 + this._updateParallel(selector, updates, callback); // 925 + }; // 926 + // 927 + // performs each update operation parallely // 928 + AngularMeteorCollection._updateParallel = function (selector, updates, callback) { // 929 + var self = this; // 930 + var done = _underscore2.default.after(updates.length, callback); // 931 + // 932 + var next = function next(err, affectedDocsNum) { // 933 + if (err) return callback(err); // 934 + done(null, affectedDocsNum); // 935 + }; // 936 + // 937 + _underscore2.default.each(updates, function (update) { // 938 + self.$$collection.update(selector, update, next); // 939 + }); // 940 + }; // 941 + // 942 + AngularMeteorCollection.remove = function (keyOrDocs) { // 943 + var keys; // 944 + // 945 + // remove whole collection // 946 + if (!keyOrDocs) { // 947 + keys = _underscore2.default.pluck(this, '_id'); // 948 + } // 949 + // remove docs // 950 + else { // 951 + keyOrDocs = [].concat(keyOrDocs); // 952 + // 953 + keys = _underscore2.default.map(keyOrDocs, function (keyOrDoc) { // 954 + return keyOrDoc._id || keyOrDoc; // 955 + }); // 956 + } // 957 + // 958 + // Checks if all keys are correct. // 959 + check(keys, [Match.OneOf(String, Mongo.ObjectID)]); // 960 + // 961 + var promises = keys.map(function (key) { // 962 + return this._removeDoc(key); // 963 + }, this); // 964 + // 965 + return $meteorUtils.promiseAll(promises); // 966 + }; // 967 + // 968 + AngularMeteorCollection._removeDoc = function (id) { // 969 + var deferred = $q.defer(); // 970 + var collection = this.$$collection; // 971 + var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' }); // 972 + collection.remove(id, fulfill); // 973 + return deferred.promise; // 974 + }; // 975 + // 976 + AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) { // 977 + var self = this; // 978 + // XXX - consider adding an option for a non-orderd result for faster performance // 979 + if (self._hObserve) self._stopObserving(); // 980 + // 981 + self._hObserve = cursor.observe({ // 982 + addedAt: function addedAt(doc, atIndex) { // 983 + self.splice(atIndex, 0, doc); // 984 + self._serverBackup.splice(atIndex, 0, doc); // 985 + self._setServerUpdateMode(); // 986 + }, // 987 + // 988 + changedAt: function changedAt(doc, oldDoc, atIndex) { // 989 + diffArray.deepCopyChanges(self[atIndex], doc); // 990 + diffArray.deepCopyRemovals(self[atIndex], doc); // 991 + self._serverBackup[atIndex] = self[atIndex]; // 992 + self._setServerUpdateMode(); // 993 + }, // 994 + // 995 + movedTo: function movedTo(doc, fromIndex, toIndex) { // 996 + self.splice(fromIndex, 1); // 997 + self.splice(toIndex, 0, doc); // 998 + self._serverBackup.splice(fromIndex, 1); // 999 + self._serverBackup.splice(toIndex, 0, doc); // 1000 + self._setServerUpdateMode(); // 1001 + }, // 1002 + // 1003 + removedAt: function removedAt(oldDoc) { // 1004 + var removedIndex = $meteorUtils.findIndexById(self, oldDoc); // 1005 + // 1006 + if (removedIndex != -1) { // 1007 + self.splice(removedIndex, 1); // 1008 + self._serverBackup.splice(removedIndex, 1); // 1009 + self._setServerUpdateMode(); // 1010 + } else { // 1011 + // If it's been removed on client then it's already not in collection // 1012 + // itself but still is in the _serverBackup. // 1013 + removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc); // 1014 + // 1015 + if (removedIndex != -1) { // 1016 + self._serverBackup.splice(removedIndex, 1); // 1017 + } // 1018 + } // 1019 + } // 1020 + }); // 1021 + // 1022 + self._hDataAutorun = Tracker.autorun(function () { // 1023 + cursor.fetch(); // 1024 + if (self._serverMode) self._unsetServerUpdateMode(autoClientSave); // 1025 + }); // 1026 + }; // 1027 + // 1028 + AngularMeteorCollection._stopObserving = function () { // 1029 + this._hObserve.stop(); // 1030 + this._hDataAutorun.stop(); // 1031 + delete this._serverMode; // 1032 + delete this._hUnsetTimeout; // 1033 + }; // 1034 + // 1035 + AngularMeteorCollection._setServerUpdateMode = function (name) { // 1036 + this._serverMode = true; // 1037 + // To simplify server update logic, we don't follow // 1038 + // updates from the client at the same time. // 1039 + this._unsetAutoClientSave(); // 1040 + }; // 1041 + // 1042 + // Here we use $timeout to combine multiple updates that go // 1043 + // each one after another. // 1044 + AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) { // 1045 + var self = this; // 1046 + // 1047 + if (self._hUnsetTimeout) { // 1048 + $timeout.cancel(self._hUnsetTimeout); // 1049 + self._hUnsetTimeout = null; // 1050 + } // 1051 + // 1052 + self._hUnsetTimeout = $timeout(function () { // 1053 + self._serverMode = false; // 1054 + // Finds updates that was potentially done from the client side // 1055 + // and saves them. // 1056 + var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc); // 1057 + self._saveChanges(changes); // 1058 + // After, continues following client updates. // 1059 + if (autoClientSave) self._setAutoClientSave(); // 1060 + }, 0); // 1061 + }; // 1062 + // 1063 + AngularMeteorCollection.stop = function () { // 1064 + this._stopCursor(); // 1065 + this._hNewCurAutorun.stop(); // 1066 + }; // 1067 + // 1068 + AngularMeteorCollection._stopCursor = function () { // 1069 + this._unsetAutoClientSave(); // 1070 + // 1071 + if (this._hObserve) { // 1072 + this._hObserve.stop(); // 1073 + this._hDataAutorun.stop(); // 1074 + } // 1075 + // 1076 + this.splice(0); // 1077 + this._serverBackup.splice(0); // 1078 + }; // 1079 + // 1080 + AngularMeteorCollection._unsetAutoClientSave = function (name) { // 1081 + if (this._hRegAutoBind) { // 1082 + this._hRegAutoBind(); // 1083 + this._hRegAutoBind = null; // 1084 + } // 1085 + }; // 1086 + // 1087 + AngularMeteorCollection._setAutoClientSave = function () { // 1088 + var self = this; // 1089 + // 1090 + // Always unsets auto save to keep only one $watch handler. // 1091 + self._unsetAutoClientSave(); // 1092 + // 1093 + self._hRegAutoBind = $rootScope.$watch(function () { // 1094 + return self; // 1095 + }, function (nItems, oItems) { // 1096 + if (nItems === oItems) return; // 1097 + // 1098 + var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc); // 1099 + self._unsetAutoClientSave(); // 1100 + self._saveChanges(changes); // 1101 + self._setAutoClientSave(); // 1102 + }, true); // 1103 + }; // 1104 + // 1105 + AngularMeteorCollection._saveChanges = function (changes) { // 1106 + var self = this; // 1107 + // 1108 + // Saves added documents // 1109 + // Using reversed iteration to prevent indexes from changing during splice // 1110 + var addedDocs = changes.added.reverse().map(function (descriptor) { // 1111 + self.splice(descriptor.index, 1); // 1112 + return descriptor.item; // 1113 + }); // 1114 + // 1115 + if (addedDocs.length) self.save(addedDocs); // 1116 + // 1117 + // Removes deleted documents // 1118 + var removedDocs = changes.removed.map(function (descriptor) { // 1119 + return descriptor.item; // 1120 + }); // 1121 + // 1122 + if (removedDocs.length) self.remove(removedDocs); // 1123 + // 1124 + // Updates changed documents // 1125 + changes.changed.forEach(function (descriptor) { // 1126 + self._updateDiff(descriptor.selector, descriptor.modifier); // 1127 + }); // 1128 + }; // 1129 + // 1130 + return AngularMeteorCollection; // 1131 + }]); // 1132 + // 1133 angularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) { - function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) { // 1065 - // 1066 + function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) { // 1135 + // 1136 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow); // 1068 - } // 1069 - // 1070 - return $meteorCollectionFS; // 1071 - }]); // 1072 - // 1073 + return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow); // 1138 + } // 1139 + // 1140 + return $meteorCollectionFS; // 1141 + }]); // 1142 + // 1143 angularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) { - function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) { // 1075 - // Validate parameters // 1076 - if (!reactiveFunc) { // 1077 - throw new TypeError('The first argument of $meteorCollection is undefined.'); // 1078 - } // 1079 - // 1080 - if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) { // 1081 + function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) { // 1145 + // Validate parameters // 1146 + if (!reactiveFunc) { // 1147 + throw new TypeError('The first argument of $meteorCollection is undefined.'); // 1148 + } // 1149 + // 1150 + if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) { // 1151 throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.'); - } // 1083 - // 1084 - if (!angular.isFunction(reactiveFunc)) { // 1085 - collection = angular.isDefined(collection) ? collection : reactiveFunc; // 1086 - reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc); // 1087 - } // 1088 - // 1089 - // By default auto save - true. // 1090 - autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true; // 1091 - diffFn = diffFn || diffArray; // 1092 - return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave); // 1093 - } // 1094 - // 1095 - return $meteorCollection; // 1096 - }]); // 1097 - // 1098 + } // 1153 + // 1154 + if (!angular.isFunction(reactiveFunc)) { // 1155 + collection = angular.isDefined(collection) ? collection : reactiveFunc; // 1156 + reactiveFunc = _underscore2.default.bind(reactiveFunc.find, reactiveFunc); // 1157 + } // 1158 + // 1159 + // By default auto save - true. // 1160 + autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true; // 1161 + diffFn = diffFn || diffArray; // 1162 + return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave); // 1163 + } // 1164 + // 1165 + return $meteorCollection; // 1166 + }]); // 1167 + // 1168 angularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) { - var scopeProto = Object.getPrototypeOf($rootScope); // 1100 - scopeProto.$meteorCollection = $meteorStopper($meteorCollection); // 1101 - scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS); // 1102 - }]); // 1103 - // 1104 -/***/ }, // 1105 -/* 8 */ // 1106 -/***/ function(module, exports) { // 1107 - // 1108 - /*global // 1109 - angular, _, Mongo // 1110 - */ // 1111 - // 1112 - 'use strict'; // 1113 - // 1114 + var scopeProto = Object.getPrototypeOf($rootScope); // 1170 + scopeProto.$meteorCollection = $meteorStopper($meteorCollection); // 1171 + scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS); // 1172 + }]); // 1173 + // 1174 +/***/ }, // 1175 +/* 10 */ // 1176 +/***/ function(module, exports, __webpack_require__) { // 1177 + // 1178 + 'use strict'; // 1179 + // 1180 + var _underscore = __webpack_require__(2); // 1181 + // 1182 + var _underscore2 = _interopRequireDefault(_underscore); // 1183 + // 1184 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 1185 + // 1186 + 'use strict'; /*global // 1187 + angular, _, Mongo // 1188 + */ // 1189 + // 1190 var angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']); - // 1116 + // 1192 angularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) { - // 1118 - // A list of internals properties to not watch for, nor pass to the Document on update and etc. // 1119 + // 1194 + // A list of internals properties to not watch for, nor pass to the Document on update and etc. // 1195 AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId']; - // 1121 - function AngularMeteorObject(collection, selector, options) { // 1122 + // 1197 + function AngularMeteorObject(collection, selector, options) { // 1198 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // Make data not be an object so we can extend it to preserve // 1124 - // Collection Helpers and the like // 1125 - var helpers = collection._helpers; // 1126 - var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {}; // 1127 - var doc = collection.findOne(selector, options); // 1128 - var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel'); // 1129 - _.extend(data, doc); // 1130 - _.extend(data, AngularMeteorObject); // 1131 - _.extend(data, collectionExtension); // 1132 - // 1133 - // Omit options that may spoil document finding // 1134 - data.$$options = _.omit(options, 'skip', 'limit'); // 1135 - data.$$collection = collection; // 1136 - data.$$id = data._getId(selector); // 1137 - data._serverBackup = doc || {}; // 1138 - // 1139 - return data; // 1140 - } // 1141 - // 1142 - AngularMeteorObject.getRawObject = function () { // 1143 - return angular.copy(_.omit(this, this.$$internalProps)); // 1144 - }; // 1145 - // 1146 - AngularMeteorObject.subscribe = function () { // 1147 - $meteorSubscribe.subscribe.apply(this, arguments); // 1148 - return this; // 1149 - }; // 1150 - // 1151 - AngularMeteorObject.save = function (custom) { // 1152 - var deferred = $q.defer(); // 1153 - var collection = this.$$collection; // 1154 - var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); // 1155 - var oldDoc = collection.findOne(this.$$id); // 1156 - var mods; // 1157 - // 1158 - // update // 1159 - if (oldDoc) { // 1160 - if (custom) mods = { $set: custom };else { // 1161 - mods = getUpdates(oldDoc, this.getRawObject()); // 1162 - // If there are no updates, there is nothing to do here, returning // 1163 - if (_.isEmpty(mods)) { // 1164 - return $q.when({ action: 'updated' }); // 1165 - } // 1166 - } // 1167 - // 1168 - // NOTE: do not use #upsert() method, since it does not exist in some collections // 1169 - this._updateDiff(mods, createFulfill({ action: 'updated' })); // 1170 - } // 1171 - // insert // 1172 - else { // 1173 - if (custom) mods = _.clone(custom);else mods = this.getRawObject(); // 1174 - // 1175 - mods._id = mods._id || this.$$id; // 1176 - collection.insert(mods, createFulfill({ action: 'inserted' })); // 1177 - } // 1178 - // 1179 - return deferred.promise; // 1180 - }; // 1181 - // 1182 - AngularMeteorObject._updateDiff = function (update, callback) { // 1183 - var selector = this.$$id; // 1184 - AngularMeteorCollection._updateDiff.call(this, selector, update, callback); // 1185 - }; // 1186 - // 1187 - AngularMeteorObject.reset = function (keepClientProps) { // 1188 - var self = this; // 1189 - var options = this.$$options; // 1190 - var id = this.$$id; // 1191 - var doc = this.$$collection.findOne(id, options); // 1192 - // 1193 - if (doc) { // 1194 - // extend SubObject // 1195 - var docKeys = _.keys(doc); // 1196 - var docExtension = _.pick(doc, docKeys); // 1197 - var clientProps; // 1198 - // 1199 - _.extend(self, docExtension); // 1200 - _.extend(self._serverBackup, docExtension); // 1201 - // 1202 - if (keepClientProps) { // 1203 - clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup)); // 1204 - } else { // 1205 - clientProps = _.keys(self); // 1206 - } // 1207 - // 1208 - var serverProps = _.keys(doc); // 1209 - var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps); // 1210 - // 1211 - removedKeys.forEach(function (prop) { // 1212 - delete self[prop]; // 1213 - delete self._serverBackup[prop]; // 1214 - }); // 1215 - } else { // 1216 - _.keys(this.getRawObject()).forEach(function (prop) { // 1217 - delete self[prop]; // 1218 - }); // 1219 - // 1220 - self._serverBackup = {}; // 1221 - } // 1222 - }; // 1223 - // 1224 - AngularMeteorObject.stop = function () { // 1225 - if (this.unregisterAutoDestroy) this.unregisterAutoDestroy(); // 1226 - // 1227 - if (this.unregisterAutoBind) this.unregisterAutoBind(); // 1228 - // 1229 - if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop(); // 1230 - }; // 1231 - // 1232 - AngularMeteorObject._getId = function (selector) { // 1233 - var options = _.extend({}, this.$$options, { // 1234 - fields: { _id: 1 }, // 1235 - reactive: false, // 1236 - transform: null // 1237 - }); // 1238 - // 1239 - var doc = this.$$collection.findOne(selector, options); // 1240 - // 1241 - if (doc) return doc._id; // 1242 - if (selector instanceof Mongo.ObjectID) return selector; // 1243 - if (_.isString(selector)) return selector; // 1244 - return new Mongo.ObjectID(); // 1245 - }; // 1246 - // 1247 - return AngularMeteorObject; // 1248 - }]); // 1249 - // 1250 + // Make data not be an object so we can extend it to preserve // 1200 + // Collection Helpers and the like // 1201 + var helpers = collection._helpers; // 1202 + var data = _underscore2.default.isFunction(helpers) ? Object.create(helpers.prototype) : {}; // 1203 + var doc = collection.findOne(selector, options); // 1204 + var collectionExtension = _underscore2.default.pick(AngularMeteorCollection, '_updateParallel'); // 1205 + _underscore2.default.extend(data, doc); // 1206 + _underscore2.default.extend(data, AngularMeteorObject); // 1207 + _underscore2.default.extend(data, collectionExtension); // 1208 + // 1209 + // Omit options that may spoil document finding // 1210 + data.$$options = _underscore2.default.omit(options, 'skip', 'limit'); // 1211 + data.$$collection = collection; // 1212 + data.$$id = data._getId(selector); // 1213 + data._serverBackup = doc || {}; // 1214 + // 1215 + return data; // 1216 + } // 1217 + // 1218 + AngularMeteorObject.getRawObject = function () { // 1219 + return angular.copy(_underscore2.default.omit(this, this.$$internalProps)); // 1220 + }; // 1221 + // 1222 + AngularMeteorObject.subscribe = function () { // 1223 + $meteorSubscribe.subscribe.apply(this, arguments); // 1224 + return this; // 1225 + }; // 1226 + // 1227 + AngularMeteorObject.save = function (custom) { // 1228 + var deferred = $q.defer(); // 1229 + var collection = this.$$collection; // 1230 + var createFulfill = _underscore2.default.partial($meteorUtils.fulfill, deferred, null); // 1231 + var oldDoc = collection.findOne(this.$$id); // 1232 + var mods; // 1233 + // 1234 + // update // 1235 + if (oldDoc) { // 1236 + if (custom) mods = { $set: custom };else { // 1237 + mods = getUpdates(oldDoc, this.getRawObject()); // 1238 + // If there are no updates, there is nothing to do here, returning // 1239 + if (_underscore2.default.isEmpty(mods)) { // 1240 + return $q.when({ action: 'updated' }); // 1241 + } // 1242 + } // 1243 + // 1244 + // NOTE: do not use #upsert() method, since it does not exist in some collections // 1245 + this._updateDiff(mods, createFulfill({ action: 'updated' })); // 1246 + } // 1247 + // insert // 1248 + else { // 1249 + if (custom) mods = _underscore2.default.clone(custom);else mods = this.getRawObject(); // 1250 + // 1251 + mods._id = mods._id || this.$$id; // 1252 + collection.insert(mods, createFulfill({ action: 'inserted' })); // 1253 + } // 1254 + // 1255 + return deferred.promise; // 1256 + }; // 1257 + // 1258 + AngularMeteorObject._updateDiff = function (update, callback) { // 1259 + var selector = this.$$id; // 1260 + AngularMeteorCollection._updateDiff.call(this, selector, update, callback); // 1261 + }; // 1262 + // 1263 + AngularMeteorObject.reset = function (keepClientProps) { // 1264 + var self = this; // 1265 + var options = this.$$options; // 1266 + var id = this.$$id; // 1267 + var doc = this.$$collection.findOne(id, options); // 1268 + // 1269 + if (doc) { // 1270 + // extend SubObject // 1271 + var docKeys = _underscore2.default.keys(doc); // 1272 + var docExtension = _underscore2.default.pick(doc, docKeys); // 1273 + var clientProps; // 1274 + // 1275 + _underscore2.default.extend(self, docExtension); // 1276 + _underscore2.default.extend(self._serverBackup, docExtension); // 1277 + // 1278 + if (keepClientProps) { // 1279 + clientProps = _underscore2.default.intersection(_underscore2.default.keys(self), _underscore2.default.keys(self._serverBackup)); + } else { // 1281 + clientProps = _underscore2.default.keys(self); // 1282 + } // 1283 + // 1284 + var serverProps = _underscore2.default.keys(doc); // 1285 + var removedKeys = _underscore2.default.difference(clientProps, serverProps, self.$$internalProps); // 1286 + // 1287 + removedKeys.forEach(function (prop) { // 1288 + delete self[prop]; // 1289 + delete self._serverBackup[prop]; // 1290 + }); // 1291 + } else { // 1292 + _underscore2.default.keys(this.getRawObject()).forEach(function (prop) { // 1293 + delete self[prop]; // 1294 + }); // 1295 + // 1296 + self._serverBackup = {}; // 1297 + } // 1298 + }; // 1299 + // 1300 + AngularMeteorObject.stop = function () { // 1301 + if (this.unregisterAutoDestroy) this.unregisterAutoDestroy(); // 1302 + // 1303 + if (this.unregisterAutoBind) this.unregisterAutoBind(); // 1304 + // 1305 + if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop(); // 1306 + }; // 1307 + // 1308 + AngularMeteorObject._getId = function (selector) { // 1309 + var options = _underscore2.default.extend({}, this.$$options, { // 1310 + fields: { _id: 1 }, // 1311 + reactive: false, // 1312 + transform: null // 1313 + }); // 1314 + // 1315 + var doc = this.$$collection.findOne(selector, options); // 1316 + // 1317 + if (doc) return doc._id; // 1318 + if (selector instanceof Mongo.ObjectID) return selector; // 1319 + if (_underscore2.default.isString(selector)) return selector; // 1320 + return new Mongo.ObjectID(); // 1321 + }; // 1322 + // 1323 + return AngularMeteorObject; // 1324 + }]); // 1325 + // 1326 angularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) { - function $meteorObject(collection, id, auto, options) { // 1252 - // Validate parameters // 1253 - if (!collection) { // 1254 - throw new TypeError("The first argument of $meteorObject is undefined."); // 1255 - } // 1256 - // 1257 - if (!angular.isFunction(collection.findOne)) { // 1258 + function $meteorObject(collection, id, auto, options) { // 1328 + // Validate parameters // 1329 + if (!collection) { // 1330 + throw new TypeError("The first argument of $meteorObject is undefined."); // 1331 + } // 1332 + // 1333 + if (!angular.isFunction(collection.findOne)) { // 1334 throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property."); - } // 1260 - // 1261 - var data = new AngularMeteorObject(collection, id, options); // 1262 - // Making auto default true - http://stackoverflow.com/a/15464208/1426570 // 1263 - data._auto = auto !== false; // 1264 - _.extend(data, $meteorObject); // 1265 - data._setAutos(); // 1266 - return data; // 1267 - } // 1268 - // 1269 - $meteorObject._setAutos = function () { // 1270 - var self = this; // 1271 - // 1272 - this.autorunComputation = $meteorUtils.autorun($rootScope, function () { // 1273 - self.reset(true); // 1274 - }); // 1275 - // 1276 - // Deep watches the model and performs autobind // 1277 - this.unregisterAutoBind = this._auto && $rootScope.$watch(function () { // 1278 - return self.getRawObject(); // 1279 - }, function (item, oldItem) { // 1280 - if (item !== oldItem) self.save(); // 1281 - }, true); // 1282 - // 1283 - this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () { // 1284 - if (self && self.stop) self.pop(); // 1285 - }); // 1286 - }; // 1287 - // 1288 - return $meteorObject; // 1289 - }]); // 1290 - // 1291 + } // 1336 + // 1337 + var data = new AngularMeteorObject(collection, id, options); // 1338 + // Making auto default true - http://stackoverflow.com/a/15464208/1426570 // 1339 + data._auto = auto !== false; // 1340 + _underscore2.default.extend(data, $meteorObject); // 1341 + data._setAutos(); // 1342 + return data; // 1343 + } // 1344 + // 1345 + $meteorObject._setAutos = function () { // 1346 + var self = this; // 1347 + // 1348 + this.autorunComputation = $meteorUtils.autorun($rootScope, function () { // 1349 + self.reset(true); // 1350 + }); // 1351 + // 1352 + // Deep watches the model and performs autobind // 1353 + this.unregisterAutoBind = this._auto && $rootScope.$watch(function () { // 1354 + return self.getRawObject(); // 1355 + }, function (item, oldItem) { // 1356 + if (item !== oldItem) self.save(); // 1357 + }, true); // 1358 + // 1359 + this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () { // 1360 + if (self && self.stop) self.pop(); // 1361 + }); // 1362 + }; // 1363 + // 1364 + return $meteorObject; // 1365 + }]); // 1366 + // 1367 angularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) { - var scopeProto = Object.getPrototypeOf($rootScope); // 1293 - scopeProto.$meteorObject = $meteorStopper($meteorObject); // 1294 - }]); // 1295 - // 1296 -/***/ }, // 1297 -/* 9 */ // 1298 -/***/ function(module, exports) { // 1299 - // 1300 - /*global // 1301 - angular, _, Package, Meteor // 1302 - */ // 1303 - // 1304 - 'use strict'; // 1305 - // 1306 + var scopeProto = Object.getPrototypeOf($rootScope); // 1369 + scopeProto.$meteorObject = $meteorStopper($meteorObject); // 1370 + }]); // 1371 + // 1372 +/***/ }, // 1373 +/* 11 */ // 1374 +/***/ function(module, exports, __webpack_require__) { // 1375 + // 1376 + 'use strict'; // 1377 + // 1378 + var _underscore = __webpack_require__(2); // 1379 + // 1380 + var _underscore2 = _interopRequireDefault(_underscore); // 1381 + // 1382 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 1383 + // 1384 + 'use strict'; /*global // 1385 + angular, _, Package, Meteor // 1386 + */ // 1387 + // 1388 var angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core', 'angular-meteor.settings']); - // 1308 - // requires package 'accounts-password' // 1309 + // 1390 + // requires package 'accounts-password' // 1391 angularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) { - // 1311 - var pack = Package['accounts-base']; // 1312 - if (!pack) return; // 1313 - // 1314 - var self = this; // 1315 - var Accounts = pack.Accounts; // 1316 - // 1317 - this.waitForUser = function () { // 1318 + // 1393 + var pack = Package['accounts-base']; // 1394 + if (!pack) return; // 1395 + // 1396 + var self = this; // 1397 + var Accounts = pack.Accounts; // 1398 + // 1399 + this.waitForUser = function () { // 1400 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 1320 - var deferred = $q.defer(); // 1321 - // 1322 - $meteorUtils.autorun($rootScope, function () { // 1323 - if (!Meteor.loggingIn()) deferred.resolve(Meteor.user()); // 1324 - }, true); // 1325 - // 1326 - return deferred.promise; // 1327 - }; // 1328 - // 1329 - this.requireUser = function () { // 1330 - if (!$angularMeteorSettings.suppressWarnings) { // 1331 + // 1402 + var deferred = $q.defer(); // 1403 + // 1404 + $meteorUtils.autorun($rootScope, function () { // 1405 + if (!Meteor.loggingIn()) deferred.resolve(Meteor.user()); // 1406 + }, true); // 1407 + // 1408 + return deferred.promise; // 1409 + }; // 1410 + // 1411 + this.requireUser = function () { // 1412 + if (!$angularMeteorSettings.suppressWarnings) { // 1413 console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - } // 1333 - // 1334 - var deferred = $q.defer(); // 1335 - // 1336 - $meteorUtils.autorun($rootScope, function () { // 1337 - if (!Meteor.loggingIn()) { // 1338 - if (Meteor.user() === null) deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user()); // 1339 - } // 1340 - }, true); // 1341 - // 1342 - return deferred.promise; // 1343 - }; // 1344 - // 1345 - this.requireValidUser = function (validatorFn) { // 1346 + } // 1415 + // 1416 + var deferred = $q.defer(); // 1417 + // 1418 + $meteorUtils.autorun($rootScope, function () { // 1419 + if (!Meteor.loggingIn()) { // 1420 + if (Meteor.user() === null) deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user()); // 1421 + } // 1422 + }, true); // 1423 + // 1424 + return deferred.promise; // 1425 + }; // 1426 + // 1427 + this.requireValidUser = function (validatorFn) { // 1428 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 1348 - return self.requireUser(true).then(function (user) { // 1349 - var valid = validatorFn(user); // 1350 - // 1351 + // 1430 + return self.requireUser(true).then(function (user) { // 1431 + var valid = validatorFn(user); // 1432 + // 1433 if (valid === true) return user;else if (typeof valid === "string") return $q.reject(valid);else return $q.reject("FORBIDDEN"); - }); // 1353 - }; // 1354 - // 1355 - this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword'); // 1356 - this.createUser = $meteorUtils.promissor(Accounts, 'createUser'); // 1357 - this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword'); // 1358 - this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword'); // 1359 - this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword'); // 1360 - this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail'); // 1361 - this.logout = $meteorUtils.promissor(Meteor, 'logout'); // 1362 - this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients'); // 1363 - this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook'); // 1364 - this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter'); // 1365 - this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle'); // 1366 - this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub'); // 1367 - this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount'); // 1368 - this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup'); // 1369 - this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo'); // 1370 - }]); // 1371 - // 1372 + }); // 1435 + }; // 1436 + // 1437 + this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword'); // 1438 + this.createUser = $meteorUtils.promissor(Accounts, 'createUser'); // 1439 + this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword'); // 1440 + this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword'); // 1441 + this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword'); // 1442 + this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail'); // 1443 + this.logout = $meteorUtils.promissor(Meteor, 'logout'); // 1444 + this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients'); // 1445 + this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook'); // 1446 + this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter'); // 1447 + this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle'); // 1448 + this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub'); // 1449 + this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount'); // 1450 + this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup'); // 1451 + this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo'); // 1452 + }]); // 1453 + // 1454 angularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) { - // 1374 - var ScopeProto = Object.getPrototypeOf($rootScope); // 1375 - _.extend(ScopeProto, $$Core); // 1376 - // 1377 - $rootScope.autorun(function () { // 1378 - if (!Meteor.user) return; // 1379 - $rootScope.currentUser = Meteor.user(); // 1380 - $rootScope.loggingIn = Meteor.loggingIn(); // 1381 - }); // 1382 - }]); // 1383 - // 1384 -/***/ }, // 1385 -/* 10 */ // 1386 -/***/ function(module, exports) { // 1387 - // 1388 - /*global // 1389 - angular, _, Meteor // 1390 - */ // 1391 - // 1392 - 'use strict'; // 1393 - // 1394 + // 1456 + var ScopeProto = Object.getPrototypeOf($rootScope); // 1457 + _underscore2.default.extend(ScopeProto, $$Core); // 1458 + // 1459 + $rootScope.autorun(function () { // 1460 + if (!Meteor.user) return; // 1461 + $rootScope.currentUser = Meteor.user(); // 1462 + $rootScope.loggingIn = Meteor.loggingIn(); // 1463 + }); // 1464 + }]); // 1465 + // 1466 +/***/ }, // 1467 +/* 12 */ // 1468 +/***/ function(module, exports, __webpack_require__) { // 1469 + // 1470 + 'use strict'; // 1471 + // 1472 + var _underscore = __webpack_require__(2); // 1473 + // 1474 + var _underscore2 = _interopRequireDefault(_underscore); // 1475 + // 1476 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 1477 + // 1478 + 'use strict'; /*global // 1479 + angular, _, Meteor // 1480 + */ // 1481 + // 1482 var angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']); - // 1396 + // 1484 angularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { - this.call = function () { // 1398 + this.call = function () { // 1486 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 1400 - var deferred = $q.defer(); // 1401 - var fulfill = $meteorUtils.fulfill(deferred); // 1402 - var args = _.toArray(arguments).concat(fulfill); // 1403 - Meteor.call.apply(this, args); // 1404 - return deferred.promise; // 1405 - }; // 1406 - }]); // 1407 - // 1408 -/***/ }, // 1409 -/* 11 */ // 1410 -/***/ function(module, exports) { // 1411 - // 1412 - /*global // 1413 - angular, Session // 1414 - */ // 1415 - // 1416 - 'use strict'; // 1417 - // 1418 + // 1488 + var deferred = $q.defer(); // 1489 + var fulfill = $meteorUtils.fulfill(deferred); // 1490 + var args = _underscore2.default.toArray(arguments).concat(fulfill); // 1491 + Meteor.call.apply(this, args); // 1492 + return deferred.promise; // 1493 + }; // 1494 + }]); // 1495 + // 1496 +/***/ }, // 1497 +/* 13 */ // 1498 +/***/ function(module, exports) { // 1499 + // 1500 + /*global // 1501 + angular, Session // 1502 + */ // 1503 + // 1504 + 'use strict'; // 1505 + // 1506 var angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']); - // 1420 + // 1508 angularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) { - return function (session) { // 1422 - // 1423 - return { // 1424 - // 1425 - bind: function bind(scope, model) { // 1426 + return function (session) { // 1510 + // 1511 + return { // 1512 + // 1513 + bind: function bind(scope, model) { // 1514 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 1428 - var getter = $parse(model); // 1429 - var setter = getter.assign; // 1430 - $meteorUtils.autorun(scope, function () { // 1431 - setter(scope, Session.get(session)); // 1432 - }); // 1433 - // 1434 - scope.$watch(model, function (newItem, oldItem) { // 1435 - Session.set(session, getter(scope)); // 1436 - }, true); // 1437 - } // 1438 - }; // 1439 - }; // 1440 - }]); // 1441 - // 1442 -/***/ }, // 1443 -/* 12 */ // 1444 -/***/ function(module, exports) { // 1445 - // 1446 - /*global // 1447 - angular, Package // 1448 - */ // 1449 - // 1450 - 'use strict'; // 1451 - // 1452 + // 1516 + var getter = $parse(model); // 1517 + var setter = getter.assign; // 1518 + $meteorUtils.autorun(scope, function () { // 1519 + setter(scope, Session.get(session)); // 1520 + }); // 1521 + // 1522 + scope.$watch(model, function (newItem, oldItem) { // 1523 + Session.set(session, getter(scope)); // 1524 + }, true); // 1525 + } // 1526 + }; // 1527 + }; // 1528 + }]); // 1529 + // 1530 +/***/ }, // 1531 +/* 14 */ // 1532 +/***/ function(module, exports) { // 1533 + // 1534 + /*global // 1535 + angular, Package // 1536 + */ // 1537 + // 1538 + 'use strict'; // 1539 + // 1540 var angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']); - // 1454 - // requires package 'mdg:camera' // 1455 + // 1542 + // requires package 'mdg:camera' // 1543 angularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - var pack = Package['mdg:camera']; // 1458 - if (!pack) return; // 1459 - // 1460 - var MeteorCamera = pack.MeteorCamera; // 1461 - // 1462 - this.getPicture = function (options) { // 1463 + var pack = Package['mdg:camera']; // 1546 + if (!pack) return; // 1547 + // 1548 + var MeteorCamera = pack.MeteorCamera; // 1549 + // 1550 + this.getPicture = function (options) { // 1551 if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings'); - // 1465 - options = options || {}; // 1466 - var deferred = $q.defer(); // 1467 - MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred)); // 1468 - return deferred.promise; // 1469 - }; // 1470 - }]); // 1471 - // 1472 -/***/ }, // 1473 -/* 13 */ // 1474 -/***/ function(module, exports) { // 1475 - // 1476 - /*global // 1477 - angular // 1478 - */ // 1479 - // 1480 - 'use strict'; // 1481 - // 1482 - var angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']); // 1483 - // 1484 - angularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) { // 1485 - function $meteorStopper($meteorEntity) { // 1486 - return function () { // 1487 - var args = Array.prototype.slice.call(arguments); // 1488 - var meteorEntity = $meteorEntity.apply(this, args); // 1489 - // 1490 - angular.extend(meteorEntity, $meteorStopper); // 1491 - meteorEntity.$$scope = this; // 1492 - // 1493 - this.$on('$destroy', function () { // 1494 - meteorEntity.stop(); // 1495 - if (meteorEntity.subscription) meteorEntity.subscription.stop(); // 1496 - }); // 1497 - // 1498 - return meteorEntity; // 1499 - }; // 1500 - } // 1501 - // 1502 - $meteorStopper.subscribe = function () { // 1503 - var args = Array.prototype.slice.call(arguments); // 1504 - this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args); // 1505 - return this; // 1506 - }; // 1507 - // 1508 - return $meteorStopper; // 1509 - }]); // 1510 - // 1511 -/***/ }, // 1512 -/* 14 */ // 1513 -/***/ function(module, exports) { // 1514 - // 1515 - 'use strict'; // 1516 - // 1517 - Object.defineProperty(exports, "__esModule", { // 1518 - value: true // 1519 - }); // 1520 - var name = exports.name = 'angular-meteor.utilities'; // 1521 - var utils = exports.utils = '$$utils'; // 1522 - // 1523 - angular.module(name, []) // 1524 - // 1525 - /* // 1526 - A utility service which is provided with general utility functions // 1527 - */ // 1528 - .service(utils, ['$rootScope', function ($rootScope) { // 1529 - var self = this; // 1530 - // 1531 - // Checks if an object is a cursor // 1532 - this.isCursor = function (obj) { // 1533 - return obj instanceof Meteor.Collection.Cursor; // 1534 - }; // 1535 - // 1536 - // Cheecks if an object is a scope // 1537 - this.isScope = function (obj) { // 1538 - return obj instanceof $rootScope.constructor; // 1539 - }; // 1540 - // 1541 - // Checks if two objects are siblings // 1542 - this.areSiblings = function (obj1, obj2) { // 1543 - return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); // 1544 - }; // 1545 - // 1546 - // Binds function into a scpecified context. If an object is provided, will bind every // 1547 - // value in the object which is a function. If a tap function is provided, it will be // 1548 - // called right after the function has been invoked. // 1549 - this.bind = function (fn, context, tap) { // 1550 - tap = _.isFunction(tap) ? tap : angular.noop; // 1551 - if (_.isFunction(fn)) return bindFn(fn, context, tap); // 1552 - if (_.isObject(fn)) return bindObj(fn, context, tap); // 1553 - return fn; // 1554 - }; // 1555 - // 1556 - function bindFn(fn, context, tap) { // 1557 - return function () { // 1558 - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // 1559 - args[_key] = arguments[_key]; // 1560 - } // 1561 - // 1562 - var result = fn.apply(context, args); // 1563 - tap.call(context, { // 1564 - result: result, // 1565 - args: args // 1566 - }); // 1567 - return result; // 1568 - }; // 1569 - } // 1570 - // 1571 - function bindObj(obj, context, tap) { // 1572 - return _.keys(obj).reduce(function (bound, k) { // 1573 - bound[k] = self.bind(obj[k], context, tap); // 1574 - return bound; // 1575 - }, {}); // 1576 - } // 1577 - }]); // 1578 - // 1579 -/***/ }, // 1580 -/* 15 */ // 1581 -/***/ function(module, exports) { // 1582 - // 1583 - 'use strict'; // 1584 - // 1585 - Object.defineProperty(exports, "__esModule", { // 1586 - value: true // 1587 - }); // 1588 - // 1589 + // 1553 + options = options || {}; // 1554 + var deferred = $q.defer(); // 1555 + MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred)); // 1556 + return deferred.promise; // 1557 + }; // 1558 + }]); // 1559 + // 1560 +/***/ }, // 1561 +/* 15 */ // 1562 +/***/ function(module, exports) { // 1563 + // 1564 + /*global // 1565 + angular // 1566 + */ // 1567 + // 1568 + 'use strict'; // 1569 + // 1570 + var angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']); // 1571 + // 1572 + angularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) { // 1573 + function $meteorStopper($meteorEntity) { // 1574 + return function () { // 1575 + var args = Array.prototype.slice.call(arguments); // 1576 + var meteorEntity = $meteorEntity.apply(this, args); // 1577 + // 1578 + angular.extend(meteorEntity, $meteorStopper); // 1579 + meteorEntity.$$scope = this; // 1580 + // 1581 + this.$on('$destroy', function () { // 1582 + meteorEntity.stop(); // 1583 + if (meteorEntity.subscription) meteorEntity.subscription.stop(); // 1584 + }); // 1585 + // 1586 + return meteorEntity; // 1587 + }; // 1588 + } // 1589 + // 1590 + $meteorStopper.subscribe = function () { // 1591 + var args = Array.prototype.slice.call(arguments); // 1592 + this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args); // 1593 + return this; // 1594 + }; // 1595 + // 1596 + return $meteorStopper; // 1597 + }]); // 1598 + // 1599 +/***/ }, // 1600 +/* 16 */ // 1601 +/***/ function(module, exports, __webpack_require__) { // 1602 + // 1603 + 'use strict'; // 1604 + // 1605 + Object.defineProperty(exports, "__esModule", { // 1606 + value: true // 1607 + }); // 1608 + exports.utils = exports.name = undefined; // 1609 + // 1610 + var _underscore = __webpack_require__(2); // 1611 + // 1612 + var _underscore2 = _interopRequireDefault(_underscore); // 1613 + // 1614 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 1615 + // 1616 + var name = exports.name = 'angular-meteor.utilities'; // 1617 + var utils = exports.utils = '$$utils'; // 1618 + // 1619 + angular.module(name, []) // 1620 + // 1621 + /* // 1622 + A utility service which is provided with general utility functions // 1623 + */ // 1624 + .service(utils, ['$rootScope', function ($rootScope) { // 1625 + var self = this; // 1626 + // 1627 + // Checks if an object is a cursor // 1628 + this.isCursor = function (obj) { // 1629 + return obj instanceof Meteor.Collection.Cursor; // 1630 + }; // 1631 + // 1632 + // Cheecks if an object is a scope // 1633 + this.isScope = function (obj) { // 1634 + return obj instanceof $rootScope.constructor; // 1635 + }; // 1636 + // 1637 + // Checks if an object is a view model // 1638 + this.isViewModel = function (obj) { // 1639 + return _underscore2.default.isObject(obj) && obj.$$dependencies; // 1640 + }; // 1641 + // 1642 + // Checks if two objects are siblings // 1643 + this.areSiblings = function (obj1, obj2) { // 1644 + return _underscore2.default.isObject(obj1) && _underscore2.default.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); + }; // 1646 + // 1647 + // Binds function into a scpecified context. If an object is provided, will bind every // 1648 + // value in the object which is a function. If a tap function is provided, it will be // 1649 + // called right after the function has been invoked. // 1650 + this.bind = function (fn, context, tap) { // 1651 + tap = _underscore2.default.isFunction(tap) ? tap : angular.noop; // 1652 + if (_underscore2.default.isFunction(fn)) return bindFn(fn, context, tap); // 1653 + if (_underscore2.default.isObject(fn)) return bindObj(fn, context, tap); // 1654 + return fn; // 1655 + }; // 1656 + // 1657 + function bindFn(fn, context, tap) { // 1658 + return function () { // 1659 + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // 1660 + args[_key] = arguments[_key]; // 1661 + } // 1662 + // 1663 + var result = fn.apply(context, args); // 1664 + tap.call(context, { // 1665 + result: result, // 1666 + args: args // 1667 + }); // 1668 + return result; // 1669 + }; // 1670 + } // 1671 + // 1672 + function bindObj(obj, context, tap) { // 1673 + return _underscore2.default.keys(obj).reduce(function (bound, k) { // 1674 + bound[k] = self.bind(obj[k], context, tap); // 1675 + return bound; // 1676 + }, {}); // 1677 + } // 1678 + }]); // 1679 + // 1680 +/***/ }, // 1681 +/* 17 */ // 1682 +/***/ function(module, exports, __webpack_require__) { // 1683 + // 1684 + 'use strict'; // 1685 + // 1686 + Object.defineProperty(exports, "__esModule", { // 1687 + value: true // 1688 + }); // 1689 + exports.Mixer = exports.name = undefined; // 1690 + // 1691 + var _underscore = __webpack_require__(2); // 1692 + // 1693 + var _underscore2 = _interopRequireDefault(_underscore); // 1694 + // 1695 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 1696 + // 1697 function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - // 1591 - var name = exports.name = 'angular-meteor.mixer'; // 1592 - var Mixer = exports.Mixer = '$Mixer'; // 1593 - // 1594 - angular.module(name, []) // 1595 - // 1596 - /* // 1597 - A service which lets us apply mixins into Scope.prototype. // 1598 - The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`, // 1599 - and any time a `ChildScope` prototype is created // 1600 - it will be extended by the `$Mixer`. // 1601 - This concept is good because it keeps our code // 1602 - clean and simple, and easy to extend. // 1603 - So any time we would like to define a new behaviour to our scope, // 1604 - we will just use the `$Mixer` service. // 1605 - */ // 1606 - .service(Mixer, function () { // 1607 - var _this = this; // 1608 - // 1609 - this._mixins = []; // 1610 - // Apply mixins automatically on specified contexts // 1611 - this._autoExtend = []; // 1612 - this._autoConstruct = []; // 1613 - // 1614 - // Adds a new mixin // 1615 - this.mixin = function (mixin) { // 1616 - if (!_.isObject(mixin)) { // 1617 - throw Error('argument 1 must be an object'); // 1618 - } // 1619 - // 1620 - _this._mixins = _.union(_this._mixins, [mixin]); // 1621 - // Apply mixins to stored contexts // 1622 - _this._autoExtend.forEach(function (context) { // 1623 - return _this._extend(context); // 1624 - }); // 1625 - _this._autoConstruct.forEach(function (context) { // 1626 - return _this._construct(context); // 1627 - }); // 1628 - return _this; // 1629 - }; // 1630 - // 1631 - // Removes a mixin. Useful mainly for test purposes // 1632 - this._mixout = function (mixin) { // 1633 - _this._mixins = _.without(_this._mixins, mixin); // 1634 - return _this; // 1635 - }; // 1636 - // 1637 - // Invoke function mixins with the provided context and arguments // 1638 - this._construct = function (context) { // 1639 - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { // 1640 - args[_key - 1] = arguments[_key]; // 1641 - } // 1642 - // 1643 - _this._mixins.filter(_.isFunction).forEach(function (mixin) { // 1644 - mixin.call.apply(mixin, [context].concat(args)); // 1645 - }); // 1646 - // 1647 - return context; // 1648 - }; // 1649 - // 1650 - // Extend prototype with the defined mixins // 1651 - this._extend = function (obj) { // 1652 - var _ref; // 1653 - // 1654 - return (_ref = _).extend.apply(_ref, [obj].concat(_toConsumableArray(_this._mixins))); // 1655 - }; // 1656 - }); // 1657 - // 1658 -/***/ }, // 1659 -/* 16 */ // 1660 -/***/ function(module, exports, __webpack_require__) { // 1661 - // 1662 - 'use strict'; // 1663 - // 1664 - Object.defineProperty(exports, "__esModule", { // 1665 - value: true // 1666 - }); // 1667 - exports.name = undefined; // 1668 - // 1669 - var _mixer = __webpack_require__(15); // 1670 - // 1671 - var name = exports.name = 'angular-meteor.scope'; // 1672 - // 1673 - angular.module(name, [_mixer.name]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) { // 1674 - var Scope = $rootScope.constructor; // 1675 - var $new = $rootScope.$new; // 1676 - // 1677 - // Apply extensions whether a mixin in defined. // 1678 - // Note that this way mixins which are initialized later // 1679 - // can be applied on rootScope. // 1680 - $Mixer._autoExtend.push(Scope.prototype); // 1681 - $Mixer._autoConstruct.push($rootScope); // 1682 - // 1683 - Scope.prototype.$new = function () { // 1684 - var scope = $new.apply(this, arguments); // 1685 - // Apply constructors to newly created scopes // 1686 - return $Mixer._construct(scope); // 1687 - }; // 1688 - }]); // 1689 - // 1690 -/***/ }, // 1691 -/* 17 */ // 1692 -/***/ function(module, exports, __webpack_require__) { // 1693 - // 1694 - 'use strict'; // 1695 - // 1696 - Object.defineProperty(exports, "__esModule", { // 1697 - value: true // 1698 - }); // 1699 - exports.Core = exports.name = undefined; // 1700 - // 1701 - var _utils = __webpack_require__(14); // 1702 - // 1703 - var _mixer = __webpack_require__(15); // 1704 - // 1705 + // 1699 + var name = exports.name = 'angular-meteor.mixer'; // 1700 + var Mixer = exports.Mixer = '$Mixer'; // 1701 + // 1702 + angular.module(name, []) // 1703 + // 1704 + /* // 1705 + A service which lets us apply mixins into Scope.prototype. // 1706 + The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`, // 1707 + and any time a `ChildScope` prototype is created // 1708 + it will be extended by the `$Mixer`. // 1709 + This concept is good because it keeps our code // 1710 + clean and simple, and easy to extend. // 1711 + So any time we would like to define a new behaviour to our scope, // 1712 + we will just use the `$Mixer` service. // 1713 + */ // 1714 + .service(Mixer, function () { // 1715 + var _this = this; // 1716 + // 1717 + // Used to store method's caller // 1718 + var caller = undefined; // 1719 + // 1720 + this._mixins = []; // 1721 + // Apply mixins automatically on specified contexts // 1722 + this._autoExtend = []; // 1723 + this._autoConstruct = []; // 1724 + // 1725 + // Adds a new mixin // 1726 + this.mixin = function (mixin) { // 1727 + if (!_underscore2.default.isObject(mixin)) { // 1728 + throw Error('argument 1 must be an object'); // 1729 + } // 1730 + // 1731 + _this._mixins = _underscore2.default.union(_this._mixins, [mixin]); // 1732 + // Apply mixins to stored contexts // 1733 + _this._autoExtend.forEach(function (context) { // 1734 + return _this._extend(context); // 1735 + }); // 1736 + _this._autoConstruct.forEach(function (context) { // 1737 + return _this._construct(context); // 1738 + }); // 1739 + return _this; // 1740 + }; // 1741 + // 1742 + // Removes a mixin. Useful mainly for test purposes // 1743 + this._mixout = function (mixin) { // 1744 + _this._mixins = _underscore2.default.without(_this._mixins, mixin); // 1745 + return _this; // 1746 + }; // 1747 + // 1748 + // Invoke function mixins with the provided context and arguments // 1749 + this._construct = function (context) { // 1750 + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { // 1751 + args[_key - 1] = arguments[_key]; // 1752 + } // 1753 + // 1754 + _this._mixins.filter(_underscore2.default.isFunction).forEach(function (mixin) { // 1755 + mixin.call.apply(mixin, [context].concat(args)); // 1756 + }); // 1757 + // 1758 + return context; // 1759 + }; // 1760 + // 1761 + // Extend prototype with the defined mixins // 1762 + this._extend = function (obj, options) { // 1763 + var _$defaults = _underscore2.default.defaults({}, options, { // 1764 + pattern: /.*/ }); // 1765 + // 1766 + var pattern = _$defaults.pattern; // 1767 + var context = _$defaults.context; // 1768 + // The patterns of the keys which will be filtered // 1769 + // 1770 + // 1771 + var mixins = _this._mixins.map(function (mixin) { // 1772 + // Filtering the keys by the specified pattern // 1773 + var keys = _underscore2.default.keys(mixin).filter(function (k) { // 1774 + return k.match(pattern); // 1775 + }).filter(function (k) { // 1776 + return _underscore2.default.isFunction(mixin[k]); // 1777 + }); // 1778 + // 1779 + return keys.reduce(function (boundMixin, methodName) { // 1780 + var methodHandler = mixin[methodName]; // 1781 + // 1782 + // Note that this is not an arrow function so we can conserve the conetxt // 1783 + boundMixin[methodName] = function () { // 1784 + // Storing original caller so we will know who actually called the // 1785 + // method event though it is bound to another context // 1786 + var methodContext = context || this; // 1787 + var recentCaller = caller; // 1788 + caller = this; // 1789 + // 1790 + try { // 1791 + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { // 1792 + args[_key2] = arguments[_key2]; // 1793 + } // 1794 + // 1795 + return methodHandler.apply(methodContext, args); // 1796 + } finally { // 1797 + // No matter what happens, restore variable to the previous one // 1798 + caller = recentCaller; // 1799 + } // 1800 + }; // 1801 + // 1802 + return boundMixin; // 1803 + }, {}); // 1804 + }); // 1805 + // 1806 + return _underscore2.default.extend.apply(_underscore2.default, [obj].concat(_toConsumableArray(mixins))); // 1807 + }; // 1808 + // 1809 + // Caller property can not be set // 1810 + Object.defineProperty(this, 'caller', { // 1811 + configurable: true, // 1812 + enumerable: true, // 1813 + // 1814 + get: function get() { // 1815 + return caller; // 1816 + } // 1817 + }); // 1818 + }); // 1819 + // 1820 +/***/ }, // 1821 +/* 18 */ // 1822 +/***/ function(module, exports, __webpack_require__) { // 1823 + // 1824 + 'use strict'; // 1825 + // 1826 + Object.defineProperty(exports, "__esModule", { // 1827 + value: true // 1828 + }); // 1829 + exports.name = undefined; // 1830 + // 1831 + var _mixer = __webpack_require__(17); // 1832 + // 1833 + var name = exports.name = 'angular-meteor.scope'; // 1834 + // 1835 + angular.module(name, [_mixer.name]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) { // 1836 + var Scope = $rootScope.constructor; // 1837 + var $new = $rootScope.$new; // 1838 + // 1839 + // Apply extensions whether a mixin in defined. // 1840 + // Note that this way mixins which are initialized later // 1841 + // can be applied on rootScope. // 1842 + $Mixer._autoExtend.push(Scope.prototype); // 1843 + $Mixer._autoConstruct.push($rootScope); // 1844 + // 1845 + Scope.prototype.$new = function () { // 1846 + var scope = $new.apply(this, arguments); // 1847 + // Apply constructors to newly created scopes // 1848 + return $Mixer._construct(scope); // 1849 + }; // 1850 + }]); // 1851 + // 1852 +/***/ }, // 1853 +/* 19 */ // 1854 +/***/ function(module, exports, __webpack_require__) { // 1855 + // 1856 + 'use strict'; // 1857 + // 1858 + Object.defineProperty(exports, "__esModule", { // 1859 + value: true // 1860 + }); // 1861 + exports.Core = exports.name = undefined; // 1862 + // 1863 + var _underscore = __webpack_require__(2); // 1864 + // 1865 + var _underscore2 = _interopRequireDefault(_underscore); // 1866 + // 1867 + var _utils = __webpack_require__(16); // 1868 + // 1869 + var _mixer = __webpack_require__(17); // 1870 + // 1871 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 1872 + // 1873 function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - // 1707 - var name = exports.name = 'angular-meteor.core'; // 1708 - var Core = exports.Core = '$$Core'; // 1709 - // 1710 - angular.module(name, [_utils.name, _mixer.name]) // 1711 - // 1712 - /* // 1713 - A mixin which provides us with core Meteor functions. // 1714 - */ // 1715 - .factory(Core, ['$q', _utils.utils, function ($q, $$utils) { // 1716 - function $$Core() {} // 1717 - // 1718 - // Calls Meteor.autorun() which will be digested after each run and automatically destroyed // 1719 - $$Core.autorun = function (fn) { // 1720 - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // 1721 - // 1722 - fn = this.$bindToContext(fn); // 1723 - // 1724 - if (!_.isFunction(fn)) { // 1725 - throw Error('argument 1 must be a function'); // 1726 - } // 1727 - if (!_.isObject(options)) { // 1728 - throw Error('argument 2 must be an object'); // 1729 - } // 1730 - // 1731 - var computation = Tracker.autorun(fn, options); // 1732 - this.$$autoStop(computation); // 1733 - return computation; // 1734 - }; // 1735 - // 1736 - // Calls Meteor.subscribe() which will be digested after each invokation // 1737 - // and automatically destroyed // 1738 - $$Core.subscribe = function (subName, fn, cb) { // 1739 - fn = this.$bindToContext(fn || angular.noop); // 1740 - cb = cb ? this.$bindToContext(cb) : angular.noop; // 1741 - // 1742 - if (!_.isString(subName)) { // 1743 - throw Error('argument 1 must be a string'); // 1744 - } // 1745 - if (!_.isFunction(fn)) { // 1746 - throw Error('argument 2 must be a function'); // 1747 - } // 1748 - if (!_.isFunction(cb) && !_.isObject(cb)) { // 1749 - throw Error('argument 3 must be a function or an object'); // 1750 - } // 1751 - // 1752 - var result = {}; // 1753 - // 1754 - var computation = this.autorun(function () { // 1755 - var _Meteor; // 1756 - // 1757 - var args = fn(); // 1758 - if (angular.isUndefined(args)) args = []; // 1759 - // 1760 - if (!_.isArray(args)) { // 1761 - throw Error('reactive function\'s return value must be an array'); // 1762 - } // 1763 - // 1764 + // 1875 + var name = exports.name = 'angular-meteor.core'; // 1876 + var Core = exports.Core = '$$Core'; // 1877 + // 1878 + angular.module(name, [_utils.name, _mixer.name]) // 1879 + // 1880 + /* // 1881 + A mixin which provides us with core Meteor functions. // 1882 + */ // 1883 + .factory(Core, ['$q', _utils.utils, _mixer.Mixer, function ($q, $$utils, $Mixer) { // 1884 + function $$Core() {} // 1885 + // 1886 + // Calls Meteor.autorun() which will be digested after each run and automatically destroyed // 1887 + $$Core.autorun = function (fn) { // 1888 + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // 1889 + // 1890 + fn = this.$bindToContext($Mixer.caller, fn); // 1891 + // 1892 + if (!_underscore2.default.isFunction(fn)) { // 1893 + throw Error('argument 1 must be a function'); // 1894 + } // 1895 + if (!_underscore2.default.isObject(options)) { // 1896 + throw Error('argument 2 must be an object'); // 1897 + } // 1898 + // 1899 + var computation = Tracker.autorun(fn, options); // 1900 + this.$$autoStop(computation); // 1901 + return computation; // 1902 + }; // 1903 + // 1904 + // Calls Meteor.subscribe() which will be digested after each invokation // 1905 + // and automatically destroyed // 1906 + $$Core.subscribe = function (subName, fn, cb) { // 1907 + fn = this.$bindToContext($Mixer.caller, fn || angular.noop); // 1908 + cb = cb ? this.$bindToContext($Mixer.caller, cb) : angular.noop; // 1909 + // 1910 + if (!_underscore2.default.isString(subName)) { // 1911 + throw Error('argument 1 must be a string'); // 1912 + } // 1913 + if (!_underscore2.default.isFunction(fn)) { // 1914 + throw Error('argument 2 must be a function'); // 1915 + } // 1916 + if (!_underscore2.default.isFunction(cb) && !_underscore2.default.isObject(cb)) { // 1917 + throw Error('argument 3 must be a function or an object'); // 1918 + } // 1919 + // 1920 + var result = {}; // 1921 + // 1922 + var computation = this.autorun(function () { // 1923 + var _Meteor; // 1924 + // 1925 + var args = fn(); // 1926 + if (angular.isUndefined(args)) args = []; // 1927 + // 1928 + if (!_underscore2.default.isArray(args)) { // 1929 + throw Error('reactive function\'s return value must be an array'); // 1930 + } // 1931 + // 1932 var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb])); - result.ready = subscription.ready.bind(subscription); // 1766 - result.subscriptionId = subscription.subscriptionId; // 1767 - }); // 1768 - // 1769 - // Once the computation has been stopped, // 1770 - // any subscriptions made inside will be stopped as well // 1771 - result.stop = computation.stop.bind(computation); // 1772 - return result; // 1773 - }; // 1774 - // 1775 - // Calls Meteor.call() wrapped by a digestion cycle // 1776 - $$Core.callMethod = function () { // 1777 - var _Meteor2; // 1778 - // 1779 - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // 1780 - args[_key] = arguments[_key]; // 1781 - } // 1782 - // 1783 - var fn = args.pop(); // 1784 - if (_.isFunction(fn)) fn = this.$bindToContext(fn); // 1785 - return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn])); // 1786 - }; // 1787 - // 1788 - // Calls Meteor.apply() wrapped by a digestion cycle // 1789 - $$Core.applyMethod = function () { // 1790 - var _Meteor3; // 1791 - // 1792 - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { // 1793 - args[_key2] = arguments[_key2]; // 1794 - } // 1795 - // 1796 - var fn = args.pop(); // 1797 - if (_.isFunction(fn)) fn = this.$bindToContext(fn); // 1798 - return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn])); // 1799 - }; // 1800 - // 1801 - $$Core.$$autoStop = function (stoppable) { // 1802 - this.$on('$destroy', stoppable.stop.bind(stoppable)); // 1803 - }; // 1804 - // 1805 - // Digests scope only if there is no phase at the moment // 1806 - $$Core.$$throttledDigest = function () { // 1807 - var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase; // 1808 - // 1809 - if (isDigestable) this.$digest(); // 1810 - }; // 1811 - // 1812 - // Creates a promise only that the digestion cycle will be called at its fulfillment // 1813 - $$Core.$$defer = function () { // 1814 - var deferred = $q.defer(); // 1815 - // Once promise has been fulfilled, digest // 1816 - deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this)); // 1817 - return deferred; // 1818 - }; // 1819 - // 1820 - // Binds an object or a function to the scope to the view model and digest it once it is invoked // 1821 - $$Core.$bindToContext = function (fn) { // 1822 - return $$utils.bind(fn, this, this.$$throttledDigest.bind(this)); // 1823 - }; // 1824 - // 1825 - return $$Core; // 1826 - }]); // 1827 - // 1828 -/***/ }, // 1829 -/* 18 */ // 1830 -/***/ function(module, exports, __webpack_require__) { // 1831 - // 1832 - 'use strict'; // 1833 - // 1834 - Object.defineProperty(exports, "__esModule", { // 1835 - value: true // 1836 - }); // 1837 - exports.reactive = exports.ViewModel = exports.name = undefined; // 1838 - // 1839 + result.ready = subscription.ready.bind(subscription); // 1934 + result.subscriptionId = subscription.subscriptionId; // 1935 + }); // 1936 + // 1937 + // Once the computation has been stopped, // 1938 + // any subscriptions made inside will be stopped as well // 1939 + result.stop = computation.stop.bind(computation); // 1940 + return result; // 1941 + }; // 1942 + // 1943 + // Calls Meteor.call() wrapped by a digestion cycle // 1944 + $$Core.callMethod = function () { // 1945 + var _Meteor2; // 1946 + // 1947 + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { // 1948 + args[_key] = arguments[_key]; // 1949 + } // 1950 + // 1951 + var fn = args.pop(); // 1952 + if (_underscore2.default.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn); // 1953 + return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn])); // 1954 + }; // 1955 + // 1956 + // Calls Meteor.apply() wrapped by a digestion cycle // 1957 + $$Core.applyMethod = function () { // 1958 + var _Meteor3; // 1959 + // 1960 + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { // 1961 + args[_key2] = arguments[_key2]; // 1962 + } // 1963 + // 1964 + var fn = args.pop(); // 1965 + if (_underscore2.default.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn); // 1966 + return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn])); // 1967 + }; // 1968 + // 1969 + $$Core.$$autoStop = function (stoppable) { // 1970 + this.$on('$destroy', stoppable.stop.bind(stoppable)); // 1971 + }; // 1972 + // 1973 + // Digests scope only if there is no phase at the moment // 1974 + $$Core.$$throttledDigest = function () { // 1975 + var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase; // 1976 + // 1977 + if (isDigestable) this.$digest(); // 1978 + }; // 1979 + // 1980 + // Creates a promise only that the digestion cycle will be called at its fulfillment // 1981 + $$Core.$$defer = function () { // 1982 + var deferred = $q.defer(); // 1983 + // Once promise has been fulfilled, digest // 1984 + deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this)); // 1985 + return deferred; // 1986 + }; // 1987 + // 1988 + // Binds an object or a function to the provided context and digest it once it is invoked // 1989 + $$Core.$bindToContext = function (context, fn) { // 1990 + return $$utils.bind(fn, context, this.$$throttledDigest.bind(this)); // 1991 + }; // 1992 + // 1993 + return $$Core; // 1994 + }]); // 1995 + // 1996 +/***/ }, // 1997 +/* 20 */ // 1998 +/***/ function(module, exports, __webpack_require__) { // 1999 + // 2000 + 'use strict'; // 2001 + // 2002 + Object.defineProperty(exports, "__esModule", { // 2003 + value: true // 2004 + }); // 2005 + exports.reactive = exports.ViewModel = exports.name = undefined; // 2006 + // 2007 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - // 1841 - var _utils = __webpack_require__(14); // 1842 - // 1843 - var _mixer = __webpack_require__(15); // 1844 - // 1845 - var _core = __webpack_require__(17); // 1846 - // 1847 + // 2009 + var _underscore = __webpack_require__(2); // 2010 + // 2011 + var _underscore2 = _interopRequireDefault(_underscore); // 2012 + // 2013 + var _utils = __webpack_require__(16); // 2014 + // 2015 + var _mixer = __webpack_require__(17); // 2016 + // 2017 + var _core = __webpack_require__(19); // 2018 + // 2019 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 2020 + // 2021 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - // 1849 - var name = exports.name = 'angular-meteor.view-model'; // 1850 - var ViewModel = exports.ViewModel = '$$ViewModel'; // 1851 - var reactive = exports.reactive = '$reactive'; // 1852 - // 1853 - angular.module(name, [_utils.name, _mixer.name, _core.name]) // 1854 - // 1855 - /* // 1856 - A mixin which lets us bind a view model into a scope. // 1857 - Note that only a single view model can be bound, // 1858 - otherwise the scope might behave unexpectedly. // 1859 - Mainly used to define the controller as the view model, // 1860 - and very useful when wanting to use Angular's `controllerAs` syntax. // 1861 - */ // 1862 - .factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) { // 1863 - function $$ViewModel() { // 1864 - var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // 1865 - // 1866 - // Defines the view model on the scope. // 1867 - this.$$vm = vm; // 1868 - } // 1869 - // 1870 - // Gets an object, wraps it with scope functions and returns it // 1871 - $$ViewModel.viewModel = function (vm) { // 1872 - var _this = this; // 1873 - // 1874 - if (!_.isObject(vm)) { // 1875 - throw Error('argument 1 must be an object'); // 1876 - } // 1877 - // 1878 - // Apply mixin functions // 1879 - $Mixer._mixins.forEach(function (mixin) { // 1880 - // Reject methods which starts with double $ // 1881 - var keys = _.keys(mixin).filter(function (k) { // 1882 - return k.match(/^(?!\$\$).*$/); // 1883 - }); // 1884 - var proto = _.pick(mixin, keys); // 1885 - // Bind all the methods to the prototype // 1886 - var boundProto = $$utils.bind(proto, _this); // 1887 - // Add the methods to the view model // 1888 - _.extend(vm, boundProto); // 1889 - }); // 1890 - // 1891 - // Apply mixin constructors on the view model // 1892 - $Mixer._construct(this, vm); // 1893 - return vm; // 1894 - }; // 1895 - // 1896 - // Override $$Core.$bindToContext to be bound to view model instead of scope // 1897 - $$ViewModel.$bindToContext = function (fn) { // 1898 - return $$utils.bind(fn, this.$$vm, this.$$throttledDigest.bind(this)); // 1899 - }; // 1900 - // 1901 - return $$ViewModel; // 1902 - }]) // 1903 - // 1904 - /* // 1905 - Illustrates the old API where a view model is created using $reactive service // 1906 - */ // 1907 - .service(reactive, [_utils.utils, function ($$utils) { // 1908 - var Reactive = function () { // 1909 - function Reactive(vm) { // 1910 - var _this2 = this; // 1911 - // 1912 - _classCallCheck(this, Reactive); // 1913 - // 1914 - if (!_.isObject(vm)) { // 1915 - throw Error('argument 1 must be an object'); // 1916 - } // 1917 - // 1918 - _.defer(function () { // 1919 - if (!_this2._attached) { // 1920 - console.warn('view model was not attached to any scope'); // 1921 - } // 1922 - }); // 1923 - // 1924 - this._vm = vm; // 1925 - } // 1926 - // 1927 - _createClass(Reactive, [{ // 1928 - key: 'attach', // 1929 - value: function attach(scope) { // 1930 - this._attached = true; // 1931 - // 1932 - if (!$$utils.isScope(scope)) { // 1933 - throw Error('argument 1 must be a scope'); // 1934 - } // 1935 - // 1936 - var viewModel = scope.viewModel(this._vm); // 1937 - // 1938 - // Similar to the old/Meteor API // 1939 - viewModel.call = viewModel.callMethod; // 1940 - viewModel.apply = viewModel.applyMethod; // 1941 - // 1942 - return viewModel; // 1943 - } // 1944 - }]); // 1945 - // 1946 - return Reactive; // 1947 - }(); // 1948 - // 1949 - return function (vm) { // 1950 - return new Reactive(vm); // 1951 - }; // 1952 - }]); // 1953 - // 1954 -/***/ }, // 1955 -/* 19 */ // 1956 -/***/ function(module, exports, __webpack_require__) { // 1957 - // 1958 - 'use strict'; // 1959 - // 1960 - Object.defineProperty(exports, "__esModule", { // 1961 - value: true // 1962 - }); // 1963 - exports.Reactive = exports.name = undefined; // 1964 - // 1965 - var _utils = __webpack_require__(14); // 1966 - // 1967 - var _mixer = __webpack_require__(15); // 1968 - // 1969 - var _core = __webpack_require__(17); // 1970 - // 1971 - var _viewModel = __webpack_require__(18); // 1972 - // 1973 - var name = exports.name = 'angular-meteor.reactive'; // 1974 - var Reactive = exports.Reactive = '$$Reactive'; // 1975 - // 1976 - angular.module(name, [_utils.name, _mixer.name, _core.name, _viewModel.name]) // 1977 - // 1978 - /* // 1979 - A mixin which enhance our reactive abilities by providing methods // 1980 - that are capable of updating our scope reactively. // 1981 - */ // 1982 - .factory(Reactive, ['$parse', _utils.utils, function ($parse, $$utils) { // 1983 - function $$Reactive() { // 1984 - var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // 1985 - // 1986 - // Helps us track changes made in the view model // 1987 - vm.$$dependencies = {}; // 1988 - } // 1989 - // 1990 - // Gets an object containing functions and define their results as reactive properties. // 1991 - // Once a return value has been changed the property will be reset. // 1992 - $$Reactive.helpers = function () { // 1993 - var _this = this; // 1994 - // 1995 - var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; // 1996 - // 1997 - if (!_.isObject(props)) { // 1998 - throw Error('argument 1 must be an object'); // 1999 - } // 2000 - // 2001 - _.each(props, function (v, k, i) { // 2002 - if (!_.isFunction(v)) { // 2003 - throw Error('helper ' + (i + 1) + ' must be a function'); // 2004 - } // 2005 - // 2006 - if (!_this.$$vm.$$dependencies[k]) { // 2007 - // Registers a new dependency to the specified helper // 2008 - _this.$$vm.$$dependencies[k] = new Tracker.Dependency(); // 2009 - } // 2010 - // 2011 - _this.$$setFnHelper(k, v); // 2012 - }); // 2013 - }; // 2014 - // 2015 - // Gets a model reactively // 2016 - $$Reactive.getReactively = function (k) { // 2017 - var isDeep = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; // 2018 - // 2019 - if (!_.isBoolean(isDeep)) { // 2020 - throw Error('argument 2 must be a boolean'); // 2021 - } // 2022 - // 2023 - return this.$$reactivateEntity(k, this.$watch, isDeep); // 2024 - }; // 2025 - // 2026 - // Gets a collection reactively // 2027 - $$Reactive.getCollectionReactively = function (k) { // 2028 - return this.$$reactivateEntity(k, this.$watchCollection); // 2029 - }; // 2030 - // 2031 - // Gets an entity reactively, and once it has been changed the computation will be recomputed // 2032 - $$Reactive.$$reactivateEntity = function (k, watcher) { // 2033 - if (!_.isString(k)) { // 2034 - throw Error('argument 1 must be a string'); // 2035 - } // 2036 - // 2037 - if (!this.$$vm.$$dependencies[k]) { // 2038 - this.$$vm.$$dependencies[k] = new Tracker.Dependency(); // 2039 - // 2040 - for (var _len = arguments.length, watcherArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - watcherArgs[_key - 2] = arguments[_key]; // 2042 - } // 2043 - // 2044 - this.$$watchEntity.apply(this, [k, watcher].concat(watcherArgs)); // 2045 - } // 2046 - // 2047 - this.$$vm.$$dependencies[k].depend(); // 2048 - return $parse(k)(this.$$vm); // 2049 - }; // 2050 - // 2051 - // Watches for changes in the view model, and if so will notify a change // 2052 - $$Reactive.$$watchEntity = function (k, watcher) { // 2053 - var _this2 = this; // 2054 - // 2055 - // Gets a deep property from the view model // 2056 - var getVal = _.partial($parse(k), this.$$vm); // 2057 - var initialVal = getVal(); // 2058 - // 2059 - // Watches for changes in the view model // 2060 - // 2061 - for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - watcherArgs[_key2 - 2] = arguments[_key2]; // 2063 - } // 2064 - // 2065 - watcher.call.apply(watcher, [this, getVal, function (val, oldVal) { // 2066 - var hasChanged = val !== initialVal || val !== oldVal; // 2067 - // 2068 - // Notify if a change has been detected // 2069 - if (hasChanged) _this2.$$changed(k); // 2070 - }].concat(watcherArgs)); // 2071 - }; // 2072 - // 2073 - // Invokes a function and sets the return value as a property // 2074 - $$Reactive.$$setFnHelper = function (k, fn) { // 2075 - var _this3 = this; // 2076 - // 2077 - this.autorun(function (computation) { // 2078 - // Invokes the reactive functon // 2079 - var model = fn.apply(_this3.$$vm); // 2080 - // 2081 - // Ignore notifications made by the following handler // 2082 - Tracker.nonreactive(function () { // 2083 - // If a cursor, observe its changes and update acoordingly // 2084 - if ($$utils.isCursor(model)) { // 2085 - (function () { // 2086 - var observation = _this3.$$handleCursor(k, model); // 2087 - // 2088 - computation.onInvalidate(function () { // 2089 - observation.stop(); // 2090 - _this3.$$vm[k].splice(0); // 2091 - }); // 2092 - })(); // 2093 - } else { // 2094 - _this3.$$handleNonCursor(k, model); // 2095 - } // 2096 - // 2097 - // Notify change and update the view model // 2098 - _this3.$$changed(k); // 2099 - }); // 2100 - }); // 2101 - }; // 2102 - // 2103 - // Sets a value helper as a setter and a getter which will notify computations once used // 2104 - $$Reactive.$$setValHelper = function (k, v) { // 2105 - var _this4 = this; // 2106 - // 2107 - var watch = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; // 2108 - // 2109 - // If set, reactives property // 2110 - if (watch) { // 2111 - var isDeep = _.isObject(v); // 2112 - this.getReactively(k, isDeep); // 2113 - } // 2114 - // 2115 - Object.defineProperty(this.$$vm, k, { // 2116 - configurable: true, // 2117 - enumerable: true, // 2118 - // 2119 - get: function get() { // 2120 - return v; // 2121 - }, // 2122 - set: function set(newVal) { // 2123 - v = newVal; // 2124 - _this4.$$changed(k); // 2125 - } // 2126 - }); // 2127 - }; // 2128 - // 2129 - // Fetching a cursor and updates properties once the result set has been changed // 2130 - $$Reactive.$$handleCursor = function (k, cursor) { // 2131 - var _this5 = this; // 2132 - // 2133 - // If not defined set it // 2134 - if (angular.isUndefined(this.$$vm[k])) { // 2135 - this.$$setValHelper(k, cursor.fetch(), false); // 2136 - } // 2137 - // If defined update it // 2138 - else { // 2139 - var diff = jsondiffpatch.diff(this.$$vm[k], cursor.fetch()); // 2140 - jsondiffpatch.patch(this.$$vm[k], diff); // 2141 - } // 2142 - // 2143 - // Observe changes made in the result set // 2144 - var observation = cursor.observe({ // 2145 - addedAt: function addedAt(doc, atIndex) { // 2146 - if (!observation) return; // 2147 - _this5.$$vm[k].splice(atIndex, 0, doc); // 2148 - _this5.$$changed(k); // 2149 - }, // 2150 - changedAt: function changedAt(doc, oldDoc, atIndex) { // 2151 - var diff = jsondiffpatch.diff(_this5.$$vm[k][atIndex], doc); // 2152 - jsondiffpatch.patch(_this5.$$vm[k][atIndex], diff); // 2153 - _this5.$$changed(k); // 2154 - }, // 2155 - movedTo: function movedTo(doc, fromIndex, toIndex) { // 2156 - _this5.$$vm[k].splice(fromIndex, 1); // 2157 - _this5.$$vm[k].splice(toIndex, 0, doc); // 2158 - _this5.$$changed(k); // 2159 - }, // 2160 - removedAt: function removedAt(oldDoc, atIndex) { // 2161 - _this5.$$vm[k].splice(atIndex, 1); // 2162 - _this5.$$changed(k); // 2163 - } // 2164 - }); // 2165 - // 2166 - return observation; // 2167 - }; // 2168 - // 2169 - $$Reactive.$$handleNonCursor = function (k, data) { // 2170 - var v = this.$$vm[k]; // 2171 - // 2172 - if (angular.isDefined(v)) { // 2173 - delete this.$$vm[k]; // 2174 - v = null; // 2175 - } // 2176 - // 2177 - if (angular.isUndefined(v)) { // 2178 - this.$$setValHelper(k, data); // 2179 - } // 2180 - // Update property if the new value is from the same type // 2181 - else if ($$utils.areSiblings(v, data)) { // 2182 - var diff = jsondiffpatch.diff(v, data); // 2183 - jsondiffpatch.patch(v, diff); // 2184 - this.$$changed(k); // 2185 - } else { // 2186 - this.$$vm[k] = data; // 2187 - } // 2188 - }; // 2189 - // 2190 - // Notifies dependency in view model // 2191 - $$Reactive.$$depend = function (k) { // 2192 - this.$$vm.$$dependencies[k].depend(); // 2193 - }; // 2194 - // 2195 - // Notifies change in view model // 2196 - $$Reactive.$$changed = function (k) { // 2197 - this.$$throttledDigest(); // 2198 - this.$$vm.$$dependencies[k].changed(); // 2199 - }; // 2200 - // 2201 - return $$Reactive; // 2202 - }]); // 2203 - // 2204 -/***/ }, // 2205 -/* 20 */ // 2206 -/***/ function(module, exports) { // 2207 - // 2208 - 'use strict'; // 2209 - // 2210 - Object.defineProperty(exports, "__esModule", { // 2211 - value: true // 2212 - }); // 2213 - var name = exports.name = 'angular-templates'; // 2214 - // 2215 - try { // 2216 - angular.module(name); // 2217 - } catch (e) { // 2218 - angular.module(name, []); // 2219 - } // 2220 - // 2221 -/***/ } // 2222 -/******/ ]); // 2223 -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // 2023 + var name = exports.name = 'angular-meteor.view-model'; // 2024 + var ViewModel = exports.ViewModel = '$$ViewModel'; // 2025 + var reactive = exports.reactive = '$reactive'; // 2026 + // 2027 + angular.module(name, [_utils.name, _mixer.name, _core.name]) // 2028 + // 2029 + /* // 2030 + A mixin which lets us bind a view model into a scope. // 2031 + Note that only a single view model can be bound, // 2032 + otherwise the scope might behave unexpectedly. // 2033 + Mainly used to define the controller as the view model, // 2034 + and very useful when wanting to use Angular's `controllerAs` syntax. // 2035 + */ // 2036 + .factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) { // 2037 + function $$ViewModel() {} // 2038 + // 2039 + // Gets an object, wraps it with scope functions and returns it // 2040 + $$ViewModel.viewModel = function (vm) { // 2041 + if (!_underscore2.default.isObject(vm)) { // 2042 + throw Error('argument 1 must be an object'); // 2043 + } // 2044 + // 2045 + // Extend view model with mixin functions // 2046 + $Mixer._extend(vm, { // 2047 + pattern: /^(?!\$\$).*$/, // Omitting methods which start with a $$ notation // 2048 + context: this // Binding methods to scope // 2049 + }); // 2050 + // 2051 + // Apply mixin constructors on scope with view model // 2052 + $Mixer._construct(this, vm); // 2053 + return vm; // 2054 + }; // 2055 + // 2056 + return $$ViewModel; // 2057 + }]) // 2058 + // 2059 + /* // 2060 + Illustrates the old API where a view model is created using $reactive service // 2061 + */ // 2062 + .service(reactive, [_utils.utils, function ($$utils) { // 2063 + var Reactive = function () { // 2064 + function Reactive(vm) { // 2065 + var _this = this; // 2066 + // 2067 + _classCallCheck(this, Reactive); // 2068 + // 2069 + if (!_underscore2.default.isObject(vm)) { // 2070 + throw Error('argument 1 must be an object'); // 2071 + } // 2072 + // 2073 + _underscore2.default.defer(function () { // 2074 + if (!_this._attached) { // 2075 + console.warn('view model was not attached to any scope'); // 2076 + } // 2077 + }); // 2078 + // 2079 + this._vm = vm; // 2080 + } // 2081 + // 2082 + _createClass(Reactive, [{ // 2083 + key: 'attach', // 2084 + value: function attach(scope) { // 2085 + this._attached = true; // 2086 + // 2087 + if (!$$utils.isScope(scope)) { // 2088 + throw Error('argument 1 must be a scope'); // 2089 + } // 2090 + // 2091 + var viewModel = scope.viewModel(this._vm); // 2092 + // 2093 + // Similar to the old/Meteor API // 2094 + viewModel.call = viewModel.callMethod; // 2095 + viewModel.apply = viewModel.applyMethod; // 2096 + // 2097 + return viewModel; // 2098 + } // 2099 + }]); // 2100 + // 2101 + return Reactive; // 2102 + }(); // 2103 + // 2104 + return function (vm) { // 2105 + return new Reactive(vm); // 2106 + }; // 2107 + }]); // 2108 + // 2109 +/***/ }, // 2110 +/* 21 */ // 2111 +/***/ function(module, exports, __webpack_require__) { // 2112 + // 2113 + 'use strict'; // 2114 + // 2115 + Object.defineProperty(exports, "__esModule", { // 2116 + value: true // 2117 + }); // 2118 + exports.Reactive = exports.name = undefined; // 2119 + // 2120 + var _jsondiffpatch = __webpack_require__(22); // 2121 + // 2122 + var _jsondiffpatch2 = _interopRequireDefault(_jsondiffpatch); // 2123 + // 2124 + var _underscore = __webpack_require__(2); // 2125 + // 2126 + var _underscore2 = _interopRequireDefault(_underscore); // 2127 + // 2128 + var _utils = __webpack_require__(16); // 2129 + // 2130 + var _mixer = __webpack_require__(17); // 2131 + // 2132 + var _core = __webpack_require__(19); // 2133 + // 2134 + var _viewModel = __webpack_require__(20); // 2135 + // 2136 + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // 2137 + // 2138 + var name = exports.name = 'angular-meteor.reactive'; // 2139 + var Reactive = exports.Reactive = '$$Reactive'; // 2140 + // 2141 + angular.module(name, [_utils.name, _mixer.name, _core.name, _viewModel.name]) // 2142 + // 2143 + /* // 2144 + A mixin which enhance our reactive abilities by providing methods // 2145 + that are capable of updating our scope reactively. // 2146 + */ // 2147 + .factory(Reactive, ['$parse', _utils.utils, _mixer.Mixer, function ($parse, $$utils, $Mixer) { // 2148 + function $$Reactive() { // 2149 + var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0]; // 2150 + // 2151 + // Helps us track changes made in the view model // 2152 + vm.$$dependencies = {}; // 2153 + } // 2154 + // 2155 + // Gets an object containing functions and define their results as reactive properties. // 2156 + // Once a return value has been changed the property will be reset. // 2157 + $$Reactive.helpers = function (vm, props) { // 2158 + var _this = this; // 2159 + // 2160 + if ($$utils.isViewModel(vm)) { // 2161 + if (!_underscore2.default.isObject(props)) { // 2162 + throw Error('argument 2 must be an object'); // 2163 + } // 2164 + } else { // 2165 + props = vm; // 2166 + vm = $Mixer.caller; // 2167 + // 2168 + if (!_underscore2.default.isObject(props)) { // 2169 + throw Error('argument 1 must be an object'); // 2170 + } // 2171 + } // 2172 + // 2173 + _underscore2.default.each(props, function (v, k) { // 2174 + if (!_underscore2.default.isFunction(v)) { // 2175 + throw Error('helper \'' + k + '\' must be a function'); // 2176 + } // 2177 + }); // 2178 + // 2179 + _underscore2.default.each(props, function (v, k) { // 2180 + if (!vm.$$dependencies[k]) { // 2181 + // Registers a new dependency to the specified helper // 2182 + vm.$$dependencies[k] = new Tracker.Dependency(); // 2183 + } // 2184 + // 2185 + _this.$$setFnHelper(vm, k, v); // 2186 + }); // 2187 + }; // 2188 + // 2189 + // Gets a model reactively // 2190 + $$Reactive.getReactively = function (vm, k, isDeep) { // 2191 + if ($$utils.isViewModel(vm)) { // 2192 + if (angular.isUndefined(isDeep)) isDeep = false; // 2193 + // 2194 + if (!_underscore2.default.isString(k)) { // 2195 + throw Error('argument 2 must be a string'); // 2196 + } // 2197 + if (!_underscore2.default.isBoolean(isDeep)) { // 2198 + throw Error('argument 3 must be a boolean'); // 2199 + } // 2200 + } else { // 2201 + isDeep = angular.isDefined(k) ? k : false; // 2202 + k = vm; // 2203 + vm = $Mixer.caller; // 2204 + // 2205 + if (!_underscore2.default.isString(k)) { // 2206 + throw Error('argument 1 must be a string'); // 2207 + } // 2208 + if (!_underscore2.default.isBoolean(isDeep)) { // 2209 + throw Error('argument 2 must be a boolean'); // 2210 + } // 2211 + } // 2212 + // 2213 + return this.$$reactivateEntity(vm, k, this.$watch, isDeep); // 2214 + }; // 2215 + // 2216 + // Gets a collection reactively // 2217 + $$Reactive.getCollectionReactively = function (vm, k) { // 2218 + if ($$utils.isViewModel(vm)) { // 2219 + if (!_underscore2.default.isString(k)) { // 2220 + throw Error('argument 2 must be a string'); // 2221 + } // 2222 + } else { // 2223 + k = vm; // 2224 + vm = $Mixer.caller; // 2225 + // 2226 + if (!_underscore2.default.isString(k)) { // 2227 + throw Error('argument 1 must be a string'); // 2228 + } // 2229 + } // 2230 + // 2231 + return this.$$reactivateEntity(vm, k, this.$watchCollection); // 2232 + }; // 2233 + // 2234 + // Gets an entity reactively, and once it has been changed the computation will be recomputed // 2235 + $$Reactive.$$reactivateEntity = function (vm, k, watcher) { // 2236 + if (!vm.$$dependencies[k]) { // 2237 + vm.$$dependencies[k] = new Tracker.Dependency(); // 2238 + // 2239 + for (var _len = arguments.length, watcherArgs = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { + watcherArgs[_key - 3] = arguments[_key]; // 2241 + } // 2242 + // 2243 + this.$$watchEntity.apply(this, [vm, k, watcher].concat(watcherArgs)); // 2244 + } // 2245 + // 2246 + vm.$$dependencies[k].depend(); // 2247 + return $parse(k)(vm); // 2248 + }; // 2249 + // 2250 + // Watches for changes in the view model, and if so will notify a change // 2251 + $$Reactive.$$watchEntity = function (vm, k, watcher) { // 2252 + var _this2 = this; // 2253 + // 2254 + // Gets a deep property from the caller // 2255 + var getVal = _underscore2.default.partial($parse(k), vm); // 2256 + var initialVal = getVal(); // 2257 + // 2258 + // Watches for changes in the view model // 2259 + // 2260 + for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) { + watcherArgs[_key2 - 3] = arguments[_key2]; // 2262 + } // 2263 + // 2264 + watcher.call.apply(watcher, [this, getVal, function (val, oldVal) { // 2265 + var hasChanged = val !== initialVal || val !== oldVal; // 2266 + // 2267 + // Notify if a change has been detected // 2268 + if (hasChanged) _this2.$$changed(vm, k); // 2269 + }].concat(watcherArgs)); // 2270 + }; // 2271 + // 2272 + // Invokes a function and sets the return value as a property // 2273 + $$Reactive.$$setFnHelper = function (vm, k, fn) { // 2274 + var _this3 = this; // 2275 + // 2276 + var activeObservation = null; // 2277 + var lastModel = null; // 2278 + var lastModelData = []; // 2279 + // 2280 + this.autorun(function () /* computation */{ // 2281 + // Invokes the reactive functon // 2282 + var model = fn.apply(vm); // 2283 + // 2284 + // Ignore notifications made by the following handler // 2285 + Tracker.nonreactive(function () { // 2286 + // If a cursor, observe its changes and update acoordingly // 2287 + if ($$utils.isCursor(model)) { // 2288 + var modelData = undefined; // 2289 + // 2290 + if (angular.isUndefined(vm[k])) { // 2291 + _this3.$$setValHelper(vm, k, [], false); // 2292 + } // 2293 + // 2294 + if (activeObservation) { // 2295 + lastModelData = lastModel.fetch(); // 2296 + activeObservation.stop(); // 2297 + activeObservation = null; // 2298 + } // 2299 + // 2300 + var handle = _this3.$$handleCursor(vm, k, model); // 2301 + // 2302 + activeObservation = handle.observation; // 2303 + modelData = handle.data; // 2304 + // 2305 + if (lastModelData.length !== 0) { // 2306 + var diff = _jsondiffpatch2.default.diff(lastModelData, modelData); // 2307 + vm[k] = _jsondiffpatch2.default.patch(lastModelData, diff); // 2308 + } else { // 2309 + vm[k] = modelData; // 2310 + } // 2311 + // 2312 + lastModel = model; // 2313 + lastModelData = modelData; // 2314 + // 2315 + /* computation.onInvalidate(() => { // 2316 + activeObservation.stop(); // 2317 + });*/ // 2318 + } else { // 2319 + _this3.$$handleNonCursor(vm, k, model); // 2320 + } // 2321 + // 2322 + // Notify change and update the view model // 2323 + _this3.$$changed(vm, k); // 2324 + }); // 2325 + }); // 2326 + }; // 2327 + // 2328 + // Sets a value helper as a setter and a getter which will notify computations once used // 2329 + $$Reactive.$$setValHelper = function (vm, k, v) { // 2330 + var _this4 = this; // 2331 + // 2332 + var watch = arguments.length <= 3 || arguments[3] === undefined ? true : arguments[3]; // 2333 + // 2334 + // If set, reactives property // 2335 + if (watch) { // 2336 + var isDeep = _underscore2.default.isObject(v); // 2337 + this.getReactively(vm, k, isDeep); // 2338 + } // 2339 + // 2340 + Object.defineProperty(vm, k, { // 2341 + configurable: true, // 2342 + enumerable: true, // 2343 + // 2344 + get: function get() { // 2345 + return v; // 2346 + }, // 2347 + set: function set(newVal) { // 2348 + v = newVal; // 2349 + _this4.$$changed(vm, k); // 2350 + } // 2351 + }); // 2352 + }; // 2353 + // 2354 + // Fetching a cursor and updates properties once the result set has been changed // 2355 + $$Reactive.$$handleCursor = function (vm, k, cursor) { // 2356 + var _this5 = this; // 2357 + // 2358 + var data = []; // 2359 + // Observe changes made in the result set // 2360 + var observation = cursor.observe({ // 2361 + addedAt: function addedAt(doc, atIndex) { // 2362 + if (!observation) { // 2363 + data.push(doc); // 2364 + return; // 2365 + } // 2366 + vm[k].splice(atIndex, 0, doc); // 2367 + _this5.$$changed(vm, k); // 2368 + }, // 2369 + changedAt: function changedAt(doc, oldDoc, atIndex) { // 2370 + var diff = _jsondiffpatch2.default.diff(vm[k][atIndex], doc); // 2371 + _jsondiffpatch2.default.patch(vm[k][atIndex], diff); // 2372 + _this5.$$changed(vm, k); // 2373 + }, // 2374 + movedTo: function movedTo(doc, fromIndex, toIndex) { // 2375 + vm[k].splice(fromIndex, 1); // 2376 + vm[k].splice(toIndex, 0, doc); // 2377 + _this5.$$changed(vm, k); // 2378 + }, // 2379 + removedAt: function removedAt(oldDoc, atIndex) { // 2380 + vm[k].splice(atIndex, 1); // 2381 + _this5.$$changed(vm, k); // 2382 + } // 2383 + }); // 2384 + // 2385 + return { // 2386 + observation: observation, // 2387 + data: data // 2388 + }; // 2389 + }; // 2390 + // 2391 + $$Reactive.$$handleNonCursor = function (vm, k, data) { // 2392 + var v = vm[k]; // 2393 + // 2394 + if (angular.isDefined(v)) { // 2395 + delete vm[k]; // 2396 + v = null; // 2397 + } // 2398 + // 2399 + if (angular.isUndefined(v)) { // 2400 + this.$$setValHelper(vm, k, data); // 2401 + } // 2402 + // Update property if the new value is from the same type // 2403 + else if ($$utils.areSiblings(v, data)) { // 2404 + var diff = _jsondiffpatch2.default.diff(v, data); // 2405 + _jsondiffpatch2.default.patch(v, diff); // 2406 + this.$$changed(vm, k); // 2407 + } else { // 2408 + vm[k] = data; // 2409 + } // 2410 + }; // 2411 + // 2412 + // Notifies dependency in view model // 2413 + $$Reactive.$$depend = function (vm, k) { // 2414 + vm.$$dependencies[k].depend(); // 2415 + }; // 2416 + // 2417 + // Notifies change in view model // 2418 + $$Reactive.$$changed = function (vm, k) { // 2419 + this.$$throttledDigest(); // 2420 + vm.$$dependencies[k].changed(); // 2421 + }; // 2422 + // 2423 + return $$Reactive; // 2424 + }]); // 2425 + // 2426 +/***/ }, // 2427 +/* 22 */ // 2428 +/***/ function(module, exports) { // 2429 + // 2430 + module.exports = __WEBPACK_EXTERNAL_MODULE_22__; // 2431 + // 2432 +/***/ }, // 2433 +/* 23 */ // 2434 +/***/ function(module, exports) { // 2435 + // 2436 + 'use strict'; // 2437 + // 2438 + Object.defineProperty(exports, "__esModule", { // 2439 + value: true // 2440 + }); // 2441 + var name = exports.name = 'angular-templates'; // 2442 + // 2443 + try { // 2444 + angular.module(name); // 2445 + } catch (e) { // 2446 + angular.module(name, []); // 2447 + } // 2448 + // 2449 +/***/ } // 2450 +/******/ ]) // 2451 +}); // 2452 +; // 2453 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// }).call(this); diff --git a/dist/angular-meteor.bundle.min.js b/dist/angular-meteor.bundle.min.js index c89fcf8e0..32ccb6314 100644 --- a/dist/angular-meteor.bundle.min.js +++ b/dist/angular-meteor.bundle.min.js @@ -2,6 +2,6 @@ module.exports=function(exec){try{return!!exec()}catch(e){return true}}},function(module,exports,__webpack_require__){var global=__webpack_require__(4),core=__webpack_require__(9),hide=__webpack_require__(10),$redef=__webpack_require__(12),PROTOTYPE="prototype";var ctx=function(fn,that){return function(){return fn.apply(that,arguments)}};var $def=function(type,name,source){var key,own,out,exp,isGlobal=type&$def.G,isProto=type&$def.P,target=isGlobal?global:type&$def.S?global[name]||(global[name]={}):(global[name]||{})[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&$def.F)&&target&&key in target;out=(own?target:source)[key];if(type&$def.B&&own)exp=ctx(out,global);else exp=isProto&&typeof out=="function"?ctx(Function.call,out):out;if(target&&!own)$redef(target,key,out);if(exports[key]!=out)hide(exports,key,exp);if(isProto)(exports[PROTOTYPE]||(exports[PROTOTYPE]={}))[key]=out}};global.core=core;$def.F=1;$def.G=2;$def.S=4;$def.P=8;$def.B=16;$def.W=32;module.exports=$def},function(module,exports){var core=module.exports={version:"1.2.1"};if(typeof __e=="number")__e=core},function(module,exports,__webpack_require__){var $=__webpack_require__(3),createDesc=__webpack_require__(11);module.exports=__webpack_require__(6)?function(object,key,value){return $.setDesc(object,key,createDesc(1,value))}:function(object,key,value){object[key]=value;return object}},function(module,exports){module.exports=function(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}},function(module,exports,__webpack_require__){var global=__webpack_require__(4),hide=__webpack_require__(10),SRC=__webpack_require__(13)("src"),TO_STRING="toString",$toString=Function[TO_STRING],TPL=(""+$toString).split(TO_STRING);__webpack_require__(9).inspectSource=function(it){return $toString.call(it)};(module.exports=function(O,key,val,safe){if(typeof val=="function"){hide(val,SRC,O[key]?""+O[key]:TPL.join(String(key)));if(!("name"in val))val.name=key}if(O===global){O[key]=val}else{if(!safe)delete O[key];hide(O,key,val)}})(Function.prototype,TO_STRING,function toString(){return typeof this=="function"&&this[SRC]||$toString.call(this)})},function(module,exports){var id=0,px=Math.random();module.exports=function(key){return"Symbol(".concat(key===undefined?"":key,")_",(++id+px).toString(36))}},function(module,exports,__webpack_require__){var global=__webpack_require__(4),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(key){return store[key]||(store[key]={})}},function(module,exports,__webpack_require__){var has=__webpack_require__(5),hide=__webpack_require__(10),TAG=__webpack_require__(16)("toStringTag");module.exports=function(it,tag,stat){if(it&&!has(it=stat?it:it.prototype,TAG))hide(it,TAG,tag)}},function(module,exports,__webpack_require__){var store=__webpack_require__(14)("wks"),Symbol=__webpack_require__(4).Symbol;module.exports=function(name){return store[name]||(store[name]=Symbol&&Symbol[name]||(Symbol||__webpack_require__(13))("Symbol."+name))}},function(module,exports,__webpack_require__){var $=__webpack_require__(3),toIObject=__webpack_require__(18);module.exports=function(object,el){var O=toIObject(object),keys=$.getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}},function(module,exports,__webpack_require__){var IObject=__webpack_require__(19),defined=__webpack_require__(21);module.exports=function(it){return IObject(defined(it))}},function(module,exports,__webpack_require__){var cof=__webpack_require__(20);module.exports=0 in Object("z")?Object:function(it){return cof(it)=="String"?it.split(""):Object(it)}},function(module,exports){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},function(module,exports){module.exports=function(it){if(it==undefined)throw TypeError("Can't call method on "+it);return it}},function(module,exports,__webpack_require__){var toString={}.toString,toIObject=__webpack_require__(18),getNames=__webpack_require__(3).getNames;var windowNames=typeof window=="object"&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];var getWindowNames=function(it){try{return getNames(it)}catch(e){return windowNames.slice()}};module.exports.get=function getOwnPropertyNames(it){if(windowNames&&toString.call(it)=="[object Window]")return getWindowNames(it);return getNames(toIObject(it))}},function(module,exports,__webpack_require__){var $=__webpack_require__(3);module.exports=function(it){var keys=$.getKeys(it),getSymbols=$.getSymbols;if(getSymbols){var symbols=getSymbols(it),isEnum=$.isEnum,i=0,key;while(symbols.length>i)if(isEnum.call(it,key=symbols[i++]))keys.push(key)}return keys}},function(module,exports,__webpack_require__){var cof=__webpack_require__(20);module.exports=Array.isArray||function(arg){return cof(arg)=="Array"}},function(module,exports){module.exports=function(it){return typeof it==="object"?it!==null:typeof it==="function"}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);module.exports=function(it){if(!isObject(it))throw TypeError(it+" is not an object!");return it}},function(module,exports){module.exports=false},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.S+$def.F,"Object",{assign:__webpack_require__(29)})},function(module,exports,__webpack_require__){var toObject=__webpack_require__(30),IObject=__webpack_require__(19),enumKeys=__webpack_require__(23),has=__webpack_require__(5);module.exports=__webpack_require__(7)(function(){var a=Object.assign,A={},B={},S=Symbol(),K="abcdefghijklmnopqrst";A[S]=7;K.split("").forEach(function(k){B[k]=k});return a({},A)[S]!=7||Object.keys(a({},B)).join("")!=K})?function assign(target,source){var T=toObject(target),l=arguments.length,i=1;while(l>i){var S=IObject(arguments[i++]),keys=enumKeys(S),length=keys.length,j=0,key;while(length>j)if(has(S,key=keys[j++]))T[key]=S[key]}return T}:Object.assign},function(module,exports,__webpack_require__){var defined=__webpack_require__(21);module.exports=function(it){return Object(defined(it))}},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.S,"Object",{is:__webpack_require__(32)})},function(module,exports){module.exports=Object.is||function is(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.S,"Object",{setPrototypeOf:__webpack_require__(34).set})},function(module,exports,__webpack_require__){var getDesc=__webpack_require__(3).getDesc,isObject=__webpack_require__(25),anObject=__webpack_require__(26);var check=function(O,proto){anObject(O);if(!isObject(proto)&&proto!==null)throw TypeError(proto+": can't set as prototype!")};module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(test,buggy,set){try{set=__webpack_require__(35)(Function.call,getDesc(Object.prototype,"__proto__").set,2);set(test,[]);buggy=!(test instanceof Array)}catch(e){buggy=true}return function setPrototypeOf(O,proto){check(O,proto);if(buggy)O.__proto__=proto;else set(O,proto);return O}}({},false):undefined),check:check}},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(36);module.exports=function(fn,that,length){aFunction(fn);if(that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports){module.exports=function(it){if(typeof it!="function")throw TypeError(it+" is not a function!");return it}},function(module,exports,__webpack_require__){"use strict";var classof=__webpack_require__(38),test={};test[__webpack_require__(16)("toStringTag")]="z";if(test+""!="[object z]"){__webpack_require__(12)(Object.prototype,"toString",function toString(){return"[object "+classof(this)+"]"},true)}},function(module,exports,__webpack_require__){var cof=__webpack_require__(20),TAG=__webpack_require__(16)("toStringTag"),ARG=cof(function(){return arguments}())=="Arguments";module.exports=function(it){var O,T,B;return it===undefined?"Undefined":it===null?"Null":typeof(T=(O=Object(it))[TAG])=="string"?T:ARG?cof(O):(B=cof(O))=="Object"&&typeof O.callee=="function"?"Arguments":B}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("freeze",function($freeze){return function freeze(it){return $freeze&&isObject(it)?$freeze(it):it}})},function(module,exports,__webpack_require__){module.exports=function(KEY,exec){var $def=__webpack_require__(8),fn=(__webpack_require__(9).Object||{})[KEY]||Object[KEY],exp={};exp[KEY]=exec(fn);$def($def.S+$def.F*__webpack_require__(7)(function(){fn(1)}),"Object",exp)}},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("seal",function($seal){return function seal(it){return $seal&&isObject(it)?$seal(it):it}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("preventExtensions",function($preventExtensions){return function preventExtensions(it){return $preventExtensions&&isObject(it)?$preventExtensions(it):it}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("isFrozen",function($isFrozen){return function isFrozen(it){return isObject(it)?$isFrozen?$isFrozen(it):false:true}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("isSealed",function($isSealed){return function isSealed(it){return isObject(it)?$isSealed?$isSealed(it):false:true}})},function(module,exports,__webpack_require__){var isObject=__webpack_require__(25);__webpack_require__(40)("isExtensible",function($isExtensible){return function isExtensible(it){return isObject(it)?$isExtensible?$isExtensible(it):true:false}})},function(module,exports,__webpack_require__){var toIObject=__webpack_require__(18);__webpack_require__(40)("getOwnPropertyDescriptor",function($getOwnPropertyDescriptor){return function getOwnPropertyDescriptor(it,key){return $getOwnPropertyDescriptor(toIObject(it),key)}})},function(module,exports,__webpack_require__){var toObject=__webpack_require__(30);__webpack_require__(40)("getPrototypeOf",function($getPrototypeOf){return function getPrototypeOf(it){return $getPrototypeOf(toObject(it))}})},function(module,exports,__webpack_require__){var toObject=__webpack_require__(30);__webpack_require__(40)("keys",function($keys){return function keys(it){return $keys(toObject(it))}})},function(module,exports,__webpack_require__){__webpack_require__(40)("getOwnPropertyNames",function(){return __webpack_require__(22).get})},function(module,exports,__webpack_require__){__webpack_require__(51);__webpack_require__(57);__webpack_require__(63);__webpack_require__(64);__webpack_require__(66);__webpack_require__(69);__webpack_require__(72);__webpack_require__(74);__webpack_require__(76);module.exports=__webpack_require__(9).Array},function(module,exports,__webpack_require__){"use strict";var $at=__webpack_require__(52)(true);__webpack_require__(54)(String,"String",function(iterated){this._t=String(iterated);this._i=0},function(){var O=this._t,index=this._i,point;if(index>=O.length)return{value:undefined,done:true};point=$at(O,index);this._i+=point.length;return{value:point,done:false}})},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(53),defined=__webpack_require__(21);module.exports=function(TO_STRING){return function(that,pos){var s=String(defined(that)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return TO_STRING?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?TO_STRING?s.charAt(i):a:TO_STRING?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}},function(module,exports){var ceil=Math.ceil,floor=Math.floor;module.exports=function(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}},function(module,exports,__webpack_require__){"use strict";var LIBRARY=__webpack_require__(27),$def=__webpack_require__(8),$redef=__webpack_require__(12),hide=__webpack_require__(10),has=__webpack_require__(5),SYMBOL_ITERATOR=__webpack_require__(16)("iterator"),Iterators=__webpack_require__(55),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values";var returnThis=function(){return this};module.exports=function(Base,NAME,Constructor,next,DEFAULT,IS_SET,FORCE){__webpack_require__(56)(Constructor,NAME,next);var createMethod=function(kind){switch(kind){case KEYS:return function keys(){return new Constructor(this,kind)};case VALUES:return function values(){return new Constructor(this,kind)}}return function entries(){return new Constructor(this,kind)}};var TAG=NAME+" Iterator",proto=Base.prototype,_native=proto[SYMBOL_ITERATOR]||proto[FF_ITERATOR]||DEFAULT&&proto[DEFAULT],_default=_native||createMethod(DEFAULT),methods,key;if(_native){var IteratorPrototype=__webpack_require__(3).getProto(_default.call(new Base));__webpack_require__(15)(IteratorPrototype,TAG,true);if(!LIBRARY&&has(proto,FF_ITERATOR))hide(IteratorPrototype,SYMBOL_ITERATOR,returnThis)}if(!LIBRARY||FORCE)hide(proto,SYMBOL_ITERATOR,_default);Iterators[NAME]=_default;Iterators[TAG]=returnThis;if(DEFAULT){methods={keys:IS_SET?_default:createMethod(KEYS),values:DEFAULT==VALUES?_default:createMethod(VALUES),entries:DEFAULT!=VALUES?_default:createMethod("entries")};if(FORCE)for(key in methods){if(!(key in proto))$redef(proto,key,methods[key])}else $def($def.P+$def.F*BUGGY,NAME,methods)}}},function(module,exports){module.exports={}},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),IteratorPrototype={};__webpack_require__(10)(IteratorPrototype,__webpack_require__(16)("iterator"),function(){return this});module.exports=function(Constructor,NAME,next){Constructor.prototype=$.create(IteratorPrototype,{next:__webpack_require__(11)(1,next)});__webpack_require__(15)(Constructor,NAME+" Iterator")}},function(module,exports,__webpack_require__){"use strict";var ctx=__webpack_require__(35),$def=__webpack_require__(8),toObject=__webpack_require__(30),call=__webpack_require__(58),isArrayIter=__webpack_require__(59),toLength=__webpack_require__(60),getIterFn=__webpack_require__(61);$def($def.S+$def.F*!__webpack_require__(62)(function(iter){Array.from(iter)}),"Array",{from:function from(arrayLike){var O=toObject(arrayLike),C=typeof this=="function"?this:Array,mapfn=arguments[1],mapping=mapfn!==undefined,index=0,iterFn=getIterFn(O),length,result,step,iterator;if(mapping)mapfn=ctx(mapfn,arguments[2],2);if(iterFn!=undefined&&!(C==Array&&isArrayIter(iterFn))){for(iterator=iterFn.call(O),result=new C;!(step=iterator.next()).done;index++){result[index]=mapping?call(iterator,mapfn,[step.value,index],true):step.value}}else{length=toLength(O.length);for(result=new C(length);length>index;index++){result[index]=mapping?mapfn(O[index],index):O[index]}}result.length=index;return result}})},function(module,exports,__webpack_require__){var anObject=__webpack_require__(26);module.exports=function(iterator,fn,value,entries){try{return entries?fn(anObject(value)[0],value[1]):fn(value)}catch(e){var ret=iterator["return"];if(ret!==undefined)anObject(ret.call(iterator));throw e}}},function(module,exports,__webpack_require__){var Iterators=__webpack_require__(55),ITERATOR=__webpack_require__(16)("iterator");module.exports=function(it){return(Iterators.Array||Array.prototype[ITERATOR])===it}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(53),min=Math.min;module.exports=function(it){return it>0?min(toInteger(it),9007199254740991):0}},function(module,exports,__webpack_require__){var classof=__webpack_require__(38),ITERATOR=__webpack_require__(16)("iterator"),Iterators=__webpack_require__(55);module.exports=__webpack_require__(9).getIteratorMethod=function(it){if(it!=undefined)return it[ITERATOR]||it["@@iterator"]||Iterators[classof(it)]}},function(module,exports,__webpack_require__){var SYMBOL_ITERATOR=__webpack_require__(16)("iterator"),SAFE_CLOSING=false;try{var riter=[7][SYMBOL_ITERATOR]();riter["return"]=function(){SAFE_CLOSING=true};Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(exec){if(!SAFE_CLOSING)return false;var safe=false;try{var arr=[7],iter=arr[SYMBOL_ITERATOR]();iter.next=function(){safe=true};arr[SYMBOL_ITERATOR]=function(){return iter};exec(arr)}catch(e){}return safe}},function(module,exports,__webpack_require__){"use strict";var $def=__webpack_require__(8);$def($def.S+$def.F*__webpack_require__(7)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){var index=0,length=arguments.length,result=new(typeof this=="function"?this:Array)(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}})},function(module,exports,__webpack_require__){__webpack_require__(65)(Array)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),SPECIES=__webpack_require__(16)("species");module.exports=function(C){if(__webpack_require__(6)&&!(SPECIES in C))$.setDesc(C,SPECIES,{configurable:true,get:function(){return this}})}},function(module,exports,__webpack_require__){"use strict";var setUnscope=__webpack_require__(67),step=__webpack_require__(68),Iterators=__webpack_require__(55),toIObject=__webpack_require__(18);__webpack_require__(54)(Array,"Array",function(iterated,kind){this._t=toIObject(iterated);this._i=0;this._k=kind},function(){var O=this._t,kind=this._k,index=this._i++;if(!O||index>=O.length){this._t=undefined;return step(1)}if(kind=="keys")return step(0,index);if(kind=="values")return step(0,O[index]);return step(0,[index,O[index]])},"values");Iterators.Arguments=Iterators.Array;setUnscope("keys");setUnscope("values");setUnscope("entries")},function(module,exports,__webpack_require__){var UNSCOPABLES=__webpack_require__(16)("unscopables");if([][UNSCOPABLES]==undefined)__webpack_require__(10)(Array.prototype,UNSCOPABLES,{});module.exports=function(key){[][UNSCOPABLES][key]=true}},function(module,exports){module.exports=function(done,value){return{value:value,done:!!done}}},function(module,exports,__webpack_require__){"use strict";var $def=__webpack_require__(8);$def($def.P,"Array",{copyWithin:__webpack_require__(70)});__webpack_require__(67)("copyWithin")},function(module,exports,__webpack_require__){"use strict";var toObject=__webpack_require__(30),toIndex=__webpack_require__(71),toLength=__webpack_require__(60);module.exports=[].copyWithin||function copyWithin(target,start){var O=toObject(this),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),end=arguments[2],count=Math.min((end===undefined?len:toIndex(end,len))-from,len-to),inc=1;if(from0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O}},function(module,exports,__webpack_require__){var toInteger=__webpack_require__(53),max=Math.max,min=Math.min;module.exports=function(index,length){index=toInteger(index);return index<0?max(index+length,0):min(index,length)}},function(module,exports,__webpack_require__){var $def=__webpack_require__(8);$def($def.P,"Array",{fill:__webpack_require__(73)});__webpack_require__(67)("fill")},function(module,exports,__webpack_require__){"use strict";var toObject=__webpack_require__(30),toIndex=__webpack_require__(71),toLength=__webpack_require__(60);module.exports=[].fill||function fill(value){var O=toObject(this,true),length=toLength(O.length),index=toIndex(arguments[1],length),end=arguments[2],endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O}},function(module,exports,__webpack_require__){"use strict";var KEY="find",$def=__webpack_require__(8),forced=true,$find=__webpack_require__(75)(5);if(KEY in[])Array(1)[KEY](function(){forced=false});$def($def.P+$def.F*forced,"Array",{find:function find(callbackfn){return $find(this,callbackfn,arguments[1])}});__webpack_require__(67)(KEY)},function(module,exports,__webpack_require__){var ctx=__webpack_require__(35),isObject=__webpack_require__(25),IObject=__webpack_require__(19),toObject=__webpack_require__(30),toLength=__webpack_require__(60),isArray=__webpack_require__(24),SPECIES=__webpack_require__(16)("species");var ASC=function(original,length){var C;if(isArray(original)&&isObject(C=original.constructor)){C=C[SPECIES];if(C===null)C=undefined}return new(C===undefined?Array:C)(length)};module.exports=function(TYPE){var IS_MAP=TYPE==1,IS_FILTER=TYPE==2,IS_SOME=TYPE==3,IS_EVERY=TYPE==4,IS_FIND_INDEX=TYPE==6,NO_HOLES=TYPE==5||IS_FIND_INDEX;return function($this,callbackfn,that){var O=toObject($this),self=IObject(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=IS_MAP?ASC($this,length):IS_FILTER?ASC($this,0):undefined,val,res;for(;length>index;index++)if(NO_HOLES||index in self){val=self[index];res=f(val,index,O);if(TYPE){if(IS_MAP)result[index]=res;else if(res)switch(TYPE){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(IS_EVERY)return false}}return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:result}}},function(module,exports,__webpack_require__){"use strict";var KEY="findIndex",$def=__webpack_require__(8),forced=true,$find=__webpack_require__(75)(6);if(KEY in[])Array(1)[KEY](function(){forced=false});$def($def.P+$def.F*forced,"Array",{findIndex:function findIndex(callbackfn){return $find(this,callbackfn,arguments[1])}});__webpack_require__(67)(KEY)},function(module,exports,__webpack_require__){__webpack_require__(78);__webpack_require__(79);__webpack_require__(80);__webpack_require__(51);__webpack_require__(82);__webpack_require__(83);__webpack_require__(87);__webpack_require__(88);__webpack_require__(90);__webpack_require__(91);__webpack_require__(93);__webpack_require__(94);__webpack_require__(95);module.exports=__webpack_require__(9).String},function(module,exports,__webpack_require__){var $def=__webpack_require__(8),toIndex=__webpack_require__(71),fromCharCode=String.fromCharCode,$fromCodePoint=String.fromCodePoint;$def($def.S+$def.F*(!!$fromCodePoint&&$fromCodePoint.length!=1),"String",{fromCodePoint:function fromCodePoint(x){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fromCharCode(code):fromCharCode(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")}})},function(module,exports,__webpack_require__){var $def=__webpack_require__(8),toIObject=__webpack_require__(18),toLength=__webpack_require__(60);$def($def.S,"String",{raw:function raw(callSite){var tpl=toIObject(callSite.raw),len=toLength(tpl.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(tpl[i++]));if(i0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res}},function(module,exports,__webpack_require__){"use strict";var $def=__webpack_require__(8),toLength=__webpack_require__(60),context=__webpack_require__(84),STARTS_WITH="startsWith",$startsWith=""[STARTS_WITH];$def($def.P+$def.F*__webpack_require__(86)(STARTS_WITH),"String",{startsWith:function startsWith(searchString){var that=context(this,searchString,STARTS_WITH),index=toLength(Math.min(arguments[1],that.length)),search=String(searchString);return $startsWith?$startsWith.call(that,search,index):that.slice(index,index+search.length)===search}})},function(module,exports,__webpack_require__){__webpack_require__(92)("match",1,function(defined,MATCH){return function match(regexp){"use strict";var O=defined(this),fn=regexp==undefined?undefined:regexp[MATCH];return fn!==undefined?fn.call(regexp,O):new RegExp(regexp)[MATCH](String(O))}})},function(module,exports,__webpack_require__){"use strict";module.exports=function(KEY,length,exec){var defined=__webpack_require__(21),SYMBOL=__webpack_require__(16)(KEY),original=""[KEY];if(__webpack_require__(7)(function(){var O={};O[SYMBOL]=function(){return 7};return""[KEY](O)!=7})){__webpack_require__(12)(String.prototype,KEY,exec(defined,SYMBOL,original));__webpack_require__(10)(RegExp.prototype,SYMBOL,length==2?function(string,arg){return original.call(string,this,arg)}:function(string){return original.call(string,this)})}}},function(module,exports,__webpack_require__){__webpack_require__(92)("replace",2,function(defined,REPLACE,$replace){return function replace(searchValue,replaceValue){"use strict";var O=defined(this),fn=searchValue==undefined?undefined:searchValue[REPLACE];return fn!==undefined?fn.call(searchValue,O,replaceValue):$replace.call(String(O),searchValue,replaceValue)}})},function(module,exports,__webpack_require__){__webpack_require__(92)("search",1,function(defined,SEARCH){return function search(regexp){"use strict";var O=defined(this),fn=regexp==undefined?undefined:regexp[SEARCH];return fn!==undefined?fn.call(regexp,O):new RegExp(regexp)[SEARCH](String(O))}})},function(module,exports,__webpack_require__){__webpack_require__(92)("split",2,function(defined,SPLIT,$split){return function split(separator,limit){"use strict";var O=defined(this),fn=separator==undefined?undefined:separator[SPLIT];return fn!==undefined?fn.call(separator,O,limit):$split.call(String(O),separator,limit)}})},function(module,exports,__webpack_require__){__webpack_require__(97);__webpack_require__(98);module.exports=__webpack_require__(9).Function},function(module,exports,__webpack_require__){var setDesc=__webpack_require__(3).setDesc,createDesc=__webpack_require__(11),has=__webpack_require__(5),FProto=Function.prototype,nameRE=/^\s*function ([^ (]*)/,NAME="name";NAME in FProto||__webpack_require__(6)&&setDesc(FProto,NAME,{configurable:true,get:function(){var match=(""+this).match(nameRE),name=match?match[1]:"";has(this,NAME)||setDesc(this,NAME,createDesc(5,name));return name}})},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),isObject=__webpack_require__(25),HAS_INSTANCE=__webpack_require__(16)("hasInstance"),FunctionProto=Function.prototype;if(!(HAS_INSTANCE in FunctionProto))$.setDesc(FunctionProto,HAS_INSTANCE,{value:function(O){if(typeof this!="function"||!isObject(O))return false;if(!isObject(this.prototype))return O instanceof this;while(O=$.getProto(O))if(this.prototype===O)return true;return false}})},function(module,exports,__webpack_require__){__webpack_require__(2);module.exports=__webpack_require__(9).Symbol},function(module,exports,__webpack_require__){__webpack_require__(37);__webpack_require__(51);__webpack_require__(101);__webpack_require__(102);module.exports=__webpack_require__(9).Map},function(module,exports,__webpack_require__){__webpack_require__(66);var global=__webpack_require__(4),hide=__webpack_require__(10),Iterators=__webpack_require__(55),ITERATOR=__webpack_require__(16)("iterator"),NL=global.NodeList,HTC=global.HTMLCollection,NLProto=NL&&NL.prototype,HTCProto=HTC&&HTC.prototype,ArrayValues=Iterators.NodeList=Iterators.HTMLCollection=Iterators.Array;if(NL&&!(ITERATOR in NLProto))hide(NLProto,ITERATOR,ArrayValues);if(HTC&&!(ITERATOR in HTCProto))hide(HTCProto,ITERATOR,ArrayValues)},function(module,exports,__webpack_require__){"use strict";var strong=__webpack_require__(103);__webpack_require__(107)("Map",function(get){return function Map(){return get(this,arguments[0])}},{get:function get(key){var entry=strong.getEntry(this,key);return entry&&entry.v},set:function set(key,value){return strong.def(this,key===0?0:key,value)}},strong,true)},function(module,exports,__webpack_require__){"use strict";var $=__webpack_require__(3),hide=__webpack_require__(10),ctx=__webpack_require__(35),species=__webpack_require__(65),strictNew=__webpack_require__(104),defined=__webpack_require__(21),forOf=__webpack_require__(105),step=__webpack_require__(68),ID=__webpack_require__(13)("id"),$has=__webpack_require__(5),isObject=__webpack_require__(25),isExtensible=Object.isExtensible||isObject,SUPPORT_DESC=__webpack_require__(6),SIZE=SUPPORT_DESC?"_s":"size",id=0;var fastKey=function(it,create){if(!isObject(it))return typeof it=="symbol"?it:(typeof it=="string"?"S":"P")+it;if(!$has(it,ID)){if(!isExtensible(it))return"F";if(!create)return"E";hide(it,ID,++id)}return"O"+it[ID]};var getEntry=function(that,key){var index=fastKey(key),entry;if(index!=="F")return that._i[index];for(entry=that._f;entry;entry=entry.n){if(entry.k==key)return entry}};module.exports={getConstructor:function(wrapper,NAME,IS_MAP,ADDER){var C=wrapper(function(that,iterable){strictNew(that,C,NAME);that._i=$.create(null);that._f=undefined;that._l=undefined;that[SIZE]=0;if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that); });__webpack_require__(106)(C.prototype,{clear:function clear(){for(var that=this,data=that._i,entry=that._f;entry;entry=entry.n){entry.r=true;if(entry.p)entry.p=entry.p.n=undefined;delete data[entry.i]}that._f=that._l=undefined;that[SIZE]=0},"delete":function(key){var that=this,entry=getEntry(that,key);if(entry){var next=entry.n,prev=entry.p;delete that._i[entry.i];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that._f==entry)that._f=next;if(that._l==entry)that._l=prev;that[SIZE]--}return!!entry},forEach:function forEach(callbackfn){var f=ctx(callbackfn,arguments[1],3),entry;while(entry=entry?entry.n:this._f){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function has(key){return!!getEntry(this,key)}});if(SUPPORT_DESC)$.setDesc(C.prototype,"size",{get:function(){return defined(this[SIZE])}});return C},def:function(that,key,value){var entry=getEntry(that,key),prev,index;if(entry){entry.v=value}else{that._l=entry={i:index=fastKey(key,true),k:key,v:value,p:prev=that._l,n:undefined,r:false};if(!that._f)that._f=entry;if(prev)prev.n=entry;that[SIZE]++;if(index!=="F")that._i[index]=entry}return that},getEntry:getEntry,setStrong:function(C,NAME,IS_MAP){__webpack_require__(54)(C,NAME,function(iterated,kind){this._t=iterated;this._k=kind;this._l=undefined},function(){var that=this,kind=that._k,entry=that._l;while(entry&&entry.r)entry=entry.p;if(!that._t||!(that._l=entry=entry?entry.n:that._t._f)){that._t=undefined;return step(1)}if(kind=="keys")return step(0,entry.k);if(kind=="values")return step(0,entry.v);return step(0,[entry.k,entry.v])},IS_MAP?"entries":"values",!IS_MAP,true);species(C);species(__webpack_require__(9)[NAME])}}},function(module,exports){module.exports=function(it,Constructor,name){if(!(it instanceof Constructor))throw TypeError(name+": use the 'new' operator!");return it}},function(module,exports,__webpack_require__){var ctx=__webpack_require__(35),call=__webpack_require__(58),isArrayIter=__webpack_require__(59),anObject=__webpack_require__(26),toLength=__webpack_require__(60),getIterFn=__webpack_require__(61);module.exports=function(iterable,entries,fn,that){var iterFn=getIterFn(iterable),f=ctx(fn,that,entries?2:1),index=0,length,step,iterator;if(typeof iterFn!="function")throw TypeError(iterable+" is not iterable!");if(isArrayIter(iterFn))for(length=toLength(iterable.length);length>index;index++){entries?f(anObject(step=iterable[index])[0],step[1]):f(iterable[index])}else for(iterator=iterFn.call(iterable);!(step=iterator.next()).done;){call(iterator,f,step.value,entries)}}},function(module,exports,__webpack_require__){var $redef=__webpack_require__(12);module.exports=function(target,src){for(var key in src)$redef(target,key,src[key]);return target}},function(module,exports,__webpack_require__){"use strict";var global=__webpack_require__(4),$def=__webpack_require__(8),forOf=__webpack_require__(105),strictNew=__webpack_require__(104);module.exports=function(NAME,wrapper,methods,common,IS_MAP,IS_WEAK){var Base=global[NAME],C=Base,ADDER=IS_MAP?"set":"add",proto=C&&C.prototype,O={};var fixMethod=function(KEY){var fn=proto[KEY];__webpack_require__(12)(proto,KEY,KEY=="delete"?function(a){return fn.call(this,a===0?0:a)}:KEY=="has"?function has(a){return fn.call(this,a===0?0:a)}:KEY=="get"?function get(a){return fn.call(this,a===0?0:a)}:KEY=="add"?function add(a){fn.call(this,a===0?0:a);return this}:function set(a,b){fn.call(this,a===0?0:a,b);return this})};if(typeof C!="function"||!(IS_WEAK||proto.forEach&&!__webpack_require__(7)(function(){(new C).entries().next()}))){C=common.getConstructor(wrapper,NAME,IS_MAP,ADDER);__webpack_require__(106)(C.prototype,methods)}else{var inst=new C,chain=inst[ADDER](IS_WEAK?{}:-0,1),buggyZero;if(!__webpack_require__(62)(function(iter){new C(iter)})){C=wrapper(function(target,iterable){strictNew(target,C,NAME);var that=new Base;if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that);return that});C.prototype=proto;proto.constructor=C}IS_WEAK||inst.forEach(function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixMethod("delete");fixMethod("has");IS_MAP&&fixMethod("get")}if(buggyZero||chain!==inst)fixMethod(ADDER);if(IS_WEAK&&proto.clear)delete proto.clear}__webpack_require__(15)(C,NAME);O[NAME]=C;$def($def.G+$def.W+$def.F*(C!=Base),O);if(!IS_WEAK)common.setStrong(C,NAME,IS_MAP);return C}},function(module,exports,__webpack_require__){__webpack_require__(37);__webpack_require__(51);__webpack_require__(101);__webpack_require__(109);module.exports=__webpack_require__(9).Set},function(module,exports,__webpack_require__){"use strict";var strong=__webpack_require__(103);__webpack_require__(107)("Set",function(get){return function Set(){return get(this,arguments[0])}},{add:function add(value){return strong.def(this,value=value===0?0:value,value)}},strong)}]);if(typeof Package==="undefined")Package={};Package["ecmascript-runtime"]={Symbol:Symbol,Map:Map,Set:Set}})();(function(){var Meteor=Package.meteor.Meteor;var Promise;(function(){(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.p="";return __webpack_require__(0)})([function(module,exports,__webpack_require__){var MeteorPromise=__webpack_require__(1);var es6PromiseThen=MeteorPromise.prototype.then;MeteorPromise.prototype.then=function(onResolved,onRejected){if(typeof Meteor==="object"&&typeof Meteor.bindEnvironment==="function"){return es6PromiseThen.call(this,onResolved&&Meteor.bindEnvironment(onResolved,raise),onRejected&&Meteor.bindEnvironment(onRejected,raise))}return es6PromiseThen.call(this,onResolved,onRejected)};function raise(exception){throw exception}Promise=MeteorPromise},function(module,exports,__webpack_require__){(function(global){var hasOwn=Object.prototype.hasOwnProperty;var g=typeof global==="object"?global:typeof window==="object"?window:typeof self==="object"?self:this;var GlobalPromise=g.Promise;var NpmPromise=__webpack_require__(2);function copyMethods(target,source){Object.keys(source).forEach(function(key){var value=source[key];if(typeof value==="function"&&!hasOwn.call(target,key)){target[key]=value}})}if(typeof GlobalPromise==="function"){copyMethods(GlobalPromise,NpmPromise);copyMethods(GlobalPromise.prototype,NpmPromise.prototype);module.exports=GlobalPromise}else{module.exports=NpmPromise}}).call(exports,function(){return this}())},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(3)},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(4);__webpack_require__(6);__webpack_require__(7);__webpack_require__(8);__webpack_require__(9)},function(module,exports,__webpack_require__){"use strict";var asap=__webpack_require__(5);function noop(){}var LAST_ERROR=null;var IS_ERROR={};function getThen(obj){try{return obj.then}catch(ex){LAST_ERROR=ex;return IS_ERROR}}function tryCallOne(fn,a){try{return fn(a)}catch(ex){LAST_ERROR=ex;return IS_ERROR}}function tryCallTwo(fn,a,b){try{fn(a,b)}catch(ex){LAST_ERROR=ex;return IS_ERROR}}module.exports=Promise;function Promise(fn){if(typeof this!=="object"){throw new TypeError("Promises must be constructed via new")}if(typeof fn!=="function"){throw new TypeError("not a function")}this._37=0;this._12=null;this._59=[];if(fn===noop)return;doResolve(fn,this)}Promise._99=noop;Promise.prototype.then=function(onFulfilled,onRejected){if(this.constructor!==Promise){return safeThen(this,onFulfilled,onRejected)}var res=new Promise(noop);handle(this,new Handler(onFulfilled,onRejected,res));return res};function safeThen(self,onFulfilled,onRejected){return new self.constructor(function(resolve,reject){var res=new Promise(noop);res.then(resolve,reject);handle(self,new Handler(onFulfilled,onRejected,res))})}function handle(self,deferred){while(self._37===3){self=self._12}if(self._37===0){self._59.push(deferred);return}asap(function(){var cb=self._37===1?deferred.onFulfilled:deferred.onRejected;if(cb===null){if(self._37===1){resolve(deferred.promise,self._12)}else{reject(deferred.promise,self._12)}return}var ret=tryCallOne(cb,self._12);if(ret===IS_ERROR){reject(deferred.promise,LAST_ERROR)}else{resolve(deferred.promise,ret)}})}function resolve(self,newValue){if(newValue===self){return reject(self,new TypeError("A promise cannot be resolved with itself."))}if(newValue&&(typeof newValue==="object"||typeof newValue==="function")){var then=getThen(newValue);if(then===IS_ERROR){return reject(self,LAST_ERROR)}if(then===self.then&&newValue instanceof Promise){self._37=3;self._12=newValue;finale(self);return}else if(typeof then==="function"){doResolve(then.bind(newValue),self);return}}self._37=1;self._12=newValue;finale(self)}function reject(self,newValue){self._37=2;self._12=newValue;finale(self)}function finale(self){for(var i=0;icapacity){for(var scan=0,newLength=queue.length-index;scan0?argumentCount:0);return new Promise(function(resolve,reject){args.push(function(err,res){if(err)reject(err);else resolve(res)});var res=fn.apply(self,args);if(res&&(typeof res==="object"||typeof res==="function")&&typeof res.then==="function"){resolve(res)}})}};Promise.nodeify=function(fn){return function(){var args=Array.prototype.slice.call(arguments);var callback=typeof args[args.length-1]==="function"?args.pop():null;var ctx=this;try{return fn.apply(this,arguments).nodeify(callback,ctx)}catch(ex){if(callback===null||typeof callback=="undefined"){return new Promise(function(resolve,reject){reject(ex)})}else{asap(function(){callback.call(ctx,ex)})}}}};Promise.prototype.nodeify=function(callback,ctx){if(typeof callback!="function")return this;this.then(function(value){asap(function(){callback.call(ctx,null,value)})},function(err){asap(function(){callback.call(ctx,err)})})}},function(module,exports,__webpack_require__){"use strict";var rawAsap=__webpack_require__(5);var freeTasks=[];var pendingErrors=[];var requestErrorThrow=rawAsap.makeRequestCallFromTimer(throwFirstError);function throwFirstError(){if(pendingErrors.length){throw pendingErrors.shift()}}module.exports=asap;function asap(task){var rawTask;if(freeTasks.length){rawTask=freeTasks.pop()}else{rawTask=new RawTask}rawTask.task=task;rawAsap(rawTask)}function RawTask(){this.task=null}RawTask.prototype.call=function(){try{this.task.call()}catch(error){if(asap.onerror){asap.onerror(error)}else{pendingErrors.push(error);requestErrorThrow()}}finally{this.task=null;freeTasks[freeTasks.length]=this}}}])}).call(this);if(typeof Package==="undefined")Package={};Package.promise={Promise:Promise}})();(function(){var Meteor=Package.meteor.Meteor;var _=Package.underscore._;var Tracker=Package.tracker.Tracker;var Deps=Package.tracker.Deps;var EJSON=Package.ejson.EJSON;var ECMAScript=Package.ecmascript.ECMAScript;var babelHelpers=Package["babel-runtime"].babelHelpers;var Symbol=Package["ecmascript-runtime"].Symbol;var Map=Package["ecmascript-runtime"].Map;var Set=Package["ecmascript-runtime"].Set;var Promise=Package.promise.Promise;var ReactiveDict;(function(){var stringify=function(value){if(value===undefined)return"undefined";return EJSON.stringify(value)};var parse=function(serialized){if(serialized===undefined||serialized==="undefined")return undefined;return EJSON.parse(serialized)};var changed=function(v){v&&v.changed()};ReactiveDict=function(dictName){if(dictName){if(typeof dictName==="string"){ReactiveDict._registerDictForMigrate(dictName,this);this.keys=ReactiveDict._loadMigratedDict(dictName)||{};this.name=dictName}else if(typeof dictName==="object"){this.keys=dictName}else{throw new Error("Invalid ReactiveDict argument: "+dictName)}}else{this.keys={}}this.allDeps=new Tracker.Dependency;this.keyDeps={};this.keyValueDeps={}};_.extend(ReactiveDict.prototype,{set:function(keyOrObject,value){var self=this;if(typeof keyOrObject==="object"&&value===undefined){self._setObject(keyOrObject);return}var key=keyOrObject;value=stringify(value);var keyExisted=_.has(self.keys,key);var oldSerializedValue=keyExisted?self.keys[key]:"undefined";var isNewValue=value!==oldSerializedValue;self.keys[key]=value;if(isNewValue||!keyExisted){self.allDeps.changed()}if(isNewValue){changed(self.keyDeps[key]);if(self.keyValueDeps[key]){changed(self.keyValueDeps[key][oldSerializedValue]);changed(self.keyValueDeps[key][value])}}},setDefault:function(key,value){var self=this;if(!_.has(self.keys,key)){self.set(key,value)}},get:function(key){var self=this;self._ensureKey(key);self.keyDeps[key].depend();return parse(self.keys[key])},equals:function(key,value){var self=this;var ObjectID=null;if(Package.mongo){ObjectID=Package.mongo.Mongo.ObjectID}if(typeof value!=="string"&&typeof value!=="number"&&typeof value!=="boolean"&&typeof value!=="undefined"&&!(value instanceof Date)&&!(ObjectID&&value instanceof ObjectID)&&value!==null){throw new Error("ReactiveDict.equals: value must be scalar")}var serializedValue=stringify(value);if(Tracker.active){self._ensureKey(key);if(!_.has(self.keyValueDeps[key],serializedValue))self.keyValueDeps[key][serializedValue]=new Tracker.Dependency;var isNew=self.keyValueDeps[key][serializedValue].depend();if(isNew){Tracker.onInvalidate(function(){if(!self.keyValueDeps[key][serializedValue].hasDependents())delete self.keyValueDeps[key][serializedValue]})}}var oldValue=undefined;if(_.has(self.keys,key))oldValue=parse(self.keys[key]);return EJSON.equals(oldValue,value)},all:function(){this.allDeps.depend();var ret={};_.each(this.keys,function(value,key){ret[key]=parse(value)});return ret},clear:function(){var self=this;var oldKeys=self.keys;self.keys={};self.allDeps.changed();_.each(oldKeys,function(value,key){changed(self.keyDeps[key]);changed(self.keyValueDeps[key][value]);changed(self.keyValueDeps[key]["undefined"])})},"delete":function(key){var self=this;var didRemove=false;if(_.has(self.keys,key)){var oldValue=self.keys[key];delete self.keys[key];changed(self.keyDeps[key]);if(self.keyValueDeps[key]){changed(self.keyValueDeps[key][oldValue]);changed(self.keyValueDeps[key]["undefined"])}self.allDeps.changed();didRemove=true}return didRemove},_setObject:function(object){var self=this;_.each(object,function(value,key){self.set(key,value)})},_ensureKey:function(key){var self=this;if(!(key in self.keyDeps)){self.keyDeps[key]=new Tracker.Dependency;self.keyValueDeps[key]={}}},_getMigrationData:function(){return this.keys}})}).call(this);(function(){ReactiveDict._migratedDictData={};ReactiveDict._dictsToMigrate={};ReactiveDict._loadMigratedDict=function(dictName){if(_.has(ReactiveDict._migratedDictData,dictName))return ReactiveDict._migratedDictData[dictName];return null};ReactiveDict._registerDictForMigrate=function(dictName,dict){if(_.has(ReactiveDict._dictsToMigrate,dictName))throw new Error("Duplicate ReactiveDict name: "+dictName);ReactiveDict._dictsToMigrate[dictName]=dict};if(Meteor.isClient&&Package.reload){var migrationData=Package.reload.Reload._migrationData("reactive-dict");if(migrationData&&migrationData.dicts)ReactiveDict._migratedDictData=migrationData.dicts;Package.reload.Reload._onMigrate("reactive-dict",function(){var dictsToMigrate=ReactiveDict._dictsToMigrate;var dataToMigrate={};for(var dictName in babelHelpers.sanitizeForInObject(dictsToMigrate))dataToMigrate[dictName]=dictsToMigrate[dictName]._getMigrationData();return[true,{dicts:dataToMigrate}]})}}).call(this);if(typeof Package==="undefined")Package={};Package["reactive-dict"]={ReactiveDict:ReactiveDict}})();(function(){var Meteor=Package.meteor.Meteor;var _=Package.underscore._;var ReactiveDict=Package["reactive-dict"].ReactiveDict;var EJSON=Package.ejson.EJSON;var Session;(function(){Session=new ReactiveDict("session")}).call(this);if(typeof Package==="undefined")Package={};Package.session={Session:Session}})();(function(){var Meteor=Package.meteor.Meteor;var Tracker=Package.tracker.Tracker;var Deps=Package.tracker.Deps;var ReactiveVar;(function(){ReactiveVar=function(initialValue,equalsFunc){if(!(this instanceof ReactiveVar))return new ReactiveVar(initialValue,equalsFunc);this.curValue=initialValue;this.equalsFunc=equalsFunc;this.dep=new Tracker.Dependency};ReactiveVar._isEqual=function(oldValue,newValue){var a=oldValue,b=newValue;if(a!==b)return false;else return!a||typeof a==="number"||typeof a==="boolean"||typeof a==="string"};ReactiveVar.prototype.get=function(){if(Tracker.active)this.dep.depend();return this.curValue};ReactiveVar.prototype.set=function(newValue){var oldValue=this.curValue;if((this.equalsFunc||ReactiveVar._isEqual)(oldValue,newValue))return;this.curValue=newValue;this.dep.changed()};ReactiveVar.prototype.toString=function(){return"ReactiveVar{"+this.get()+"}"};ReactiveVar.prototype._numListeners=function(){var count=0;for(var id in this.dep._dependentsById)count++;return count}}).call(this);if(typeof Package==="undefined")Package={};Package["reactive-var"]={ReactiveVar:ReactiveVar}})();(function(){var Meteor=Package.meteor.Meteor;var Mongo=Package.mongo.Mongo;var Tracker=Package.tracker.Tracker;var Deps=Package.tracker.Deps;var LocalCollection=Package.minimongo.LocalCollection;var Minimongo=Package.minimongo.Minimongo;var CollectionExtensions;(function(){(function(){CollectionExtensions={};CollectionExtensions._extensions=[];Meteor.addCollectionExtension=function(customFunction){if(typeof customFunction!=="function"){throw new Meteor.Error("collection-extension-wrong-argument","You must pass a function into Meteor.addCollectionExtension().")}CollectionExtensions._extensions.push(customFunction);if(typeof Meteor.users!=="undefined"){customFunction.apply(Meteor.users,["users"])}};Meteor.addCollectionPrototype=function(name,customFunction){if(typeof name!=="string"){throw new Meteor.Error("collection-extension-wrong-argument","You must pass a string as the first argument into Meteor.addCollectionPrototype().")}if(typeof customFunction!=="function"){throw new Meteor.Error("collection-extension-wrong-argument","You must pass a function as the second argument into Meteor.addCollectionPrototype().")}(typeof Mongo!=="undefined"?Mongo.Collection:Meteor.Collection).prototype[name]=customFunction};CollectionExtensions._reassignCollectionPrototype=function(instance,constr){var hasSetPrototypeOf=typeof Object.setPrototypeOf==="function";if(!constr)constr=typeof Mongo!=="undefined"?Mongo.Collection:Meteor.Collection;if(hasSetPrototypeOf){Object.setPrototypeOf(instance,constr.prototype)}else if(instance.__proto__){instance.__proto__=constr.prototype}};CollectionExtensions._wrapCollection=function(ns,as){if(!as._CollectionPrototype)as._CollectionPrototype=new as.Collection(null);var constructor=as.Collection;var proto=as._CollectionPrototype;ns.Collection=function(){var ret=constructor.apply(this,arguments);CollectionExtensions._processCollectionExtensions(this,arguments);return ret};ns.Collection.prototype=proto;ns.Collection.prototype.constructor=ns.Collection;for(var prop in constructor){if(constructor.hasOwnProperty(prop)){ns.Collection[prop]=constructor[prop]}}};CollectionExtensions._processCollectionExtensions=function(self,args){var args=args?[].slice.call(args,0):undefined;var extensions=CollectionExtensions._extensions;for(var i=0,len=extensions.length;itext2.length?text1:text2;var shorttext=text1.length>text2.length?text2:text1;var i=longtext.indexOf(shorttext);if(i!=-1){diffs=[[DIFF_INSERT,longtext.substring(0,i)],[DIFF_EQUAL,shorttext],[DIFF_INSERT,longtext.substring(i+shorttext.length)]];if(text1.length>text2.length){diffs[0][0]=diffs[2][0]=DIFF_DELETE}return diffs}if(shorttext.length==1){return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]]}longtext=shorttext=null;var hm=this.diff_halfMatch_(text1,text2);if(hm){var text1_a=hm[0];var text1_b=hm[1];var text2_a=hm[2];var text2_b=hm[3];var mid_common=hm[4];var diffs_a=this.diff_main(text1_a,text2_a,checklines,deadline);var diffs_b=this.diff_main(text1_b,text2_b,checklines,deadline);return diffs_a.concat([[DIFF_EQUAL,mid_common]],diffs_b)}if(checklines&&text1.length>100&&text2.length>100){return this.diff_lineMode_(text1,text2,deadline)}return this.diff_bisect_(text1,text2,deadline)};diff_match_patch.prototype.diff_lineMode_=function(text1,text2,deadline){var a=this.diff_linesToChars_(text1,text2);text1=a[0];text2=a[1];var linearray=a[2];var diffs=this.diff_bisect_(text1,text2,deadline);this.diff_charsToLines_(diffs,linearray);this.diff_cleanupSemantic(diffs);diffs.push([DIFF_EQUAL,""]);var pointer=0;var count_delete=0;var count_insert=0;var text_delete="";var text_insert="";while(pointer=1&&count_insert>=1){var a=this.diff_main(text_delete,text_insert,false,deadline);diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert);pointer=pointer-count_delete-count_insert;for(var j=a.length-1;j>=0;j--){diffs.splice(pointer,0,a[j])}pointer=pointer+a.length}count_insert=0;count_delete=0;text_delete="";text_insert="";break}pointer++}diffs.pop();return diffs};diff_match_patch.prototype.diff_bisect_=function(text1,text2,deadline){var text1_length=text1.length;var text2_length=text2.length;var max_d=Math.ceil((text1_length+text2_length)/2);var v_offset=max_d;var v_length=2*max_d;var v1=new Array(v_length);var v2=new Array(v_length);for(var x=0;xdeadline){break}for(var k1=-d+k1start;k1<=d-k1end;k1+=2){var k1_offset=v_offset+k1;var x1;if(k1==-d||k1!=d&&v1[k1_offset-1]text1_length){k1end+=2}else if(y1>text2_length){k1start+=2}else if(front){var k2_offset=v_offset+delta-k1;if(k2_offset>=0&&k2_offset=x2){return this.diff_bisectSplit_(text1,text2,x1,y1,deadline)}}}}for(var k2=-d+k2start;k2<=d-k2end;k2+=2){var k2_offset=v_offset+k2;var x2;if(k2==-d||k2!=d&&v2[k2_offset-1]text1_length){k2end+=2}else if(y2>text2_length){k2start+=2}else if(!front){var k1_offset=v_offset+delta-k2;if(k1_offset>=0&&k1_offset=x2){return this.diff_bisectSplit_(text1,text2,x1,y1,deadline)}}}}}return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]]};diff_match_patch.prototype.diff_bisectSplit_=function(text1,text2,x,y,deadline){var text1a=text1.substring(0,x); var text2a=text2.substring(0,y);var text1b=text1.substring(x);var text2b=text2.substring(y);var diffs=this.diff_main(text1a,text2a,false,deadline);var diffsb=this.diff_main(text1b,text2b,false,deadline);return diffs.concat(diffsb)};diff_match_patch.prototype.diff_linesToChars_=function(text1,text2){var lineArray=[];var lineHash={};lineArray[0]="";function diff_linesToCharsMunge_(text){var chars="";var lineStart=0;var lineEnd=-1;var lineArrayLength=lineArray.length;while(lineEndtext2_length){text1=text1.substring(text1_length-text2_length)}else if(text1_lengthtext2.length?text1:text2;var shorttext=text1.length>text2.length?text2:text1;if(longtext.length<4||shorttext.length*2=longtext.length){return[best_longtext_a,best_longtext_b,best_shorttext_a,best_shorttext_b,best_common]}else{return null}}var hm1=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/4));var hm2=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/2));var hm;if(!hm1&&!hm2){return null}else if(!hm2){hm=hm1}else if(!hm1){hm=hm2}else{hm=hm1[4].length>hm2[4].length?hm1:hm2}var text1_a,text1_b,text2_a,text2_b;if(text1.length>text2.length){text1_a=hm[0];text1_b=hm[1];text2_a=hm[2];text2_b=hm[3]}else{text2_a=hm[0];text2_b=hm[1];text1_a=hm[2];text1_b=hm[3]}var mid_common=hm[4];return[text1_a,text1_b,text2_a,text2_b,mid_common]};diff_match_patch.prototype.diff_cleanupSemantic=function(diffs){var changes=false;var equalities=[];var equalitiesLength=0;var lastequality=null;var pointer=0;var length_insertions1=0;var length_deletions1=0;var length_insertions2=0;var length_deletions2=0;while(pointer0?equalities[equalitiesLength-1]:-1;length_insertions1=0;length_deletions1=0;length_insertions2=0;length_deletions2=0;lastequality=null;changes=true}}pointer++}if(changes){this.diff_cleanupMerge(diffs)}this.diff_cleanupSemanticLossless(diffs);pointer=1;while(pointer=deletion.length/2||overlap_length>=insertion.length/2){diffs.splice(pointer,0,[DIFF_EQUAL,insertion.substring(0,overlap_length)]);diffs[pointer-1][1]=deletion.substring(0,deletion.length-overlap_length);diffs[pointer+1][1]=insertion.substring(overlap_length);pointer++}pointer++}pointer++}};diff_match_patch.prototype.diff_cleanupSemanticLossless=function(diffs){var punctuation=/[^a-zA-Z0-9]/;var whitespace=/\s/;var linebreak=/[\r\n]/;var blanklineEnd=/\n\r?\n$/;var blanklineStart=/^\r?\n\r?\n/;function diff_cleanupSemanticScore_(one,two){if(!one||!two){return 5}var score=0;if(one.charAt(one.length-1).match(punctuation)||two.charAt(0).match(punctuation)){score++;if(one.charAt(one.length-1).match(whitespace)||two.charAt(0).match(whitespace)){score++;if(one.charAt(one.length-1).match(linebreak)||two.charAt(0).match(linebreak)){score++;if(one.match(blanklineEnd)||two.match(blanklineStart)){score++}}}}return score}var pointer=1;while(pointer=bestScore){bestScore=score;bestEquality1=equality1;bestEdit=edit;bestEquality2=equality2}}if(diffs[pointer-1][1]!=bestEquality1){if(bestEquality1){diffs[pointer-1][1]=bestEquality1}else{diffs.splice(pointer-1,1);pointer--}diffs[pointer][1]=bestEdit;if(bestEquality2){diffs[pointer+1][1]=bestEquality2}else{diffs.splice(pointer+1,1);pointer--}}}pointer++}};diff_match_patch.prototype.diff_cleanupEfficiency=function(diffs){var changes=false;var equalities=[];var equalitiesLength=0;var lastequality="";var pointer=0;var pre_ins=false;var pre_del=false;var post_ins=false;var post_del=false;while(pointer0?equalities[equalitiesLength-1]:-1;post_ins=post_del=false}changes=true}}pointer++}if(changes){this.diff_cleanupMerge(diffs)}};diff_match_patch.prototype.diff_cleanupMerge=function(diffs){diffs.push([DIFF_EQUAL,""]);var pointer=0;var count_delete=0;var count_insert=0;var text_delete="";var text_insert="";var commonlength;while(pointer1){if(count_delete!==0&&count_insert!==0){commonlength=this.diff_commonPrefix(text_insert,text_delete);if(commonlength!==0){if(pointer-count_delete-count_insert>0&&diffs[pointer-count_delete-count_insert-1][0]==DIFF_EQUAL){diffs[pointer-count_delete-count_insert-1][1]+=text_insert.substring(0,commonlength)}else{diffs.splice(0,0,[DIFF_EQUAL,text_insert.substring(0,commonlength)]);pointer++}text_insert=text_insert.substring(commonlength);text_delete=text_delete.substring(commonlength)}commonlength=this.diff_commonSuffix(text_insert,text_delete);if(commonlength!==0){diffs[pointer][1]=text_insert.substring(text_insert.length-commonlength)+diffs[pointer][1];text_insert=text_insert.substring(0,text_insert.length-commonlength);text_delete=text_delete.substring(0,text_delete.length-commonlength)}}if(count_delete===0){diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[DIFF_INSERT,text_insert])}else if(count_insert===0){diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[DIFF_DELETE,text_delete])}else{diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[DIFF_DELETE,text_delete],[DIFF_INSERT,text_insert])}pointer=pointer-count_delete-count_insert+(count_delete?1:0)+(count_insert?1:0)+1}else if(pointer!==0&&diffs[pointer-1][0]==DIFF_EQUAL){diffs[pointer-1][1]+=diffs[pointer][1];diffs.splice(pointer,1)}else{pointer++}count_insert=0;count_delete=0;text_delete="";text_insert="";break}}if(diffs[diffs.length-1][1]===""){diffs.pop()}var changes=false;pointer=1;while(pointerloc){break}last_chars1=chars1;last_chars2=chars2}if(diffs.length!=x&&diffs[x][0]===DIFF_DELETE){return last_chars2}return last_chars2+(loc-last_chars1)};diff_match_patch.prototype.diff_prettyHtml=function(diffs){var html=[];var i=0;var pattern_amp=/&/g;var pattern_lt=//g;var pattern_para=/\n/g;for(var x=0;x");switch(op){case DIFF_INSERT:html[x]=''+text+"";break;case DIFF_DELETE:html[x]=''+text+"";break;case DIFF_EQUAL:html[x]=""+text+"";break}if(op!==DIFF_DELETE){i+=data.length}}return html.join("")};diff_match_patch.prototype.diff_text1=function(diffs){var text=[];for(var x=0;xthis.Match_MaxBits){throw new Error("Pattern too long for this browser.")}var s=this.match_alphabet_(pattern);var dmp=this;function match_bitapScore_(e,x){var accuracy=e/pattern.length;var proximity=Math.abs(loc-x);if(!dmp.Match_Distance){return proximity?1:accuracy}return accuracy+proximity/dmp.Match_Distance}var score_threshold=this.Match_Threshold;var best_loc=text.indexOf(pattern,loc);if(best_loc!=-1){score_threshold=Math.min(match_bitapScore_(0,best_loc),score_threshold);best_loc=text.lastIndexOf(pattern,loc+pattern.length);if(best_loc!=-1){score_threshold=Math.min(match_bitapScore_(0,best_loc),score_threshold)}}var matchmask=1<=start;j--){var charMatch=s[text.charAt(j-1)];if(d===0){rd[j]=(rd[j+1]<<1|1)&charMatch}else{rd[j]=(rd[j+1]<<1|1)&charMatch|((last_rd[j+1]|last_rd[j])<<1|1)|last_rd[j+1]}if(rd[j]&matchmask){var score=match_bitapScore_(d,j-1);if(score<=score_threshold){score_threshold=score;best_loc=j-1;if(best_loc>loc){start=Math.max(1,2*loc-best_loc)}else{break}}}}if(match_bitapScore_(d+1,loc)>score_threshold){break}last_rd=rd}return best_loc};diff_match_patch.prototype.match_alphabet_=function(pattern){var s={};for(var i=0;i2){this.diff_cleanupSemantic(diffs);this.diff_cleanupEfficiency(diffs)}}else if(a&&typeof a=="object"&&typeof opt_b=="undefined"&&typeof opt_c=="undefined"){diffs=a;text1=this.diff_text1(diffs)}else if(typeof a=="string"&&opt_b&&typeof opt_b=="object"&&typeof opt_c=="undefined"){text1=a;diffs=opt_b}else if(typeof a=="string"&&typeof opt_b=="string"&&opt_c&&typeof opt_c=="object"){text1=a;diffs=opt_c}else{throw new Error("Unknown call format to patch_make.")}if(diffs.length===0){return[]}var patches=[];var patch=new diff_match_patch.patch_obj;var patchDiffLength=0;var char_count1=0;var char_count2=0;var prepatch_text=text1;var postpatch_text=text1;for(var x=0;x=2*this.Patch_Margin){if(patchDiffLength){this.patch_addContext_(patch,prepatch_text);patches.push(patch);patch=new diff_match_patch.patch_obj;patchDiffLength=0;prepatch_text=postpatch_text;char_count1=char_count2}}break}if(diff_type!==DIFF_INSERT){char_count1+=diff_text.length}if(diff_type!==DIFF_DELETE){char_count2+=diff_text.length}}if(patchDiffLength){this.patch_addContext_(patch,prepatch_text);patches.push(patch)}return patches};diff_match_patch.prototype.patch_deepCopy=function(patches){var patchesCopy=[];for(var x=0;xthis.Match_MaxBits){start_loc=this.match_main(text,text1.substring(0,this.Match_MaxBits),expected_loc);if(start_loc!=-1){end_loc=this.match_main(text,text1.substring(text1.length-this.Match_MaxBits),expected_loc+text1.length-this.Match_MaxBits);if(end_loc==-1||start_loc>=end_loc){start_loc=-1}}}else{start_loc=this.match_main(text,text1,expected_loc)}if(start_loc==-1){results[x]=false;delta-=patches[x].length2-patches[x].length1}else{results[x]=true;delta=start_loc-expected_loc;var text2;if(end_loc==-1){text2=text.substring(start_loc,start_loc+text1.length)}else{text2=text.substring(start_loc,end_loc+this.Match_MaxBits)}if(text1==text2){text=text.substring(0,start_loc)+this.diff_text2(patches[x].diffs)+text.substring(start_loc+text1.length)}else{var diffs=this.diff_main(text1,text2,false);if(text1.length>this.Match_MaxBits&&this.diff_levenshtein(diffs)/text1.length>this.Patch_DeleteThreshold){results[x]=false}else{this.diff_cleanupSemanticLossless(diffs);var index1=0;var index2;for(var y=0;ydiffs[0][1].length){var extraLength=paddingLength-diffs[0][1].length;diffs[0][1]=nullPadding.substring(diffs[0][1].length)+diffs[0][1];patch.start1-=extraLength;patch.start2-=extraLength;patch.length1+=extraLength;patch.length2+=extraLength}patch=patches[patches.length-1];diffs=patch.diffs;if(diffs.length==0||diffs[diffs.length-1][0]!=DIFF_EQUAL){diffs.push([DIFF_EQUAL,nullPadding]);patch.length1+=paddingLength;patch.length2+=paddingLength}else if(paddingLength>diffs[diffs.length-1][1].length){var extraLength=paddingLength-diffs[diffs.length-1][1].length;diffs[diffs.length-1][1]+=nullPadding.substring(0,extraLength);patch.length1+=extraLength;patch.length2+=extraLength}return nullPadding};diff_match_patch.prototype.patch_splitMax=function(patches){var patch_size=this.Match_MaxBits;for(var x=0;xpatch_size){var bigpatch=patches[x];patches.splice(x--,1);var start1=bigpatch.start1;var start2=bigpatch.start2;var precontext="";while(bigpatch.diffs.length!==0){var patch=new diff_match_patch.patch_obj;var empty=true;patch.start1=start1-precontext.length;patch.start2=start2-precontext.length;if(precontext!==""){patch.length1=patch.length2=precontext.length;patch.diffs.push([DIFF_EQUAL,precontext])}while(bigpatch.diffs.length!==0&&patch.length12*patch_size){patch.length1+=diff_text.length;start1+=diff_text.length;empty=false;patch.diffs.push([diff_type,diff_text]);bigpatch.diffs.shift()}else{diff_text=diff_text.substring(0,patch_size-patch.length1-this.Patch_Margin);patch.length1+=diff_text.length;start1+=diff_text.length;if(diff_type===DIFF_EQUAL){patch.length2+=diff_text.length;start2+=diff_text.length}else{empty=false}patch.diffs.push([diff_type,diff_text]);if(diff_text==bigpatch.diffs[0][1]){bigpatch.diffs.shift()}else{bigpatch.diffs[0][1]=bigpatch.diffs[0][1].substring(diff_text.length)}}}precontext=this.diff_text2(patch.diffs);precontext=precontext.substring(precontext.length-this.Patch_Margin);var postcontext=this.diff_text1(bigpatch.diffs).substring(0,this.Patch_Margin);if(postcontext!==""){patch.length1+=postcontext.length;patch.length2+=postcontext.length;if(patch.diffs.length!==0&&patch.diffs[patch.diffs.length-1][0]===DIFF_EQUAL){patch.diffs[patch.diffs.length-1][1]+=postcontext}else{patch.diffs.push([DIFF_EQUAL,postcontext])}}if(!empty){patches.splice(++x,0,patch)}}}}};diff_match_patch.prototype.patch_toText=function(patches){var text=[];for(var x=0;x0&&len2>0&&!matchContext.objectHash&&typeof matchContext.matchByPosition!=="boolean"){matchContext.matchByPosition=!arraysHaveMatchByRef(array1,array2,len1,len2)}while(commonHead0){for(var removeItemIndex1=0;removeItemIndex1=0;index--){index1=toRemove[index];var indexDiff=delta["_"+index1];var removedValue=array.splice(index1,1)[0];if(indexDiff[2]===ARRAY_MOVE){toInsert.push({index:indexDiff[1],value:removedValue})}}toInsert=toInsert.sort(compare.numericallyBy("index"));var toInsertLength=toInsert.length;for(index=0;index0){for(index=0;indexreverseIndex){reverseIndex++}else if(moveFromIndex>=reverseIndex&&moveToIndexmatrix[index1-1][index2]){return backtrack(matrix,array1,array2,index1,index2-1,context)}else{return backtrack(matrix,array1,array2,index1-1,index2,context)}};var get=function(array1,array2,match,context){context=context||{};var matrix=lengthMatrix(array1,array2,match||defaultMatch,context);var result=backtrack(matrix,array1,array2,array1.length,array2.length,context);if(typeof array1==="string"&&typeof array2==="string"){result.sequence=result.sequence.join("")}return result};exports.get=get},{}],13:[function(require,module,exports){var DiffContext=require("../contexts/diff").DiffContext;var PatchContext=require("../contexts/patch").PatchContext;var ReverseContext=require("../contexts/reverse").ReverseContext;var collectChildrenDiffFilter=function collectChildrenDiffFilter(context){if(!context||!context.children){return}var length=context.children.length;var child;var result=context.result;for(var index=0;index1)level=isShallow;else if(isShallow)level=1;if(level){src=utils.rip(src,level);dst=utils.rip(dst,level)}return compare(src,dst)};var compare=function compare(src,dst){var srcKeys=_.keys(src);var dstKeys=_.keys(dst);var keys=_.chain([]).concat(srcKeys).concat(dstKeys).uniq().without("$$hashKey").value();return keys.reduce(function(diff,k){var srcValue=src[k];var dstValue=dst[k];if(_.isDate(srcValue)&&_.isDate(dstValue)){if(srcValue.getTime()!=dstValue.getTime())diff[k]=dstValue}if(_.isObject(srcValue)&&_.isObject(dstValue)){var valueDiff=getDifference(srcValue,dstValue);utils.setFilled(diff,k,valueDiff)}else if(srcValue!==dstValue){diff[k]=dstValue}return diff},{})};return getDifference}();var getUpdates=function(){var getUpdates=function getUpdates(src,dst,isShallow){utils.assert(_.isObject(src),"first argument must be an object");utils.assert(_.isObject(dst),"second argument must be an object");var diff=getDifference(src,dst,isShallow);var paths=utils.toPaths(diff);var set=createSet(paths);var unset=createUnset(paths);var pull=createPull(unset);var updates={};utils.setFilled(updates,"$set",set);utils.setFilled(updates,"$unset",unset);utils.setFilled(updates,"$pull",pull);return updates};var createSet=function createSet(paths){var undefinedKeys=getUndefinedKeys(paths);return _.omit(paths,undefinedKeys)};var createUnset=function createUnset(paths){var undefinedKeys=getUndefinedKeys(paths);var unset=_.pick(paths,undefinedKeys);return _.reduce(unset,function(result,v,k){result[k]=true;return result},{})};var createPull=function createPull(unset){var arrKeyPaths=_.keys(unset).map(function(k){var split=k.match(/(.*)\.\d+$/);return split&&split[1]});return _.compact(arrKeyPaths).reduce(function(pull,k){pull[k]=null;return pull; -},{})};var getUndefinedKeys=function getUndefinedKeys(obj){return _.keys(obj).filter(function(k){var v=obj[k];return _.isUndefined(v)})};return getUpdates}();module.value("getUpdates",getUpdates)})()},function(module,exports){"use strict";var _module=angular.module("diffArray",["getUpdates"]);_module.factory("diffArray",["getUpdates",function(getUpdates){var LocalCollection=Package.minimongo.LocalCollection;var idStringify=LocalCollection._idStringify||Package["mongo-id"].MongoID.idStringify;var idParse=LocalCollection._idParse||Package["mongo-id"].MongoID.idParse;function diffArray(lastSeqArray,seqArray,callbacks,preventNestedDiff){preventNestedDiff=!!preventNestedDiff;var diffFn=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges;var oldObjIds=[];var newObjIds=[];var posOld={};var posNew={};var posCur={};var lengthCur=lastSeqArray.length;_.each(seqArray,function(doc,i){newObjIds.push({_id:doc._id});posNew[idStringify(doc._id)]=i});_.each(lastSeqArray,function(doc,i){oldObjIds.push({_id:doc._id});posOld[idStringify(doc._id)]=i;posCur[idStringify(doc._id)]=i});diffFn(oldObjIds,newObjIds,{addedBefore:function addedBefore(id,doc,before){var position=before?posCur[idStringify(before)]:lengthCur;_.each(posCur,function(pos,id){if(pos>=position)posCur[id]++});lengthCur++;posCur[idStringify(id)]=position;callbacks.addedAt(id,seqArray[posNew[idStringify(id)]],position,before)},movedBefore:function movedBefore(id,before){var prevPosition=posCur[idStringify(id)];var position=before?posCur[idStringify(before)]:lengthCur-1;_.each(posCur,function(pos,id){if(pos>=prevPosition&&pos<=position)posCur[id]--;else if(pos<=prevPosition&&pos>=position)posCur[id]++});posCur[idStringify(id)]=position;callbacks.movedTo(id,seqArray[posNew[idStringify(id)]],prevPosition,position,before)},removed:function removed(id){var prevPosition=posCur[idStringify(id)];_.each(posCur,function(pos,id){if(pos>=prevPosition)posCur[id]--});delete posCur[idStringify(id)];lengthCur--;callbacks.removedAt(id,lastSeqArray[posOld[idStringify(id)]],prevPosition)}});_.each(posNew,function(pos,idString){if(!_.has(posOld,idString))return;var id=idParse(idString);var newItem=seqArray[pos]||{};var oldItem=lastSeqArray[posOld[idString]];var updates=getUpdates(oldItem,newItem,preventNestedDiff);if(!_.isEmpty(updates))callbacks.changedAt(id,updates,pos,oldItem)})}diffArray.shallow=function(lastSeqArray,seqArray,callbacks){return diffArray(lastSeqArray,seqArray,callbacks,true)};diffArray.deepCopyChanges=function(oldItem,newItem){var setDiff=getUpdates(oldItem,newItem).$set;_.each(setDiff,function(v,deepKey){setDeep(oldItem,deepKey,v)})};diffArray.deepCopyRemovals=function(oldItem,newItem){var unsetDiff=getUpdates(oldItem,newItem).$unset;_.each(unsetDiff,function(v,deepKey){unsetDeep(oldItem,deepKey)})};diffArray.getChanges=function(newCollection,oldCollection,diffMethod){var changes={added:[],removed:[],changed:[]};diffMethod(oldCollection,newCollection,{addedAt:function addedAt(id,item,index){changes.added.push({item:item,index:index})},removedAt:function removedAt(id,item,index){changes.removed.push({item:item,index:index})},changedAt:function changedAt(id,updates,index,oldItem){changes.changed.push({selector:id,modifier:updates})},movedTo:function movedTo(id,item,fromIndex,toIndex){}});return changes};var setDeep=function setDeep(obj,deepKey,v){var split=deepKey.split(".");var initialKeys=_.initial(split);var lastKey=_.last(split);initialKeys.reduce(function(subObj,k,i){var nextKey=split[i+1];if(isNumStr(nextKey)){if(subObj[k]===null)subObj[k]=[];if(subObj[k].length==parseInt(nextKey))subObj[k].push(null)}else if(subObj[k]===null||!isHash(subObj[k])){subObj[k]={}}return subObj[k]},obj);var deepObj=getDeep(obj,initialKeys);deepObj[lastKey]=v;return v};var unsetDeep=function unsetDeep(obj,deepKey){var split=deepKey.split(".");var initialKeys=_.initial(split);var lastKey=_.last(split);var deepObj=getDeep(obj,initialKeys);if(_.isArray(deepObj)&&isNumStr(lastKey))return!!deepObj.splice(lastKey,1);else return delete deepObj[lastKey]};var getDeep=function getDeep(obj,keys){return keys.reduce(function(subObj,k){return subObj[k]},obj)};var isHash=function isHash(obj){return _.isObject(obj)&&Object.getPrototypeOf(obj)===Object.prototype};var isNumStr=function isNumStr(str){return str.match(/^\d+$/)};return diffArray}])},function(module,exports){"use strict";angular.module("angular-meteor.settings",[]).constant("$angularMeteorSettings",{suppressWarnings:false})},function(module,exports){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function($compile,$document,$rootScope){var Router=(Package["iron:router"]||{}).Router;if(!Router)return;var isLoaded=false;Router.onAfterAction(function(req,res,next){Tracker.afterFlush(function(){if(isLoaded)return;$compile($document)($rootScope);if(!$rootScope.$$phase)$rootScope.$apply();isLoaded=true})})}])},function(module,exports){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};var angularMeteorUtils=angular.module("angular-meteor.utils",["angular-meteor.settings"]);angularMeteorUtils.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function($q,$timeout,$angularMeteorSettings){var self=this;this.autorun=function(scope,fn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var comp=Tracker.autorun(function(c){fn(c);if(!c.firstRun)$timeout(angular.noop,0)});scope.$on("$destroy",function(){comp.stop()});return comp};this.stripDollarPrefixedKeys=function(data){if(!_.isObject(data)||data instanceof Date||data instanceof File||EJSON.toJSONValue(data).$type==="oid"||(typeof FS==="undefined"?"undefined":_typeof(FS))==="object"&&data instanceof FS.File)return data;var out=_.isArray(data)?[]:{};_.each(data,function(v,k){if(typeof k!=="string"||k.charAt(0)!=="$")out[k]=self.stripDollarPrefixedKeys(v)});return out};this.fulfill=function(deferred,boundError,boundResult){return function(err,result){if(err)deferred.reject(boundError==null?err:boundError);else if(typeof boundResult=="function")deferred.resolve(boundResult==null?result:boundResult(result));else deferred.resolve(boundResult==null?result:boundResult)}};this.promissor=function(obj,method){return function(){var deferred=$q.defer();var fulfill=self.fulfill(deferred);var args=_.toArray(arguments).concat(fulfill);obj[method].apply(obj,args);return deferred.promise}};this.promiseAll=function(promises){var allPromise=$q.all(promises);allPromise.finally(function(){$timeout(angular.noop)});return allPromise};this.getCollectionByName=function(string){return Mongo.Collection.get(string)};this.findIndexById=function(collection,doc){var foundDoc=_.find(collection,function(colDoc){return EJSON.equals(colDoc._id,doc._id)});return _.indexOf(collection,foundDoc)}}]);angularMeteorUtils.run(["$rootScope","$meteorUtils",function($rootScope,$meteorUtils){Object.getPrototypeOf($rootScope).$meteorAutorun=function(fn){return $meteorUtils.autorun(this,fn)}}])},function(module,exports){"use strict";var angularMeteorSubscribe=angular.module("angular-meteor.subscribe",["angular-meteor.settings"]);angularMeteorSubscribe.service("$meteorSubscribe",["$q","$angularMeteorSettings",function($q,$angularMeteorSettings){var self=this;this._subscribe=function(scope,deferred,args){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var subscription=null;var lastArg=args[args.length-1];if(angular.isObject(lastArg)&&angular.isFunction(lastArg.onStop)){var _onStop=lastArg.onStop;args.pop()}args.push({onReady:function onReady(){deferred.resolve(subscription)},onStop:function onStop(err){if(!deferred.promise.$$state.status){if(err)deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}else if(_onStop)_onStop.apply(this,Array.prototype.slice.call(arguments))}});subscription=Meteor.subscribe.apply(scope,args);return subscription};this.subscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=null;self._subscribe(this,deferred,args);return deferred.promise}}]);angularMeteorSubscribe.run(["$rootScope","$q","$meteorSubscribe",function($rootScope,$q,$meteorSubscribe){Object.getPrototypeOf($rootScope).$meteorSubscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=$meteorSubscribe._subscribe(this,deferred,args);this.$on("$destroy",function(){subscription.stop()});return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorCollection=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray","angular-meteor.settings"]);angularMeteorCollection.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,$rootScope,$timeout,diffArray,$angularMeteorSettings){function AngularMeteorCollection(curDefFunc,collection,diffArrayFunc,autoClientSave){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var data=[];data._serverBackup=[];data._diffArrayFunc=diffArrayFunc;data._hObserve=null;data._hNewCurAutorun=null;data._hDataAutorun=null;if(angular.isDefined(collection)){data.$$collection=collection}else{var cursor=curDefFunc();data.$$collection=$meteorUtils.getCollectionByName(cursor.collection.name)}_.extend(data,AngularMeteorCollection);data._startCurAutorun(curDefFunc,autoClientSave);return data}AngularMeteorCollection._startCurAutorun=function(curDefFunc,autoClientSave){var self=this;self._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){self._stopCursor()});if(autoClientSave)self._setAutoClientSave();self._updateCursor(curDefFunc(),autoClientSave)})};AngularMeteorCollection.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorCollection.save=function(docs,useUnsetModifier){if(!docs)docs=this;docs=[].concat(docs);var promises=docs.map(function(doc){return this._upsertDoc(doc,useUnsetModifier)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._upsertDoc=function(doc,useUnsetModifier){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_.partial($meteorUtils.fulfill,deferred,null);doc=$meteorUtils.stripDollarPrefixedKeys(doc);var docId=doc._id;var isExist=collection.findOne(docId);if(isExist){delete doc._id;var modifier=useUnsetModifier?{$unset:doc}:{$set:doc};collection.update(docId,modifier,createFulfill(function(){return{_id:docId,action:"updated"}}))}else{collection.insert(doc,createFulfill(function(id){return{_id:id,action:"inserted"}}))}return deferred.promise};AngularMeteorCollection._updateDiff=function(selector,update,callback){callback=callback||angular.noop;var setters=_.omit(update,"$pull");var updates=[setters];_.each(update.$pull,function(pull,prop){var puller={};puller[prop]=pull;updates.push({$pull:puller})});this._updateParallel(selector,updates,callback)};AngularMeteorCollection._updateParallel=function(selector,updates,callback){var self=this;var done=_.after(updates.length,callback);var next=function next(err,affectedDocsNum){if(err)return callback(err);done(null,affectedDocsNum)};_.each(updates,function(update){self.$$collection.update(selector,update,next)})};AngularMeteorCollection.remove=function(keyOrDocs){var keys;if(!keyOrDocs){keys=_.pluck(this,"_id")}else{keyOrDocs=[].concat(keyOrDocs);keys=_.map(keyOrDocs,function(keyOrDoc){return keyOrDoc._id||keyOrDoc})}check(keys,[Match.OneOf(String,Mongo.ObjectID)]);var promises=keys.map(function(key){return this._removeDoc(key)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._removeDoc=function(id){var deferred=$q.defer();var collection=this.$$collection;var fulfill=$meteorUtils.fulfill(deferred,null,{_id:id,action:"removed"});collection.remove(id,fulfill);return deferred.promise};AngularMeteorCollection._updateCursor=function(cursor,autoClientSave){var self=this;if(self._hObserve)self._stopObserving();self._hObserve=cursor.observe({addedAt:function addedAt(doc,atIndex){self.splice(atIndex,0,doc);self._serverBackup.splice(atIndex,0,doc);self._setServerUpdateMode()},changedAt:function changedAt(doc,oldDoc,atIndex){diffArray.deepCopyChanges(self[atIndex],doc);diffArray.deepCopyRemovals(self[atIndex],doc);self._serverBackup[atIndex]=self[atIndex];self._setServerUpdateMode()},movedTo:function movedTo(doc,fromIndex,toIndex){self.splice(fromIndex,1);self.splice(toIndex,0,doc);self._serverBackup.splice(fromIndex,1);self._serverBackup.splice(toIndex,0,doc);self._setServerUpdateMode()},removedAt:function removedAt(oldDoc){var removedIndex=$meteorUtils.findIndexById(self,oldDoc);if(removedIndex!=-1){self.splice(removedIndex,1);self._serverBackup.splice(removedIndex,1);self._setServerUpdateMode()}else{removedIndex=$meteorUtils.findIndexById(self._serverBackup,oldDoc);if(removedIndex!=-1){self._serverBackup.splice(removedIndex,1)}}}});self._hDataAutorun=Tracker.autorun(function(){cursor.fetch();if(self._serverMode)self._unsetServerUpdateMode(autoClientSave)})};AngularMeteorCollection._stopObserving=function(){this._hObserve.stop();this._hDataAutorun.stop();delete this._serverMode;delete this._hUnsetTimeout};AngularMeteorCollection._setServerUpdateMode=function(name){this._serverMode=true;this._unsetAutoClientSave()};AngularMeteorCollection._unsetServerUpdateMode=function(autoClientSave){var self=this;if(self._hUnsetTimeout){$timeout.cancel(self._hUnsetTimeout);self._hUnsetTimeout=null}self._hUnsetTimeout=$timeout(function(){self._serverMode=false;var changes=diffArray.getChanges(self,self._serverBackup,self._diffArrayFunc);self._saveChanges(changes);if(autoClientSave)self._setAutoClientSave()},0)};AngularMeteorCollection.stop=function(){this._stopCursor();this._hNewCurAutorun.stop()};AngularMeteorCollection._stopCursor=function(){this._unsetAutoClientSave();if(this._hObserve){this._hObserve.stop();this._hDataAutorun.stop()}this.splice(0);this._serverBackup.splice(0)};AngularMeteorCollection._unsetAutoClientSave=function(name){if(this._hRegAutoBind){this._hRegAutoBind();this._hRegAutoBind=null}};AngularMeteorCollection._setAutoClientSave=function(){var self=this;self._unsetAutoClientSave();self._hRegAutoBind=$rootScope.$watch(function(){return self},function(nItems,oItems){if(nItems===oItems)return;var changes=diffArray.getChanges(self,oItems,self._diffArrayFunc);self._unsetAutoClientSave();self._saveChanges(changes);self._setAutoClientSave()},true)};AngularMeteorCollection._saveChanges=function(changes){var self=this;var addedDocs=changes.added.reverse().map(function(descriptor){self.splice(descriptor.index,1);return descriptor.item});if(addedDocs.length)self.save(addedDocs);var removedDocs=changes.removed.map(function(descriptor){return descriptor.item});if(removedDocs.length)self.remove(removedDocs);changes.changed.forEach(function(descriptor){self._updateDiff(descriptor.selector,descriptor.modifier)})};return AngularMeteorCollection}]);angularMeteorCollection.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function($meteorCollection,diffArray,$angularMeteorSettings){function $meteorCollectionFS(reactiveFunc,autoClientSave,collection){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return new $meteorCollection(reactiveFunc,autoClientSave,collection,diffArray.shallow)}return $meteorCollectionFS}]);angularMeteorCollection.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(AngularMeteorCollection,$rootScope,diffArray){function $meteorCollection(reactiveFunc,autoClientSave,collection,diffFn){if(!reactiveFunc){throw new TypeError("The first argument of $meteorCollection is undefined.")}if(!(angular.isFunction(reactiveFunc)||angular.isFunction(reactiveFunc.find))){throw new TypeError("The first argument of $meteorCollection must be a function or "+"a have a find function property.")}if(!angular.isFunction(reactiveFunc)){collection=angular.isDefined(collection)?collection:reactiveFunc;reactiveFunc=_.bind(reactiveFunc.find,reactiveFunc)}autoClientSave=angular.isDefined(autoClientSave)?autoClientSave:true;diffFn=diffFn||diffArray;return new AngularMeteorCollection(reactiveFunc,collection,diffFn,autoClientSave)}return $meteorCollection}]);angularMeteorCollection.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function($rootScope,$meteorCollection,$meteorCollectionFS,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorCollection=$meteorStopper($meteorCollection);scopeProto.$meteorCollectionFS=$meteorStopper($meteorCollectionFS)}])},function(module,exports){"use strict";var angularMeteorObject=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray","angular-meteor.settings"]);angularMeteorObject.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,diffArray,getUpdates,AngularMeteorCollection,$angularMeteorSettings){AngularMeteorObject.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"];function AngularMeteorObject(collection,selector,options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var helpers=collection._helpers;var data=_.isFunction(helpers)?Object.create(helpers.prototype):{};var doc=collection.findOne(selector,options);var collectionExtension=_.pick(AngularMeteorCollection,"_updateParallel");_.extend(data,doc);_.extend(data,AngularMeteorObject);_.extend(data,collectionExtension);data.$$options=_.omit(options,"skip","limit");data.$$collection=collection;data.$$id=data._getId(selector);data._serverBackup=doc||{};return data}AngularMeteorObject.getRawObject=function(){return angular.copy(_.omit(this,this.$$internalProps))};AngularMeteorObject.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorObject.save=function(custom){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_.partial($meteorUtils.fulfill,deferred,null);var oldDoc=collection.findOne(this.$$id);var mods;if(oldDoc){if(custom)mods={$set:custom};else{mods=getUpdates(oldDoc,this.getRawObject());if(_.isEmpty(mods)){return $q.when({action:"updated"})}}this._updateDiff(mods,createFulfill({action:"updated"}))}else{if(custom)mods=_.clone(custom);else mods=this.getRawObject();mods._id=mods._id||this.$$id;collection.insert(mods,createFulfill({action:"inserted"}))}return deferred.promise};AngularMeteorObject._updateDiff=function(update,callback){var selector=this.$$id;AngularMeteorCollection._updateDiff.call(this,selector,update,callback)};AngularMeteorObject.reset=function(keepClientProps){var self=this;var options=this.$$options;var id=this.$$id;var doc=this.$$collection.findOne(id,options);if(doc){var docKeys=_.keys(doc);var docExtension=_.pick(doc,docKeys);var clientProps;_.extend(self,docExtension);_.extend(self._serverBackup,docExtension);if(keepClientProps){clientProps=_.intersection(_.keys(self),_.keys(self._serverBackup))}else{clientProps=_.keys(self)}var serverProps=_.keys(doc);var removedKeys=_.difference(clientProps,serverProps,self.$$internalProps);removedKeys.forEach(function(prop){delete self[prop];delete self._serverBackup[prop]})}else{_.keys(this.getRawObject()).forEach(function(prop){delete self[prop]});self._serverBackup={}}};AngularMeteorObject.stop=function(){if(this.unregisterAutoDestroy)this.unregisterAutoDestroy();if(this.unregisterAutoBind)this.unregisterAutoBind();if(this.autorunComputation&&this.autorunComputation.stop)this.autorunComputation.stop()};AngularMeteorObject._getId=function(selector){var options=_.extend({},this.$$options,{fields:{_id:1},reactive:false,transform:null});var doc=this.$$collection.findOne(selector,options);if(doc)return doc._id;if(selector instanceof Mongo.ObjectID)return selector;if(_.isString(selector))return selector;return new Mongo.ObjectID};return AngularMeteorObject}]);angularMeteorObject.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function($rootScope,$meteorUtils,getUpdates,AngularMeteorObject){function $meteorObject(collection,id,auto,options){if(!collection){throw new TypeError("The first argument of $meteorObject is undefined.")}if(!angular.isFunction(collection.findOne)){throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.")}var data=new AngularMeteorObject(collection,id,options);data._auto=auto!==false;_.extend(data,$meteorObject);data._setAutos();return data}$meteorObject._setAutos=function(){var self=this;this.autorunComputation=$meteorUtils.autorun($rootScope,function(){self.reset(true)});this.unregisterAutoBind=this._auto&&$rootScope.$watch(function(){return self.getRawObject()},function(item,oldItem){if(item!==oldItem)self.save()},true);this.unregisterAutoDestroy=$rootScope.$on("$destroy",function(){if(self&&self.stop)self.pop()})};return $meteorObject}]);angularMeteorObject.run(["$rootScope","$meteorObject","$meteorStopper",function($rootScope,$meteorObject,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorObject=$meteorStopper($meteorObject)}])},function(module,exports){"use strict";var angularMeteorUser=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core","angular-meteor.settings"]);angularMeteorUser.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function($rootScope,$meteorUtils,$q,$angularMeteorSettings){var pack=Package["accounts-base"];if(!pack)return;var self=this;var Accounts=pack.Accounts;this.waitForUser=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn())deferred.resolve(Meteor.user())},true);return deferred.promise};this.requireUser=function(){if(!$angularMeteorSettings.suppressWarnings){console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings")}var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn()){if(Meteor.user()===null)deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user())}},true);return deferred.promise};this.requireValidUser=function(validatorFn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return self.requireUser(true).then(function(user){var valid=validatorFn(user);if(valid===true)return user;else if(typeof valid==="string")return $q.reject(valid);else return $q.reject("FORBIDDEN")})};this.loginWithPassword=$meteorUtils.promissor(Meteor,"loginWithPassword");this.createUser=$meteorUtils.promissor(Accounts,"createUser");this.changePassword=$meteorUtils.promissor(Accounts,"changePassword");this.forgotPassword=$meteorUtils.promissor(Accounts,"forgotPassword");this.resetPassword=$meteorUtils.promissor(Accounts,"resetPassword");this.verifyEmail=$meteorUtils.promissor(Accounts,"verifyEmail");this.logout=$meteorUtils.promissor(Meteor,"logout");this.logoutOtherClients=$meteorUtils.promissor(Meteor,"logoutOtherClients");this.loginWithFacebook=$meteorUtils.promissor(Meteor,"loginWithFacebook");this.loginWithTwitter=$meteorUtils.promissor(Meteor,"loginWithTwitter");this.loginWithGoogle=$meteorUtils.promissor(Meteor,"loginWithGoogle");this.loginWithGithub=$meteorUtils.promissor(Meteor,"loginWithGithub");this.loginWithMeteorDeveloperAccount=$meteorUtils.promissor(Meteor,"loginWithMeteorDeveloperAccount");this.loginWithMeetup=$meteorUtils.promissor(Meteor,"loginWithMeetup");this.loginWithWeibo=$meteorUtils.promissor(Meteor,"loginWithWeibo")}]);angularMeteorUser.run(["$rootScope","$angularMeteorSettings","$$Core",function($rootScope,$angularMeteorSettings,$$Core){var ScopeProto=Object.getPrototypeOf($rootScope);_.extend(ScopeProto,$$Core);$rootScope.autorun(function(){if(!Meteor.user)return;$rootScope.currentUser=Meteor.user();$rootScope.loggingIn=Meteor.loggingIn()})}])},function(module,exports){"use strict";var angularMeteorMethods=angular.module("angular-meteor.methods",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorMethods.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){this.call=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();var fulfill=$meteorUtils.fulfill(deferred);var args=_.toArray(arguments).concat(fulfill);Meteor.call.apply(this,args);return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorSession=angular.module("angular-meteor.session",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorSession.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function($meteorUtils,$parse,$angularMeteorSettings){return function(session){return{bind:function bind(scope,model){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var getter=$parse(model);var setter=getter.assign;$meteorUtils.autorun(scope,function(){setter(scope,Session.get(session))});scope.$watch(model,function(newItem,oldItem){Session.set(session,getter(scope))},true)}}}}])},function(module,exports){"use strict";var angularMeteorCamera=angular.module("angular-meteor.camera",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorCamera.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var pack=Package["mdg:camera"];if(!pack)return;var MeteorCamera=pack.MeteorCamera;this.getPicture=function(options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");options=options||{};var deferred=$q.defer();MeteorCamera.getPicture(options,$meteorUtils.fulfill(deferred));return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorStopper=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);angularMeteorStopper.factory("$meteorStopper",["$q","$meteorSubscribe",function($q,$meteorSubscribe){function $meteorStopper($meteorEntity){return function(){var args=Array.prototype.slice.call(arguments);var meteorEntity=$meteorEntity.apply(this,args);angular.extend(meteorEntity,$meteorStopper);meteorEntity.$$scope=this;this.$on("$destroy",function(){meteorEntity.stop();if(meteorEntity.subscription)meteorEntity.subscription.stop()});return meteorEntity}}$meteorStopper.subscribe=function(){var args=Array.prototype.slice.call(arguments);this.subscription=$meteorSubscribe._subscribe(this.$$scope,$q.defer(),args);return this};return $meteorStopper}])},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var name=exports.name="angular-meteor.utilities";var utils=exports.utils="$$utils";angular.module(name,[]).service(utils,["$rootScope",function($rootScope){var self=this;this.isCursor=function(obj){return obj instanceof Meteor.Collection.Cursor};this.isScope=function(obj){return obj instanceof $rootScope.constructor};this.areSiblings=function(obj1,obj2){return _.isObject(obj1)&&_.isObject(obj2)&&Object.getPrototypeOf(obj1)===Object.getPrototypeOf(obj2)};this.bind=function(fn,context,tap){tap=_.isFunction(tap)?tap:angular.noop;if(_.isFunction(fn))return bindFn(fn,context,tap);if(_.isObject(fn))return bindObj(fn,context,tap);return fn};function bindFn(fn,context,tap){return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var result=fn.apply(context,args);tap.call(context,{result:result,args:args});return result}}function bindObj(obj,context,tap){return _.keys(obj).reduce(function(bound,k){bound[k]=self.bind(obj[k],context,tap);return bound},{})}}])},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}_this._mixins.filter(_.isFunction).forEach(function(mixin){mixin.call.apply(mixin,[context].concat(args))});return context};this._extend=function(obj){var _ref;return(_ref=_).extend.apply(_ref,[obj].concat(_toConsumableArray(_this._mixins)))}})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.name=undefined;var _mixer=__webpack_require__(15);var name=exports.name="angular-meteor.scope";angular.module(name,[_mixer.name]).run(["$rootScope",_mixer.Mixer,function($rootScope,$Mixer){var Scope=$rootScope.constructor;var $new=$rootScope.$new;$Mixer._autoExtend.push(Scope.prototype);$Mixer._autoConstruct.push($rootScope);Scope.prototype.$new=function(){var scope=$new.apply(this,arguments);return $Mixer._construct(scope)}}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Core=exports.name=undefined;var _utils=__webpack_require__(14);var _mixer=__webpack_require__(15);function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i2?_len-2:0),_key=2;_key<_len;_key++){watcherArgs[_key-2]=arguments[_key]}this.$$watchEntity.apply(this,[k,watcher].concat(watcherArgs))}this.$$vm.$$dependencies[k].depend();return $parse(k)(this.$$vm)};$$Reactive.$$watchEntity=function(k,watcher){var _this2=this;var getVal=_.partial($parse(k),this.$$vm);var initialVal=getVal();for(var _len2=arguments.length,watcherArgs=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){watcherArgs[_key2-2]=arguments[_key2]}watcher.call.apply(watcher,[this,getVal,function(val,oldVal){var hasChanged=val!==initialVal||val!==oldVal;if(hasChanged)_this2.$$changed(k)}].concat(watcherArgs))};$$Reactive.$$setFnHelper=function(k,fn){var _this3=this;this.autorun(function(computation){var model=fn.apply(_this3.$$vm);Tracker.nonreactive(function(){if($$utils.isCursor(model)){(function(){var observation=_this3.$$handleCursor(k,model);computation.onInvalidate(function(){observation.stop();_this3.$$vm[k].splice(0)})})()}else{_this3.$$handleNonCursor(k,model)}_this3.$$changed(k)})})};$$Reactive.$$setValHelper=function(k,v){var _this4=this;var watch=arguments.length<=2||arguments[2]===undefined?true:arguments[2];if(watch){var isDeep=_.isObject(v);this.getReactively(k,isDeep)}Object.defineProperty(this.$$vm,k,{configurable:true,enumerable:true,get:function get(){return v},set:function set(newVal){v=newVal;_this4.$$changed(k)}})};$$Reactive.$$handleCursor=function(k,cursor){var _this5=this;if(angular.isUndefined(this.$$vm[k])){this.$$setValHelper(k,cursor.fetch(),false)}else{var diff=jsondiffpatch.diff(this.$$vm[k],cursor.fetch());jsondiffpatch.patch(this.$$vm[k],diff)}var observation=cursor.observe({addedAt:function addedAt(doc,atIndex){if(!observation)return;_this5.$$vm[k].splice(atIndex,0,doc);_this5.$$changed(k)},changedAt:function changedAt(doc,oldDoc,atIndex){var diff=jsondiffpatch.diff(_this5.$$vm[k][atIndex],doc);jsondiffpatch.patch(_this5.$$vm[k][atIndex],diff);_this5.$$changed(k)},movedTo:function movedTo(doc,fromIndex,toIndex){_this5.$$vm[k].splice(fromIndex,1);_this5.$$vm[k].splice(toIndex,0,doc);_this5.$$changed(k)},removedAt:function removedAt(oldDoc,atIndex){_this5.$$vm[k].splice(atIndex,1);_this5.$$changed(k)}});return observation};$$Reactive.$$handleNonCursor=function(k,data){var v=this.$$vm[k];if(angular.isDefined(v)){delete this.$$vm[k];v=null}if(angular.isUndefined(v)){this.$$setValHelper(k,data)}else if($$utils.areSiblings(v,data)){var diff=jsondiffpatch.diff(v,data);jsondiffpatch.patch(v,diff);this.$$changed(k)}else{this.$$vm[k]=data}};$$Reactive.$$depend=function(k){this.$$vm.$$dependencies[k].depend()};$$Reactive.$$changed=function(k){this.$$throttledDigest();this.$$vm.$$dependencies[k].changed()};return $$Reactive}])},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var name=exports.name="angular-templates";try{angular.module(name)}catch(e){angular.module(name,[])}}])}).call(this);if(typeof Package==="undefined")Package={};Package["angular-meteor-data"]={}})(); \ No newline at end of file +return this.processor.process(new PatchContext(left,delta))};DiffPatcher.prototype.reverse=function(delta){return this.processor.process(new ReverseContext(delta))};DiffPatcher.prototype.unpatch=function(right,delta){return this.patch(right,this.reverse(delta))};exports.DiffPatcher=DiffPatcher},{"./contexts/diff":4,"./contexts/patch":5,"./contexts/reverse":6,"./filters/arrays":10,"./filters/dates":11,"./filters/nested":13,"./filters/texts":14,"./filters/trivial":15,"./pipe":17,"./processor":18}],9:[function(require,module,exports){exports.isBrowser=typeof window!=="undefined"},{}],10:[function(require,module,exports){var DiffContext=require("../contexts/diff").DiffContext;var PatchContext=require("../contexts/patch").PatchContext;var ReverseContext=require("../contexts/reverse").ReverseContext;var lcs=require("./lcs");var ARRAY_MOVE=3;var isArray=typeof Array.isArray==="function"?Array.isArray:function(a){return a instanceof Array};var arrayIndexOf=typeof Array.prototype.indexOf==="function"?function(array,item){return array.indexOf(item)}:function(array,item){var length=array.length;for(var i=0;i0&&len2>0&&!matchContext.objectHash&&typeof matchContext.matchByPosition!=="boolean"){matchContext.matchByPosition=!arraysHaveMatchByRef(array1,array2,len1,len2)}while(commonHead0){for(var removeItemIndex1=0;removeItemIndex1=0;index--){index1=toRemove[index];var indexDiff=delta["_"+index1];var removedValue=array.splice(index1,1)[0];if(indexDiff[2]===ARRAY_MOVE){toInsert.push({index:indexDiff[1],value:removedValue})}}toInsert=toInsert.sort(compare.numericallyBy("index"));var toInsertLength=toInsert.length;for(index=0;index0){for(index=0;indexreverseIndex){reverseIndex++}else if(moveFromIndex>=reverseIndex&&moveToIndexmatrix[index1-1][index2]){return backtrack(matrix,array1,array2,index1,index2-1,context)}else{return backtrack(matrix,array1,array2,index1-1,index2,context)}};var get=function(array1,array2,match,context){context=context||{};var matrix=lengthMatrix(array1,array2,match||defaultMatch,context);var result=backtrack(matrix,array1,array2,array1.length,array2.length,context);if(typeof array1==="string"&&typeof array2==="string"){result.sequence=result.sequence.join("")}return result};exports.get=get},{}],13:[function(require,module,exports){var DiffContext=require("../contexts/diff").DiffContext;var PatchContext=require("../contexts/patch").PatchContext;var ReverseContext=require("../contexts/reverse").ReverseContext;var collectChildrenDiffFilter=function collectChildrenDiffFilter(context){if(!context||!context.children){return}var length=context.children.length;var child;var result=context.result;for(var index=0;index1)level=isShallow;else if(isShallow)level=1;if(level){src=utils.rip(src,level);dst=utils.rip(dst,level)}return compare(src,dst)};var compare=function compare(src,dst){var srcKeys=_underscore2.default.keys(src);var dstKeys=_underscore2.default.keys(dst);var keys=_underscore2.default.chain([]).concat(srcKeys).concat(dstKeys).uniq().without("$$hashKey").value();return keys.reduce(function(diff,k){var srcValue=src[k];var dstValue=dst[k];if(_underscore2.default.isDate(srcValue)&&_underscore2.default.isDate(dstValue)){if(srcValue.getTime()!=dstValue.getTime())diff[k]=dstValue}if(_underscore2.default.isObject(srcValue)&&_underscore2.default.isObject(dstValue)){var valueDiff=getDifference(srcValue,dstValue); +utils.setFilled(diff,k,valueDiff)}else if(srcValue!==dstValue){diff[k]=dstValue}return diff},{})};return getDifference}();var getUpdates=function(){var getUpdates=function getUpdates(src,dst,isShallow){utils.assert(_underscore2.default.isObject(src),"first argument must be an object");utils.assert(_underscore2.default.isObject(dst),"second argument must be an object");var diff=getDifference(src,dst,isShallow);var paths=utils.toPaths(diff);var set=createSet(paths);var unset=createUnset(paths);var pull=createPull(unset);var updates={};utils.setFilled(updates,"$set",set);utils.setFilled(updates,"$unset",unset);utils.setFilled(updates,"$pull",pull);return updates};var createSet=function createSet(paths){var undefinedKeys=getUndefinedKeys(paths);return _underscore2.default.omit(paths,undefinedKeys)};var createUnset=function createUnset(paths){var undefinedKeys=getUndefinedKeys(paths);var unset=_underscore2.default.pick(paths,undefinedKeys);return _underscore2.default.reduce(unset,function(result,v,k){result[k]=true;return result},{})};var createPull=function createPull(unset){var arrKeyPaths=_underscore2.default.keys(unset).map(function(k){var split=k.match(/(.*)\.\d+$/);return split&&split[1]});return _underscore2.default.compact(arrKeyPaths).reduce(function(pull,k){pull[k]=null;return pull},{})};var getUndefinedKeys=function getUndefinedKeys(obj){return _underscore2.default.keys(obj).filter(function(k){var v=obj[k];return _underscore2.default.isUndefined(v)})};return getUpdates}();module.value("getUpdates",getUpdates)})()},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _underscore=__webpack_require__(3);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}if(typeof _underscore2.default==="undefined"){if(typeof Package.underscore==="undefined"){throw new Error("underscore is missing")}}exports.default=_underscore2.default||Package.underscore._;module.exports=exports["default"]},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_3__},function(module,exports,__webpack_require__){"use strict";var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}"use strict";var _module=angular.module("diffArray",["getUpdates"]);_module.factory("diffArray",["getUpdates",function(getUpdates){var LocalCollection=Package.minimongo.LocalCollection;var idStringify=LocalCollection._idStringify||Package["mongo-id"].MongoID.idStringify;var idParse=LocalCollection._idParse||Package["mongo-id"].MongoID.idParse;function diffArray(lastSeqArray,seqArray,callbacks,preventNestedDiff){preventNestedDiff=!!preventNestedDiff;var diffFn=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges;var oldObjIds=[];var newObjIds=[];var posOld={};var posNew={};var posCur={};var lengthCur=lastSeqArray.length;_underscore2.default.each(seqArray,function(doc,i){newObjIds.push({_id:doc._id});posNew[idStringify(doc._id)]=i});_underscore2.default.each(lastSeqArray,function(doc,i){oldObjIds.push({_id:doc._id});posOld[idStringify(doc._id)]=i;posCur[idStringify(doc._id)]=i});diffFn(oldObjIds,newObjIds,{addedBefore:function addedBefore(id,doc,before){var position=before?posCur[idStringify(before)]:lengthCur;_underscore2.default.each(posCur,function(pos,id){if(pos>=position)posCur[id]++});lengthCur++;posCur[idStringify(id)]=position;callbacks.addedAt(id,seqArray[posNew[idStringify(id)]],position,before)},movedBefore:function movedBefore(id,before){var prevPosition=posCur[idStringify(id)];var position=before?posCur[idStringify(before)]:lengthCur-1;_underscore2.default.each(posCur,function(pos,id){if(pos>=prevPosition&&pos<=position)posCur[id]--;else if(pos<=prevPosition&&pos>=position)posCur[id]++});posCur[idStringify(id)]=position;callbacks.movedTo(id,seqArray[posNew[idStringify(id)]],prevPosition,position,before)},removed:function removed(id){var prevPosition=posCur[idStringify(id)];_underscore2.default.each(posCur,function(pos,id){if(pos>=prevPosition)posCur[id]--});delete posCur[idStringify(id)];lengthCur--;callbacks.removedAt(id,lastSeqArray[posOld[idStringify(id)]],prevPosition)}});_underscore2.default.each(posNew,function(pos,idString){if(!_underscore2.default.has(posOld,idString))return;var id=idParse(idString);var newItem=seqArray[pos]||{};var oldItem=lastSeqArray[posOld[idString]];var updates=getUpdates(oldItem,newItem,preventNestedDiff);if(!_underscore2.default.isEmpty(updates))callbacks.changedAt(id,updates,pos,oldItem)})}diffArray.shallow=function(lastSeqArray,seqArray,callbacks){return diffArray(lastSeqArray,seqArray,callbacks,true)};diffArray.deepCopyChanges=function(oldItem,newItem){var setDiff=getUpdates(oldItem,newItem).$set;_underscore2.default.each(setDiff,function(v,deepKey){setDeep(oldItem,deepKey,v)})};diffArray.deepCopyRemovals=function(oldItem,newItem){var unsetDiff=getUpdates(oldItem,newItem).$unset;_underscore2.default.each(unsetDiff,function(v,deepKey){unsetDeep(oldItem,deepKey)})};diffArray.getChanges=function(newCollection,oldCollection,diffMethod){var changes={added:[],removed:[],changed:[]};diffMethod(oldCollection,newCollection,{addedAt:function addedAt(id,item,index){changes.added.push({item:item,index:index})},removedAt:function removedAt(id,item,index){changes.removed.push({item:item,index:index})},changedAt:function changedAt(id,updates,index,oldItem){changes.changed.push({selector:id,modifier:updates})},movedTo:function movedTo(id,item,fromIndex,toIndex){}});return changes};var setDeep=function setDeep(obj,deepKey,v){var split=deepKey.split(".");var initialKeys=_underscore2.default.initial(split);var lastKey=_underscore2.default.last(split);initialKeys.reduce(function(subObj,k,i){var nextKey=split[i+1];if(isNumStr(nextKey)){if(subObj[k]===null)subObj[k]=[];if(subObj[k].length==parseInt(nextKey))subObj[k].push(null)}else if(subObj[k]===null||!isHash(subObj[k])){subObj[k]={}}return subObj[k]},obj);var deepObj=getDeep(obj,initialKeys);deepObj[lastKey]=v;return v};var unsetDeep=function unsetDeep(obj,deepKey){var split=deepKey.split(".");var initialKeys=_underscore2.default.initial(split);var lastKey=_underscore2.default.last(split);var deepObj=getDeep(obj,initialKeys);if(_underscore2.default.isArray(deepObj)&&isNumStr(lastKey))return!!deepObj.splice(lastKey,1);else return delete deepObj[lastKey]};var getDeep=function getDeep(obj,keys){return keys.reduce(function(subObj,k){return subObj[k]},obj)};var isHash=function isHash(obj){return _underscore2.default.isObject(obj)&&Object.getPrototypeOf(obj)===Object.prototype};var isNumStr=function isNumStr(str){return str.match(/^\d+$/)};return diffArray}])},function(module,exports){"use strict";angular.module("angular-meteor.settings",[]).constant("$angularMeteorSettings",{suppressWarnings:true})},function(module,exports){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function($compile,$document,$rootScope){var Router=(Package["iron:router"]||{}).Router;if(!Router)return;var isLoaded=false;Router.onAfterAction(function(req,res,next){Tracker.afterFlush(function(){if(isLoaded)return;$compile($document)($rootScope);if(!$rootScope.$$phase)$rootScope.$apply();isLoaded=true})})}])},function(module,exports,__webpack_require__){"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj};var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}"use strict";var angularMeteorUtils=angular.module("angular-meteor.utils",["angular-meteor.settings"]);angularMeteorUtils.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function($q,$timeout,$angularMeteorSettings){var self=this;this.autorun=function(scope,fn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var comp=Tracker.autorun(function(c){fn(c);if(!c.firstRun)$timeout(angular.noop,0)});scope.$on("$destroy",function(){comp.stop()});return comp};this.stripDollarPrefixedKeys=function(data){if(!_underscore2.default.isObject(data)||data instanceof Date||data instanceof File||EJSON.toJSONValue(data).$type==="oid"||(typeof FS==="undefined"?"undefined":_typeof(FS))==="object"&&data instanceof FS.File)return data;var out=_underscore2.default.isArray(data)?[]:{};_underscore2.default.each(data,function(v,k){if(typeof k!=="string"||k.charAt(0)!=="$")out[k]=self.stripDollarPrefixedKeys(v)});return out};this.fulfill=function(deferred,boundError,boundResult){return function(err,result){if(err)deferred.reject(boundError==null?err:boundError);else if(typeof boundResult=="function")deferred.resolve(boundResult==null?result:boundResult(result));else deferred.resolve(boundResult==null?result:boundResult)}};this.promissor=function(obj,method){return function(){var deferred=$q.defer();var fulfill=self.fulfill(deferred);var args=_underscore2.default.toArray(arguments).concat(fulfill);obj[method].apply(obj,args);return deferred.promise}};this.promiseAll=function(promises){var allPromise=$q.all(promises);allPromise.finally(function(){$timeout(angular.noop)});return allPromise};this.getCollectionByName=function(string){return Mongo.Collection.get(string)};this.findIndexById=function(collection,doc){var foundDoc=_underscore2.default.find(collection,function(colDoc){return EJSON.equals(colDoc._id,doc._id)});return _underscore2.default.indexOf(collection,foundDoc)}}]);angularMeteorUtils.run(["$rootScope","$meteorUtils",function($rootScope,$meteorUtils){Object.getPrototypeOf($rootScope).$meteorAutorun=function(fn){return $meteorUtils.autorun(this,fn)}}])},function(module,exports){"use strict";var angularMeteorSubscribe=angular.module("angular-meteor.subscribe",["angular-meteor.settings"]);angularMeteorSubscribe.service("$meteorSubscribe",["$q","$angularMeteorSettings",function($q,$angularMeteorSettings){var self=this;this._subscribe=function(scope,deferred,args){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var subscription=null;var lastArg=args[args.length-1];if(angular.isObject(lastArg)&&angular.isFunction(lastArg.onStop)){var _onStop=lastArg.onStop;args.pop()}args.push({onReady:function onReady(){deferred.resolve(subscription)},onStop:function onStop(err){if(!deferred.promise.$$state.status){if(err)deferred.reject(err);else deferred.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}else if(_onStop)_onStop.apply(this,Array.prototype.slice.call(arguments))}});subscription=Meteor.subscribe.apply(scope,args);return subscription};this.subscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=null;self._subscribe(this,deferred,args);return deferred.promise}}]);angularMeteorSubscribe.run(["$rootScope","$q","$meteorSubscribe",function($rootScope,$q,$meteorSubscribe){Object.getPrototypeOf($rootScope).$meteorSubscribe=function(){var deferred=$q.defer();var args=Array.prototype.slice.call(arguments);var subscription=$meteorSubscribe._subscribe(this,deferred,args);this.$on("$destroy",function(){subscription.stop()});return deferred.promise}}])},function(module,exports,__webpack_require__){"use strict";var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}"use strict";var angularMeteorCollection=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray","angular-meteor.settings"]);angularMeteorCollection.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,$rootScope,$timeout,diffArray,$angularMeteorSettings){function AngularMeteorCollection(curDefFunc,collection,diffArrayFunc,autoClientSave){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var data=[];data._serverBackup=[];data._diffArrayFunc=diffArrayFunc;data._hObserve=null;data._hNewCurAutorun=null;data._hDataAutorun=null;if(angular.isDefined(collection)){data.$$collection=collection}else{var cursor=curDefFunc();data.$$collection=$meteorUtils.getCollectionByName(cursor.collection.name)}_underscore2.default.extend(data,AngularMeteorCollection);data._startCurAutorun(curDefFunc,autoClientSave);return data}AngularMeteorCollection._startCurAutorun=function(curDefFunc,autoClientSave){var self=this;self._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){self._stopCursor()});if(autoClientSave)self._setAutoClientSave();self._updateCursor(curDefFunc(),autoClientSave)})};AngularMeteorCollection.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorCollection.save=function(docs,useUnsetModifier){if(!docs)docs=this;docs=[].concat(docs);var promises=docs.map(function(doc){return this._upsertDoc(doc,useUnsetModifier)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._upsertDoc=function(doc,useUnsetModifier){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_underscore2.default.partial($meteorUtils.fulfill,deferred,null);doc=$meteorUtils.stripDollarPrefixedKeys(doc);var docId=doc._id;var isExist=collection.findOne(docId);if(isExist){delete doc._id;var modifier=useUnsetModifier?{$unset:doc}:{$set:doc};collection.update(docId,modifier,createFulfill(function(){return{_id:docId,action:"updated"}}))}else{collection.insert(doc,createFulfill(function(id){return{_id:id,action:"inserted"}}))}return deferred.promise};AngularMeteorCollection._updateDiff=function(selector,update,callback){callback=callback||angular.noop;var setters=_underscore2.default.omit(update,"$pull");var updates=[setters];_underscore2.default.each(update.$pull,function(pull,prop){var puller={};puller[prop]=pull;updates.push({$pull:puller})});this._updateParallel(selector,updates,callback)};AngularMeteorCollection._updateParallel=function(selector,updates,callback){var self=this;var done=_underscore2.default.after(updates.length,callback);var next=function next(err,affectedDocsNum){if(err)return callback(err);done(null,affectedDocsNum)};_underscore2.default.each(updates,function(update){self.$$collection.update(selector,update,next)})};AngularMeteorCollection.remove=function(keyOrDocs){var keys;if(!keyOrDocs){keys=_underscore2.default.pluck(this,"_id")}else{keyOrDocs=[].concat(keyOrDocs);keys=_underscore2.default.map(keyOrDocs,function(keyOrDoc){return keyOrDoc._id||keyOrDoc})}check(keys,[Match.OneOf(String,Mongo.ObjectID)]);var promises=keys.map(function(key){return this._removeDoc(key)},this);return $meteorUtils.promiseAll(promises)};AngularMeteorCollection._removeDoc=function(id){var deferred=$q.defer();var collection=this.$$collection;var fulfill=$meteorUtils.fulfill(deferred,null,{_id:id,action:"removed"});collection.remove(id,fulfill);return deferred.promise};AngularMeteorCollection._updateCursor=function(cursor,autoClientSave){var self=this;if(self._hObserve)self._stopObserving();self._hObserve=cursor.observe({addedAt:function addedAt(doc,atIndex){self.splice(atIndex,0,doc);self._serverBackup.splice(atIndex,0,doc);self._setServerUpdateMode()},changedAt:function changedAt(doc,oldDoc,atIndex){diffArray.deepCopyChanges(self[atIndex],doc);diffArray.deepCopyRemovals(self[atIndex],doc);self._serverBackup[atIndex]=self[atIndex];self._setServerUpdateMode()},movedTo:function movedTo(doc,fromIndex,toIndex){self.splice(fromIndex,1);self.splice(toIndex,0,doc);self._serverBackup.splice(fromIndex,1);self._serverBackup.splice(toIndex,0,doc);self._setServerUpdateMode()},removedAt:function removedAt(oldDoc){var removedIndex=$meteorUtils.findIndexById(self,oldDoc);if(removedIndex!=-1){self.splice(removedIndex,1);self._serverBackup.splice(removedIndex,1);self._setServerUpdateMode()}else{removedIndex=$meteorUtils.findIndexById(self._serverBackup,oldDoc);if(removedIndex!=-1){self._serverBackup.splice(removedIndex,1)}}}});self._hDataAutorun=Tracker.autorun(function(){cursor.fetch();if(self._serverMode)self._unsetServerUpdateMode(autoClientSave)})};AngularMeteorCollection._stopObserving=function(){this._hObserve.stop();this._hDataAutorun.stop();delete this._serverMode;delete this._hUnsetTimeout};AngularMeteorCollection._setServerUpdateMode=function(name){this._serverMode=true;this._unsetAutoClientSave()};AngularMeteorCollection._unsetServerUpdateMode=function(autoClientSave){var self=this;if(self._hUnsetTimeout){$timeout.cancel(self._hUnsetTimeout);self._hUnsetTimeout=null}self._hUnsetTimeout=$timeout(function(){self._serverMode=false;var changes=diffArray.getChanges(self,self._serverBackup,self._diffArrayFunc);self._saveChanges(changes);if(autoClientSave)self._setAutoClientSave()},0)};AngularMeteorCollection.stop=function(){this._stopCursor();this._hNewCurAutorun.stop()};AngularMeteorCollection._stopCursor=function(){this._unsetAutoClientSave();if(this._hObserve){this._hObserve.stop();this._hDataAutorun.stop()}this.splice(0);this._serverBackup.splice(0)};AngularMeteorCollection._unsetAutoClientSave=function(name){if(this._hRegAutoBind){this._hRegAutoBind();this._hRegAutoBind=null}};AngularMeteorCollection._setAutoClientSave=function(){var self=this;self._unsetAutoClientSave();self._hRegAutoBind=$rootScope.$watch(function(){return self},function(nItems,oItems){if(nItems===oItems)return;var changes=diffArray.getChanges(self,oItems,self._diffArrayFunc);self._unsetAutoClientSave();self._saveChanges(changes);self._setAutoClientSave()},true)};AngularMeteorCollection._saveChanges=function(changes){var self=this;var addedDocs=changes.added.reverse().map(function(descriptor){self.splice(descriptor.index,1);return descriptor.item});if(addedDocs.length)self.save(addedDocs);var removedDocs=changes.removed.map(function(descriptor){return descriptor.item});if(removedDocs.length)self.remove(removedDocs);changes.changed.forEach(function(descriptor){self._updateDiff(descriptor.selector,descriptor.modifier)})};return AngularMeteorCollection}]);angularMeteorCollection.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function($meteorCollection,diffArray,$angularMeteorSettings){function $meteorCollectionFS(reactiveFunc,autoClientSave,collection){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return new $meteorCollection(reactiveFunc,autoClientSave,collection,diffArray.shallow)}return $meteorCollectionFS}]);angularMeteorCollection.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(AngularMeteorCollection,$rootScope,diffArray){function $meteorCollection(reactiveFunc,autoClientSave,collection,diffFn){if(!reactiveFunc){throw new TypeError("The first argument of $meteorCollection is undefined.")}if(!(angular.isFunction(reactiveFunc)||angular.isFunction(reactiveFunc.find))){throw new TypeError("The first argument of $meteorCollection must be a function or "+"a have a find function property.")}if(!angular.isFunction(reactiveFunc)){collection=angular.isDefined(collection)?collection:reactiveFunc;reactiveFunc=_underscore2.default.bind(reactiveFunc.find,reactiveFunc)}autoClientSave=angular.isDefined(autoClientSave)?autoClientSave:true;diffFn=diffFn||diffArray;return new AngularMeteorCollection(reactiveFunc,collection,diffFn,autoClientSave)}return $meteorCollection}]);angularMeteorCollection.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function($rootScope,$meteorCollection,$meteorCollectionFS,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorCollection=$meteorStopper($meteorCollection);scopeProto.$meteorCollectionFS=$meteorStopper($meteorCollectionFS)}])},function(module,exports,__webpack_require__){"use strict";var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}"use strict";var angularMeteorObject=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray","angular-meteor.settings"]);angularMeteorObject.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function($q,$meteorSubscribe,$meteorUtils,diffArray,getUpdates,AngularMeteorCollection,$angularMeteorSettings){AngularMeteorObject.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"];function AngularMeteorObject(collection,selector,options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var helpers=collection._helpers;var data=_underscore2.default.isFunction(helpers)?Object.create(helpers.prototype):{};var doc=collection.findOne(selector,options);var collectionExtension=_underscore2.default.pick(AngularMeteorCollection,"_updateParallel");_underscore2.default.extend(data,doc);_underscore2.default.extend(data,AngularMeteorObject);_underscore2.default.extend(data,collectionExtension);data.$$options=_underscore2.default.omit(options,"skip","limit");data.$$collection=collection;data.$$id=data._getId(selector);data._serverBackup=doc||{};return data}AngularMeteorObject.getRawObject=function(){return angular.copy(_underscore2.default.omit(this,this.$$internalProps))};AngularMeteorObject.subscribe=function(){$meteorSubscribe.subscribe.apply(this,arguments);return this};AngularMeteorObject.save=function(custom){var deferred=$q.defer();var collection=this.$$collection;var createFulfill=_underscore2.default.partial($meteorUtils.fulfill,deferred,null);var oldDoc=collection.findOne(this.$$id);var mods;if(oldDoc){if(custom)mods={$set:custom};else{mods=getUpdates(oldDoc,this.getRawObject());if(_underscore2.default.isEmpty(mods)){return $q.when({action:"updated"})}}this._updateDiff(mods,createFulfill({action:"updated"}))}else{if(custom)mods=_underscore2.default.clone(custom);else mods=this.getRawObject();mods._id=mods._id||this.$$id;collection.insert(mods,createFulfill({action:"inserted"}))}return deferred.promise};AngularMeteorObject._updateDiff=function(update,callback){var selector=this.$$id;AngularMeteorCollection._updateDiff.call(this,selector,update,callback)};AngularMeteorObject.reset=function(keepClientProps){var self=this;var options=this.$$options;var id=this.$$id;var doc=this.$$collection.findOne(id,options);if(doc){var docKeys=_underscore2.default.keys(doc);var docExtension=_underscore2.default.pick(doc,docKeys);var clientProps;_underscore2.default.extend(self,docExtension);_underscore2.default.extend(self._serverBackup,docExtension);if(keepClientProps){clientProps=_underscore2.default.intersection(_underscore2.default.keys(self),_underscore2.default.keys(self._serverBackup))}else{clientProps=_underscore2.default.keys(self)}var serverProps=_underscore2.default.keys(doc);var removedKeys=_underscore2.default.difference(clientProps,serverProps,self.$$internalProps);removedKeys.forEach(function(prop){delete self[prop];delete self._serverBackup[prop]})}else{_underscore2.default.keys(this.getRawObject()).forEach(function(prop){delete self[prop]});self._serverBackup={}}};AngularMeteorObject.stop=function(){if(this.unregisterAutoDestroy)this.unregisterAutoDestroy();if(this.unregisterAutoBind)this.unregisterAutoBind();if(this.autorunComputation&&this.autorunComputation.stop)this.autorunComputation.stop()};AngularMeteorObject._getId=function(selector){var options=_underscore2.default.extend({},this.$$options,{fields:{_id:1},reactive:false,transform:null});var doc=this.$$collection.findOne(selector,options);if(doc)return doc._id;if(selector instanceof Mongo.ObjectID)return selector;if(_underscore2.default.isString(selector))return selector;return new Mongo.ObjectID};return AngularMeteorObject}]);angularMeteorObject.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function($rootScope,$meteorUtils,getUpdates,AngularMeteorObject){function $meteorObject(collection,id,auto,options){if(!collection){throw new TypeError("The first argument of $meteorObject is undefined.")}if(!angular.isFunction(collection.findOne)){throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.")}var data=new AngularMeteorObject(collection,id,options);data._auto=auto!==false;_underscore2.default.extend(data,$meteorObject);data._setAutos();return data}$meteorObject._setAutos=function(){var self=this;this.autorunComputation=$meteorUtils.autorun($rootScope,function(){self.reset(true)});this.unregisterAutoBind=this._auto&&$rootScope.$watch(function(){return self.getRawObject()},function(item,oldItem){if(item!==oldItem)self.save()},true);this.unregisterAutoDestroy=$rootScope.$on("$destroy",function(){if(self&&self.stop)self.pop()})};return $meteorObject}]);angularMeteorObject.run(["$rootScope","$meteorObject","$meteorStopper",function($rootScope,$meteorObject,$meteorStopper){var scopeProto=Object.getPrototypeOf($rootScope);scopeProto.$meteorObject=$meteorStopper($meteorObject)}])},function(module,exports,__webpack_require__){"use strict";var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}"use strict";var angularMeteorUser=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core","angular-meteor.settings"]);angularMeteorUser.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function($rootScope,$meteorUtils,$q,$angularMeteorSettings){var pack=Package["accounts-base"];if(!pack)return;var self=this;var Accounts=pack.Accounts;this.waitForUser=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn())deferred.resolve(Meteor.user())},true);return deferred.promise};this.requireUser=function(){if(!$angularMeteorSettings.suppressWarnings){console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings")}var deferred=$q.defer();$meteorUtils.autorun($rootScope,function(){if(!Meteor.loggingIn()){if(Meteor.user()===null)deferred.reject("AUTH_REQUIRED");else deferred.resolve(Meteor.user())}},true);return deferred.promise};this.requireValidUser=function(validatorFn){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");return self.requireUser(true).then(function(user){var valid=validatorFn(user);if(valid===true)return user;else if(typeof valid==="string")return $q.reject(valid);else return $q.reject("FORBIDDEN")})};this.loginWithPassword=$meteorUtils.promissor(Meteor,"loginWithPassword");this.createUser=$meteorUtils.promissor(Accounts,"createUser");this.changePassword=$meteorUtils.promissor(Accounts,"changePassword");this.forgotPassword=$meteorUtils.promissor(Accounts,"forgotPassword");this.resetPassword=$meteorUtils.promissor(Accounts,"resetPassword");this.verifyEmail=$meteorUtils.promissor(Accounts,"verifyEmail");this.logout=$meteorUtils.promissor(Meteor,"logout");this.logoutOtherClients=$meteorUtils.promissor(Meteor,"logoutOtherClients");this.loginWithFacebook=$meteorUtils.promissor(Meteor,"loginWithFacebook");this.loginWithTwitter=$meteorUtils.promissor(Meteor,"loginWithTwitter");this.loginWithGoogle=$meteorUtils.promissor(Meteor,"loginWithGoogle");this.loginWithGithub=$meteorUtils.promissor(Meteor,"loginWithGithub");this.loginWithMeteorDeveloperAccount=$meteorUtils.promissor(Meteor,"loginWithMeteorDeveloperAccount");this.loginWithMeetup=$meteorUtils.promissor(Meteor,"loginWithMeetup");this.loginWithWeibo=$meteorUtils.promissor(Meteor,"loginWithWeibo")}]);angularMeteorUser.run(["$rootScope","$angularMeteorSettings","$$Core",function($rootScope,$angularMeteorSettings,$$Core){var ScopeProto=Object.getPrototypeOf($rootScope);_underscore2.default.extend(ScopeProto,$$Core);$rootScope.autorun(function(){if(!Meteor.user)return;$rootScope.currentUser=Meteor.user();$rootScope.loggingIn=Meteor.loggingIn()})}])},function(module,exports,__webpack_require__){"use strict";var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}"use strict";var angularMeteorMethods=angular.module("angular-meteor.methods",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorMethods.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){this.call=function(){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var deferred=$q.defer();var fulfill=$meteorUtils.fulfill(deferred);var args=_underscore2.default.toArray(arguments).concat(fulfill);Meteor.call.apply(this,args);return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorSession=angular.module("angular-meteor.session",["angular-meteor.utils","angular-meteor.settings"]); +angularMeteorSession.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function($meteorUtils,$parse,$angularMeteorSettings){return function(session){return{bind:function bind(scope,model){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var getter=$parse(model);var setter=getter.assign;$meteorUtils.autorun(scope,function(){setter(scope,Session.get(session))});scope.$watch(model,function(newItem,oldItem){Session.set(session,getter(scope))},true)}}}}])},function(module,exports){"use strict";var angularMeteorCamera=angular.module("angular-meteor.camera",["angular-meteor.utils","angular-meteor.settings"]);angularMeteorCamera.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function($q,$meteorUtils,$angularMeteorSettings){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var pack=Package["mdg:camera"];if(!pack)return;var MeteorCamera=pack.MeteorCamera;this.getPicture=function(options){if(!$angularMeteorSettings.suppressWarnings)console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");options=options||{};var deferred=$q.defer();MeteorCamera.getPicture(options,$meteorUtils.fulfill(deferred));return deferred.promise}}])},function(module,exports){"use strict";var angularMeteorStopper=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);angularMeteorStopper.factory("$meteorStopper",["$q","$meteorSubscribe",function($q,$meteorSubscribe){function $meteorStopper($meteorEntity){return function(){var args=Array.prototype.slice.call(arguments);var meteorEntity=$meteorEntity.apply(this,args);angular.extend(meteorEntity,$meteorStopper);meteorEntity.$$scope=this;this.$on("$destroy",function(){meteorEntity.stop();if(meteorEntity.subscription)meteorEntity.subscription.stop()});return meteorEntity}}$meteorStopper.subscribe=function(){var args=Array.prototype.slice.call(arguments);this.subscription=$meteorSubscribe._subscribe(this.$$scope,$q.defer(),args);return this};return $meteorStopper}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.utils=exports.name=undefined;var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var name=exports.name="angular-meteor.utilities";var utils=exports.utils="$$utils";angular.module(name,[]).service(utils,["$rootScope",function($rootScope){var self=this;this.isCursor=function(obj){return obj instanceof Meteor.Collection.Cursor};this.isScope=function(obj){return obj instanceof $rootScope.constructor};this.isViewModel=function(obj){return _underscore2.default.isObject(obj)&&obj.$$dependencies};this.areSiblings=function(obj1,obj2){return _underscore2.default.isObject(obj1)&&_underscore2.default.isObject(obj2)&&Object.getPrototypeOf(obj1)===Object.getPrototypeOf(obj2)};this.bind=function(fn,context,tap){tap=_underscore2.default.isFunction(tap)?tap:angular.noop;if(_underscore2.default.isFunction(fn))return bindFn(fn,context,tap);if(_underscore2.default.isObject(fn))return bindObj(fn,context,tap);return fn};function bindFn(fn,context,tap){return function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}var result=fn.apply(context,args);tap.call(context,{result:result,args:args});return result}}function bindObj(obj,context,tap){return _underscore2.default.keys(obj).reduce(function(bound,k){bound[k]=self.bind(obj[k],context,tap);return bound},{})}}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Mixer=exports.name=undefined;var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}_this._mixins.filter(_underscore2.default.isFunction).forEach(function(mixin){mixin.call.apply(mixin,[context].concat(args))});return context};this._extend=function(obj,options){var _$defaults=_underscore2.default.defaults({},options,{pattern:/.*/});var pattern=_$defaults.pattern;var context=_$defaults.context;var mixins=_this._mixins.map(function(mixin){var keys=_underscore2.default.keys(mixin).filter(function(k){return k.match(pattern)}).filter(function(k){return _underscore2.default.isFunction(mixin[k])});return keys.reduce(function(boundMixin,methodName){var methodHandler=mixin[methodName];boundMixin[methodName]=function(){var methodContext=context||this;var recentCaller=caller;caller=this;try{for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}return methodHandler.apply(methodContext,args)}finally{caller=recentCaller}};return boundMixin},{})});return _underscore2.default.extend.apply(_underscore2.default,[obj].concat(_toConsumableArray(mixins)))};Object.defineProperty(this,"caller",{configurable:true,enumerable:true,get:function get(){return caller}})})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.name=undefined;var _mixer=__webpack_require__(17);var name=exports.name="angular-meteor.scope";angular.module(name,[_mixer.name]).run(["$rootScope",_mixer.Mixer,function($rootScope,$Mixer){var Scope=$rootScope.constructor;var $new=$rootScope.$new;$Mixer._autoExtend.push(Scope.prototype);$Mixer._autoConstruct.push($rootScope);Scope.prototype.$new=function(){var scope=$new.apply(this,arguments);return $Mixer._construct(scope)}}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Core=exports.name=undefined;var _underscore=__webpack_require__(2);var _underscore2=_interopRequireDefault(_underscore);var _utils=__webpack_require__(16);var _mixer=__webpack_require__(17);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i3?_len-3:0),_key=3;_key<_len;_key++){watcherArgs[_key-3]=arguments[_key]}this.$$watchEntity.apply(this,[vm,k,watcher].concat(watcherArgs))}vm.$$dependencies[k].depend();return $parse(k)(vm)};$$Reactive.$$watchEntity=function(vm,k,watcher){var _this2=this;var getVal=_underscore2.default.partial($parse(k),vm);var initialVal=getVal();for(var _len2=arguments.length,watcherArgs=Array(_len2>3?_len2-3:0),_key2=3;_key2<_len2;_key2++){watcherArgs[_key2-3]=arguments[_key2]}watcher.call.apply(watcher,[this,getVal,function(val,oldVal){var hasChanged=val!==initialVal||val!==oldVal;if(hasChanged)_this2.$$changed(vm,k)}].concat(watcherArgs))};$$Reactive.$$setFnHelper=function(vm,k,fn){var _this3=this;var activeObservation=null;var lastModel=null;var lastModelData=[];this.autorun(function(){var model=fn.apply(vm);Tracker.nonreactive(function(){if($$utils.isCursor(model)){var modelData=undefined;if(angular.isUndefined(vm[k])){_this3.$$setValHelper(vm,k,[],false)}if(activeObservation){lastModelData=lastModel.fetch();activeObservation.stop();activeObservation=null}var handle=_this3.$$handleCursor(vm,k,model);activeObservation=handle.observation;modelData=handle.data;if(lastModelData.length!==0){var diff=_jsondiffpatch2.default.diff(lastModelData,modelData);vm[k]=_jsondiffpatch2.default.patch(lastModelData,diff)}else{vm[k]=modelData}lastModel=model;lastModelData=modelData}else{_this3.$$handleNonCursor(vm,k,model)}_this3.$$changed(vm,k)})})};$$Reactive.$$setValHelper=function(vm,k,v){var _this4=this;var watch=arguments.length<=3||arguments[3]===undefined?true:arguments[3];if(watch){var isDeep=_underscore2.default.isObject(v);this.getReactively(vm,k,isDeep)}Object.defineProperty(vm,k,{configurable:true,enumerable:true,get:function get(){return v},set:function set(newVal){v=newVal;_this4.$$changed(vm,k)}})};$$Reactive.$$handleCursor=function(vm,k,cursor){var _this5=this;var data=[];var observation=cursor.observe({addedAt:function addedAt(doc,atIndex){if(!observation){data.push(doc);return}vm[k].splice(atIndex,0,doc);_this5.$$changed(vm,k)},changedAt:function changedAt(doc,oldDoc,atIndex){var diff=_jsondiffpatch2.default.diff(vm[k][atIndex],doc);_jsondiffpatch2.default.patch(vm[k][atIndex],diff);_this5.$$changed(vm,k)},movedTo:function movedTo(doc,fromIndex,toIndex){vm[k].splice(fromIndex,1);vm[k].splice(toIndex,0,doc);_this5.$$changed(vm,k)},removedAt:function removedAt(oldDoc,atIndex){vm[k].splice(atIndex,1);_this5.$$changed(vm,k)}});return{observation:observation,data:data}};$$Reactive.$$handleNonCursor=function(vm,k,data){var v=vm[k];if(angular.isDefined(v)){delete vm[k];v=null}if(angular.isUndefined(v)){this.$$setValHelper(vm,k,data)}else if($$utils.areSiblings(v,data)){var diff=_jsondiffpatch2.default.diff(v,data);_jsondiffpatch2.default.patch(v,diff);this.$$changed(vm,k)}else{vm[k]=data}};$$Reactive.$$depend=function(vm,k){vm.$$dependencies[k].depend()};$$Reactive.$$changed=function(vm,k){this.$$throttledDigest();vm.$$dependencies[k].changed()};return $$Reactive}])},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_22__},function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var name=exports.name="angular-templates";try{angular.module(name)}catch(e){angular.module(name,[])}}])})}).call(this);if(typeof Package==="undefined")Package={};Package["angular-meteor-data"]={}})(); \ No newline at end of file diff --git a/dist/angular-meteor.js b/dist/angular-meteor.js index 44a5462b9..286f9c7da 100644 --- a/dist/angular-meteor.js +++ b/dist/angular-meteor.js @@ -1,5 +1,15 @@ -/*! angular-meteor v1.3.7 */ -/******/ (function(modules) { // webpackBootstrap +/*! angular-meteor v1.3.9 */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("underscore"), require("jsondiffpatch")); + else if(typeof define === 'function' && define.amd) + define(["underscore", "jsondiffpatch"], factory); + else if(typeof exports === 'object') + exports["angularMeteor"] = factory(require("underscore"), require("jsondiffpatch")); + else + root["angularMeteor"] = factory(root["_"], root["jsondiffpatch"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_22__) { +return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -50,14 +60,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); - exports.name = undefined; __webpack_require__(1); - __webpack_require__(2); - - __webpack_require__(3); - __webpack_require__(4); __webpack_require__(5); @@ -78,26 +83,34 @@ __webpack_require__(13); - var _utils = __webpack_require__(14); + __webpack_require__(14); + + __webpack_require__(15); + + var _utils = __webpack_require__(16); - var _mixer = __webpack_require__(15); + var _mixer = __webpack_require__(17); - var _scope = __webpack_require__(16); + var _scope = __webpack_require__(18); - var _core = __webpack_require__(17); + var _core = __webpack_require__(19); - var _viewModel = __webpack_require__(18); + var _viewModel = __webpack_require__(20); - var _reactive = __webpack_require__(19); + var _reactive = __webpack_require__(21); - var _templates = __webpack_require__(20); + var _templates = __webpack_require__(23); // legacy // lib - var name = exports.name = 'angular-meteor'; + + + var name = 'angular-meteor'; // new + exports.default = name; + angular.module(name, [ // new @@ -129,18 +142,26 @@ _this[method] = $meteorUser[method]; }); }]); + module.exports = exports['default']; /***/ }, /* 1 */ -/***/ function(module, exports) { +/***/ function(module, exports, __webpack_require__) { - /*global - angular, _ - */ + 'use strict'; + + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 'use strict'; // https://github.com/DAB0mB/get-updates + /*global + angular, _ + */ (function () { var module = angular.module('getUpdates', []); @@ -149,8 +170,8 @@ var rip = function rip(obj, level) { if (level < 1) return {}; - return _.reduce(obj, function (clone, v, k) { - v = _.isObject(v) ? rip(v, --level) : v; + return _underscore2.default.reduce(obj, function (clone, v, k) { + v = _underscore2.default.isObject(v) ? rip(v, --level) : v; clone[k] = v; return clone; }, {}); @@ -159,27 +180,27 @@ var toPaths = function toPaths(obj) { var keys = getKeyPaths(obj); var values = getDeepValues(obj); - return _.object(keys, values); + return _underscore2.default.object(keys, values); }; var getKeyPaths = function getKeyPaths(obj) { - var keys = _.keys(obj).map(function (k) { + var keys = _underscore2.default.keys(obj).map(function (k) { var v = obj[k]; - if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k; + if (!_underscore2.default.isObject(v) || _underscore2.default.isEmpty(v) || _underscore2.default.isArray(v)) return k; return getKeyPaths(v).map(function (subKey) { return k + '.' + subKey; }); }); - return _.flatten(keys); + return _underscore2.default.flatten(keys); }; var getDeepValues = function getDeepValues(obj, arr) { arr = arr || []; - _.values(obj).forEach(function (v) { - if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr); + _underscore2.default.values(obj).forEach(function (v) { + if (!_underscore2.default.isObject(v) || _underscore2.default.isEmpty(v) || _underscore2.default.isArray(v)) arr.push(v);else getDeepValues(v, arr); }); return arr; @@ -187,14 +208,14 @@ var flatten = function flatten(arr) { return arr.reduce(function (flattened, v, i) { - if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v); + if (_underscore2.default.isArray(v) && !_underscore2.default.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v); return flattened; }, []); }; var setFilled = function setFilled(obj, k, v) { - if (!_.isEmpty(v)) obj[k] = v; + if (!_underscore2.default.isEmpty(v)) obj[k] = v; }; var assert = function assert(result, msg) { @@ -231,20 +252,20 @@ }; var compare = function compare(src, dst) { - var srcKeys = _.keys(src); - var dstKeys = _.keys(dst); + var srcKeys = _underscore2.default.keys(src); + var dstKeys = _underscore2.default.keys(dst); - var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value(); + var keys = _underscore2.default.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value(); return keys.reduce(function (diff, k) { var srcValue = src[k]; var dstValue = dst[k]; - if (_.isDate(srcValue) && _.isDate(dstValue)) { + if (_underscore2.default.isDate(srcValue) && _underscore2.default.isDate(dstValue)) { if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue; } - if (_.isObject(srcValue) && _.isObject(dstValue)) { + if (_underscore2.default.isObject(srcValue) && _underscore2.default.isObject(dstValue)) { var valueDiff = getDifference(srcValue, dstValue); utils.setFilled(diff, k, valueDiff); } else if (srcValue !== dstValue) { @@ -260,8 +281,8 @@ var getUpdates = function () { var getUpdates = function getUpdates(src, dst, isShallow) { - utils.assert(_.isObject(src), 'first argument must be an object'); - utils.assert(_.isObject(dst), 'second argument must be an object'); + utils.assert(_underscore2.default.isObject(src), 'first argument must be an object'); + utils.assert(_underscore2.default.isObject(dst), 'second argument must be an object'); var diff = getDifference(src, dst, isShallow); var paths = utils.toPaths(diff); @@ -280,35 +301,35 @@ var createSet = function createSet(paths) { var undefinedKeys = getUndefinedKeys(paths); - return _.omit(paths, undefinedKeys); + return _underscore2.default.omit(paths, undefinedKeys); }; var createUnset = function createUnset(paths) { var undefinedKeys = getUndefinedKeys(paths); - var unset = _.pick(paths, undefinedKeys); + var unset = _underscore2.default.pick(paths, undefinedKeys); - return _.reduce(unset, function (result, v, k) { + return _underscore2.default.reduce(unset, function (result, v, k) { result[k] = true; return result; }, {}); }; var createPull = function createPull(unset) { - var arrKeyPaths = _.keys(unset).map(function (k) { + var arrKeyPaths = _underscore2.default.keys(unset).map(function (k) { var split = k.match(/(.*)\.\d+$/); return split && split[1]; }); - return _.compact(arrKeyPaths).reduce(function (pull, k) { + return _underscore2.default.compact(arrKeyPaths).reduce(function (pull, k) { pull[k] = null; return pull; }, {}); }; var getUndefinedKeys = function getUndefinedKeys(obj) { - return _.keys(obj).filter(function (k) { + return _underscore2.default.keys(obj).filter(function (k) { var v = obj[k]; - return _.isUndefined(v); + return _underscore2.default.isUndefined(v); }); }; @@ -320,14 +341,51 @@ /***/ }, /* 2 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _underscore = __webpack_require__(3); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + if (typeof _underscore2.default === 'undefined') { + if (typeof Package.underscore === 'undefined') { + throw new Error('underscore is missing'); + } + } + + exports.default = _underscore2.default || Package.underscore._; + module.exports = exports['default']; + +/***/ }, +/* 3 */ /***/ function(module, exports) { - /*global - angular, _, Package - */ + module.exports = __WEBPACK_EXTERNAL_MODULE_3__; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + 'use strict'; /*global + angular, _, Package + */ + var _module = angular.module('diffArray', ['getUpdates']); _module.factory('diffArray', ['getUpdates', function (getUpdates) { @@ -353,12 +411,12 @@ var posCur = {}; var lengthCur = lastSeqArray.length; - _.each(seqArray, function (doc, i) { + _underscore2.default.each(seqArray, function (doc, i) { newObjIds.push({ _id: doc._id }); posNew[idStringify(doc._id)] = i; }); - _.each(lastSeqArray, function (doc, i) { + _underscore2.default.each(lastSeqArray, function (doc, i) { oldObjIds.push({ _id: doc._id }); posOld[idStringify(doc._id)] = i; posCur[idStringify(doc._id)] = i; @@ -372,7 +430,7 @@ addedBefore: function addedBefore(id, doc, before) { var position = before ? posCur[idStringify(before)] : lengthCur; - _.each(posCur, function (pos, id) { + _underscore2.default.each(posCur, function (pos, id) { if (pos >= position) posCur[id]++; }); @@ -386,7 +444,7 @@ var prevPosition = posCur[idStringify(id)]; var position = before ? posCur[idStringify(before)] : lengthCur - 1; - _.each(posCur, function (pos, id) { + _underscore2.default.each(posCur, function (pos, id) { if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++; }); @@ -397,7 +455,7 @@ removed: function removed(id) { var prevPosition = posCur[idStringify(id)]; - _.each(posCur, function (pos, id) { + _underscore2.default.each(posCur, function (pos, id) { if (pos >= prevPosition) posCur[id]--; }); @@ -408,15 +466,15 @@ } }); - _.each(posNew, function (pos, idString) { - if (!_.has(posOld, idString)) return; + _underscore2.default.each(posNew, function (pos, idString) { + if (!_underscore2.default.has(posOld, idString)) return; var id = idParse(idString); var newItem = seqArray[pos] || {}; var oldItem = lastSeqArray[posOld[idString]]; var updates = getUpdates(oldItem, newItem, preventNestedDiff); - if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem); + if (!_underscore2.default.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem); }); } @@ -427,7 +485,7 @@ diffArray.deepCopyChanges = function (oldItem, newItem) { var setDiff = getUpdates(oldItem, newItem).$set; - _.each(setDiff, function (v, deepKey) { + _underscore2.default.each(setDiff, function (v, deepKey) { setDeep(oldItem, deepKey, v); }); }; @@ -435,7 +493,7 @@ diffArray.deepCopyRemovals = function (oldItem, newItem) { var unsetDiff = getUpdates(oldItem, newItem).$unset; - _.each(unsetDiff, function (v, deepKey) { + _underscore2.default.each(unsetDiff, function (v, deepKey) { unsetDeep(oldItem, deepKey); }); }; @@ -467,8 +525,8 @@ var setDeep = function setDeep(obj, deepKey, v) { var split = deepKey.split('.'); - var initialKeys = _.initial(split); - var lastKey = _.last(split); + var initialKeys = _underscore2.default.initial(split); + var lastKey = _underscore2.default.last(split); initialKeys.reduce(function (subObj, k, i) { var nextKey = split[i + 1]; @@ -490,11 +548,11 @@ var unsetDeep = function unsetDeep(obj, deepKey) { var split = deepKey.split('.'); - var initialKeys = _.initial(split); - var lastKey = _.last(split); + var initialKeys = _underscore2.default.initial(split); + var lastKey = _underscore2.default.last(split); var deepObj = getDeep(obj, initialKeys); - if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey]; + if (_underscore2.default.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey]; }; var getDeep = function getDeep(obj, keys) { @@ -504,7 +562,7 @@ }; var isHash = function isHash(obj) { - return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype; + return _underscore2.default.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype; }; var isNumStr = function isNumStr(str) { @@ -515,17 +573,17 @@ }]); /***/ }, -/* 3 */ +/* 5 */ /***/ function(module, exports) { 'use strict'; angular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', { - suppressWarnings: false + suppressWarnings: true }); /***/ }, -/* 4 */ +/* 6 */ /***/ function(module, exports) { 'use strict'; @@ -548,16 +606,22 @@ }]); /***/ }, -/* 5 */ -/***/ function(module, exports) { - - /*global - angular, _, Tracker, EJSON, FS, Mongo - */ +/* 7 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /*global + angular, _, Tracker, EJSON, FS, Mongo + */ + + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + 'use strict'; var angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']); @@ -588,11 +652,11 @@ // Borrowed from angularFire // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454 this.stripDollarPrefixedKeys = function (data) { - if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data; + if (!_underscore2.default.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data; - var out = _.isArray(data) ? [] : {}; + var out = _underscore2.default.isArray(data) ? [] : {}; - _.each(data, function (v, k) { + _underscore2.default.each(data, function (v, k) { if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v); }); @@ -611,7 +675,7 @@ return function () { var deferred = $q.defer(); var fulfill = self.fulfill(deferred); - var args = _.toArray(arguments).concat(fulfill); + var args = _underscore2.default.toArray(arguments).concat(fulfill); obj[method].apply(obj, args); return deferred.promise; }; @@ -634,12 +698,12 @@ }; this.findIndexById = function (collection, doc) { - var foundDoc = _.find(collection, function (colDoc) { + var foundDoc = _underscore2.default.find(collection, function (colDoc) { // EJSON.equals used to compare Mongo.ObjectIDs and Strings. return EJSON.equals(colDoc._id, doc._id); }); - return _.indexOf(collection, foundDoc); + return _underscore2.default.indexOf(collection, foundDoc); }; }]); @@ -650,7 +714,7 @@ }]); /***/ }, -/* 6 */ +/* 8 */ /***/ function(module, exports) { /*global @@ -726,15 +790,21 @@ }]); /***/ }, -/* 7 */ -/***/ function(module, exports) { - - /*global - angular, _, Tracker, check, Match, Mongo - */ +/* 9 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + 'use strict'; /*global + angular, _, Tracker, check, Match, Mongo + */ + var angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']); // The reason angular meteor collection is a factory function and not something @@ -768,7 +838,7 @@ data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name); } - _.extend(data, AngularMeteorCollection); + _underscore2.default.extend(data, AngularMeteorCollection); data._startCurAutorun(curDefFunc, autoClientSave); return data; @@ -810,7 +880,7 @@ AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) { var deferred = $q.defer(); var collection = this.$$collection; - var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); + var createFulfill = _underscore2.default.partial($meteorUtils.fulfill, deferred, null); // delete $$hashkey doc = $meteorUtils.stripDollarPrefixedKeys(doc); @@ -843,10 +913,10 @@ // see issue: https://github.com/Urigo/angular-meteor/issues/793 AngularMeteorCollection._updateDiff = function (selector, update, callback) { callback = callback || angular.noop; - var setters = _.omit(update, '$pull'); + var setters = _underscore2.default.omit(update, '$pull'); var updates = [setters]; - _.each(update.$pull, function (pull, prop) { + _underscore2.default.each(update.$pull, function (pull, prop) { var puller = {}; puller[prop] = pull; updates.push({ $pull: puller }); @@ -858,14 +928,14 @@ // performs each update operation parallely AngularMeteorCollection._updateParallel = function (selector, updates, callback) { var self = this; - var done = _.after(updates.length, callback); + var done = _underscore2.default.after(updates.length, callback); var next = function next(err, affectedDocsNum) { if (err) return callback(err); done(null, affectedDocsNum); }; - _.each(updates, function (update) { + _underscore2.default.each(updates, function (update) { self.$$collection.update(selector, update, next); }); }; @@ -875,13 +945,13 @@ // remove whole collection if (!keyOrDocs) { - keys = _.pluck(this, '_id'); + keys = _underscore2.default.pluck(this, '_id'); } // remove docs else { keyOrDocs = [].concat(keyOrDocs); - keys = _.map(keyOrDocs, function (keyOrDoc) { + keys = _underscore2.default.map(keyOrDocs, function (keyOrDoc) { return keyOrDoc._id || keyOrDoc; }); } @@ -1084,7 +1154,7 @@ if (!angular.isFunction(reactiveFunc)) { collection = angular.isDefined(collection) ? collection : reactiveFunc; - reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc); + reactiveFunc = _underscore2.default.bind(reactiveFunc.find, reactiveFunc); } // By default auto save - true. @@ -1103,15 +1173,21 @@ }]); /***/ }, -/* 8 */ -/***/ function(module, exports) { - - /*global - angular, _, Mongo - */ +/* 10 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + 'use strict'; /*global + angular, _, Mongo + */ + var angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']); angularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) { @@ -1124,15 +1200,15 @@ // Make data not be an object so we can extend it to preserve // Collection Helpers and the like var helpers = collection._helpers; - var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {}; + var data = _underscore2.default.isFunction(helpers) ? Object.create(helpers.prototype) : {}; var doc = collection.findOne(selector, options); - var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel'); - _.extend(data, doc); - _.extend(data, AngularMeteorObject); - _.extend(data, collectionExtension); + var collectionExtension = _underscore2.default.pick(AngularMeteorCollection, '_updateParallel'); + _underscore2.default.extend(data, doc); + _underscore2.default.extend(data, AngularMeteorObject); + _underscore2.default.extend(data, collectionExtension); // Omit options that may spoil document finding - data.$$options = _.omit(options, 'skip', 'limit'); + data.$$options = _underscore2.default.omit(options, 'skip', 'limit'); data.$$collection = collection; data.$$id = data._getId(selector); data._serverBackup = doc || {}; @@ -1141,7 +1217,7 @@ } AngularMeteorObject.getRawObject = function () { - return angular.copy(_.omit(this, this.$$internalProps)); + return angular.copy(_underscore2.default.omit(this, this.$$internalProps)); }; AngularMeteorObject.subscribe = function () { @@ -1152,7 +1228,7 @@ AngularMeteorObject.save = function (custom) { var deferred = $q.defer(); var collection = this.$$collection; - var createFulfill = _.partial($meteorUtils.fulfill, deferred, null); + var createFulfill = _underscore2.default.partial($meteorUtils.fulfill, deferred, null); var oldDoc = collection.findOne(this.$$id); var mods; @@ -1161,7 +1237,7 @@ if (custom) mods = { $set: custom };else { mods = getUpdates(oldDoc, this.getRawObject()); // If there are no updates, there is nothing to do here, returning - if (_.isEmpty(mods)) { + if (_underscore2.default.isEmpty(mods)) { return $q.when({ action: 'updated' }); } } @@ -1171,7 +1247,7 @@ } // insert else { - if (custom) mods = _.clone(custom);else mods = this.getRawObject(); + if (custom) mods = _underscore2.default.clone(custom);else mods = this.getRawObject(); mods._id = mods._id || this.$$id; collection.insert(mods, createFulfill({ action: 'inserted' })); @@ -1193,28 +1269,28 @@ if (doc) { // extend SubObject - var docKeys = _.keys(doc); - var docExtension = _.pick(doc, docKeys); + var docKeys = _underscore2.default.keys(doc); + var docExtension = _underscore2.default.pick(doc, docKeys); var clientProps; - _.extend(self, docExtension); - _.extend(self._serverBackup, docExtension); + _underscore2.default.extend(self, docExtension); + _underscore2.default.extend(self._serverBackup, docExtension); if (keepClientProps) { - clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup)); + clientProps = _underscore2.default.intersection(_underscore2.default.keys(self), _underscore2.default.keys(self._serverBackup)); } else { - clientProps = _.keys(self); + clientProps = _underscore2.default.keys(self); } - var serverProps = _.keys(doc); - var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps); + var serverProps = _underscore2.default.keys(doc); + var removedKeys = _underscore2.default.difference(clientProps, serverProps, self.$$internalProps); removedKeys.forEach(function (prop) { delete self[prop]; delete self._serverBackup[prop]; }); } else { - _.keys(this.getRawObject()).forEach(function (prop) { + _underscore2.default.keys(this.getRawObject()).forEach(function (prop) { delete self[prop]; }); @@ -1231,7 +1307,7 @@ }; AngularMeteorObject._getId = function (selector) { - var options = _.extend({}, this.$$options, { + var options = _underscore2.default.extend({}, this.$$options, { fields: { _id: 1 }, reactive: false, transform: null @@ -1241,7 +1317,7 @@ if (doc) return doc._id; if (selector instanceof Mongo.ObjectID) return selector; - if (_.isString(selector)) return selector; + if (_underscore2.default.isString(selector)) return selector; return new Mongo.ObjectID(); }; @@ -1262,7 +1338,7 @@ var data = new AngularMeteorObject(collection, id, options); // Making auto default true - http://stackoverflow.com/a/15464208/1426570 data._auto = auto !== false; - _.extend(data, $meteorObject); + _underscore2.default.extend(data, $meteorObject); data._setAutos(); return data; } @@ -1295,15 +1371,21 @@ }]); /***/ }, -/* 9 */ -/***/ function(module, exports) { - - /*global - angular, _, Package, Meteor - */ +/* 11 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + 'use strict'; /*global + angular, _, Package, Meteor + */ + var angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core', 'angular-meteor.settings']); // requires package 'accounts-password' @@ -1373,7 +1455,7 @@ angularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) { var ScopeProto = Object.getPrototypeOf($rootScope); - _.extend(ScopeProto, $$Core); + _underscore2.default.extend(ScopeProto, $$Core); $rootScope.autorun(function () { if (!Meteor.user) return; @@ -1383,15 +1465,21 @@ }]); /***/ }, -/* 10 */ -/***/ function(module, exports) { - - /*global - angular, _, Meteor - */ +/* 12 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + 'use strict'; /*global + angular, _, Meteor + */ + var angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']); angularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) { @@ -1400,14 +1488,14 @@ var deferred = $q.defer(); var fulfill = $meteorUtils.fulfill(deferred); - var args = _.toArray(arguments).concat(fulfill); + var args = _underscore2.default.toArray(arguments).concat(fulfill); Meteor.call.apply(this, args); return deferred.promise; }; }]); /***/ }, -/* 11 */ +/* 13 */ /***/ function(module, exports) { /*global @@ -1441,7 +1529,7 @@ }]); /***/ }, -/* 12 */ +/* 14 */ /***/ function(module, exports) { /*global @@ -1471,7 +1559,7 @@ }]); /***/ }, -/* 13 */ +/* 15 */ /***/ function(module, exports) { /*global @@ -1510,14 +1598,22 @@ }]); /***/ }, -/* 14 */ -/***/ function(module, exports) { +/* 16 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); + exports.utils = exports.name = undefined; + + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var name = exports.name = 'angular-meteor.utilities'; var utils = exports.utils = '$$utils'; @@ -1541,21 +1637,21 @@ // Checks if an object is a view model this.isViewModel = function (obj) { - return _.isObject(obj) && obj.$$dependencies; + return _underscore2.default.isObject(obj) && obj.$$dependencies; }; // Checks if two objects are siblings this.areSiblings = function (obj1, obj2) { - return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); + return _underscore2.default.isObject(obj1) && _underscore2.default.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2); }; // Binds function into a scpecified context. If an object is provided, will bind every // value in the object which is a function. If a tap function is provided, it will be // called right after the function has been invoked. this.bind = function (fn, context, tap) { - tap = _.isFunction(tap) ? tap : angular.noop; - if (_.isFunction(fn)) return bindFn(fn, context, tap); - if (_.isObject(fn)) return bindObj(fn, context, tap); + tap = _underscore2.default.isFunction(tap) ? tap : angular.noop; + if (_underscore2.default.isFunction(fn)) return bindFn(fn, context, tap); + if (_underscore2.default.isObject(fn)) return bindObj(fn, context, tap); return fn; }; @@ -1575,7 +1671,7 @@ } function bindObj(obj, context, tap) { - return _.keys(obj).reduce(function (bound, k) { + return _underscore2.default.keys(obj).reduce(function (bound, k) { bound[k] = self.bind(obj[k], context, tap); return bound; }, {}); @@ -1583,14 +1679,21 @@ }]); /***/ }, -/* 15 */ -/***/ function(module, exports) { +/* 17 */ +/***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); + exports.Mixer = exports.name = undefined; + + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -1613,7 +1716,7 @@ var _this = this; // Used to store method's caller - var caller = void 0; + var caller = undefined; this._mixins = []; // Apply mixins automatically on specified contexts @@ -1622,11 +1725,11 @@ // Adds a new mixin this.mixin = function (mixin) { - if (!_.isObject(mixin)) { + if (!_underscore2.default.isObject(mixin)) { throw Error('argument 1 must be an object'); } - _this._mixins = _.union(_this._mixins, [mixin]); + _this._mixins = _underscore2.default.union(_this._mixins, [mixin]); // Apply mixins to stored contexts _this._autoExtend.forEach(function (context) { return _this._extend(context); @@ -1639,7 +1742,7 @@ // Removes a mixin. Useful mainly for test purposes this._mixout = function (mixin) { - _this._mixins = _.without(_this._mixins, mixin); + _this._mixins = _underscore2.default.without(_this._mixins, mixin); return _this; }; @@ -1649,7 +1752,7 @@ args[_key - 1] = arguments[_key]; } - _this._mixins.filter(_.isFunction).forEach(function (mixin) { + _this._mixins.filter(_underscore2.default.isFunction).forEach(function (mixin) { mixin.call.apply(mixin, [context].concat(args)); }); @@ -1658,9 +1761,7 @@ // Extend prototype with the defined mixins this._extend = function (obj, options) { - var _ref; - - var _$defaults = _.defaults({}, options, { + var _$defaults = _underscore2.default.defaults({}, options, { pattern: /.*/ }); var pattern = _$defaults.pattern; @@ -1670,10 +1771,10 @@ var mixins = _this._mixins.map(function (mixin) { // Filtering the keys by the specified pattern - var keys = _.keys(mixin).filter(function (k) { + var keys = _underscore2.default.keys(mixin).filter(function (k) { return k.match(pattern); }).filter(function (k) { - return _.isFunction(mixin[k]); + return _underscore2.default.isFunction(mixin[k]); }); return keys.reduce(function (boundMixin, methodName) { @@ -1703,7 +1804,7 @@ }, {}); }); - return (_ref = _).extend.apply(_ref, [obj].concat(_toConsumableArray(mixins))); + return _underscore2.default.extend.apply(_underscore2.default, [obj].concat(_toConsumableArray(mixins))); }; // Caller property can not be set @@ -1718,7 +1819,7 @@ }); /***/ }, -/* 16 */ +/* 18 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1728,7 +1829,7 @@ }); exports.name = undefined; - var _mixer = __webpack_require__(15); + var _mixer = __webpack_require__(17); var name = exports.name = 'angular-meteor.scope'; @@ -1750,7 +1851,7 @@ }]); /***/ }, -/* 17 */ +/* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1760,9 +1861,15 @@ }); exports.Core = exports.name = undefined; - var _utils = __webpack_require__(14); + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); - var _mixer = __webpack_require__(15); + var _utils = __webpack_require__(16); + + var _mixer = __webpack_require__(17); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } @@ -1783,10 +1890,10 @@ fn = this.$bindToContext($Mixer.caller, fn); - if (!_.isFunction(fn)) { + if (!_underscore2.default.isFunction(fn)) { throw Error('argument 1 must be a function'); } - if (!_.isObject(options)) { + if (!_underscore2.default.isObject(options)) { throw Error('argument 2 must be an object'); } @@ -1801,13 +1908,13 @@ fn = this.$bindToContext($Mixer.caller, fn || angular.noop); cb = cb ? this.$bindToContext($Mixer.caller, cb) : angular.noop; - if (!_.isString(subName)) { + if (!_underscore2.default.isString(subName)) { throw Error('argument 1 must be a string'); } - if (!_.isFunction(fn)) { + if (!_underscore2.default.isFunction(fn)) { throw Error('argument 2 must be a function'); } - if (!_.isFunction(cb) && !_.isObject(cb)) { + if (!_underscore2.default.isFunction(cb) && !_underscore2.default.isObject(cb)) { throw Error('argument 3 must be a function or an object'); } @@ -1819,7 +1926,7 @@ var args = fn(); if (angular.isUndefined(args)) args = []; - if (!_.isArray(args)) { + if (!_underscore2.default.isArray(args)) { throw Error('reactive function\'s return value must be an array'); } @@ -1843,7 +1950,7 @@ } var fn = args.pop(); - if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn); + if (_underscore2.default.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn); return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn])); }; @@ -1856,7 +1963,7 @@ } var fn = args.pop(); - if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn); + if (_underscore2.default.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn); return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn])); }; @@ -1888,7 +1995,7 @@ }]); /***/ }, -/* 18 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -1900,11 +2007,17 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - var _utils = __webpack_require__(14); + var _underscore = __webpack_require__(2); + + var _underscore2 = _interopRequireDefault(_underscore); - var _mixer = __webpack_require__(15); + var _utils = __webpack_require__(16); - var _core = __webpack_require__(17); + var _mixer = __webpack_require__(17); + + var _core = __webpack_require__(19); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1926,7 +2039,7 @@ // Gets an object, wraps it with scope functions and returns it $$ViewModel.viewModel = function (vm) { - if (!_.isObject(vm)) { + if (!_underscore2.default.isObject(vm)) { throw Error('argument 1 must be an object'); } @@ -1954,11 +2067,11 @@ _classCallCheck(this, Reactive); - if (!_.isObject(vm)) { + if (!_underscore2.default.isObject(vm)) { throw Error('argument 1 must be an object'); } - _.defer(function () { + _underscore2.default.defer(function () { if (!_this._attached) { console.warn('view model was not attached to any scope'); } @@ -1995,7 +2108,7 @@ }]); /***/ }, -/* 19 */ +/* 21 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -2005,13 +2118,23 @@ }); exports.Reactive = exports.name = undefined; - var _utils = __webpack_require__(14); + var _jsondiffpatch = __webpack_require__(22); + + var _jsondiffpatch2 = _interopRequireDefault(_jsondiffpatch); + + var _underscore = __webpack_require__(2); - var _mixer = __webpack_require__(15); + var _underscore2 = _interopRequireDefault(_underscore); - var _core = __webpack_require__(17); + var _utils = __webpack_require__(16); - var _viewModel = __webpack_require__(18); + var _mixer = __webpack_require__(17); + + var _core = __webpack_require__(19); + + var _viewModel = __webpack_require__(20); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var name = exports.name = 'angular-meteor.reactive'; var Reactive = exports.Reactive = '$$Reactive'; @@ -2036,25 +2159,25 @@ var _this = this; if ($$utils.isViewModel(vm)) { - if (!_.isObject(props)) { + if (!_underscore2.default.isObject(props)) { throw Error('argument 2 must be an object'); } } else { props = vm; vm = $Mixer.caller; - if (!_.isObject(props)) { + if (!_underscore2.default.isObject(props)) { throw Error('argument 1 must be an object'); } } - _.each(props, function (v, k) { - if (!_.isFunction(v)) { + _underscore2.default.each(props, function (v, k) { + if (!_underscore2.default.isFunction(v)) { throw Error('helper \'' + k + '\' must be a function'); } }); - _.each(props, function (v, k) { + _underscore2.default.each(props, function (v, k) { if (!vm.$$dependencies[k]) { // Registers a new dependency to the specified helper vm.$$dependencies[k] = new Tracker.Dependency(); @@ -2069,10 +2192,10 @@ if ($$utils.isViewModel(vm)) { if (angular.isUndefined(isDeep)) isDeep = false; - if (!_.isString(k)) { + if (!_underscore2.default.isString(k)) { throw Error('argument 2 must be a string'); } - if (!_.isBoolean(isDeep)) { + if (!_underscore2.default.isBoolean(isDeep)) { throw Error('argument 3 must be a boolean'); } } else { @@ -2080,10 +2203,10 @@ k = vm; vm = $Mixer.caller; - if (!_.isString(k)) { + if (!_underscore2.default.isString(k)) { throw Error('argument 1 must be a string'); } - if (!_.isBoolean(isDeep)) { + if (!_underscore2.default.isBoolean(isDeep)) { throw Error('argument 2 must be a boolean'); } } @@ -2094,14 +2217,14 @@ // Gets a collection reactively $$Reactive.getCollectionReactively = function (vm, k) { if ($$utils.isViewModel(vm)) { - if (!_.isString(k)) { + if (!_underscore2.default.isString(k)) { throw Error('argument 2 must be a string'); } } else { k = vm; vm = $Mixer.caller; - if (!_.isString(k)) { + if (!_underscore2.default.isString(k)) { throw Error('argument 1 must be a string'); } } @@ -2130,7 +2253,7 @@ var _this2 = this; // Gets a deep property from the caller - var getVal = _.partial($parse(k), vm); + var getVal = _underscore2.default.partial($parse(k), vm); var initialVal = getVal(); // Watches for changes in the view model @@ -2163,7 +2286,7 @@ Tracker.nonreactive(function () { // If a cursor, observe its changes and update acoordingly if ($$utils.isCursor(model)) { - var modelData = void 0; + var modelData = undefined; if (angular.isUndefined(vm[k])) { _this3.$$setValHelper(vm, k, [], false); @@ -2180,8 +2303,12 @@ activeObservation = handle.observation; modelData = handle.data; - var diff = jsondiffpatch.diff(lastModelData, modelData); - vm[k] = jsondiffpatch.patch(lastModelData, diff); + if (lastModelData.length !== 0) { + var diff = _jsondiffpatch2.default.diff(lastModelData, modelData); + vm[k] = _jsondiffpatch2.default.patch(lastModelData, diff); + } else { + vm[k] = modelData; + } lastModel = model; lastModelData = modelData; @@ -2207,7 +2334,7 @@ // If set, reactives property if (watch) { - var isDeep = _.isObject(v); + var isDeep = _underscore2.default.isObject(v); this.getReactively(vm, k, isDeep); } @@ -2241,8 +2368,8 @@ _this5.$$changed(vm, k); }, changedAt: function changedAt(doc, oldDoc, atIndex) { - var diff = jsondiffpatch.diff(vm[k][atIndex], doc); - jsondiffpatch.patch(vm[k][atIndex], diff); + var diff = _jsondiffpatch2.default.diff(vm[k][atIndex], doc); + _jsondiffpatch2.default.patch(vm[k][atIndex], diff); _this5.$$changed(vm, k); }, movedTo: function movedTo(doc, fromIndex, toIndex) { @@ -2275,8 +2402,8 @@ } // Update property if the new value is from the same type else if ($$utils.areSiblings(v, data)) { - var diff = jsondiffpatch.diff(v, data); - jsondiffpatch.patch(v, diff); + var diff = _jsondiffpatch2.default.diff(v, data); + _jsondiffpatch2.default.patch(v, diff); this.$$changed(vm, k); } else { vm[k] = data; @@ -2298,7 +2425,13 @@ }]); /***/ }, -/* 20 */ +/* 22 */ +/***/ function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_22__; + +/***/ }, +/* 23 */ /***/ function(module, exports) { 'use strict'; @@ -2315,4 +2448,6 @@ } /***/ } -/******/ ]); \ No newline at end of file +/******/ ]) +}); +; \ No newline at end of file diff --git a/dist/angular-meteor.min.js b/dist/angular-meteor.min.js index c8f6ae7ec..86906ce71 100644 --- a/dist/angular-meteor.min.js +++ b/dist/angular-meteor.min.js @@ -1,4 +1,4 @@ -/*! angular-meteor v1.3.7 */ -!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.name=void 0,r(1),r(2),r(3),r(4),r(5),r(6),r(7),r(8),r(9),r(10),r(11),r(12),r(13);var n=r(14),o=r(15),i=r(16),a=r(17),s=r(18),u=r(19),c=r(20),l=t.name="angular-meteor";angular.module(l,[n.name,o.name,i.name,a.name,s.name,u.name,c.name,"angular-meteor.ironrouter","angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","angular-meteor.object","angular-meteor.user","angular-meteor.methods","angular-meteor.session","angular-meteor.camera"]).run([o.Mixer,a.Core,s.ViewModel,u.Reactive,function(e,t,r,n){e.mixin(t).mixin(r).mixin(n)}]).service("$meteor",["$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser",function(e,t,r,n,o,i,a,s,u){var c=this;this.collection=e,this.collectionFS=t,this.object=r,this.subscribe=i.subscribe,this.call=n.call,this.session=o,this.autorun=a.autorun,this.getCollectionByName=a.getCollectionByName,this.getPicture=s.getPicture,["loginWithPassword","requireUser","requireValidUser","waitForUser","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","loginWithMeteorDeveloperAccount","loginWithFacebook","loginWithGithub","loginWithGoogle","loginWithMeetup","loginWithTwitter","loginWithWeibo","logout","logoutOtherClients"].forEach(function(e){c[e]=u[e]})}])},function(e,t){"use strict";!function(){var e=angular.module("getUpdates",[]),t=function(){var e=function s(e,t){return 1>t?{}:_.reduce(e,function(e,r,n){return r=_.isObject(r)?s(r,--t):r,e[n]=r,e},{})},t=function(e){var t=r(e),o=n(e);return _.object(t,o)},r=function u(e){var t=_.keys(e).map(function(t){var r=e[t];return!_.isObject(r)||_.isEmpty(r)||_.isArray(r)?t:u(r).map(function(e){return t+"."+e})});return _.flatten(t)},n=function c(e,t){return t=t||[],_.values(e).forEach(function(e){!_.isObject(e)||_.isEmpty(e)||_.isArray(e)?t.push(e):c(e,t)}),t},o=function(e,t,r){_.isEmpty(r)||(e[t]=r)},i=function(e,t){e||a(t)},a=function(e){throw Error("get-updates error - "+e)};return{rip:e,toPaths:t,getKeyPaths:r,getDeepValues:n,setFilled:o,assert:i,throwErr:a}}(),r=function(){var e=function(e,n,o){var i;return o>1?i=o:o&&(i=1),i&&(e=t.rip(e,i),n=t.rip(n,i)),r(e,n)},r=function(r,n){var o=_.keys(r),i=_.keys(n),a=_.chain([]).concat(o).concat(i).uniq().without("$$hashKey").value();return a.reduce(function(o,i){var a=r[i],s=n[i];if(_.isDate(a)&&_.isDate(s)&&a.getTime()!=s.getTime()&&(o[i]=s),_.isObject(a)&&_.isObject(s)){var u=e(a,s);t.setFilled(o,i,u)}else a!==s&&(o[i]=s);return o},{})};return e}(),n=function(){var e=function(e,a,s){t.assert(_.isObject(e),"first argument must be an object"),t.assert(_.isObject(a),"second argument must be an object");var u=r(e,a,s),c=t.toPaths(u),l=n(c),f=o(c),d=i(f),h={};return t.setFilled(h,"$set",l),t.setFilled(h,"$unset",f),t.setFilled(h,"$pull",d),h},n=function(e){var t=a(e);return _.omit(e,t)},o=function(e){var t=a(e),r=_.pick(e,t);return _.reduce(r,function(e,t,r){return e[r]=!0,e},{})},i=function(e){var t=_.keys(e).map(function(e){var t=e.match(/(.*)\.\d+$/);return t&&t[1]});return _.compact(t).reduce(function(e,t){return e[t]=null,e},{})},a=function(e){return _.keys(e).filter(function(t){var r=e[t];return _.isUndefined(r)})};return e}();e.value("getUpdates",n)}()},function(e,t){"use strict";var r=angular.module("diffArray",["getUpdates"]);r.factory("diffArray",["getUpdates",function(e){function t(t,r,i,a){a=!!a;var s=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges,u=[],c=[],l={},f={},d={},h=t.length;_.each(r,function(e,t){c.push({_id:e._id}),f[n(e._id)]=t}),_.each(t,function(e,t){u.push({_id:e._id}),l[n(e._id)]=t,d[n(e._id)]=t}),s(u,c,{addedBefore:function(e,t,o){var a=o?d[n(o)]:h;_.each(d,function(e,t){e>=a&&d[t]++}),h++,d[n(e)]=a,i.addedAt(e,r[f[n(e)]],a,o)},movedBefore:function(e,t){var o=d[n(e)],a=t?d[n(t)]:h-1;_.each(d,function(e,t){e>=o&&a>=e?d[t]--:o>=e&&e>=a&&d[t]++}),d[n(e)]=a,i.movedTo(e,r[f[n(e)]],o,a,t)},removed:function(e){var r=d[n(e)];_.each(d,function(e,t){e>=r&&d[t]--}),delete d[n(e)],h--,i.removedAt(e,t[l[n(e)]],r)}}),_.each(f,function(n,s){if(_.has(l,s)){var u=o(s),c=r[n]||{},f=t[l[s]],d=e(f,c,a);_.isEmpty(d)||i.changedAt(u,d,n,f)}})}var r=Package.minimongo.LocalCollection,n=r._idStringify||Package["mongo-id"].MongoID.idStringify,o=r._idParse||Package["mongo-id"].MongoID.idParse;t.shallow=function(e,r,n){return t(e,r,n,!0)},t.deepCopyChanges=function(t,r){var n=e(t,r).$set;_.each(n,function(e,r){i(t,r,e)})},t.deepCopyRemovals=function(t,r){var n=e(t,r).$unset;_.each(n,function(e,r){a(t,r)})},t.getChanges=function(e,t,r){var n={added:[],removed:[],changed:[]};return r(t,e,{addedAt:function(e,t,r){n.added.push({item:t,index:r})},removedAt:function(e,t,r){n.removed.push({item:t,index:r})},changedAt:function(e,t,r,o){n.changed.push({selector:e,modifier:t})},movedTo:function(e,t,r,n){}}),n};var i=function(e,t,r){var n=t.split("."),o=_.initial(n),i=_.last(n);o.reduce(function(e,t,r){var o=n[r+1];return c(o)?(null===e[t]&&(e[t]=[]),e[t].length==parseInt(o)&&e[t].push(null)):null!==e[t]&&u(e[t])||(e[t]={}),e[t]},e);var a=s(e,o);return a[i]=r,r},a=function(e,t){var r=t.split("."),n=_.initial(r),o=_.last(r),i=s(e,n);return _.isArray(i)&&c(o)?!!i.splice(o,1):delete i[o]},s=function(e,t){return t.reduce(function(e,t){return e[t]},e)},u=function(e){return _.isObject(e)&&Object.getPrototypeOf(e)===Object.prototype},c=function(e){return e.match(/^\d+$/)};return t}])},function(e,t){"use strict";angular.module("angular-meteor.settings",[]).constant("$angularMeteorSettings",{suppressWarnings:!1})},function(e,t){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function(e,t,r){var n=(Package["iron:router"]||{}).Router;if(n){var o=!1;n.onAfterAction(function(n,i,a){Tracker.afterFlush(function(){o||(e(t)(r),r.$$phase||r.$apply(),o=!0)})})}}])},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=angular.module("angular-meteor.utils",["angular-meteor.settings"]);n.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function(e,t,n){var o=this;this.autorun=function(e,r){n.suppressWarnings||console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=Tracker.autorun(function(e){r(e),e.firstRun||t(angular.noop,0)});return e.$on("$destroy",function(){o.stop()}),o},this.stripDollarPrefixedKeys=function(e){if(!_.isObject(e)||e instanceof Date||e instanceof File||"oid"===EJSON.toJSONValue(e).$type||"object"===("undefined"==typeof FS?"undefined":r(FS))&&e instanceof FS.File)return e;var t=_.isArray(e)?[]:{};return _.each(e,function(e,r){"string"==typeof r&&"$"===r.charAt(0)||(t[r]=o.stripDollarPrefixedKeys(e))}),t},this.fulfill=function(e,t,r){return function(n,o){n?e.reject(null==t?n:t):"function"==typeof r?e.resolve(null==r?o:r(o)):e.resolve(null==r?o:r)}},this.promissor=function(t,r){return function(){var n=e.defer(),i=o.fulfill(n),a=_.toArray(arguments).concat(i);return t[r].apply(t,a),n.promise}},this.promiseAll=function(r){var n=e.all(r);return n["finally"](function(){t(angular.noop)}),n},this.getCollectionByName=function(e){return Mongo.Collection.get(e)},this.findIndexById=function(e,t){var r=_.find(e,function(e){return EJSON.equals(e._id,t._id)});return _.indexOf(e,r)}}]),n.run(["$rootScope","$meteorUtils",function(e,t){Object.getPrototypeOf(e).$meteorAutorun=function(e){return t.autorun(this,e)}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.subscribe",["angular-meteor.settings"]);r.service("$meteorSubscribe",["$q","$angularMeteorSettings",function(e,t){var r=this;this._subscribe=function(e,r,n){t.suppressWarnings||console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=null,i=n[n.length-1];if(angular.isObject(i)&&angular.isFunction(i.onStop)){var a=i.onStop;n.pop()}return n.push({onReady:function(){r.resolve(o)},onStop:function(e){r.promise.$$state.status?a&&a.apply(this,Array.prototype.slice.call(arguments)):e?r.reject(e):r.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}}),o=Meteor.subscribe.apply(e,n)},this.subscribe=function(){var t=e.defer(),n=Array.prototype.slice.call(arguments);return r._subscribe(this,t,n),t.promise}}]),r.run(["$rootScope","$q","$meteorSubscribe",function(e,t,r){Object.getPrototypeOf(e).$meteorSubscribe=function(){var e=t.defer(),n=Array.prototype.slice.call(arguments),o=r._subscribe(this,e,n);return this.$on("$destroy",function(){o.stop()}),e.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray","angular-meteor.settings"]);r.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function(e,t,r,n,o,i,a){function s(e,t,n,o){a.suppressWarnings||console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var i=[];if(i._serverBackup=[],i._diffArrayFunc=n,i._hObserve=null,i._hNewCurAutorun=null,i._hDataAutorun=null,angular.isDefined(t))i.$$collection=t;else{var u=e();i.$$collection=r.getCollectionByName(u.collection.name)}return _.extend(i,s),i._startCurAutorun(e,o),i}return s._startCurAutorun=function(e,t){var r=this;r._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){r._stopCursor()}),t&&r._setAutoClientSave(),r._updateCursor(e(),t)})},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(e,t){e||(e=this),e=[].concat(e);var n=e.map(function(e){return this._upsertDoc(e,t)},this);return r.promiseAll(n)},s._upsertDoc=function(t,n){var o=e.defer(),i=this.$$collection,a=_.partial(r.fulfill,o,null);t=r.stripDollarPrefixedKeys(t);var s=t._id,u=i.findOne(s);if(u){delete t._id;var c=n?{$unset:t}:{$set:t};i.update(s,c,a(function(){return{_id:s,action:"updated"}}))}else i.insert(t,a(function(e){return{_id:e,action:"inserted"}}));return o.promise},s._updateDiff=function(e,t,r){r=r||angular.noop;var n=_.omit(t,"$pull"),o=[n];_.each(t.$pull,function(e,t){var r={};r[t]=e,o.push({$pull:r})}),this._updateParallel(e,o,r)},s._updateParallel=function(e,t,r){var n=this,o=_.after(t.length,r),i=function(e,t){return e?r(e):void o(null,t)};_.each(t,function(t){n.$$collection.update(e,t,i)})},s.remove=function(e){var t;e?(e=[].concat(e),t=_.map(e,function(e){return e._id||e})):t=_.pluck(this,"_id"),check(t,[Match.OneOf(String,Mongo.ObjectID)]);var n=t.map(function(e){return this._removeDoc(e)},this);return r.promiseAll(n)},s._removeDoc=function(t){var n=e.defer(),o=this.$$collection,i=r.fulfill(n,null,{_id:t,action:"removed"});return o.remove(t,i),n.promise},s._updateCursor=function(e,t){var n=this;n._hObserve&&n._stopObserving(),n._hObserve=e.observe({addedAt:function(e,t){n.splice(t,0,e),n._serverBackup.splice(t,0,e),n._setServerUpdateMode()},changedAt:function(e,t,r){i.deepCopyChanges(n[r],e),i.deepCopyRemovals(n[r],e),n._serverBackup[r]=n[r],n._setServerUpdateMode()},movedTo:function(e,t,r){n.splice(t,1),n.splice(r,0,e),n._serverBackup.splice(t,1),n._serverBackup.splice(r,0,e),n._setServerUpdateMode()},removedAt:function(e){var t=r.findIndexById(n,e);-1!=t?(n.splice(t,1),n._serverBackup.splice(t,1),n._setServerUpdateMode()):(t=r.findIndexById(n._serverBackup,e),-1!=t&&n._serverBackup.splice(t,1))}}),n._hDataAutorun=Tracker.autorun(function(){e.fetch(),n._serverMode&&n._unsetServerUpdateMode(t)})},s._stopObserving=function(){this._hObserve.stop(),this._hDataAutorun.stop(),delete this._serverMode,delete this._hUnsetTimeout},s._setServerUpdateMode=function(e){this._serverMode=!0,this._unsetAutoClientSave()},s._unsetServerUpdateMode=function(e){var t=this;t._hUnsetTimeout&&(o.cancel(t._hUnsetTimeout),t._hUnsetTimeout=null),t._hUnsetTimeout=o(function(){t._serverMode=!1;var r=i.getChanges(t,t._serverBackup,t._diffArrayFunc);t._saveChanges(r),e&&t._setAutoClientSave()},0)},s.stop=function(){this._stopCursor(),this._hNewCurAutorun.stop()},s._stopCursor=function(){this._unsetAutoClientSave(),this._hObserve&&(this._hObserve.stop(),this._hDataAutorun.stop()),this.splice(0),this._serverBackup.splice(0)},s._unsetAutoClientSave=function(e){this._hRegAutoBind&&(this._hRegAutoBind(),this._hRegAutoBind=null)},s._setAutoClientSave=function(){var e=this;e._unsetAutoClientSave(),e._hRegAutoBind=n.$watch(function(){return e},function(t,r){if(t!==r){var n=i.getChanges(e,r,e._diffArrayFunc);e._unsetAutoClientSave(),e._saveChanges(n),e._setAutoClientSave()}},!0)},s._saveChanges=function(e){var t=this,r=e.added.reverse().map(function(e){return t.splice(e.index,1),e.item});r.length&&t.save(r);var n=e.removed.map(function(e){return e.item});n.length&&t.remove(n),e.changed.forEach(function(e){t._updateDiff(e.selector,e.modifier)})},s}]),r.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function(e,t,r){function n(n,o,i){return r.suppressWarnings||console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),new e(n,o,i,t.shallow)}return n}]),r.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(e,t,r){function n(t,n,o,i){if(!t)throw new TypeError("The first argument of $meteorCollection is undefined.");if(!angular.isFunction(t)&&!angular.isFunction(t.find))throw new TypeError("The first argument of $meteorCollection must be a function or a have a find function property.");return angular.isFunction(t)||(o=angular.isDefined(o)?o:t,t=_.bind(t.find,t)),n=angular.isDefined(n)?n:!0,i=i||r,new e(t,o,i,n)}return n}]),r.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function(e,t,r,n){var o=Object.getPrototypeOf(e);o.$meteorCollection=n(t),o.$meteorCollectionFS=n(r)}])},function(e,t){"use strict";var r=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray","angular-meteor.settings"]);r.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function(e,t,r,n,o,i,a){function s(e,t,r){a.suppressWarnings||console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e._helpers,o=_.isFunction(n)?Object.create(n.prototype):{},u=e.findOne(t,r),c=_.pick(i,"_updateParallel");return _.extend(o,u),_.extend(o,s),_.extend(o,c),o.$$options=_.omit(r,"skip","limit"),o.$$collection=e,o.$$id=o._getId(t),o._serverBackup=u||{},o}return s.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"],s.getRawObject=function(){return angular.copy(_.omit(this,this.$$internalProps))},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(t){var n,i=e.defer(),a=this.$$collection,s=_.partial(r.fulfill,i,null),u=a.findOne(this.$$id);if(u){if(t)n={$set:t};else if(n=o(u,this.getRawObject()),_.isEmpty(n))return e.when({action:"updated"});this._updateDiff(n,s({action:"updated"}))}else n=t?_.clone(t):this.getRawObject(),n._id=n._id||this.$$id,a.insert(n,s({action:"inserted"}));return i.promise},s._updateDiff=function(e,t){var r=this.$$id;i._updateDiff.call(this,r,e,t)},s.reset=function(e){var t=this,r=this.$$options,n=this.$$id,o=this.$$collection.findOne(n,r);if(o){var i,a=_.keys(o),s=_.pick(o,a);_.extend(t,s),_.extend(t._serverBackup,s),i=e?_.intersection(_.keys(t),_.keys(t._serverBackup)):_.keys(t);var u=_.keys(o),c=_.difference(i,u,t.$$internalProps);c.forEach(function(e){delete t[e],delete t._serverBackup[e]})}else _.keys(this.getRawObject()).forEach(function(e){delete t[e]}),t._serverBackup={}},s.stop=function(){this.unregisterAutoDestroy&&this.unregisterAutoDestroy(),this.unregisterAutoBind&&this.unregisterAutoBind(),this.autorunComputation&&this.autorunComputation.stop&&this.autorunComputation.stop()},s._getId=function(e){var t=_.extend({},this.$$options,{fields:{_id:1},reactive:!1,transform:null}),r=this.$$collection.findOne(e,t);return r?r._id:e instanceof Mongo.ObjectID?e:_.isString(e)?e:new Mongo.ObjectID},s}]),r.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function(e,t,r,n){function o(e,t,r,i){if(!e)throw new TypeError("The first argument of $meteorObject is undefined.");if(!angular.isFunction(e.findOne))throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.");var a=new n(e,t,i);return a._auto=r!==!1,_.extend(a,o),a._setAutos(),a}return o._setAutos=function(){var r=this;this.autorunComputation=t.autorun(e,function(){r.reset(!0)}),this.unregisterAutoBind=this._auto&&e.$watch(function(){return r.getRawObject()},function(e,t){e!==t&&r.save()},!0),this.unregisterAutoDestroy=e.$on("$destroy",function(){r&&r.stop&&r.pop()})},o}]),r.run(["$rootScope","$meteorObject","$meteorStopper",function(e,t,r){var n=Object.getPrototypeOf(e);n.$meteorObject=r(t)}])},function(e,t){"use strict";var r=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core","angular-meteor.settings"]);r.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function(e,t,r,n){var o=Package["accounts-base"];if(o){var i=this,a=o.Accounts;this.waitForUser=function(){n.suppressWarnings||console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||o.resolve(Meteor.user())},!0),o.promise},this.requireUser=function(){n.suppressWarnings||console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||(null===Meteor.user()?o.reject("AUTH_REQUIRED"):o.resolve(Meteor.user()))},!0),o.promise},this.requireValidUser=function(e){return n.suppressWarnings||console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),i.requireUser(!0).then(function(t){var n=e(t);return n===!0?t:"string"==typeof n?r.reject(n):r.reject("FORBIDDEN")})},this.loginWithPassword=t.promissor(Meteor,"loginWithPassword"),this.createUser=t.promissor(a,"createUser"),this.changePassword=t.promissor(a,"changePassword"),this.forgotPassword=t.promissor(a,"forgotPassword"),this.resetPassword=t.promissor(a,"resetPassword"),this.verifyEmail=t.promissor(a,"verifyEmail"),this.logout=t.promissor(Meteor,"logout"),this.logoutOtherClients=t.promissor(Meteor,"logoutOtherClients"),this.loginWithFacebook=t.promissor(Meteor,"loginWithFacebook"),this.loginWithTwitter=t.promissor(Meteor,"loginWithTwitter"),this.loginWithGoogle=t.promissor(Meteor,"loginWithGoogle"),this.loginWithGithub=t.promissor(Meteor,"loginWithGithub"),this.loginWithMeteorDeveloperAccount=t.promissor(Meteor,"loginWithMeteorDeveloperAccount"),this.loginWithMeetup=t.promissor(Meteor,"loginWithMeetup"),this.loginWithWeibo=t.promissor(Meteor,"loginWithWeibo")}}]),r.run(["$rootScope","$angularMeteorSettings","$$Core",function(e,t,r){var n=Object.getPrototypeOf(e);_.extend(n,r),e.autorun(function(){Meteor.user&&(e.currentUser=Meteor.user(),e.loggingIn=Meteor.loggingIn())})}])},function(e,t){"use strict";var r=angular.module("angular-meteor.methods",["angular-meteor.utils","angular-meteor.settings"]);r.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){this.call=function(){r.suppressWarnings||console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e.defer(),o=t.fulfill(n),i=_.toArray(arguments).concat(o);return Meteor.call.apply(this,i),n.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.session",["angular-meteor.utils","angular-meteor.settings"]);r.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function(e,t,r){return function(n){return{bind:function(o,i){r.suppressWarnings||console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var a=t(i),s=a.assign;e.autorun(o,function(){s(o,Session.get(n))}),o.$watch(i,function(e,t){Session.set(n,a(o))},!0)}}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.camera",["angular-meteor.utils","angular-meteor.settings"]);r.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=Package["mdg:camera"];if(n){var o=n.MeteorCamera;this.getPicture=function(n){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),n=n||{};var i=e.defer();return o.getPicture(n,t.fulfill(i)),i.promise}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);r.factory("$meteorStopper",["$q","$meteorSubscribe",function(e,t){function r(e){return function(){var t=Array.prototype.slice.call(arguments),n=e.apply(this,t);return angular.extend(n,r),n.$$scope=this,this.$on("$destroy",function(){n.stop(),n.subscription&&n.subscription.stop()}),n}}return r.subscribe=function(){var r=Array.prototype.slice.call(arguments);return this.subscription=t._subscribe(this.$$scope,e.defer(),r),this},r}])},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.name="angular-meteor.utilities",n=t.utils="$$utils";angular.module(r,[]).service(n,["$rootScope",function(e){function t(e,t,r){return function(){for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];var a=e.apply(t,o);return r.call(t,{result:a,args:o}),a}}function r(e,t,r){return _.keys(e).reduce(function(o,i){return o[i]=n.bind(e[i],t,r),o},{})}var n=this;this.isCursor=function(e){return e instanceof Meteor.Collection.Cursor},this.isScope=function(t){return t instanceof e.constructor},this.isViewModel=function(e){return _.isObject(e)&&e.$$dependencies},this.areSiblings=function(e,t){return _.isObject(e)&&_.isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)},this.bind=function(e,n,o){return o=_.isFunction(o)?o:angular.noop,_.isFunction(e)?t(e,n,o):_.isObject(e)?r(e,n,o):e}}])},function(e,t){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?r-1:0),o=1;r>o;o++)n[o-1]=arguments[o];return e._mixins.filter(_.isFunction).forEach(function(e){e.call.apply(e,[t].concat(n))}),t},this._extend=function(n,o){var i,a=_.defaults({},o,{pattern:/.*/}),s=a.pattern,u=a.context,c=e._mixins.map(function(e){var r=_.keys(e).filter(function(e){return e.match(s)}).filter(function(t){return _.isFunction(e[t])});return r.reduce(function(r,n){var o=e[n];return r[n]=function(){var e=u||this,r=t;t=this;try{for(var n=arguments.length,i=Array(n),a=0;n>a;a++)i[a]=arguments[a];return o.apply(e,i)}finally{t=r}},r},{})});return(i=_).extend.apply(i,[n].concat(r(c)))},Object.defineProperty(this,"caller",{configurable:!0,enumerable:!0,get:function(){return t}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.name=void 0;var n=r(15),o=t.name="angular-meteor.scope";angular.module(o,[n.name]).run(["$rootScope",n.Mixer,function(e,t){var r=e.constructor,n=e.$new;t._autoExtend.push(r.prototype),t._autoConstruct.push(e),r.prototype.$new=function(){var e=n.apply(this,arguments);return t._construct(e)}}])},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);to;o++)n[o]=arguments[o];var i=n.pop();return _.isFunction(i)&&(i=this.$bindToContext(r.caller,i)),(e=Meteor).call.apply(e,n.concat([i]))},o.applyMethod=function(){for(var e,t=arguments.length,n=Array(t),o=0;t>o;o++)n[o]=arguments[o];var i=n.pop();return _.isFunction(i)&&(i=this.$bindToContext(r.caller,i)),(e=Meteor).apply.apply(e,n.concat([i]))},o.$$autoStop=function(e){this.$on("$destroy",e.stop.bind(e))},o.$$throttledDigest=function(){var e=!this.$$destroyed&&!this.$$phase&&!this.$root.$$phase;e&&this.$digest()},o.$$defer=function(){var t=e.defer();return t.promise=t.promise["finally"](this.$$throttledDigest.bind(this)),t},o.$bindToContext=function(e,r){return t.bind(r,e,this.$$throttledDigest.bind(this))},o}])},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.reactive=t.ViewModel=t.name=void 0;var o=function(){function e(e,t){for(var r=0;r3?o-3:0),a=3;o>a;a++)i[a-3]=arguments[a];this.$$watchEntity.apply(this,[t,r,n].concat(i))}return t.$$dependencies[r].depend(),e(r)(t)},n.$$watchEntity=function(t,r,n){for(var o=this,i=_.partial(e(r),t),a=i(),s=arguments.length,u=Array(s>3?s-3:0),c=3;s>c;c++)u[c-3]=arguments[c];n.call.apply(n,[this,i,function(e,n){var i=e!==a||e!==n;i&&o.$$changed(t,r)}].concat(u))},n.$$setFnHelper=function(e,r,n){var o=this;this.autorun(function(i){var a=n.apply(e);Tracker.nonreactive(function(){t.isCursor(a)?!function(){var t=o.$$handleCursor(e,r,a);i.onInvalidate(function(){t.stop(),e[r].splice(0)})}():o.$$handleNonCursor(e,r,a),o.$$changed(e,r)})})},n.$$setValHelper=function(e,t,r){var n=this,o=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];if(o){var i=_.isObject(r);this.getReactively(e,t,i)}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return r},set:function(o){r=o,n.$$changed(e,t)}})},n.$$handleCursor=function(e,t,r){var n=this;if(angular.isUndefined(e[t]))this.$$setValHelper(e,t,r.fetch(),!1);else{var o=jsondiffpatch.diff(e[t],r.fetch());jsondiffpatch.patch(e[t],o)}var i=r.observe({addedAt:function(r,o){i&&(e[t].splice(o,0,r),n.$$changed(e,t))},changedAt:function(r,o,i){var a=jsondiffpatch.diff(e[t][i],r);jsondiffpatch.patch(e[t][i],a),n.$$changed(e,t)},movedTo:function(r,o,i){e[t].splice(o,1),e[t].splice(i,0,r),n.$$changed(e,t)},removedAt:function(r,o){e[t].splice(o,1),n.$$changed(e,t)}});return i},n.$$handleNonCursor=function(e,r,n){var o=e[r];if(angular.isDefined(o)&&(delete e[r],o=null),angular.isUndefined(o))this.$$setValHelper(e,r,n);else if(t.areSiblings(o,n)){var i=jsondiffpatch.diff(o,n);jsondiffpatch.patch(o,i),this.$$changed(e,r)}else e[r]=n},n.$$depend=function(e,t){e.$$dependencies[t].depend()},n.$$changed=function(e,t){this.$$throttledDigest(),e.$$dependencies[t].changed()},n}])},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.name="angular-templates";try{angular.module(r)}catch(n){angular.module(r,[])}}]); +/*! angular-meteor v1.3.9 */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("underscore"),require("jsondiffpatch")):"function"==typeof define&&define.amd?define(["underscore","jsondiffpatch"],t):"object"==typeof exports?exports.angularMeteor=t(require("underscore"),require("jsondiffpatch")):e.angularMeteor=t(e._,e.jsondiffpatch)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(1),r(4),r(5),r(6),r(7),r(8),r(9),r(10),r(11),r(12),r(13),r(14),r(15);var n=r(16),o=r(17),i=r(18),a=r(19),u=r(20),s=r(21),l=r(23),c="angular-meteor";t["default"]=c,angular.module(c,[n.name,o.name,i.name,a.name,u.name,s.name,l.name,"angular-meteor.ironrouter","angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","angular-meteor.object","angular-meteor.user","angular-meteor.methods","angular-meteor.session","angular-meteor.camera"]).run([o.Mixer,a.Core,u.ViewModel,s.Reactive,function(e,t,r,n){e.mixin(t).mixin(r).mixin(n)}]).service("$meteor",["$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser",function(e,t,r,n,o,i,a,u,s){var l=this;this.collection=e,this.collectionFS=t,this.object=r,this.subscribe=i.subscribe,this.call=n.call,this.session=o,this.autorun=a.autorun,this.getCollectionByName=a.getCollectionByName,this.getPicture=u.getPicture,["loginWithPassword","requireUser","requireValidUser","waitForUser","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","loginWithMeteorDeveloperAccount","loginWithFacebook","loginWithGithub","loginWithGoogle","loginWithMeetup","loginWithTwitter","loginWithWeibo","logout","logoutOtherClients"].forEach(function(e){l[e]=s[e]})}]),e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=r(2),i=n(o);!function(){var e=angular.module("getUpdates",[]),t=function(){var e=function s(e,t){return 1>t?{}:i["default"].reduce(e,function(e,r,n){return r=i["default"].isObject(r)?s(r,--t):r,e[n]=r,e},{})},t=function(e){var t=r(e),o=n(e);return i["default"].object(t,o)},r=function l(e){var t=i["default"].keys(e).map(function(t){var r=e[t];return!i["default"].isObject(r)||i["default"].isEmpty(r)||i["default"].isArray(r)?t:l(r).map(function(e){return t+"."+e})});return i["default"].flatten(t)},n=function c(e,t){return t=t||[],i["default"].values(e).forEach(function(e){!i["default"].isObject(e)||i["default"].isEmpty(e)||i["default"].isArray(e)?t.push(e):c(e,t)}),t},o=function(e,t,r){i["default"].isEmpty(r)||(e[t]=r)},a=function(e,t){e||u(t)},u=function(e){throw Error("get-updates error - "+e)};return{rip:e,toPaths:t,getKeyPaths:r,getDeepValues:n,setFilled:o,assert:a,throwErr:u}}(),r=function(){var e=function(e,n,o){var i;return o>1?i=o:o&&(i=1),i&&(e=t.rip(e,i),n=t.rip(n,i)),r(e,n)},r=function(r,n){var o=i["default"].keys(r),a=i["default"].keys(n),u=i["default"].chain([]).concat(o).concat(a).uniq().without("$$hashKey").value();return u.reduce(function(o,a){var u=r[a],s=n[a];if(i["default"].isDate(u)&&i["default"].isDate(s)&&u.getTime()!=s.getTime()&&(o[a]=s),i["default"].isObject(u)&&i["default"].isObject(s)){var l=e(u,s);t.setFilled(o,a,l)}else u!==s&&(o[a]=s);return o},{})};return e}(),n=function(){var e=function(e,u,s){t.assert(i["default"].isObject(e),"first argument must be an object"),t.assert(i["default"].isObject(u),"second argument must be an object");var l=r(e,u,s),c=t.toPaths(l),f=n(c),d=o(c),p=a(d),h={};return t.setFilled(h,"$set",f),t.setFilled(h,"$unset",d),t.setFilled(h,"$pull",p),h},n=function(e){var t=u(e);return i["default"].omit(e,t)},o=function(e){var t=u(e),r=i["default"].pick(e,t);return i["default"].reduce(r,function(e,t,r){return e[r]=!0,e},{})},a=function(e){var t=i["default"].keys(e).map(function(e){var t=e.match(/(.*)\.\d+$/);return t&&t[1]});return i["default"].compact(t).reduce(function(e,t){return e[t]=null,e},{})},u=function(e){return i["default"].keys(e).filter(function(t){var r=e[t];return i["default"].isUndefined(r)})};return e}();e.value("getUpdates",n)}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(3),i=n(o);if("undefined"==typeof i["default"]&&"undefined"==typeof Package.underscore)throw new Error("underscore is missing");t["default"]=i["default"]||Package.underscore._,e.exports=t["default"]},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=r(2),i=n(o),a=angular.module("diffArray",["getUpdates"]);a.factory("diffArray",["getUpdates",function(e){function t(t,r,a,u){u=!!u;var s=Package.minimongo.LocalCollection._diffQueryOrderedChanges||Package["diff-sequence"].DiffSequence.diffQueryOrderedChanges,l=[],c=[],f={},d={},p={},h=t.length;i["default"].each(r,function(e,t){c.push({_id:e._id}),d[n(e._id)]=t}),i["default"].each(t,function(e,t){l.push({_id:e._id}),f[n(e._id)]=t,p[n(e._id)]=t}),s(l,c,{addedBefore:function(e,t,o){var u=o?p[n(o)]:h;i["default"].each(p,function(e,t){e>=u&&p[t]++}),h++,p[n(e)]=u,a.addedAt(e,r[d[n(e)]],u,o)},movedBefore:function(e,t){var o=p[n(e)],u=t?p[n(t)]:h-1;i["default"].each(p,function(e,t){e>=o&&u>=e?p[t]--:o>=e&&e>=u&&p[t]++}),p[n(e)]=u,a.movedTo(e,r[d[n(e)]],o,u,t)},removed:function(e){var r=p[n(e)];i["default"].each(p,function(e,t){e>=r&&p[t]--}),delete p[n(e)],h--,a.removedAt(e,t[f[n(e)]],r)}}),i["default"].each(d,function(n,s){if(i["default"].has(f,s)){var l=o(s),c=r[n]||{},d=t[f[s]],p=e(d,c,u);i["default"].isEmpty(p)||a.changedAt(l,p,n,d)}})}var r=Package.minimongo.LocalCollection,n=r._idStringify||Package["mongo-id"].MongoID.idStringify,o=r._idParse||Package["mongo-id"].MongoID.idParse;t.shallow=function(e,r,n){return t(e,r,n,!0)},t.deepCopyChanges=function(t,r){var n=e(t,r).$set;i["default"].each(n,function(e,r){a(t,r,e)})},t.deepCopyRemovals=function(t,r){var n=e(t,r).$unset;i["default"].each(n,function(e,r){u(t,r)})},t.getChanges=function(e,t,r){var n={added:[],removed:[],changed:[]};return r(t,e,{addedAt:function(e,t,r){n.added.push({item:t,index:r})},removedAt:function(e,t,r){n.removed.push({item:t,index:r})},changedAt:function(e,t,r,o){n.changed.push({selector:e,modifier:t})},movedTo:function(e,t,r,n){}}),n};var a=function(e,t,r){var n=t.split("."),o=i["default"].initial(n),a=i["default"].last(n);o.reduce(function(e,t,r){var o=n[r+1];return c(o)?(null===e[t]&&(e[t]=[]),e[t].length==parseInt(o)&&e[t].push(null)):null!==e[t]&&l(e[t])||(e[t]={}),e[t]},e);var u=s(e,o);return u[a]=r,r},u=function(e,t){var r=t.split("."),n=i["default"].initial(r),o=i["default"].last(r),a=s(e,n);return i["default"].isArray(a)&&c(o)?!!a.splice(o,1):delete a[o]},s=function(e,t){return t.reduce(function(e,t){return e[t]},e)},l=function(e){return i["default"].isObject(e)&&Object.getPrototypeOf(e)===Object.prototype},c=function(e){return e.match(/^\d+$/)};return t}])},function(e,t){"use strict";angular.module("angular-meteor.settings",[]).constant("$angularMeteorSettings",{suppressWarnings:!0})},function(e,t){"use strict";angular.module("angular-meteor.ironrouter",[]).run(["$compile","$document","$rootScope",function(e,t,r){var n=(Package["iron:router"]||{}).Router;if(n){var o=!1;n.onAfterAction(function(n,i,a){Tracker.afterFlush(function(){o||(e(t)(r),r.$$phase||r.$apply(),o=!0)})})}}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i=r(2),a=n(i),u=angular.module("angular-meteor.utils",["angular-meteor.settings"]);u.service("$meteorUtils",["$q","$timeout","$angularMeteorSettings",function(e,t,r){var n=this;this.autorun=function(e,n){r.suppressWarnings||console.warn("[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=Tracker.autorun(function(e){n(e),e.firstRun||t(angular.noop,0)});return e.$on("$destroy",function(){o.stop()}),o},this.stripDollarPrefixedKeys=function(e){if(!a["default"].isObject(e)||e instanceof Date||e instanceof File||"oid"===EJSON.toJSONValue(e).$type||"object"===("undefined"==typeof FS?"undefined":o(FS))&&e instanceof FS.File)return e;var t=a["default"].isArray(e)?[]:{};return a["default"].each(e,function(e,r){"string"==typeof r&&"$"===r.charAt(0)||(t[r]=n.stripDollarPrefixedKeys(e))}),t},this.fulfill=function(e,t,r){return function(n,o){n?e.reject(null==t?n:t):"function"==typeof r?e.resolve(null==r?o:r(o)):e.resolve(null==r?o:r)}},this.promissor=function(t,r){return function(){var o=e.defer(),i=n.fulfill(o),u=a["default"].toArray(arguments).concat(i);return t[r].apply(t,u),o.promise}},this.promiseAll=function(r){var n=e.all(r);return n["finally"](function(){t(angular.noop)}),n},this.getCollectionByName=function(e){return Mongo.Collection.get(e)},this.findIndexById=function(e,t){var r=a["default"].find(e,function(e){return EJSON.equals(e._id,t._id)});return a["default"].indexOf(e,r)}}]),u.run(["$rootScope","$meteorUtils",function(e,t){Object.getPrototypeOf(e).$meteorAutorun=function(e){return t.autorun(this,e)}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.subscribe",["angular-meteor.settings"]);r.service("$meteorSubscribe",["$q","$angularMeteorSettings",function(e,t){var r=this;this._subscribe=function(e,r,n){t.suppressWarnings||console.warn("[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=null,i=n[n.length-1];if(angular.isObject(i)&&angular.isFunction(i.onStop)){var a=i.onStop;n.pop()}return n.push({onReady:function(){r.resolve(o)},onStop:function(e){r.promise.$$state.status?a&&a.apply(this,Array.prototype.slice.call(arguments)):e?r.reject(e):r.reject(new Meteor.Error("Subscription Stopped","Subscription stopped by a call to stop method. Either by the client or by the server."))}}),o=Meteor.subscribe.apply(e,n)},this.subscribe=function(){var t=e.defer(),n=Array.prototype.slice.call(arguments);return r._subscribe(this,t,n),t.promise}}]),r.run(["$rootScope","$q","$meteorSubscribe",function(e,t,r){Object.getPrototypeOf(e).$meteorSubscribe=function(){var e=t.defer(),n=Array.prototype.slice.call(arguments),o=r._subscribe(this,e,n);return this.$on("$destroy",function(){o.stop()}),e.promise}}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=r(2),i=n(o),a=angular.module("angular-meteor.collection",["angular-meteor.stopper","angular-meteor.subscribe","angular-meteor.utils","diffArray","angular-meteor.settings"]);a.factory("AngularMeteorCollection",["$q","$meteorSubscribe","$meteorUtils","$rootScope","$timeout","diffArray","$angularMeteorSettings",function(e,t,r,n,o,a,u){function s(e,t,n,o){u.suppressWarnings||console.warn("[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var a=[];if(a._serverBackup=[],a._diffArrayFunc=n,a._hObserve=null,a._hNewCurAutorun=null,a._hDataAutorun=null,angular.isDefined(t))a.$$collection=t;else{var l=e();a.$$collection=r.getCollectionByName(l.collection.name)}return i["default"].extend(a,s),a._startCurAutorun(e,o),a}return s._startCurAutorun=function(e,t){var r=this;r._hNewCurAutorun=Tracker.autorun(function(){Tracker.onInvalidate(function(){r._stopCursor()}),t&&r._setAutoClientSave(),r._updateCursor(e(),t)})},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(e,t){e||(e=this),e=[].concat(e);var n=e.map(function(e){return this._upsertDoc(e,t)},this);return r.promiseAll(n)},s._upsertDoc=function(t,n){var o=e.defer(),a=this.$$collection,u=i["default"].partial(r.fulfill,o,null);t=r.stripDollarPrefixedKeys(t);var s=t._id,l=a.findOne(s);if(l){delete t._id;var c=n?{$unset:t}:{$set:t};a.update(s,c,u(function(){return{_id:s,action:"updated"}}))}else a.insert(t,u(function(e){return{_id:e,action:"inserted"}}));return o.promise},s._updateDiff=function(e,t,r){r=r||angular.noop;var n=i["default"].omit(t,"$pull"),o=[n];i["default"].each(t.$pull,function(e,t){var r={};r[t]=e,o.push({$pull:r})}),this._updateParallel(e,o,r)},s._updateParallel=function(e,t,r){var n=this,o=i["default"].after(t.length,r),a=function(e,t){return e?r(e):void o(null,t)};i["default"].each(t,function(t){n.$$collection.update(e,t,a)})},s.remove=function(e){var t;e?(e=[].concat(e),t=i["default"].map(e,function(e){return e._id||e})):t=i["default"].pluck(this,"_id"),check(t,[Match.OneOf(String,Mongo.ObjectID)]);var n=t.map(function(e){return this._removeDoc(e)},this);return r.promiseAll(n)},s._removeDoc=function(t){var n=e.defer(),o=this.$$collection,i=r.fulfill(n,null,{_id:t,action:"removed"});return o.remove(t,i),n.promise},s._updateCursor=function(e,t){var n=this;n._hObserve&&n._stopObserving(),n._hObserve=e.observe({addedAt:function(e,t){n.splice(t,0,e),n._serverBackup.splice(t,0,e),n._setServerUpdateMode()},changedAt:function(e,t,r){a.deepCopyChanges(n[r],e),a.deepCopyRemovals(n[r],e),n._serverBackup[r]=n[r],n._setServerUpdateMode()},movedTo:function(e,t,r){n.splice(t,1),n.splice(r,0,e),n._serverBackup.splice(t,1),n._serverBackup.splice(r,0,e),n._setServerUpdateMode()},removedAt:function(e){var t=r.findIndexById(n,e);-1!=t?(n.splice(t,1),n._serverBackup.splice(t,1),n._setServerUpdateMode()):(t=r.findIndexById(n._serverBackup,e),-1!=t&&n._serverBackup.splice(t,1))}}),n._hDataAutorun=Tracker.autorun(function(){e.fetch(),n._serverMode&&n._unsetServerUpdateMode(t)})},s._stopObserving=function(){this._hObserve.stop(),this._hDataAutorun.stop(),delete this._serverMode,delete this._hUnsetTimeout},s._setServerUpdateMode=function(e){this._serverMode=!0,this._unsetAutoClientSave()},s._unsetServerUpdateMode=function(e){var t=this;t._hUnsetTimeout&&(o.cancel(t._hUnsetTimeout),t._hUnsetTimeout=null),t._hUnsetTimeout=o(function(){t._serverMode=!1;var r=a.getChanges(t,t._serverBackup,t._diffArrayFunc);t._saveChanges(r),e&&t._setAutoClientSave()},0)},s.stop=function(){this._stopCursor(),this._hNewCurAutorun.stop()},s._stopCursor=function(){this._unsetAutoClientSave(),this._hObserve&&(this._hObserve.stop(),this._hDataAutorun.stop()),this.splice(0),this._serverBackup.splice(0)},s._unsetAutoClientSave=function(e){this._hRegAutoBind&&(this._hRegAutoBind(),this._hRegAutoBind=null)},s._setAutoClientSave=function(){var e=this;e._unsetAutoClientSave(),e._hRegAutoBind=n.$watch(function(){return e},function(t,r){if(t!==r){var n=a.getChanges(e,r,e._diffArrayFunc);e._unsetAutoClientSave(),e._saveChanges(n),e._setAutoClientSave()}},!0)},s._saveChanges=function(e){var t=this,r=e.added.reverse().map(function(e){return t.splice(e.index,1),e.item});r.length&&t.save(r);var n=e.removed.map(function(e){return e.item});n.length&&t.remove(n),e.changed.forEach(function(e){t._updateDiff(e.selector,e.modifier)})},s}]),a.factory("$meteorCollectionFS",["$meteorCollection","diffArray","$angularMeteorSettings",function(e,t,r){function n(n,o,i){return r.suppressWarnings||console.warn("[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),new e(n,o,i,t.shallow)}return n}]),a.factory("$meteorCollection",["AngularMeteorCollection","$rootScope","diffArray",function(e,t,r){function n(t,n,o,a){if(!t)throw new TypeError("The first argument of $meteorCollection is undefined.");if(!angular.isFunction(t)&&!angular.isFunction(t.find))throw new TypeError("The first argument of $meteorCollection must be a function or a have a find function property.");return angular.isFunction(t)||(o=angular.isDefined(o)?o:t,t=i["default"].bind(t.find,t)),n=angular.isDefined(n)?n:!0,a=a||r,new e(t,o,a,n)}return n}]),a.run(["$rootScope","$meteorCollection","$meteorCollectionFS","$meteorStopper",function(e,t,r,n){var o=Object.getPrototypeOf(e);o.$meteorCollection=n(t),o.$meteorCollectionFS=n(r)}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=r(2),i=n(o),a=angular.module("angular-meteor.object",["angular-meteor.utils","angular-meteor.subscribe","angular-meteor.collection","getUpdates","diffArray","angular-meteor.settings"]);a.factory("AngularMeteorObject",["$q","$meteorSubscribe","$meteorUtils","diffArray","getUpdates","AngularMeteorCollection","$angularMeteorSettings",function(e,t,r,n,o,a,u){function s(e,t,r){u.suppressWarnings||console.warn("[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e._helpers,o=i["default"].isFunction(n)?Object.create(n.prototype):{},l=e.findOne(t,r),c=i["default"].pick(a,"_updateParallel");return i["default"].extend(o,l),i["default"].extend(o,s),i["default"].extend(o,c),o.$$options=i["default"].omit(r,"skip","limit"),o.$$collection=e,o.$$id=o._getId(t),o._serverBackup=l||{},o}return s.$$internalProps=["$$collection","$$options","$$id","$$hashkey","$$internalProps","$$scope","bind","save","reset","subscribe","stop","autorunComputation","unregisterAutoBind","unregisterAutoDestroy","getRawObject","_auto","_setAutos","_eventEmitter","_serverBackup","_updateDiff","_updateParallel","_getId"],s.getRawObject=function(){return angular.copy(i["default"].omit(this,this.$$internalProps))},s.subscribe=function(){return t.subscribe.apply(this,arguments),this},s.save=function(t){var n,a=e.defer(),u=this.$$collection,s=i["default"].partial(r.fulfill,a,null),l=u.findOne(this.$$id);if(l){if(t)n={$set:t};else if(n=o(l,this.getRawObject()),i["default"].isEmpty(n))return e.when({action:"updated"});this._updateDiff(n,s({action:"updated"}))}else n=t?i["default"].clone(t):this.getRawObject(),n._id=n._id||this.$$id,u.insert(n,s({action:"inserted"}));return a.promise},s._updateDiff=function(e,t){var r=this.$$id;a._updateDiff.call(this,r,e,t)},s.reset=function(e){var t=this,r=this.$$options,n=this.$$id,o=this.$$collection.findOne(n,r);if(o){var a,u=i["default"].keys(o),s=i["default"].pick(o,u);i["default"].extend(t,s),i["default"].extend(t._serverBackup,s),a=e?i["default"].intersection(i["default"].keys(t),i["default"].keys(t._serverBackup)):i["default"].keys(t);var l=i["default"].keys(o),c=i["default"].difference(a,l,t.$$internalProps);c.forEach(function(e){delete t[e],delete t._serverBackup[e]})}else i["default"].keys(this.getRawObject()).forEach(function(e){delete t[e]}),t._serverBackup={}},s.stop=function(){this.unregisterAutoDestroy&&this.unregisterAutoDestroy(),this.unregisterAutoBind&&this.unregisterAutoBind(),this.autorunComputation&&this.autorunComputation.stop&&this.autorunComputation.stop()},s._getId=function(e){var t=i["default"].extend({},this.$$options,{fields:{_id:1},reactive:!1,transform:null}),r=this.$$collection.findOne(e,t);return r?r._id:e instanceof Mongo.ObjectID?e:i["default"].isString(e)?e:new Mongo.ObjectID},s}]),a.factory("$meteorObject",["$rootScope","$meteorUtils","getUpdates","AngularMeteorObject",function(e,t,r,n){function o(e,t,r,a){if(!e)throw new TypeError("The first argument of $meteorObject is undefined.");if(!angular.isFunction(e.findOne))throw new TypeError("The first argument of $meteorObject must be a function or a have a findOne function property.");var u=new n(e,t,a);return u._auto=r!==!1,i["default"].extend(u,o),u._setAutos(),u}return o._setAutos=function(){var r=this;this.autorunComputation=t.autorun(e,function(){r.reset(!0)}),this.unregisterAutoBind=this._auto&&e.$watch(function(){return r.getRawObject()},function(e,t){e!==t&&r.save()},!0),this.unregisterAutoDestroy=e.$on("$destroy",function(){r&&r.stop&&r.pop()})},o}]),a.run(["$rootScope","$meteorObject","$meteorStopper",function(e,t,r){var n=Object.getPrototypeOf(e);n.$meteorObject=r(t)}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=r(2),i=n(o),a=angular.module("angular-meteor.user",["angular-meteor.utils","angular-meteor.core","angular-meteor.settings"]);a.service("$meteorUser",["$rootScope","$meteorUtils","$q","$angularMeteorSettings",function(e,t,r,n){var o=Package["accounts-base"];if(o){var i=this,a=o.Accounts;this.waitForUser=function(){n.suppressWarnings||console.warn("[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||o.resolve(Meteor.user())},!0),o.promise},this.requireUser=function(){n.suppressWarnings||console.warn("[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var o=r.defer();return t.autorun(e,function(){Meteor.loggingIn()||(null===Meteor.user()?o.reject("AUTH_REQUIRED"):o.resolve(Meteor.user()))},!0),o.promise},this.requireValidUser=function(e){return n.suppressWarnings||console.warn("[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),i.requireUser(!0).then(function(t){var n=e(t);return n===!0?t:"string"==typeof n?r.reject(n):r.reject("FORBIDDEN")})},this.loginWithPassword=t.promissor(Meteor,"loginWithPassword"),this.createUser=t.promissor(a,"createUser"),this.changePassword=t.promissor(a,"changePassword"),this.forgotPassword=t.promissor(a,"forgotPassword"),this.resetPassword=t.promissor(a,"resetPassword"),this.verifyEmail=t.promissor(a,"verifyEmail"),this.logout=t.promissor(Meteor,"logout"),this.logoutOtherClients=t.promissor(Meteor,"logoutOtherClients"),this.loginWithFacebook=t.promissor(Meteor,"loginWithFacebook"),this.loginWithTwitter=t.promissor(Meteor,"loginWithTwitter"),this.loginWithGoogle=t.promissor(Meteor,"loginWithGoogle"),this.loginWithGithub=t.promissor(Meteor,"loginWithGithub"),this.loginWithMeteorDeveloperAccount=t.promissor(Meteor,"loginWithMeteorDeveloperAccount"),this.loginWithMeetup=t.promissor(Meteor,"loginWithMeetup"),this.loginWithWeibo=t.promissor(Meteor,"loginWithWeibo")}}]),a.run(["$rootScope","$angularMeteorSettings","$$Core",function(e,t,r){var n=Object.getPrototypeOf(e);i["default"].extend(n,r),e.autorun(function(){Meteor.user&&(e.currentUser=Meteor.user(),e.loggingIn=Meteor.loggingIn())})}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=r(2),i=n(o),a=angular.module("angular-meteor.methods",["angular-meteor.utils","angular-meteor.settings"]);a.service("$meteorMethods",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){this.call=function(){r.suppressWarnings||console.warn("[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=e.defer(),o=t.fulfill(n),a=i["default"].toArray(arguments).concat(o);return Meteor.call.apply(this,a),n.promise}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.session",["angular-meteor.utils","angular-meteor.settings"]);r.factory("$meteorSession",["$meteorUtils","$parse","$angularMeteorSettings",function(e,t,r){return function(n){return{bind:function(o,i){r.suppressWarnings||console.warn("[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var a=t(i),u=a.assign;e.autorun(o,function(){u(o,Session.get(n))}),o.$watch(i,function(e,t){Session.set(n,a(o))},!0)}}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.camera",["angular-meteor.utils","angular-meteor.settings"]);r.service("$meteorCamera",["$q","$meteorUtils","$angularMeteorSettings",function(e,t,r){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings");var n=Package["mdg:camera"];if(n){var o=n.MeteorCamera;this.getPicture=function(n){r.suppressWarnings||console.warn("[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings"),n=n||{};var i=e.defer();return o.getPicture(n,t.fulfill(i)),i.promise}}}])},function(e,t){"use strict";var r=angular.module("angular-meteor.stopper",["angular-meteor.subscribe"]);r.factory("$meteorStopper",["$q","$meteorSubscribe",function(e,t){function r(e){return function(){var t=Array.prototype.slice.call(arguments),n=e.apply(this,t);return angular.extend(n,r),n.$$scope=this,this.$on("$destroy",function(){n.stop(),n.subscription&&n.subscription.stop()}),n}}return r.subscribe=function(){var r=Array.prototype.slice.call(arguments);return this.subscription=t._subscribe(this.$$scope,e.defer(),r),this},r}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.name=void 0;var o=r(2),i=n(o),a=t.name="angular-meteor.utilities",u=t.utils="$$utils";angular.module(a,[]).service(u,["$rootScope",function(e){function t(e,t,r){return function(){for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];var a=e.apply(t,o);return r.call(t,{result:a,args:o}),a}}function r(e,t,r){return i["default"].keys(e).reduce(function(o,i){return o[i]=n.bind(e[i],t,r),o},{})}var n=this;this.isCursor=function(e){return e instanceof Meteor.Collection.Cursor},this.isScope=function(t){return t instanceof e.constructor},this.isViewModel=function(e){return i["default"].isObject(e)&&e.$$dependencies},this.areSiblings=function(e,t){return i["default"].isObject(e)&&i["default"].isObject(t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)},this.bind=function(e,n,o){return o=i["default"].isFunction(o)?o:angular.noop,i["default"].isFunction(e)?t(e,n,o):i["default"].isObject(e)?r(e,n,o):e}}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t1?r-1:0),o=1;r>o;o++)n[o-1]=arguments[o];return e._mixins.filter(a["default"].isFunction).forEach(function(e){e.call.apply(e,[t].concat(n))}),t},this._extend=function(r,n){var i=a["default"].defaults({},n,{pattern:/.*/}),u=i.pattern,s=i.context,l=e._mixins.map(function(e){var r=a["default"].keys(e).filter(function(e){return e.match(u)}).filter(function(t){return a["default"].isFunction(e[t])});return r.reduce(function(r,n){var o=e[n];return r[n]=function(){var e=s||this,r=t;t=this;try{for(var n=arguments.length,i=Array(n),a=0;n>a;a++)i[a]=arguments[a];return o.apply(e,i)}finally{t=r}},r},{})});return a["default"].extend.apply(a["default"],[r].concat(o(l)))},Object.defineProperty(this,"caller",{configurable:!0,enumerable:!0,get:function(){return t}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.name=void 0;var n=r(17),o=t.name="angular-meteor.scope";angular.module(o,[n.name]).run(["$rootScope",n.Mixer,function(e,t){var r=e.constructor,n=e.$new;t._autoExtend.push(r.prototype),t._autoConstruct.push(e),r.prototype.$new=function(){var e=n.apply(this,arguments);return t._construct(e)}}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);to;o++)n[o]=arguments[o];var i=n.pop();return a["default"].isFunction(i)&&(i=this.$bindToContext(r.caller,i)),(e=Meteor).call.apply(e,n.concat([i]))},n.applyMethod=function(){for(var e,t=arguments.length,n=Array(t),o=0;t>o;o++)n[o]=arguments[o];var i=n.pop();return a["default"].isFunction(i)&&(i=this.$bindToContext(r.caller,i)),(e=Meteor).apply.apply(e,n.concat([i]))},n.$$autoStop=function(e){this.$on("$destroy",e.stop.bind(e))},n.$$throttledDigest=function(){var e=!this.$$destroyed&&!this.$$phase&&!this.$root.$$phase;e&&this.$digest()},n.$$defer=function(){var t=e.defer();return t.promise=t.promise["finally"](this.$$throttledDigest.bind(this)), +t},n.$bindToContext=function(e,r){return t.bind(r,e,this.$$throttledDigest.bind(this))},n}])},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.reactive=t.ViewModel=t.name=void 0;var i=function(){function e(e,t){for(var r=0;r3?o-3:0),a=3;o>a;a++)i[a-3]=arguments[a];this.$$watchEntity.apply(this,[t,r,n].concat(i))}return t.$$dependencies[r].depend(),e(r)(t)},n.$$watchEntity=function(t,r,n){for(var o=this,i=u["default"].partial(e(r),t),a=i(),s=arguments.length,l=Array(s>3?s-3:0),c=3;s>c;c++)l[c-3]=arguments[c];n.call.apply(n,[this,i,function(e,n){var i=e!==a||e!==n;i&&o.$$changed(t,r)}].concat(l))},n.$$setFnHelper=function(e,r,n){var o=this,a=null,u=null,s=[];this.autorun(function(){var l=n.apply(e);Tracker.nonreactive(function(){if(t.isCursor(l)){var n=void 0;angular.isUndefined(e[r])&&o.$$setValHelper(e,r,[],!1),a&&(s=u.fetch(),a.stop(),a=null);var c=o.$$handleCursor(e,r,l);if(a=c.observation,n=c.data,0!==s.length){var f=i["default"].diff(s,n);e[r]=i["default"].patch(s,f)}else e[r]=n;u=l,s=n}else o.$$handleNonCursor(e,r,l);o.$$changed(e,r)})})},n.$$setValHelper=function(e,t,r){var n=this,o=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];if(o){var i=u["default"].isObject(r);this.getReactively(e,t,i)}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return r},set:function(o){r=o,n.$$changed(e,t)}})},n.$$handleCursor=function(e,t,r){var n=this,o=[],a=r.observe({addedAt:function(r,i){return a?(e[t].splice(i,0,r),void n.$$changed(e,t)):void o.push(r)},changedAt:function(r,o,a){var u=i["default"].diff(e[t][a],r);i["default"].patch(e[t][a],u),n.$$changed(e,t)},movedTo:function(r,o,i){e[t].splice(o,1),e[t].splice(i,0,r),n.$$changed(e,t)},removedAt:function(r,o){e[t].splice(o,1),n.$$changed(e,t)}});return{observation:a,data:o}},n.$$handleNonCursor=function(e,r,n){var o=e[r];if(angular.isDefined(o)&&(delete e[r],o=null),angular.isUndefined(o))this.$$setValHelper(e,r,n);else if(t.areSiblings(o,n)){var a=i["default"].diff(o,n);i["default"].patch(o,a),this.$$changed(e,r)}else e[r]=n},n.$$depend=function(e,t){e.$$dependencies[t].depend()},n.$$changed=function(e,t){this.$$throttledDigest(),e.$$dependencies[t].changed()},n}])},function(e,r){e.exports=t},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.name="angular-templates";try{angular.module(r)}catch(n){angular.module(r,[])}}])}); //# sourceMappingURL=angular-meteor.min.js.map \ No newline at end of file diff --git a/dist/angular-meteor.min.js.map b/dist/angular-meteor.min.js.map index d6b9c1923..cb647d0c9 100644 --- a/dist/angular-meteor.min.js.map +++ b/dist/angular-meteor.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///dist/angular-meteor.min.js","webpack:///webpack/bootstrap b5f5480244b0a53ac05c","webpack:///./src/angular-meteor.js","webpack:///./src/lib/get-updates.js","webpack:///./src/lib/diff-array.js","webpack:///./src/modules/angular-meteor-settings.js","webpack:///./src/modules/angular-meteor-ironrouter.js","webpack:///./src/modules/angular-meteor-utils.js","webpack:///./src/modules/angular-meteor-subscribe.js","webpack:///./src/modules/angular-meteor-collection.js","webpack:///./src/modules/angular-meteor-object.js","webpack:///./src/modules/angular-meteor-user.js","webpack:///./src/modules/angular-meteor-methods.js","webpack:///./src/modules/angular-meteor-session.js","webpack:///./src/modules/angular-meteor-camera.js","webpack:///./src/modules/angular-meteor-stopper.js","webpack:///./src/modules/utils.js","webpack:///./src/modules/mixer.js","webpack:///./src/modules/scope.js","webpack:///./src/modules/core.js","webpack:///./src/modules/view-model.js","webpack:///./src/modules/reactive.js","webpack:///./src/modules/templates.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","Object","defineProperty","value","name","undefined","_utils","_mixer","_scope","_core","_viewModel","_reactive","_templates","angular","run","Mixer","Core","ViewModel","Reactive","$Mixer","$$Core","$$ViewModel","$$Reactive","mixin","service","$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser","_this","this","collection","collectionFS","object","subscribe","session","autorun","getCollectionByName","getPicture","forEach","method","utils","rip","obj","level","_","reduce","clone","v","k","isObject","toPaths","keys","getKeyPaths","values","getDeepValues","map","isEmpty","isArray","subKey","flatten","arr","push","setFilled","assert","result","msg","throwErr","Error","getDifference","src","dst","isShallow","compare","srcKeys","dstKeys","chain","concat","uniq","without","diff","srcValue","dstValue","isDate","getTime","valueDiff","getUpdates","paths","set","createSet","unset","createUnset","pull","createPull","updates","undefinedKeys","getUndefinedKeys","omit","pick","arrKeyPaths","split","match","compact","filter","isUndefined","_module","factory","diffArray","lastSeqArray","seqArray","callbacks","preventNestedDiff","diffFn","Package","minimongo","LocalCollection","_diffQueryOrderedChanges","DiffSequence","diffQueryOrderedChanges","oldObjIds","newObjIds","posOld","posNew","posCur","lengthCur","length","each","doc","i","_id","idStringify","addedBefore","before","position","pos","addedAt","movedBefore","prevPosition","movedTo","removed","removedAt","idString","has","idParse","newItem","oldItem","changedAt","_idStringify","MongoID","_idParse","shallow","deepCopyChanges","setDiff","$set","deepKey","setDeep","deepCopyRemovals","unsetDiff","$unset","unsetDeep","getChanges","newCollection","oldCollection","diffMethod","changes","added","changed","item","index","selector","modifier","fromIndex","toIndex","initialKeys","initial","lastKey","last","subObj","nextKey","isNumStr","parseInt","isHash","deepObj","getDeep","splice","getPrototypeOf","prototype","str","constant","suppressWarnings","$compile","$document","$rootScope","Router","isLoaded","onAfterAction","req","res","next","Tracker","afterFlush","$$phase","$apply","_typeof","Symbol","iterator","constructor","angularMeteorUtils","$q","$timeout","$angularMeteorSettings","self","scope","fn","console","warn","comp","firstRun","noop","$on","stop","stripDollarPrefixedKeys","data","Date","File","EJSON","toJSONValue","$type","FS","out","charAt","fulfill","deferred","boundError","boundResult","err","reject","resolve","promissor","defer","args","toArray","arguments","apply","promise","promiseAll","promises","allPromise","all","string","Mongo","Collection","get","findIndexById","foundDoc","find","colDoc","equals","indexOf","$meteorAutorun","angularMeteorSubscribe","_subscribe","subscription","lastArg","isFunction","onStop","_onStop","pop","onReady","$$state","status","Array","slice","Meteor","angularMeteorCollection","AngularMeteorCollection","curDefFunc","diffArrayFunc","autoClientSave","_serverBackup","_diffArrayFunc","_hObserve","_hNewCurAutorun","_hDataAutorun","isDefined","$$collection","cursor","extend","_startCurAutorun","onInvalidate","_stopCursor","_setAutoClientSave","_updateCursor","save","docs","useUnsetModifier","_upsertDoc","createFulfill","partial","docId","isExist","findOne","update","action","insert","_updateDiff","callback","setters","$pull","prop","puller","_updateParallel","done","after","affectedDocsNum","remove","keyOrDocs","keyOrDoc","pluck","check","Match","OneOf","String","ObjectID","key","_removeDoc","_stopObserving","observe","atIndex","_setServerUpdateMode","oldDoc","removedIndex","fetch","_serverMode","_unsetServerUpdateMode","_hUnsetTimeout","_unsetAutoClientSave","cancel","_saveChanges","_hRegAutoBind","$watch","nItems","oItems","addedDocs","reverse","descriptor","removedDocs","reactiveFunc","TypeError","bind","$meteorStopper","scopeProto","angularMeteorObject","AngularMeteorObject","options","helpers","_helpers","create","collectionExtension","$$options","$$id","_getId","$$internalProps","getRawObject","copy","custom","mods","when","reset","keepClientProps","clientProps","docKeys","docExtension","intersection","serverProps","removedKeys","difference","unregisterAutoDestroy","unregisterAutoBind","autorunComputation","fields","reactive","transform","isString","auto","_auto","_setAutos","angularMeteorUser","pack","Accounts","waitForUser","loggingIn","user","requireUser","requireValidUser","validatorFn","then","valid","loginWithPassword","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","logout","logoutOtherClients","loginWithFacebook","loginWithTwitter","loginWithGoogle","loginWithGithub","loginWithMeteorDeveloperAccount","loginWithMeetup","loginWithWeibo","ScopeProto","currentUser","angularMeteorMethods","angularMeteorSession","$parse","model","getter","setter","assign","Session","angularMeteorCamera","MeteorCamera","angularMeteorStopper","$meteorEntity","meteorEntity","$$scope","bindFn","context","tap","_len","_key","bindObj","bound","isCursor","Cursor","isScope","isViewModel","$$dependencies","areSiblings","obj1","obj2","_toConsumableArray","arr2","from","caller","_mixins","_autoExtend","_autoConstruct","union","_extend","_construct","_mixout","_ref","_$defaults","defaults","pattern","mixins","boundMixin","methodName","methodHandler","methodContext","recentCaller","_len2","_key2","configurable","enumerable","Scope","$new","$$utils","$bindToContext","computation","$$autoStop","subName","cb","_Meteor","ready","subscriptionId","callMethod","_Meteor2","applyMethod","_Meteor3","stoppable","$$throttledDigest","isDigestable","$$destroyed","$root","$digest","$$defer","_classCallCheck","instance","Constructor","_createClass","defineProperties","target","props","writable","protoProps","staticProps","viewModel","vm","_attached","_vm","Dependency","$$setFnHelper","getReactively","isDeep","isBoolean","$$reactivateEntity","getCollectionReactively","$watchCollection","watcher","watcherArgs","$$watchEntity","depend","_this2","getVal","initialVal","val","oldVal","hasChanged","$$changed","_this3","nonreactive","observation","$$handleCursor","$$handleNonCursor","$$setValHelper","_this4","watch","newVal","_this5","jsondiffpatch","patch","$$depend","e"],"mappings":";CACS,SAAUA,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDOM,SAASI,EAAQD,EAASH,GAE/B,YAEAW,QAAOC,eAAeT,EAAS,cAC7BU,OAAO,IAETV,EAAQW,KAAOC,OEnDhBf,EAAA,GACAA,EAAA,GAEAA,EAAA,GACAA,EAAA,GACAA,EAAA,GACAA,EAAA,GACAA,EAAA,GACAA,EAAA,GACAA,EAAA,GACAA,EAAA,IACAA,EAAA,IACAA,EAAA,IACAA,EAAA,GAGA,IAAAgB,GAAAhB,EAAA,IACAiB,EAAAjB,EAAA,IACAkB,EAAAlB,EAAA,IACAmB,EAAAnB,EAAA,IACAoB,EAAApB,EAAA,IACAqB,EAAArB,EAAA,IACAsB,EAAAtB,EAAA,IAEac,EAAAX,EAAAW,KAAO,gBAEpBS,SAAQnB,OAAOU,GF4EdE,EAAOF,KAAMG,EAAOH,KAAMI,EAAOJ,KAAMK,EAAML,KAAMM,EAAWN,KAAMO,EAAUP,KAAMQ,EAAWR,KEjE9F,4BACA,u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C,GACvBlD,KAAK6e,UAAUrB,EAAIrc,OAEnBqc,GAAGrc,GAAK6K,GAzNoB7M,EA8NrBugB,SAAW,SAASlC,EAAIrc,GACjCqc,EAAG9D,eAAevY,GAAGmd,UA/NSnf,EAmOrB0f,UAAY,SAASrB,EAAIrc,GAClCnB,KAAKuc,oBACLiB,EAAG9D,eAAevY,GAAGqH,WAGhBrJ,MrBy+DL,SAAS5B,EAAQD,GAEtB,YAEAQ,QAAOC,eAAeT,EAAS,cAC7BU,OAAO,GsB/uEH,IAAMC,GAAAX,EAAAW,KAAO,mBAEpB,KACES,QAAQnB,OAAOU,GACf,MAAO0hB,GACPjhB,QAAQnB,OAAOU","file":"dist/angular-meteor.min.js","sourcesContent":["/*! angular-meteor v1.3.7 */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.name = undefined;\n\t\n\t__webpack_require__(1);\n\t\n\t__webpack_require__(2);\n\t\n\t__webpack_require__(3);\n\t\n\t__webpack_require__(4);\n\t\n\t__webpack_require__(5);\n\t\n\t__webpack_require__(6);\n\t\n\t__webpack_require__(7);\n\t\n\t__webpack_require__(8);\n\t\n\t__webpack_require__(9);\n\t\n\t__webpack_require__(10);\n\t\n\t__webpack_require__(11);\n\t\n\t__webpack_require__(12);\n\t\n\t__webpack_require__(13);\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar _scope = __webpack_require__(16);\n\t\n\tvar _core = __webpack_require__(17);\n\t\n\tvar _viewModel = __webpack_require__(18);\n\t\n\tvar _reactive = __webpack_require__(19);\n\t\n\tvar _templates = __webpack_require__(20);\n\t\n\t// legacy\n\t// lib\n\tvar name = exports.name = 'angular-meteor';\n\t\n\t// new\n\t\n\t\n\tangular.module(name, [\n\t// new\n\t_utils.name, _mixer.name, _scope.name, _core.name, _viewModel.name, _reactive.name, _templates.name,\n\t\n\t// legacy\n\t'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).run([_mixer.Mixer, _core.Core, _viewModel.ViewModel, _reactive.Reactive, function ($Mixer, $$Core, $$ViewModel, $$Reactive) {\n\t // Load all mixins\n\t $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive);\n\t}])\n\t\n\t// legacy\n\t// Putting all services under $meteor service for syntactic sugar\n\t.service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) {\n\t var _this = this;\n\t\n\t this.collection = $meteorCollection;\n\t this.collectionFS = $meteorCollectionFS;\n\t this.object = $meteorObject;\n\t this.subscribe = $meteorSubscribe.subscribe;\n\t this.call = $meteorMethods.call;\n\t this.session = $meteorSession;\n\t this.autorun = $meteorUtils.autorun;\n\t this.getCollectionByName = $meteorUtils.getCollectionByName;\n\t this.getPicture = $meteorCamera.getPicture;\n\t\n\t // $meteorUser\n\t ['loginWithPassword', 'requireUser', 'requireValidUser', 'waitForUser', 'createUser', 'changePassword', 'forgotPassword', 'resetPassword', 'verifyEmail', 'loginWithMeteorDeveloperAccount', 'loginWithFacebook', 'loginWithGithub', 'loginWithGoogle', 'loginWithMeetup', 'loginWithTwitter', 'loginWithWeibo', 'logout', 'logoutOtherClients'].forEach(function (method) {\n\t _this[method] = $meteorUser[method];\n\t });\n\t}]);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _\n\t */\n\t\n\t'use strict';\n\t\n\t// https://github.com/DAB0mB/get-updates\n\t\n\t(function () {\n\t var module = angular.module('getUpdates', []);\n\t\n\t var utils = function () {\n\t var rip = function rip(obj, level) {\n\t if (level < 1) return {};\n\t\n\t return _.reduce(obj, function (clone, v, k) {\n\t v = _.isObject(v) ? rip(v, --level) : v;\n\t clone[k] = v;\n\t return clone;\n\t }, {});\n\t };\n\t\n\t var toPaths = function toPaths(obj) {\n\t var keys = getKeyPaths(obj);\n\t var values = getDeepValues(obj);\n\t return _.object(keys, values);\n\t };\n\t\n\t var getKeyPaths = function getKeyPaths(obj) {\n\t var keys = _.keys(obj).map(function (k) {\n\t var v = obj[k];\n\t if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\n\t\n\t return getKeyPaths(v).map(function (subKey) {\n\t return k + '.' + subKey;\n\t });\n\t });\n\t\n\t return _.flatten(keys);\n\t };\n\t\n\t var getDeepValues = function getDeepValues(obj, arr) {\n\t arr = arr || [];\n\t\n\t _.values(obj).forEach(function (v) {\n\t if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) arr.push(v);else getDeepValues(v, arr);\n\t });\n\t\n\t return arr;\n\t };\n\t\n\t var flatten = function flatten(arr) {\n\t return arr.reduce(function (flattened, v, i) {\n\t if (_.isArray(v) && !_.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v);\n\t\n\t return flattened;\n\t }, []);\n\t };\n\t\n\t var setFilled = function setFilled(obj, k, v) {\n\t if (!_.isEmpty(v)) obj[k] = v;\n\t };\n\t\n\t var assert = function assert(result, msg) {\n\t if (!result) throwErr(msg);\n\t };\n\t\n\t var throwErr = function throwErr(msg) {\n\t throw Error('get-updates error - ' + msg);\n\t };\n\t\n\t return {\n\t rip: rip,\n\t toPaths: toPaths,\n\t getKeyPaths: getKeyPaths,\n\t getDeepValues: getDeepValues,\n\t setFilled: setFilled,\n\t assert: assert,\n\t throwErr: throwErr\n\t };\n\t }();\n\t\n\t var getDifference = function () {\n\t var getDifference = function getDifference(src, dst, isShallow) {\n\t var level;\n\t\n\t if (isShallow > 1) level = isShallow;else if (isShallow) level = 1;\n\t\n\t if (level) {\n\t src = utils.rip(src, level);\n\t dst = utils.rip(dst, level);\n\t }\n\t\n\t return compare(src, dst);\n\t };\n\t\n\t var compare = function compare(src, dst) {\n\t var srcKeys = _.keys(src);\n\t var dstKeys = _.keys(dst);\n\t\n\t var keys = _.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value();\n\t\n\t return keys.reduce(function (diff, k) {\n\t var srcValue = src[k];\n\t var dstValue = dst[k];\n\t\n\t if (_.isDate(srcValue) && _.isDate(dstValue)) {\n\t if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n\t }\n\t\n\t if (_.isObject(srcValue) && _.isObject(dstValue)) {\n\t var valueDiff = getDifference(srcValue, dstValue);\n\t utils.setFilled(diff, k, valueDiff);\n\t } else if (srcValue !== dstValue) {\n\t diff[k] = dstValue;\n\t }\n\t\n\t return diff;\n\t }, {});\n\t };\n\t\n\t return getDifference;\n\t }();\n\t\n\t var getUpdates = function () {\n\t var getUpdates = function getUpdates(src, dst, isShallow) {\n\t utils.assert(_.isObject(src), 'first argument must be an object');\n\t utils.assert(_.isObject(dst), 'second argument must be an object');\n\t\n\t var diff = getDifference(src, dst, isShallow);\n\t var paths = utils.toPaths(diff);\n\t\n\t var set = createSet(paths);\n\t var unset = createUnset(paths);\n\t var pull = createPull(unset);\n\t\n\t var updates = {};\n\t utils.setFilled(updates, '$set', set);\n\t utils.setFilled(updates, '$unset', unset);\n\t utils.setFilled(updates, '$pull', pull);\n\t\n\t return updates;\n\t };\n\t\n\t var createSet = function createSet(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t return _.omit(paths, undefinedKeys);\n\t };\n\t\n\t var createUnset = function createUnset(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t var unset = _.pick(paths, undefinedKeys);\n\t\n\t return _.reduce(unset, function (result, v, k) {\n\t result[k] = true;\n\t return result;\n\t }, {});\n\t };\n\t\n\t var createPull = function createPull(unset) {\n\t var arrKeyPaths = _.keys(unset).map(function (k) {\n\t var split = k.match(/(.*)\\.\\d+$/);\n\t return split && split[1];\n\t });\n\t\n\t return _.compact(arrKeyPaths).reduce(function (pull, k) {\n\t pull[k] = null;\n\t return pull;\n\t }, {});\n\t };\n\t\n\t var getUndefinedKeys = function getUndefinedKeys(obj) {\n\t return _.keys(obj).filter(function (k) {\n\t var v = obj[k];\n\t return _.isUndefined(v);\n\t });\n\t };\n\t\n\t return getUpdates;\n\t }();\n\t\n\t module.value('getUpdates', getUpdates);\n\t})();\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Package\n\t */\n\t\n\t'use strict';\n\t\n\tvar _module = angular.module('diffArray', ['getUpdates']);\n\t\n\t_module.factory('diffArray', ['getUpdates', function (getUpdates) {\n\t var LocalCollection = Package.minimongo.LocalCollection;\n\t var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n\t var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\t\n\t // Calculates the differences between `lastSeqArray` and\n\t // `seqArray` and calls appropriate functions from `callbacks`.\n\t // Reuses Minimongo's diff algorithm implementation.\n\t // XXX Should be replaced with the original diffArray function here:\n\t // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n\t // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n\t function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n\t preventNestedDiff = !!preventNestedDiff;\n\t\n\t var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\t\n\t var oldObjIds = [];\n\t var newObjIds = [];\n\t var posOld = {}; // maps from idStringify'd ids\n\t var posNew = {}; // ditto\n\t var posCur = {};\n\t var lengthCur = lastSeqArray.length;\n\t\n\t _.each(seqArray, function (doc, i) {\n\t newObjIds.push({ _id: doc._id });\n\t posNew[idStringify(doc._id)] = i;\n\t });\n\t\n\t _.each(lastSeqArray, function (doc, i) {\n\t oldObjIds.push({ _id: doc._id });\n\t posOld[idStringify(doc._id)] = i;\n\t posCur[idStringify(doc._id)] = i;\n\t });\n\t\n\t // Arrays can contain arbitrary objects. We don't diff the\n\t // objects. Instead we always fire 'changedAt' callback on every\n\t // object. The consumer of `observe-sequence` should deal with\n\t // it appropriately.\n\t diffFn(oldObjIds, newObjIds, {\n\t addedBefore: function addedBefore(id, doc, before) {\n\t var position = before ? posCur[idStringify(before)] : lengthCur;\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= position) posCur[id]++;\n\t });\n\t\n\t lengthCur++;\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before);\n\t },\n\t\n\t movedBefore: function movedBefore(id, before) {\n\t var prevPosition = posCur[idStringify(id)];\n\t var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++;\n\t });\n\t\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before);\n\t },\n\t removed: function removed(id) {\n\t var prevPosition = posCur[idStringify(id)];\n\t\n\t _.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition) posCur[id]--;\n\t });\n\t\n\t delete posCur[idStringify(id)];\n\t lengthCur--;\n\t\n\t callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition);\n\t }\n\t });\n\t\n\t _.each(posNew, function (pos, idString) {\n\t if (!_.has(posOld, idString)) return;\n\t\n\t var id = idParse(idString);\n\t var newItem = seqArray[pos] || {};\n\t var oldItem = lastSeqArray[posOld[idString]];\n\t var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\t\n\t if (!_.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem);\n\t });\n\t }\n\t\n\t diffArray.shallow = function (lastSeqArray, seqArray, callbacks) {\n\t return diffArray(lastSeqArray, seqArray, callbacks, true);\n\t };\n\t\n\t diffArray.deepCopyChanges = function (oldItem, newItem) {\n\t var setDiff = getUpdates(oldItem, newItem).$set;\n\t\n\t _.each(setDiff, function (v, deepKey) {\n\t setDeep(oldItem, deepKey, v);\n\t });\n\t };\n\t\n\t diffArray.deepCopyRemovals = function (oldItem, newItem) {\n\t var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\t\n\t _.each(unsetDiff, function (v, deepKey) {\n\t unsetDeep(oldItem, deepKey);\n\t });\n\t };\n\t\n\t // Finds changes between two collections\n\t diffArray.getChanges = function (newCollection, oldCollection, diffMethod) {\n\t var changes = { added: [], removed: [], changed: [] };\n\t\n\t diffMethod(oldCollection, newCollection, {\n\t addedAt: function addedAt(id, item, index) {\n\t changes.added.push({ item: item, index: index });\n\t },\n\t\n\t removedAt: function removedAt(id, item, index) {\n\t changes.removed.push({ item: item, index: index });\n\t },\n\t\n\t changedAt: function changedAt(id, updates, index, oldItem) {\n\t changes.changed.push({ selector: id, modifier: updates });\n\t },\n\t\n\t movedTo: function movedTo(id, item, fromIndex, toIndex) {\n\t // XXX do we need this?\n\t }\n\t });\n\t\n\t return changes;\n\t };\n\t\n\t var setDeep = function setDeep(obj, deepKey, v) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _.initial(split);\n\t var lastKey = _.last(split);\n\t\n\t initialKeys.reduce(function (subObj, k, i) {\n\t var nextKey = split[i + 1];\n\t\n\t if (isNumStr(nextKey)) {\n\t if (subObj[k] === null) subObj[k] = [];\n\t if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n\t } else if (subObj[k] === null || !isHash(subObj[k])) {\n\t subObj[k] = {};\n\t }\n\t\n\t return subObj[k];\n\t }, obj);\n\t\n\t var deepObj = getDeep(obj, initialKeys);\n\t deepObj[lastKey] = v;\n\t return v;\n\t };\n\t\n\t var unsetDeep = function unsetDeep(obj, deepKey) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _.initial(split);\n\t var lastKey = _.last(split);\n\t var deepObj = getDeep(obj, initialKeys);\n\t\n\t if (_.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey];\n\t };\n\t\n\t var getDeep = function getDeep(obj, keys) {\n\t return keys.reduce(function (subObj, k) {\n\t return subObj[k];\n\t }, obj);\n\t };\n\t\n\t var isHash = function isHash(obj) {\n\t return _.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype;\n\t };\n\t\n\t var isNumStr = function isNumStr(str) {\n\t return str.match(/^\\d+$/);\n\t };\n\t\n\t return diffArray;\n\t}]);\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', {\n\t suppressWarnings: false\n\t});\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) {\n\t var Router = (Package['iron:router'] || {}).Router;\n\t if (!Router) return;\n\t\n\t var isLoaded = false;\n\t\n\t // Recompile after iron:router builds page\n\t Router.onAfterAction(function (req, res, next) {\n\t Tracker.afterFlush(function () {\n\t if (isLoaded) return;\n\t $compile($document)($rootScope);\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t isLoaded = true;\n\t });\n\t });\n\t}]);\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Tracker, EJSON, FS, Mongo\n\t */\n\t\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\tvar angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']);\n\t\n\tangularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this.autorun = function (scope, fn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t // wrapping around Deps.autorun\n\t var comp = Tracker.autorun(function (c) {\n\t fn(c);\n\t // this is run immediately for the first call\n\t // but after that, we need to $apply to start Angular digest\n\t if (!c.firstRun) $timeout(angular.noop, 0);\n\t });\n\t\n\t // stop autorun when scope is destroyed\n\t scope.$on('$destroy', function () {\n\t comp.stop();\n\t });\n\t\n\t // return autorun object so that it can be stopped manually\n\t return comp;\n\t };\n\t\n\t // Borrowed from angularFire\n\t // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n\t this.stripDollarPrefixedKeys = function (data) {\n\t if (!_.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data;\n\t\n\t var out = _.isArray(data) ? [] : {};\n\t\n\t _.each(data, function (v, k) {\n\t if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v);\n\t });\n\t\n\t return out;\n\t };\n\t\n\t // Returns a callback which fulfills promise\n\t this.fulfill = function (deferred, boundError, boundResult) {\n\t return function (err, result) {\n\t if (err) deferred.reject(boundError == null ? err : boundError);else if (typeof boundResult == \"function\") deferred.resolve(boundResult == null ? result : boundResult(result));else deferred.resolve(boundResult == null ? result : boundResult);\n\t };\n\t };\n\t\n\t // creates a function which invokes method with the given arguments and returns a promise\n\t this.promissor = function (obj, method) {\n\t return function () {\n\t var deferred = $q.defer();\n\t var fulfill = self.fulfill(deferred);\n\t var args = _.toArray(arguments).concat(fulfill);\n\t obj[method].apply(obj, args);\n\t return deferred.promise;\n\t };\n\t };\n\t\n\t // creates a $q.all() promise and call digestion loop on fulfillment\n\t this.promiseAll = function (promises) {\n\t var allPromise = $q.all(promises);\n\t\n\t allPromise.finally(function () {\n\t // calls digestion loop with no conflicts\n\t $timeout(angular.noop);\n\t });\n\t\n\t return allPromise;\n\t };\n\t\n\t this.getCollectionByName = function (string) {\n\t return Mongo.Collection.get(string);\n\t };\n\t\n\t this.findIndexById = function (collection, doc) {\n\t var foundDoc = _.find(collection, function (colDoc) {\n\t // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n\t return EJSON.equals(colDoc._id, doc._id);\n\t });\n\t\n\t return _.indexOf(collection, foundDoc);\n\t };\n\t}]);\n\t\n\tangularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) {\n\t Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) {\n\t return $meteorUtils.autorun(this, fn);\n\t };\n\t}]);\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']);\n\t\n\tangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this._subscribe = function (scope, deferred, args) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var subscription = null;\n\t var lastArg = args[args.length - 1];\n\t\n\t // User supplied onStop callback\n\t // save it for later use and remove\n\t // from subscription arguments\n\t if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) {\n\t var _onStop = lastArg.onStop;\n\t\n\t args.pop();\n\t }\n\t\n\t args.push({\n\t onReady: function onReady() {\n\t deferred.resolve(subscription);\n\t },\n\t onStop: function onStop(err) {\n\t if (!deferred.promise.$$state.status) {\n\t if (err) deferred.reject(err);else deferred.reject(new Meteor.Error(\"Subscription Stopped\", \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n\t } else if (_onStop)\n\t // After promise was resolved or rejected\n\t // call user supplied onStop callback.\n\t _onStop.apply(this, Array.prototype.slice.call(arguments));\n\t }\n\t });\n\t\n\t subscription = Meteor.subscribe.apply(scope, args);\n\t\n\t return subscription;\n\t };\n\t\n\t this.subscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t var subscription = null;\n\t\n\t self._subscribe(this, deferred, args);\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\t\n\tangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) {\n\t Object.getPrototypeOf($rootScope).$meteorSubscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t\n\t var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\t\n\t this.$on('$destroy', function () {\n\t subscription.stop();\n\t });\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Tracker, check, Match, Mongo\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']);\n\t\n\t// The reason angular meteor collection is a factory function and not something\n\t// that inherit from array comes from here:\n\t// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n\t// We went with the direct extensions approach.\n\tangularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\t\n\t function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var data = [];\n\t // Server backup data to evaluate what changes come from client\n\t // after each server update.\n\t data._serverBackup = [];\n\t // Array differ function.\n\t data._diffArrayFunc = diffArrayFunc;\n\t // Handler of the cursor observer.\n\t data._hObserve = null;\n\t // On new cursor autorun handler\n\t // (autorun for reactive variables).\n\t data._hNewCurAutorun = null;\n\t // On new data autorun handler\n\t // (autorun for cursor.fetch).\n\t data._hDataAutorun = null;\n\t\n\t if (angular.isDefined(collection)) {\n\t data.$$collection = collection;\n\t } else {\n\t var cursor = curDefFunc();\n\t data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n\t }\n\t\n\t _.extend(data, AngularMeteorCollection);\n\t data._startCurAutorun(curDefFunc, autoClientSave);\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) {\n\t var self = this;\n\t\n\t self._hNewCurAutorun = Tracker.autorun(function () {\n\t // When the reactive func gets recomputated we need to stop any previous\n\t // observeChanges.\n\t Tracker.onInvalidate(function () {\n\t self._stopCursor();\n\t });\n\t\n\t if (autoClientSave) self._setAutoClientSave();\n\t self._updateCursor(curDefFunc(), autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorCollection.save = function (docs, useUnsetModifier) {\n\t // save whole collection\n\t if (!docs) docs = this;\n\t // save single doc\n\t docs = [].concat(docs);\n\t\n\t var promises = docs.map(function (doc) {\n\t return this._upsertDoc(doc, useUnsetModifier);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\t\n\t // delete $$hashkey\n\t doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n\t var docId = doc._id;\n\t var isExist = collection.findOne(docId);\n\t\n\t // update\n\t if (isExist) {\n\t // Deletes _id property (from the copy) so that\n\t // it can be $set using update.\n\t delete doc._id;\n\t var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc };\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t collection.update(docId, modifier, createFulfill(function () {\n\t return { _id: docId, action: 'updated' };\n\t }));\n\t }\n\t // insert\n\t else {\n\t collection.insert(doc, createFulfill(function (id) {\n\t return { _id: id, action: 'inserted' };\n\t }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t // performs $pull operations parallely.\n\t // used for handling splice operations returned from getUpdates() to prevent conflicts.\n\t // see issue: https://github.com/Urigo/angular-meteor/issues/793\n\t AngularMeteorCollection._updateDiff = function (selector, update, callback) {\n\t callback = callback || angular.noop;\n\t var setters = _.omit(update, '$pull');\n\t var updates = [setters];\n\t\n\t _.each(update.$pull, function (pull, prop) {\n\t var puller = {};\n\t puller[prop] = pull;\n\t updates.push({ $pull: puller });\n\t });\n\t\n\t this._updateParallel(selector, updates, callback);\n\t };\n\t\n\t // performs each update operation parallely\n\t AngularMeteorCollection._updateParallel = function (selector, updates, callback) {\n\t var self = this;\n\t var done = _.after(updates.length, callback);\n\t\n\t var next = function next(err, affectedDocsNum) {\n\t if (err) return callback(err);\n\t done(null, affectedDocsNum);\n\t };\n\t\n\t _.each(updates, function (update) {\n\t self.$$collection.update(selector, update, next);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.remove = function (keyOrDocs) {\n\t var keys;\n\t\n\t // remove whole collection\n\t if (!keyOrDocs) {\n\t keys = _.pluck(this, '_id');\n\t }\n\t // remove docs\n\t else {\n\t keyOrDocs = [].concat(keyOrDocs);\n\t\n\t keys = _.map(keyOrDocs, function (keyOrDoc) {\n\t return keyOrDoc._id || keyOrDoc;\n\t });\n\t }\n\t\n\t // Checks if all keys are correct.\n\t check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\t\n\t var promises = keys.map(function (key) {\n\t return this._removeDoc(key);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._removeDoc = function (id) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n\t collection.remove(id, fulfill);\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) {\n\t var self = this;\n\t // XXX - consider adding an option for a non-orderd result for faster performance\n\t if (self._hObserve) self._stopObserving();\n\t\n\t self._hObserve = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t self.splice(atIndex, 0, doc);\n\t self._serverBackup.splice(atIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t diffArray.deepCopyChanges(self[atIndex], doc);\n\t diffArray.deepCopyRemovals(self[atIndex], doc);\n\t self._serverBackup[atIndex] = self[atIndex];\n\t self._setServerUpdateMode();\n\t },\n\t\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t self.splice(fromIndex, 1);\n\t self.splice(toIndex, 0, doc);\n\t self._serverBackup.splice(fromIndex, 1);\n\t self._serverBackup.splice(toIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t removedAt: function removedAt(oldDoc) {\n\t var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self.splice(removedIndex, 1);\n\t self._serverBackup.splice(removedIndex, 1);\n\t self._setServerUpdateMode();\n\t } else {\n\t // If it's been removed on client then it's already not in collection\n\t // itself but still is in the _serverBackup.\n\t removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self._serverBackup.splice(removedIndex, 1);\n\t }\n\t }\n\t }\n\t });\n\t\n\t self._hDataAutorun = Tracker.autorun(function () {\n\t cursor.fetch();\n\t if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection._stopObserving = function () {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t delete this._serverMode;\n\t delete this._hUnsetTimeout;\n\t };\n\t\n\t AngularMeteorCollection._setServerUpdateMode = function (name) {\n\t this._serverMode = true;\n\t // To simplify server update logic, we don't follow\n\t // updates from the client at the same time.\n\t this._unsetAutoClientSave();\n\t };\n\t\n\t // Here we use $timeout to combine multiple updates that go\n\t // each one after another.\n\t AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) {\n\t var self = this;\n\t\n\t if (self._hUnsetTimeout) {\n\t $timeout.cancel(self._hUnsetTimeout);\n\t self._hUnsetTimeout = null;\n\t }\n\t\n\t self._hUnsetTimeout = $timeout(function () {\n\t self._serverMode = false;\n\t // Finds updates that was potentially done from the client side\n\t // and saves them.\n\t var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n\t self._saveChanges(changes);\n\t // After, continues following client updates.\n\t if (autoClientSave) self._setAutoClientSave();\n\t }, 0);\n\t };\n\t\n\t AngularMeteorCollection.stop = function () {\n\t this._stopCursor();\n\t this._hNewCurAutorun.stop();\n\t };\n\t\n\t AngularMeteorCollection._stopCursor = function () {\n\t this._unsetAutoClientSave();\n\t\n\t if (this._hObserve) {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t }\n\t\n\t this.splice(0);\n\t this._serverBackup.splice(0);\n\t };\n\t\n\t AngularMeteorCollection._unsetAutoClientSave = function (name) {\n\t if (this._hRegAutoBind) {\n\t this._hRegAutoBind();\n\t this._hRegAutoBind = null;\n\t }\n\t };\n\t\n\t AngularMeteorCollection._setAutoClientSave = function () {\n\t var self = this;\n\t\n\t // Always unsets auto save to keep only one $watch handler.\n\t self._unsetAutoClientSave();\n\t\n\t self._hRegAutoBind = $rootScope.$watch(function () {\n\t return self;\n\t }, function (nItems, oItems) {\n\t if (nItems === oItems) return;\n\t\n\t var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n\t self._unsetAutoClientSave();\n\t self._saveChanges(changes);\n\t self._setAutoClientSave();\n\t }, true);\n\t };\n\t\n\t AngularMeteorCollection._saveChanges = function (changes) {\n\t var self = this;\n\t\n\t // Saves added documents\n\t // Using reversed iteration to prevent indexes from changing during splice\n\t var addedDocs = changes.added.reverse().map(function (descriptor) {\n\t self.splice(descriptor.index, 1);\n\t return descriptor.item;\n\t });\n\t\n\t if (addedDocs.length) self.save(addedDocs);\n\t\n\t // Removes deleted documents\n\t var removedDocs = changes.removed.map(function (descriptor) {\n\t return descriptor.item;\n\t });\n\t\n\t if (removedDocs.length) self.remove(removedDocs);\n\t\n\t // Updates changed documents\n\t changes.changed.forEach(function (descriptor) {\n\t self._updateDiff(descriptor.selector, descriptor.modifier);\n\t });\n\t };\n\t\n\t return AngularMeteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) {\n\t function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\t\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n\t }\n\t\n\t return $meteorCollectionFS;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) {\n\t function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n\t // Validate parameters\n\t if (!reactiveFunc) {\n\t throw new TypeError('The first argument of $meteorCollection is undefined.');\n\t }\n\t\n\t if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n\t throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.');\n\t }\n\t\n\t if (!angular.isFunction(reactiveFunc)) {\n\t collection = angular.isDefined(collection) ? collection : reactiveFunc;\n\t reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\n\t }\n\t\n\t // By default auto save - true.\n\t autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n\t diffFn = diffFn || diffArray;\n\t return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n\t }\n\t\n\t return $meteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n\t scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n\t}]);\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Mongo\n\t*/\n\t\n\t'use strict';\n\t\n\tvar angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']);\n\t\n\tangularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\t\n\t // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n\t AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'];\n\t\n\t function AngularMeteorObject(collection, selector, options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t // Make data not be an object so we can extend it to preserve\n\t // Collection Helpers and the like\n\t var helpers = collection._helpers;\n\t var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n\t var doc = collection.findOne(selector, options);\n\t var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\n\t _.extend(data, doc);\n\t _.extend(data, AngularMeteorObject);\n\t _.extend(data, collectionExtension);\n\t\n\t // Omit options that may spoil document finding\n\t data.$$options = _.omit(options, 'skip', 'limit');\n\t data.$$collection = collection;\n\t data.$$id = data._getId(selector);\n\t data._serverBackup = doc || {};\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorObject.getRawObject = function () {\n\t return angular.copy(_.omit(this, this.$$internalProps));\n\t };\n\t\n\t AngularMeteorObject.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorObject.save = function (custom) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\t var oldDoc = collection.findOne(this.$$id);\n\t var mods;\n\t\n\t // update\n\t if (oldDoc) {\n\t if (custom) mods = { $set: custom };else {\n\t mods = getUpdates(oldDoc, this.getRawObject());\n\t // If there are no updates, there is nothing to do here, returning\n\t if (_.isEmpty(mods)) {\n\t return $q.when({ action: 'updated' });\n\t }\n\t }\n\t\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t this._updateDiff(mods, createFulfill({ action: 'updated' }));\n\t }\n\t // insert\n\t else {\n\t if (custom) mods = _.clone(custom);else mods = this.getRawObject();\n\t\n\t mods._id = mods._id || this.$$id;\n\t collection.insert(mods, createFulfill({ action: 'inserted' }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorObject._updateDiff = function (update, callback) {\n\t var selector = this.$$id;\n\t AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n\t };\n\t\n\t AngularMeteorObject.reset = function (keepClientProps) {\n\t var self = this;\n\t var options = this.$$options;\n\t var id = this.$$id;\n\t var doc = this.$$collection.findOne(id, options);\n\t\n\t if (doc) {\n\t // extend SubObject\n\t var docKeys = _.keys(doc);\n\t var docExtension = _.pick(doc, docKeys);\n\t var clientProps;\n\t\n\t _.extend(self, docExtension);\n\t _.extend(self._serverBackup, docExtension);\n\t\n\t if (keepClientProps) {\n\t clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\n\t } else {\n\t clientProps = _.keys(self);\n\t }\n\t\n\t var serverProps = _.keys(doc);\n\t var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\n\t\n\t removedKeys.forEach(function (prop) {\n\t delete self[prop];\n\t delete self._serverBackup[prop];\n\t });\n\t } else {\n\t _.keys(this.getRawObject()).forEach(function (prop) {\n\t delete self[prop];\n\t });\n\t\n\t self._serverBackup = {};\n\t }\n\t };\n\t\n\t AngularMeteorObject.stop = function () {\n\t if (this.unregisterAutoDestroy) this.unregisterAutoDestroy();\n\t\n\t if (this.unregisterAutoBind) this.unregisterAutoBind();\n\t\n\t if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop();\n\t };\n\t\n\t AngularMeteorObject._getId = function (selector) {\n\t var options = _.extend({}, this.$$options, {\n\t fields: { _id: 1 },\n\t reactive: false,\n\t transform: null\n\t });\n\t\n\t var doc = this.$$collection.findOne(selector, options);\n\t\n\t if (doc) return doc._id;\n\t if (selector instanceof Mongo.ObjectID) return selector;\n\t if (_.isString(selector)) return selector;\n\t return new Mongo.ObjectID();\n\t };\n\t\n\t return AngularMeteorObject;\n\t}]);\n\t\n\tangularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n\t function $meteorObject(collection, id, auto, options) {\n\t // Validate parameters\n\t if (!collection) {\n\t throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n\t }\n\t\n\t if (!angular.isFunction(collection.findOne)) {\n\t throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n\t }\n\t\n\t var data = new AngularMeteorObject(collection, id, options);\n\t // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n\t data._auto = auto !== false;\n\t _.extend(data, $meteorObject);\n\t data._setAutos();\n\t return data;\n\t }\n\t\n\t $meteorObject._setAutos = function () {\n\t var self = this;\n\t\n\t this.autorunComputation = $meteorUtils.autorun($rootScope, function () {\n\t self.reset(true);\n\t });\n\t\n\t // Deep watches the model and performs autobind\n\t this.unregisterAutoBind = this._auto && $rootScope.$watch(function () {\n\t return self.getRawObject();\n\t }, function (item, oldItem) {\n\t if (item !== oldItem) self.save();\n\t }, true);\n\t\n\t this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () {\n\t if (self && self.stop) self.pop();\n\t });\n\t };\n\t\n\t return $meteorObject;\n\t}]);\n\t\n\tangularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorObject = $meteorStopper($meteorObject);\n\t}]);\n\n/***/ },\n/* 9 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Package, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core', 'angular-meteor.settings']);\n\t\n\t// requires package 'accounts-password'\n\tangularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) {\n\t\n\t var pack = Package['accounts-base'];\n\t if (!pack) return;\n\t\n\t var self = this;\n\t var Accounts = pack.Accounts;\n\t\n\t this.waitForUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) deferred.resolve(Meteor.user());\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) {\n\t console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t }\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) {\n\t if (Meteor.user() === null) deferred.reject(\"AUTH_REQUIRED\");else deferred.resolve(Meteor.user());\n\t }\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireValidUser = function (validatorFn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t return self.requireUser(true).then(function (user) {\n\t var valid = validatorFn(user);\n\t\n\t if (valid === true) return user;else if (typeof valid === \"string\") return $q.reject(valid);else return $q.reject(\"FORBIDDEN\");\n\t });\n\t };\n\t\n\t this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n\t this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n\t this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n\t this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n\t this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n\t this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n\t this.logout = $meteorUtils.promissor(Meteor, 'logout');\n\t this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n\t this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n\t this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n\t this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n\t this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n\t this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n\t this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n\t this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n\t}]);\n\t\n\tangularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) {\n\t\n\t var ScopeProto = Object.getPrototypeOf($rootScope);\n\t _.extend(ScopeProto, $$Core);\n\t\n\t $rootScope.autorun(function () {\n\t if (!Meteor.user) return;\n\t $rootScope.currentUser = Meteor.user();\n\t $rootScope.loggingIn = Meteor.loggingIn();\n\t });\n\t}]);\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, _, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\tangularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t this.call = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t var fulfill = $meteorUtils.fulfill(deferred);\n\t var args = _.toArray(arguments).concat(fulfill);\n\t Meteor.call.apply(this, args);\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Session\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\tangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) {\n\t return function (session) {\n\t\n\t return {\n\t\n\t bind: function bind(scope, model) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var getter = $parse(model);\n\t var setter = getter.assign;\n\t $meteorUtils.autorun(scope, function () {\n\t setter(scope, Session.get(session));\n\t });\n\t\n\t scope.$watch(model, function (newItem, oldItem) {\n\t Session.set(session, getter(scope));\n\t }, true);\n\t }\n\t };\n\t };\n\t}]);\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Package\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\t// requires package 'mdg:camera'\n\tangularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t var pack = Package['mdg:camera'];\n\t if (!pack) return;\n\t\n\t var MeteorCamera = pack.MeteorCamera;\n\t\n\t this.getPicture = function (options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t options = options || {};\n\t var deferred = $q.defer();\n\t MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']);\n\t\n\tangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) {\n\t function $meteorStopper($meteorEntity) {\n\t return function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t var meteorEntity = $meteorEntity.apply(this, args);\n\t\n\t angular.extend(meteorEntity, $meteorStopper);\n\t meteorEntity.$$scope = this;\n\t\n\t this.$on('$destroy', function () {\n\t meteorEntity.stop();\n\t if (meteorEntity.subscription) meteorEntity.subscription.stop();\n\t });\n\t\n\t return meteorEntity;\n\t };\n\t }\n\t\n\t $meteorStopper.subscribe = function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n\t return this;\n\t };\n\t\n\t return $meteorStopper;\n\t}]);\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar name = exports.name = 'angular-meteor.utilities';\n\tvar utils = exports.utils = '$$utils';\n\t\n\tangular.module(name, [])\n\t\n\t/*\n\t A utility service which is provided with general utility functions\n\t */\n\t.service(utils, ['$rootScope', function ($rootScope) {\n\t var self = this;\n\t\n\t // Checks if an object is a cursor\n\t this.isCursor = function (obj) {\n\t return obj instanceof Meteor.Collection.Cursor;\n\t };\n\t\n\t // Cheecks if an object is a scope\n\t this.isScope = function (obj) {\n\t return obj instanceof $rootScope.constructor;\n\t };\n\t\n\t // Checks if an object is a view model\n\t this.isViewModel = function (obj) {\n\t return _.isObject(obj) && obj.$$dependencies;\n\t };\n\t\n\t // Checks if two objects are siblings\n\t this.areSiblings = function (obj1, obj2) {\n\t return _.isObject(obj1) && _.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n\t };\n\t\n\t // Binds function into a scpecified context. If an object is provided, will bind every\n\t // value in the object which is a function. If a tap function is provided, it will be\n\t // called right after the function has been invoked.\n\t this.bind = function (fn, context, tap) {\n\t tap = _.isFunction(tap) ? tap : angular.noop;\n\t if (_.isFunction(fn)) return bindFn(fn, context, tap);\n\t if (_.isObject(fn)) return bindObj(fn, context, tap);\n\t return fn;\n\t };\n\t\n\t function bindFn(fn, context, tap) {\n\t return function () {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var result = fn.apply(context, args);\n\t tap.call(context, {\n\t result: result,\n\t args: args\n\t });\n\t return result;\n\t };\n\t }\n\t\n\t function bindObj(obj, context, tap) {\n\t return _.keys(obj).reduce(function (bound, k) {\n\t bound[k] = self.bind(obj[k], context, tap);\n\t return bound;\n\t }, {});\n\t }\n\t}]);\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar name = exports.name = 'angular-meteor.mixer';\n\tvar Mixer = exports.Mixer = '$Mixer';\n\t\n\tangular.module(name, [])\n\t\n\t/*\n\t A service which lets us apply mixins into Scope.prototype.\n\t The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n\t and any time a `ChildScope` prototype is created\n\t it will be extended by the `$Mixer`.\n\t This concept is good because it keeps our code\n\t clean and simple, and easy to extend.\n\t So any time we would like to define a new behaviour to our scope,\n\t we will just use the `$Mixer` service.\n\t */\n\t.service(Mixer, function () {\n\t var _this = this;\n\t\n\t // Used to store method's caller\n\t var caller = void 0;\n\t\n\t this._mixins = [];\n\t // Apply mixins automatically on specified contexts\n\t this._autoExtend = [];\n\t this._autoConstruct = [];\n\t\n\t // Adds a new mixin\n\t this.mixin = function (mixin) {\n\t if (!_.isObject(mixin)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _this._mixins = _.union(_this._mixins, [mixin]);\n\t // Apply mixins to stored contexts\n\t _this._autoExtend.forEach(function (context) {\n\t return _this._extend(context);\n\t });\n\t _this._autoConstruct.forEach(function (context) {\n\t return _this._construct(context);\n\t });\n\t return _this;\n\t };\n\t\n\t // Removes a mixin. Useful mainly for test purposes\n\t this._mixout = function (mixin) {\n\t _this._mixins = _.without(_this._mixins, mixin);\n\t return _this;\n\t };\n\t\n\t // Invoke function mixins with the provided context and arguments\n\t this._construct = function (context) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t _this._mixins.filter(_.isFunction).forEach(function (mixin) {\n\t mixin.call.apply(mixin, [context].concat(args));\n\t });\n\t\n\t return context;\n\t };\n\t\n\t // Extend prototype with the defined mixins\n\t this._extend = function (obj, options) {\n\t var _ref;\n\t\n\t var _$defaults = _.defaults({}, options, {\n\t pattern: /.*/ });\n\t\n\t var pattern = _$defaults.pattern;\n\t var context = _$defaults.context;\n\t // The patterns of the keys which will be filtered\n\t\n\t\n\t var mixins = _this._mixins.map(function (mixin) {\n\t // Filtering the keys by the specified pattern\n\t var keys = _.keys(mixin).filter(function (k) {\n\t return k.match(pattern);\n\t }).filter(function (k) {\n\t return _.isFunction(mixin[k]);\n\t });\n\t\n\t return keys.reduce(function (boundMixin, methodName) {\n\t var methodHandler = mixin[methodName];\n\t\n\t // Note that this is not an arrow function so we can conserve the conetxt\n\t boundMixin[methodName] = function () {\n\t // Storing original caller so we will know who actually called the\n\t // method event though it is bound to another context\n\t var methodContext = context || this;\n\t var recentCaller = caller;\n\t caller = this;\n\t\n\t try {\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t return methodHandler.apply(methodContext, args);\n\t } finally {\n\t // No matter what happens, restore variable to the previous one\n\t caller = recentCaller;\n\t }\n\t };\n\t\n\t return boundMixin;\n\t }, {});\n\t });\n\t\n\t return (_ref = _).extend.apply(_ref, [obj].concat(_toConsumableArray(mixins)));\n\t };\n\t\n\t // Caller property can not be set\n\t Object.defineProperty(this, 'caller', {\n\t configurable: true,\n\t enumerable: true,\n\t\n\t get: function get() {\n\t return caller;\n\t }\n\t });\n\t});\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.name = undefined;\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar name = exports.name = 'angular-meteor.scope';\n\t\n\tangular.module(name, [_mixer.name]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) {\n\t var Scope = $rootScope.constructor;\n\t var $new = $rootScope.$new;\n\t\n\t // Apply extensions whether a mixin in defined.\n\t // Note that this way mixins which are initialized later\n\t // can be applied on rootScope.\n\t $Mixer._autoExtend.push(Scope.prototype);\n\t $Mixer._autoConstruct.push($rootScope);\n\t\n\t Scope.prototype.$new = function () {\n\t var scope = $new.apply(this, arguments);\n\t // Apply constructors to newly created scopes\n\t return $Mixer._construct(scope);\n\t };\n\t}]);\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Core = exports.name = undefined;\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar name = exports.name = 'angular-meteor.core';\n\tvar Core = exports.Core = '$$Core';\n\t\n\tangular.module(name, [_utils.name, _mixer.name])\n\t\n\t/*\n\t A mixin which provides us with core Meteor functions.\n\t */\n\t.factory(Core, ['$q', _utils.utils, _mixer.Mixer, function ($q, $$utils, $Mixer) {\n\t function $$Core() {}\n\t\n\t // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n\t $$Core.autorun = function (fn) {\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t fn = this.$bindToContext($Mixer.caller, fn);\n\t\n\t if (!_.isFunction(fn)) {\n\t throw Error('argument 1 must be a function');\n\t }\n\t if (!_.isObject(options)) {\n\t throw Error('argument 2 must be an object');\n\t }\n\t\n\t var computation = Tracker.autorun(fn, options);\n\t this.$$autoStop(computation);\n\t return computation;\n\t };\n\t\n\t // Calls Meteor.subscribe() which will be digested after each invokation\n\t // and automatically destroyed\n\t $$Core.subscribe = function (subName, fn, cb) {\n\t fn = this.$bindToContext($Mixer.caller, fn || angular.noop);\n\t cb = cb ? this.$bindToContext($Mixer.caller, cb) : angular.noop;\n\t\n\t if (!_.isString(subName)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t if (!_.isFunction(fn)) {\n\t throw Error('argument 2 must be a function');\n\t }\n\t if (!_.isFunction(cb) && !_.isObject(cb)) {\n\t throw Error('argument 3 must be a function or an object');\n\t }\n\t\n\t var result = {};\n\t\n\t var computation = this.autorun(function () {\n\t var _Meteor;\n\t\n\t var args = fn();\n\t if (angular.isUndefined(args)) args = [];\n\t\n\t if (!_.isArray(args)) {\n\t throw Error('reactive function\\'s return value must be an array');\n\t }\n\t\n\t var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb]));\n\t result.ready = subscription.ready.bind(subscription);\n\t result.subscriptionId = subscription.subscriptionId;\n\t });\n\t\n\t // Once the computation has been stopped,\n\t // any subscriptions made inside will be stopped as well\n\t result.stop = computation.stop.bind(computation);\n\t return result;\n\t };\n\t\n\t // Calls Meteor.call() wrapped by a digestion cycle\n\t $$Core.callMethod = function () {\n\t var _Meteor2;\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n\t return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn]));\n\t };\n\t\n\t // Calls Meteor.apply() wrapped by a digestion cycle\n\t $$Core.applyMethod = function () {\n\t var _Meteor3;\n\t\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n\t return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn]));\n\t };\n\t\n\t $$Core.$$autoStop = function (stoppable) {\n\t this.$on('$destroy', stoppable.stop.bind(stoppable));\n\t };\n\t\n\t // Digests scope only if there is no phase at the moment\n\t $$Core.$$throttledDigest = function () {\n\t var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase;\n\t\n\t if (isDigestable) this.$digest();\n\t };\n\t\n\t // Creates a promise only that the digestion cycle will be called at its fulfillment\n\t $$Core.$$defer = function () {\n\t var deferred = $q.defer();\n\t // Once promise has been fulfilled, digest\n\t deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n\t return deferred;\n\t };\n\t\n\t // Binds an object or a function to the provided context and digest it once it is invoked\n\t $$Core.$bindToContext = function (context, fn) {\n\t return $$utils.bind(fn, context, this.$$throttledDigest.bind(this));\n\t };\n\t\n\t return $$Core;\n\t}]);\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.reactive = exports.ViewModel = exports.name = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar _core = __webpack_require__(17);\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar name = exports.name = 'angular-meteor.view-model';\n\tvar ViewModel = exports.ViewModel = '$$ViewModel';\n\tvar reactive = exports.reactive = '$reactive';\n\t\n\tangular.module(name, [_utils.name, _mixer.name, _core.name])\n\t\n\t/*\n\t A mixin which lets us bind a view model into a scope.\n\t Note that only a single view model can be bound,\n\t otherwise the scope might behave unexpectedly.\n\t Mainly used to define the controller as the view model,\n\t and very useful when wanting to use Angular's `controllerAs` syntax.\n\t */\n\t.factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) {\n\t function $$ViewModel() {}\n\t\n\t // Gets an object, wraps it with scope functions and returns it\n\t $$ViewModel.viewModel = function (vm) {\n\t if (!_.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t // Extend view model with mixin functions\n\t $Mixer._extend(vm, {\n\t pattern: /^(?!\\$\\$).*$/, // Omitting methods which start with a $$ notation\n\t context: this // Binding methods to scope\n\t });\n\t\n\t // Apply mixin constructors on scope with view model\n\t $Mixer._construct(this, vm);\n\t return vm;\n\t };\n\t\n\t return $$ViewModel;\n\t}])\n\t\n\t/*\n\t Illustrates the old API where a view model is created using $reactive service\n\t */\n\t.service(reactive, [_utils.utils, function ($$utils) {\n\t var Reactive = function () {\n\t function Reactive(vm) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Reactive);\n\t\n\t if (!_.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _.defer(function () {\n\t if (!_this._attached) {\n\t console.warn('view model was not attached to any scope');\n\t }\n\t });\n\t\n\t this._vm = vm;\n\t }\n\t\n\t _createClass(Reactive, [{\n\t key: 'attach',\n\t value: function attach(scope) {\n\t this._attached = true;\n\t\n\t if (!$$utils.isScope(scope)) {\n\t throw Error('argument 1 must be a scope');\n\t }\n\t\n\t var viewModel = scope.viewModel(this._vm);\n\t\n\t // Similar to the old/Meteor API\n\t viewModel.call = viewModel.callMethod;\n\t viewModel.apply = viewModel.applyMethod;\n\t\n\t return viewModel;\n\t }\n\t }]);\n\t\n\t return Reactive;\n\t }();\n\t\n\t return function (vm) {\n\t return new Reactive(vm);\n\t };\n\t}]);\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Reactive = exports.name = undefined;\n\t\n\tvar _utils = __webpack_require__(14);\n\t\n\tvar _mixer = __webpack_require__(15);\n\t\n\tvar _core = __webpack_require__(17);\n\t\n\tvar _viewModel = __webpack_require__(18);\n\t\n\tvar name = exports.name = 'angular-meteor.reactive';\n\tvar Reactive = exports.Reactive = '$$Reactive';\n\t\n\tangular.module(name, [_utils.name, _mixer.name, _core.name, _viewModel.name])\n\t\n\t/*\n\t A mixin which enhance our reactive abilities by providing methods\n\t that are capable of updating our scope reactively.\n\t */\n\t.factory(Reactive, ['$parse', _utils.utils, _mixer.Mixer, function ($parse, $$utils, $Mixer) {\n\t function $$Reactive() {\n\t var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0];\n\t\n\t // Helps us track changes made in the view model\n\t vm.$$dependencies = {};\n\t }\n\t\n\t // Gets an object containing functions and define their results as reactive properties.\n\t // Once a return value has been changed the property will be reset.\n\t $$Reactive.helpers = function (vm, props) {\n\t var _this = this;\n\t\n\t if ($$utils.isViewModel(vm)) {\n\t if (!_.isObject(props)) {\n\t throw Error('argument 2 must be an object');\n\t }\n\t } else {\n\t props = vm;\n\t vm = $Mixer.caller;\n\t\n\t if (!_.isObject(props)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t }\n\t\n\t _.each(props, function (v, k) {\n\t if (!_.isFunction(v)) {\n\t throw Error('helper \\'' + k + '\\' must be a function');\n\t }\n\t });\n\t\n\t _.each(props, function (v, k) {\n\t if (!vm.$$dependencies[k]) {\n\t // Registers a new dependency to the specified helper\n\t vm.$$dependencies[k] = new Tracker.Dependency();\n\t }\n\t\n\t _this.$$setFnHelper(vm, k, v);\n\t });\n\t };\n\t\n\t // Gets a model reactively\n\t $$Reactive.getReactively = function (vm, k, isDeep) {\n\t if ($$utils.isViewModel(vm)) {\n\t if (angular.isUndefined(isDeep)) isDeep = false;\n\t\n\t if (!_.isString(k)) {\n\t throw Error('argument 2 must be a string');\n\t }\n\t if (!_.isBoolean(isDeep)) {\n\t throw Error('argument 3 must be a boolean');\n\t }\n\t } else {\n\t isDeep = angular.isDefined(k) ? k : false;\n\t k = vm;\n\t vm = $Mixer.caller;\n\t\n\t if (!_.isString(k)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t if (!_.isBoolean(isDeep)) {\n\t throw Error('argument 2 must be a boolean');\n\t }\n\t }\n\t\n\t return this.$$reactivateEntity(vm, k, this.$watch, isDeep);\n\t };\n\t\n\t // Gets a collection reactively\n\t $$Reactive.getCollectionReactively = function (vm, k) {\n\t if ($$utils.isViewModel(vm)) {\n\t if (!_.isString(k)) {\n\t throw Error('argument 2 must be a string');\n\t }\n\t } else {\n\t k = vm;\n\t vm = $Mixer.caller;\n\t\n\t if (!_.isString(k)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t }\n\t\n\t return this.$$reactivateEntity(vm, k, this.$watchCollection);\n\t };\n\t\n\t // Gets an entity reactively, and once it has been changed the computation will be recomputed\n\t $$Reactive.$$reactivateEntity = function (vm, k, watcher) {\n\t if (!vm.$$dependencies[k]) {\n\t vm.$$dependencies[k] = new Tracker.Dependency();\n\t\n\t for (var _len = arguments.length, watcherArgs = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n\t watcherArgs[_key - 3] = arguments[_key];\n\t }\n\t\n\t this.$$watchEntity.apply(this, [vm, k, watcher].concat(watcherArgs));\n\t }\n\t\n\t vm.$$dependencies[k].depend();\n\t return $parse(k)(vm);\n\t };\n\t\n\t // Watches for changes in the view model, and if so will notify a change\n\t $$Reactive.$$watchEntity = function (vm, k, watcher) {\n\t var _this2 = this;\n\t\n\t // Gets a deep property from the caller\n\t var getVal = _.partial($parse(k), vm);\n\t var initialVal = getVal();\n\t\n\t // Watches for changes in the view model\n\t\n\t for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {\n\t watcherArgs[_key2 - 3] = arguments[_key2];\n\t }\n\t\n\t watcher.call.apply(watcher, [this, getVal, function (val, oldVal) {\n\t var hasChanged = val !== initialVal || val !== oldVal;\n\t\n\t // Notify if a change has been detected\n\t if (hasChanged) _this2.$$changed(vm, k);\n\t }].concat(watcherArgs));\n\t };\n\t\n\t // Invokes a function and sets the return value as a property\n\t $$Reactive.$$setFnHelper = function (vm, k, fn) {\n\t var _this3 = this;\n\t\n\t this.autorun(function (computation) {\n\t // Invokes the reactive functon\n\t var model = fn.apply(vm);\n\t\n\t // Ignore notifications made by the following handler\n\t Tracker.nonreactive(function () {\n\t // If a cursor, observe its changes and update acoordingly\n\t if ($$utils.isCursor(model)) {\n\t (function () {\n\t var observation = _this3.$$handleCursor(vm, k, model);\n\t\n\t computation.onInvalidate(function () {\n\t observation.stop();\n\t vm[k].splice(0);\n\t });\n\t })();\n\t } else {\n\t _this3.$$handleNonCursor(vm, k, model);\n\t }\n\t\n\t // Notify change and update the view model\n\t _this3.$$changed(vm, k);\n\t });\n\t });\n\t };\n\t\n\t // Sets a value helper as a setter and a getter which will notify computations once used\n\t $$Reactive.$$setValHelper = function (vm, k, v) {\n\t var _this4 = this;\n\t\n\t var watch = arguments.length <= 3 || arguments[3] === undefined ? true : arguments[3];\n\t\n\t // If set, reactives property\n\t if (watch) {\n\t var isDeep = _.isObject(v);\n\t this.getReactively(vm, k, isDeep);\n\t }\n\t\n\t Object.defineProperty(vm, k, {\n\t configurable: true,\n\t enumerable: true,\n\t\n\t get: function get() {\n\t return v;\n\t },\n\t set: function set(newVal) {\n\t v = newVal;\n\t _this4.$$changed(vm, k);\n\t }\n\t });\n\t };\n\t\n\t // Fetching a cursor and updates properties once the result set has been changed\n\t $$Reactive.$$handleCursor = function (vm, k, cursor) {\n\t var _this5 = this;\n\t\n\t // If not defined set it\n\t if (angular.isUndefined(vm[k])) {\n\t this.$$setValHelper(vm, k, cursor.fetch(), false);\n\t }\n\t // If defined update it\n\t else {\n\t var diff = jsondiffpatch.diff(vm[k], cursor.fetch());\n\t jsondiffpatch.patch(vm[k], diff);\n\t }\n\t\n\t // Observe changes made in the result set\n\t var observation = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t if (!observation) return;\n\t vm[k].splice(atIndex, 0, doc);\n\t _this5.$$changed(vm, k);\n\t },\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t var diff = jsondiffpatch.diff(vm[k][atIndex], doc);\n\t jsondiffpatch.patch(vm[k][atIndex], diff);\n\t _this5.$$changed(vm, k);\n\t },\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t vm[k].splice(fromIndex, 1);\n\t vm[k].splice(toIndex, 0, doc);\n\t _this5.$$changed(vm, k);\n\t },\n\t removedAt: function removedAt(oldDoc, atIndex) {\n\t vm[k].splice(atIndex, 1);\n\t _this5.$$changed(vm, k);\n\t }\n\t });\n\t\n\t return observation;\n\t };\n\t\n\t $$Reactive.$$handleNonCursor = function (vm, k, data) {\n\t var v = vm[k];\n\t\n\t if (angular.isDefined(v)) {\n\t delete vm[k];\n\t v = null;\n\t }\n\t\n\t if (angular.isUndefined(v)) {\n\t this.$$setValHelper(vm, k, data);\n\t }\n\t // Update property if the new value is from the same type\n\t else if ($$utils.areSiblings(v, data)) {\n\t var diff = jsondiffpatch.diff(v, data);\n\t jsondiffpatch.patch(v, diff);\n\t this.$$changed(vm, k);\n\t } else {\n\t vm[k] = data;\n\t }\n\t };\n\t\n\t // Notifies dependency in view model\n\t $$Reactive.$$depend = function (vm, k) {\n\t vm.$$dependencies[k].depend();\n\t };\n\t\n\t // Notifies change in view model\n\t $$Reactive.$$changed = function (vm, k) {\n\t this.$$throttledDigest();\n\t vm.$$dependencies[k].changed();\n\t };\n\t\n\t return $$Reactive;\n\t}]);\n\n/***/ },\n/* 20 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar name = exports.name = 'angular-templates';\n\t\n\ttry {\n\t angular.module(name);\n\t} catch (e) {\n\t angular.module(name, []);\n\t}\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** dist/angular-meteor.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap b5f5480244b0a53ac05c\n **/","// lib\nimport './lib/get-updates';\nimport './lib/diff-array';\n// legacy\nimport './modules/angular-meteor-settings';\nimport './modules/angular-meteor-ironrouter';\nimport './modules/angular-meteor-utils';\nimport './modules/angular-meteor-subscribe';\nimport './modules/angular-meteor-collection';\nimport './modules/angular-meteor-object';\nimport './modules/angular-meteor-user';\nimport './modules/angular-meteor-methods';\nimport './modules/angular-meteor-session';\nimport './modules/angular-meteor-camera';\nimport './modules/angular-meteor-stopper';\n\n// new\nimport { name as utilsName } from './modules/utils';\nimport { name as mixerName, Mixer } from './modules/mixer';\nimport { name as scopeName } from './modules/scope';\nimport { name as coreName, Core } from './modules/core';\nimport { name as viewModelName, ViewModel } from './modules/view-model';\nimport { name as reactiveName, Reactive } from './modules/reactive';\nimport { name as templatesName } from './modules/templates';\n\nexport const name = 'angular-meteor';\n\nangular.module(name, [\n // new\n utilsName,\n mixerName,\n scopeName,\n coreName,\n viewModelName,\n reactiveName,\n templatesName,\n\n // legacy\n 'angular-meteor.ironrouter',\n 'angular-meteor.utils',\n 'angular-meteor.subscribe',\n 'angular-meteor.collection',\n 'angular-meteor.object',\n 'angular-meteor.user',\n 'angular-meteor.methods',\n 'angular-meteor.session',\n 'angular-meteor.camera'\n\n])\n\n.run([\n Mixer,\n Core,\n ViewModel,\n Reactive,\n\n function($Mixer, $$Core, $$ViewModel, $$Reactive) {\n // Load all mixins\n $Mixer\n .mixin($$Core)\n .mixin($$ViewModel)\n .mixin($$Reactive);\n }\n])\n\n// legacy\n// Putting all services under $meteor service for syntactic sugar\n.service('$meteor', [\n '$meteorCollection',\n '$meteorCollectionFS',\n '$meteorObject',\n '$meteorMethods',\n '$meteorSession',\n '$meteorSubscribe',\n '$meteorUtils',\n '$meteorCamera',\n '$meteorUser',\n function($meteorCollection, $meteorCollectionFS, $meteorObject,\n $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils,\n $meteorCamera, $meteorUser) {\n this.collection = $meteorCollection;\n this.collectionFS = $meteorCollectionFS;\n this.object = $meteorObject;\n this.subscribe = $meteorSubscribe.subscribe;\n this.call = $meteorMethods.call;\n this.session = $meteorSession;\n this.autorun = $meteorUtils.autorun;\n this.getCollectionByName = $meteorUtils.getCollectionByName;\n this.getPicture = $meteorCamera.getPicture;\n\n // $meteorUser\n [\n 'loginWithPassword',\n 'requireUser',\n 'requireValidUser',\n 'waitForUser',\n 'createUser',\n 'changePassword',\n 'forgotPassword',\n 'resetPassword',\n 'verifyEmail',\n 'loginWithMeteorDeveloperAccount',\n 'loginWithFacebook',\n 'loginWithGithub',\n 'loginWithGoogle',\n 'loginWithMeetup',\n 'loginWithTwitter',\n 'loginWithWeibo',\n 'logout',\n 'logoutOtherClients'\n ].forEach((method) => {\n this[method] = $meteorUser[method];\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/angular-meteor.js\n **/","/*global\n angular, _\n */\n\n'use strict';\n\n// https://github.com/DAB0mB/get-updates\n(function() {\n var module = angular.module('getUpdates', []);\n\n var utils = (function() {\n var rip = function(obj, level) {\n if (level < 1) return {};\n\n return _.reduce(obj, function(clone, v, k) {\n v = _.isObject(v) ? rip(v, --level) : v;\n clone[k] = v;\n return clone;\n }, {});\n };\n\n var toPaths = function(obj) {\n var keys = getKeyPaths(obj);\n var values = getDeepValues(obj);\n return _.object(keys, values);\n };\n\n var getKeyPaths = function(obj) {\n var keys = _.keys(obj).map(function(k) {\n var v = obj[k];\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\n\n return getKeyPaths(v).map(function(subKey) {\n return k + '.' + subKey;\n });\n });\n\n return _.flatten(keys);\n };\n\n var getDeepValues = function(obj,arr) {\n arr = arr || [];\n\n _.values(obj).forEach(function(v) {\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v))\n arr.push(v);\n else\n getDeepValues(v, arr);\n });\n\n return arr;\n };\n\n var flatten = function(arr) {\n return arr.reduce(function(flattened, v, i) {\n if (_.isArray(v) && !_.isEmpty(v))\n flattened.push.apply(flattened, flatten(v));\n else\n flattened.push(v);\n\n return flattened;\n }, []);\n };\n\n var setFilled = function(obj, k, v) {\n if (!_.isEmpty(v)) obj[k] = v;\n };\n\n var assert = function(result, msg) {\n if (!result) throwErr(msg);\n };\n\n var throwErr = function(msg) {\n throw Error('get-updates error - ' + msg);\n };\n\n return {\n rip: rip,\n toPaths: toPaths,\n getKeyPaths: getKeyPaths,\n getDeepValues: getDeepValues,\n setFilled: setFilled,\n assert: assert,\n throwErr: throwErr\n };\n })();\n\n var getDifference = (function() {\n var getDifference = function(src, dst, isShallow) {\n var level;\n\n if (isShallow > 1)\n level = isShallow;\n else if (isShallow)\n level = 1;\n\n if (level) {\n src = utils.rip(src, level);\n dst = utils.rip(dst, level);\n }\n\n return compare(src, dst);\n };\n\n var compare = function(src, dst) {\n var srcKeys = _.keys(src);\n var dstKeys = _.keys(dst);\n\n var keys = _.chain([])\n .concat(srcKeys)\n .concat(dstKeys)\n .uniq()\n .without('$$hashKey')\n .value();\n\n return keys.reduce(function(diff, k) {\n var srcValue = src[k];\n var dstValue = dst[k];\n\n if (_.isDate(srcValue) && _.isDate(dstValue)) {\n if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n }\n\n if (_.isObject(srcValue) && _.isObject(dstValue)) {\n var valueDiff = getDifference(srcValue, dstValue);\n utils.setFilled(diff, k, valueDiff);\n }\n\n else if (srcValue !== dstValue) {\n diff[k] = dstValue;\n }\n\n return diff;\n }, {});\n };\n\n return getDifference;\n })();\n\n var getUpdates = (function() {\n var getUpdates = function(src, dst, isShallow) {\n utils.assert(_.isObject(src), 'first argument must be an object');\n utils.assert(_.isObject(dst), 'second argument must be an object');\n\n var diff = getDifference(src, dst, isShallow);\n var paths = utils.toPaths(diff);\n\n var set = createSet(paths);\n var unset = createUnset(paths);\n var pull = createPull(unset);\n\n var updates = {};\n utils.setFilled(updates, '$set', set);\n utils.setFilled(updates, '$unset', unset);\n utils.setFilled(updates, '$pull', pull);\n\n return updates;\n };\n\n var createSet = function(paths) {\n var undefinedKeys = getUndefinedKeys(paths);\n return _.omit(paths, undefinedKeys);\n };\n\n var createUnset = function(paths) {\n var undefinedKeys = getUndefinedKeys(paths);\n var unset = _.pick(paths, undefinedKeys);\n\n return _.reduce(unset, function(result, v, k) {\n result[k] = true;\n return result;\n }, {});\n };\n\n var createPull = function(unset) {\n var arrKeyPaths = _.keys(unset).map(function(k) {\n var split = k.match(/(.*)\\.\\d+$/);\n return split && split[1];\n });\n\n return _.compact(arrKeyPaths).reduce(function(pull, k) {\n pull[k] = null;\n return pull;\n }, {});\n };\n\n var getUndefinedKeys = function(obj) {\n return _.keys(obj).filter(function (k) {\n var v = obj[k];\n return _.isUndefined(v);\n });\n };\n\n return getUpdates;\n })();\n\n module.value('getUpdates', getUpdates);\n})();\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/get-updates.js\n **/","/*global\n angular, _, Package\n */\n\n'use strict';\n\nvar _module = angular.module('diffArray', ['getUpdates']);\n\n_module.factory('diffArray', ['getUpdates',\n function(getUpdates) {\n var LocalCollection = Package.minimongo.LocalCollection;\n var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\n // Calculates the differences between `lastSeqArray` and\n // `seqArray` and calls appropriate functions from `callbacks`.\n // Reuses Minimongo's diff algorithm implementation.\n // XXX Should be replaced with the original diffArray function here:\n // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n preventNestedDiff = !!preventNestedDiff;\n\n var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges ||\n Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\n var oldObjIds = [];\n var newObjIds = [];\n var posOld = {}; // maps from idStringify'd ids\n var posNew = {}; // ditto\n var posCur = {};\n var lengthCur = lastSeqArray.length;\n\n _.each(seqArray, function (doc, i) {\n newObjIds.push({_id: doc._id});\n posNew[idStringify(doc._id)] = i;\n });\n\n _.each(lastSeqArray, function (doc, i) {\n oldObjIds.push({_id: doc._id});\n posOld[idStringify(doc._id)] = i;\n posCur[idStringify(doc._id)] = i;\n });\n\n // Arrays can contain arbitrary objects. We don't diff the\n // objects. Instead we always fire 'changedAt' callback on every\n // object. The consumer of `observe-sequence` should deal with\n // it appropriately.\n diffFn(oldObjIds, newObjIds, {\n addedBefore: function (id, doc, before) {\n var position = before ? posCur[idStringify(before)] : lengthCur;\n\n _.each(posCur, function (pos, id) {\n if (pos >= position) posCur[id]++;\n });\n\n lengthCur++;\n posCur[idStringify(id)] = position;\n\n callbacks.addedAt(\n id,\n seqArray[posNew[idStringify(id)]],\n position,\n before\n );\n },\n\n movedBefore: function (id, before) {\n var prevPosition = posCur[idStringify(id)];\n var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\n _.each(posCur, function (pos, id) {\n if (pos >= prevPosition && pos <= position)\n posCur[id]--;\n else if (pos <= prevPosition && pos >= position)\n posCur[id]++;\n });\n\n posCur[idStringify(id)] = position;\n\n callbacks.movedTo(\n id,\n seqArray[posNew[idStringify(id)]],\n prevPosition,\n position,\n before\n );\n },\n removed: function (id) {\n var prevPosition = posCur[idStringify(id)];\n\n _.each(posCur, function (pos, id) {\n if (pos >= prevPosition) posCur[id]--;\n });\n\n delete posCur[idStringify(id)];\n lengthCur--;\n\n callbacks.removedAt(\n id,\n lastSeqArray[posOld[idStringify(id)]],\n prevPosition\n );\n }\n });\n\n _.each(posNew, function (pos, idString) {\n if (!_.has(posOld, idString)) return;\n\n var id = idParse(idString);\n var newItem = seqArray[pos] || {};\n var oldItem = lastSeqArray[posOld[idString]];\n var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\n if (!_.isEmpty(updates))\n callbacks.changedAt(id, updates, pos, oldItem);\n });\n }\n\n diffArray.shallow = function(lastSeqArray, seqArray, callbacks) {\n return diffArray(lastSeqArray, seqArray, callbacks, true);\n };\n\n diffArray.deepCopyChanges = function (oldItem, newItem) {\n var setDiff = getUpdates(oldItem, newItem).$set;\n\n _.each(setDiff, function(v, deepKey) {\n setDeep(oldItem, deepKey, v);\n });\n };\n\n diffArray.deepCopyRemovals = function (oldItem, newItem) {\n var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\n _.each(unsetDiff, function(v, deepKey) {\n unsetDeep(oldItem, deepKey);\n });\n };\n\n // Finds changes between two collections\n diffArray.getChanges = function(newCollection, oldCollection, diffMethod) {\n var changes = {added: [], removed: [], changed: []};\n\n diffMethod(oldCollection, newCollection, {\n addedAt: function(id, item, index) {\n changes.added.push({item: item, index: index});\n },\n\n removedAt: function(id, item, index) {\n changes.removed.push({item: item, index: index});\n },\n\n changedAt: function(id, updates, index, oldItem) {\n changes.changed.push({selector: id, modifier: updates});\n },\n\n movedTo: function(id, item, fromIndex, toIndex) {\n // XXX do we need this?\n }\n });\n\n return changes;\n };\n\n var setDeep = function(obj, deepKey, v) {\n var split = deepKey.split('.');\n var initialKeys = _.initial(split);\n var lastKey = _.last(split);\n\n initialKeys.reduce(function(subObj, k, i) {\n var nextKey = split[i + 1];\n\n if (isNumStr(nextKey)) {\n if (subObj[k] === null) subObj[k] = [];\n if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n }\n\n else if (subObj[k] === null || !isHash(subObj[k])) {\n subObj[k] = {};\n }\n\n return subObj[k];\n }, obj);\n\n var deepObj = getDeep(obj, initialKeys);\n deepObj[lastKey] = v;\n return v;\n };\n\n var unsetDeep = function(obj, deepKey) {\n var split = deepKey.split('.');\n var initialKeys = _.initial(split);\n var lastKey = _.last(split);\n var deepObj = getDeep(obj, initialKeys);\n\n if (_.isArray(deepObj) && isNumStr(lastKey))\n return !!deepObj.splice(lastKey, 1);\n else\n return delete deepObj[lastKey];\n };\n\n var getDeep = function(obj, keys) {\n return keys.reduce(function(subObj, k) {\n return subObj[k];\n }, obj);\n };\n\n var isHash = function(obj) {\n return _.isObject(obj) &&\n Object.getPrototypeOf(obj) === Object.prototype;\n };\n\n var isNumStr = function(str) {\n return str.match(/^\\d+$/);\n };\n\n return diffArray;\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/diff-array.js\n **/","angular.module('angular-meteor.settings', [])\n .constant('$angularMeteorSettings', {\n suppressWarnings: false\n });\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-settings.js\n **/","angular.module('angular-meteor.ironrouter', [])\n\n\n.run([\n '$compile',\n '$document',\n '$rootScope',\n\nfunction ($compile, $document, $rootScope) {\n const Router = (Package['iron:router'] || {}).Router;\n if (!Router) return;\n\n let isLoaded = false;\n\n // Recompile after iron:router builds page\n Router.onAfterAction((req, res, next) => {\n Tracker.afterFlush(() => {\n if (isLoaded) return;\n $compile($document)($rootScope);\n if (!$rootScope.$$phase) $rootScope.$apply();\n isLoaded = true;\n });\n });\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-ironrouter.js\n **/","/*global\n angular, _, Tracker, EJSON, FS, Mongo\n */\n\n'use strict';\n\nvar angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']);\n\nangularMeteorUtils.service('$meteorUtils', [\n '$q', '$timeout', '$angularMeteorSettings',\n function ($q, $timeout, $angularMeteorSettings) {\n\n var self = this;\n\n this.autorun = function(scope, fn) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n\n // wrapping around Deps.autorun\n var comp = Tracker.autorun(function(c) {\n fn(c);\n // this is run immediately for the first call\n // but after that, we need to $apply to start Angular digest\n if (!c.firstRun) $timeout(angular.noop, 0);\n });\n\n // stop autorun when scope is destroyed\n scope.$on('$destroy', function() {\n comp.stop();\n });\n\n // return autorun object so that it can be stopped manually\n return comp;\n };\n\n // Borrowed from angularFire\n // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n this.stripDollarPrefixedKeys = function (data) {\n if (!_.isObject(data) ||\n data instanceof Date ||\n data instanceof File ||\n EJSON.toJSONValue(data).$type === 'oid' ||\n (typeof FS === 'object' && data instanceof FS.File))\n return data;\n\n var out = _.isArray(data) ? [] : {};\n\n _.each(data, function(v,k) {\n if(typeof k !== 'string' || k.charAt(0) !== '$')\n out[k] = self.stripDollarPrefixedKeys(v);\n });\n\n return out;\n };\n\n // Returns a callback which fulfills promise\n this.fulfill = function(deferred, boundError, boundResult) {\n return function(err, result) {\n if (err)\n deferred.reject(boundError == null ? err : boundError);\n else if (typeof boundResult == \"function\")\n deferred.resolve(boundResult == null ? result : boundResult(result));\n else\n deferred.resolve(boundResult == null ? result : boundResult);\n };\n };\n\n // creates a function which invokes method with the given arguments and returns a promise\n this.promissor = function(obj, method) {\n return function() {\n var deferred = $q.defer();\n var fulfill = self.fulfill(deferred);\n var args = _.toArray(arguments).concat(fulfill);\n obj[method].apply(obj, args);\n return deferred.promise;\n };\n };\n\n // creates a $q.all() promise and call digestion loop on fulfillment\n this.promiseAll = function(promises) {\n var allPromise = $q.all(promises);\n\n allPromise.finally(function() {\n // calls digestion loop with no conflicts\n $timeout(angular.noop);\n });\n\n return allPromise;\n };\n\n this.getCollectionByName = function(string){\n return Mongo.Collection.get(string);\n };\n\n this.findIndexById = function(collection, doc) {\n var foundDoc = _.find(collection, function(colDoc) {\n // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n return EJSON.equals(colDoc._id, doc._id);\n });\n\n return _.indexOf(collection, foundDoc);\n };\n }\n]);\n\nangularMeteorUtils.run([\n '$rootScope', '$meteorUtils',\n function($rootScope, $meteorUtils) {\n Object.getPrototypeOf($rootScope).$meteorAutorun = function(fn) {\n return $meteorUtils.autorun(this, fn);\n };\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-utils.js\n **/","/*global\n angular, Meteor\n */\n\n'use strict';\nvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']);\n\nangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings',\n function ($q, $angularMeteorSettings) {\n\n var self = this;\n\n this._subscribe = function(scope, deferred, args) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var subscription = null;\n var lastArg = args[args.length - 1];\n\n // User supplied onStop callback\n // save it for later use and remove\n // from subscription arguments\n if (angular.isObject(lastArg) &&\n angular.isFunction(lastArg.onStop)) {\n var onStop = lastArg.onStop;\n\n args.pop();\n }\n\n args.push({\n onReady: function() {\n deferred.resolve(subscription);\n },\n onStop: function(err) {\n if (!deferred.promise.$$state.status) {\n if (err)\n deferred.reject(err);\n else\n deferred.reject(new Meteor.Error(\"Subscription Stopped\",\n \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n } else if (onStop)\n // After promise was resolved or rejected\n // call user supplied onStop callback.\n onStop.apply(this, Array.prototype.slice.call(arguments));\n\n }\n });\n\n subscription = Meteor.subscribe.apply(scope, args);\n\n return subscription;\n };\n\n this.subscribe = function(){\n var deferred = $q.defer();\n var args = Array.prototype.slice.call(arguments);\n var subscription = null;\n\n self._subscribe(this, deferred, args);\n\n return deferred.promise;\n };\n }]);\n\nangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe',\n function($rootScope, $q, $meteorSubscribe) {\n Object.getPrototypeOf($rootScope).$meteorSubscribe = function() {\n var deferred = $q.defer();\n var args = Array.prototype.slice.call(arguments);\n\n var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\n this.$on('$destroy', function() {\n subscription.stop();\n });\n\n return deferred.promise;\n };\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-subscribe.js\n **/","/*global\n angular, _, Tracker, check, Match, Mongo\n */\n\n'use strict';\n\nvar angularMeteorCollection = angular.module('angular-meteor.collection',\n ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']);\n\n// The reason angular meteor collection is a factory function and not something\n// that inherit from array comes from here:\n// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n// We went with the direct extensions approach.\nangularMeteorCollection.factory('AngularMeteorCollection', [\n '$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings',\n function($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\n function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var data = [];\n // Server backup data to evaluate what changes come from client\n // after each server update.\n data._serverBackup = [];\n // Array differ function.\n data._diffArrayFunc = diffArrayFunc;\n // Handler of the cursor observer.\n data._hObserve = null;\n // On new cursor autorun handler\n // (autorun for reactive variables).\n data._hNewCurAutorun = null;\n // On new data autorun handler\n // (autorun for cursor.fetch).\n data._hDataAutorun = null;\n\n if (angular.isDefined(collection)) {\n data.$$collection = collection;\n } else {\n var cursor = curDefFunc();\n data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n }\n\n _.extend(data, AngularMeteorCollection);\n data._startCurAutorun(curDefFunc, autoClientSave);\n\n return data;\n }\n\n AngularMeteorCollection._startCurAutorun = function(curDefFunc, autoClientSave) {\n var self = this;\n\n self._hNewCurAutorun = Tracker.autorun(function() {\n // When the reactive func gets recomputated we need to stop any previous\n // observeChanges.\n Tracker.onInvalidate(function() {\n self._stopCursor();\n });\n\n if (autoClientSave) self._setAutoClientSave();\n self._updateCursor(curDefFunc(), autoClientSave);\n });\n };\n\n AngularMeteorCollection.subscribe = function() {\n $meteorSubscribe.subscribe.apply(this, arguments);\n return this;\n };\n\n AngularMeteorCollection.save = function(docs, useUnsetModifier) {\n // save whole collection\n if (!docs) docs = this;\n // save single doc\n docs = [].concat(docs);\n\n var promises = docs.map(function(doc) {\n return this._upsertDoc(doc, useUnsetModifier);\n }, this);\n\n return $meteorUtils.promiseAll(promises);\n };\n\n AngularMeteorCollection._upsertDoc = function(doc, useUnsetModifier) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\n // delete $$hashkey\n doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n var docId = doc._id;\n var isExist = collection.findOne(docId);\n\n // update\n if (isExist) {\n // Deletes _id property (from the copy) so that\n // it can be $set using update.\n delete doc._id;\n var modifier = useUnsetModifier ? {$unset: doc} : {$set: doc};\n // NOTE: do not use #upsert() method, since it does not exist in some collections\n collection.update(docId, modifier, createFulfill(function() {\n return {_id: docId, action: 'updated'};\n }));\n }\n // insert\n else {\n collection.insert(doc, createFulfill(function(id) {\n return {_id: id, action: 'inserted'};\n }));\n }\n\n return deferred.promise;\n };\n\n // performs $pull operations parallely.\n // used for handling splice operations returned from getUpdates() to prevent conflicts.\n // see issue: https://github.com/Urigo/angular-meteor/issues/793\n AngularMeteorCollection._updateDiff = function(selector, update, callback) {\n callback = callback || angular.noop;\n var setters = _.omit(update, '$pull');\n var updates = [setters];\n\n _.each(update.$pull, function(pull, prop) {\n var puller = {};\n puller[prop] = pull;\n updates.push({ $pull: puller });\n });\n\n this._updateParallel(selector, updates, callback);\n };\n\n // performs each update operation parallely\n AngularMeteorCollection._updateParallel = function(selector, updates, callback) {\n var self = this;\n var done = _.after(updates.length, callback);\n\n var next = function(err, affectedDocsNum) {\n if (err) return callback(err);\n done(null, affectedDocsNum);\n };\n\n _.each(updates, function(update) {\n self.$$collection.update(selector, update, next);\n });\n };\n\n AngularMeteorCollection.remove = function(keyOrDocs) {\n var keys;\n\n // remove whole collection\n if (!keyOrDocs) {\n keys = _.pluck(this, '_id');\n }\n // remove docs\n else {\n keyOrDocs = [].concat(keyOrDocs);\n\n keys = _.map(keyOrDocs, function(keyOrDoc) {\n return keyOrDoc._id || keyOrDoc;\n });\n }\n\n // Checks if all keys are correct.\n check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\n var promises = keys.map(function(key) {\n return this._removeDoc(key);\n }, this);\n\n return $meteorUtils.promiseAll(promises);\n };\n\n AngularMeteorCollection._removeDoc = function(id) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n collection.remove(id, fulfill);\n return deferred.promise;\n };\n\n AngularMeteorCollection._updateCursor = function(cursor, autoClientSave) {\n var self = this;\n // XXX - consider adding an option for a non-orderd result for faster performance\n if (self._hObserve) self._stopObserving();\n\n\n self._hObserve = cursor.observe({\n addedAt: function(doc, atIndex) {\n self.splice(atIndex, 0, doc);\n self._serverBackup.splice(atIndex, 0, doc);\n self._setServerUpdateMode();\n },\n\n changedAt: function(doc, oldDoc, atIndex) {\n diffArray.deepCopyChanges(self[atIndex], doc);\n diffArray.deepCopyRemovals(self[atIndex], doc);\n self._serverBackup[atIndex] = self[atIndex];\n self._setServerUpdateMode();\n },\n\n movedTo: function(doc, fromIndex, toIndex) {\n self.splice(fromIndex, 1);\n self.splice(toIndex, 0, doc);\n self._serverBackup.splice(fromIndex, 1);\n self._serverBackup.splice(toIndex, 0, doc);\n self._setServerUpdateMode();\n },\n\n removedAt: function(oldDoc) {\n var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\n if (removedIndex != -1) {\n self.splice(removedIndex, 1);\n self._serverBackup.splice(removedIndex, 1);\n self._setServerUpdateMode();\n } else {\n // If it's been removed on client then it's already not in collection\n // itself but still is in the _serverBackup.\n removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\n if (removedIndex != -1) {\n self._serverBackup.splice(removedIndex, 1);\n }\n }\n }\n });\n\n self._hDataAutorun = Tracker.autorun(function() {\n cursor.fetch();\n if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n });\n };\n\n AngularMeteorCollection._stopObserving = function() {\n this._hObserve.stop();\n this._hDataAutorun.stop();\n delete this._serverMode;\n delete this._hUnsetTimeout;\n };\n\n AngularMeteorCollection._setServerUpdateMode = function(name) {\n this._serverMode = true;\n // To simplify server update logic, we don't follow\n // updates from the client at the same time.\n this._unsetAutoClientSave();\n };\n\n // Here we use $timeout to combine multiple updates that go\n // each one after another.\n AngularMeteorCollection._unsetServerUpdateMode = function(autoClientSave) {\n var self = this;\n\n if (self._hUnsetTimeout) {\n $timeout.cancel(self._hUnsetTimeout);\n self._hUnsetTimeout = null;\n }\n\n self._hUnsetTimeout = $timeout(function() {\n self._serverMode = false;\n // Finds updates that was potentially done from the client side\n // and saves them.\n var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n self._saveChanges(changes);\n // After, continues following client updates.\n if (autoClientSave) self._setAutoClientSave();\n }, 0);\n };\n\n AngularMeteorCollection.stop = function() {\n this._stopCursor();\n this._hNewCurAutorun.stop();\n };\n\n AngularMeteorCollection._stopCursor = function() {\n this._unsetAutoClientSave();\n\n if (this._hObserve) {\n this._hObserve.stop();\n this._hDataAutorun.stop();\n }\n\n this.splice(0);\n this._serverBackup.splice(0);\n };\n\n AngularMeteorCollection._unsetAutoClientSave = function(name) {\n if (this._hRegAutoBind) {\n this._hRegAutoBind();\n this._hRegAutoBind = null;\n }\n };\n\n AngularMeteorCollection._setAutoClientSave = function() {\n var self = this;\n\n // Always unsets auto save to keep only one $watch handler.\n self._unsetAutoClientSave();\n\n self._hRegAutoBind = $rootScope.$watch(function() {\n return self;\n }, function(nItems, oItems) {\n if (nItems === oItems) return;\n\n var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n self._unsetAutoClientSave();\n self._saveChanges(changes);\n self._setAutoClientSave();\n }, true);\n };\n\n AngularMeteorCollection._saveChanges = function(changes) {\n var self = this;\n\n // Saves added documents\n // Using reversed iteration to prevent indexes from changing during splice\n var addedDocs = changes.added.reverse().map(function(descriptor) {\n self.splice(descriptor.index, 1);\n return descriptor.item;\n });\n\n if (addedDocs.length) self.save(addedDocs);\n\n // Removes deleted documents\n var removedDocs = changes.removed.map(function(descriptor) {\n return descriptor.item;\n });\n\n if (removedDocs.length) self.remove(removedDocs);\n\n // Updates changed documents\n changes.changed.forEach(function(descriptor) {\n self._updateDiff(descriptor.selector, descriptor.modifier);\n });\n };\n\n return AngularMeteorCollection;\n}]);\n\nangularMeteorCollection.factory('$meteorCollectionFS', [\n '$meteorCollection', 'diffArray', '$angularMeteorSettings',\n function($meteorCollection, diffArray, $angularMeteorSettings) {\n function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n }\n\n return $meteorCollectionFS;\n}]);\n\nangularMeteorCollection.factory('$meteorCollection', [\n 'AngularMeteorCollection', '$rootScope', 'diffArray',\n function(AngularMeteorCollection, $rootScope, diffArray) {\n function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n // Validate parameters\n if (!reactiveFunc) {\n throw new TypeError('The first argument of $meteorCollection is undefined.');\n }\n\n if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n throw new TypeError(\n 'The first argument of $meteorCollection must be a function or ' +\n 'a have a find function property.');\n }\n\n if (!angular.isFunction(reactiveFunc)) {\n collection = angular.isDefined(collection) ? collection : reactiveFunc;\n reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\n }\n\n // By default auto save - true.\n autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n diffFn = diffFn || diffArray;\n return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n }\n\n return $meteorCollection;\n}]);\n\nangularMeteorCollection.run([\n '$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper',\n function($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n var scopeProto = Object.getPrototypeOf($rootScope);\n scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-collection.js\n **/","/*global\n angular, _, Mongo\n*/\n\n'use strict';\n\nvar angularMeteorObject = angular.module('angular-meteor.object',\n ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']);\n\nangularMeteorObject.factory('AngularMeteorObject', [\n '$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings',\n function($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\n // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n AngularMeteorObject.$$internalProps = [\n '$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope',\n 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject',\n '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'\n ];\n\n function AngularMeteorObject (collection, selector, options){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n // Make data not be an object so we can extend it to preserve\n // Collection Helpers and the like\n var helpers = collection._helpers;\n var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n var doc = collection.findOne(selector, options);\n var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\n _.extend(data, doc);\n _.extend(data, AngularMeteorObject);\n _.extend(data, collectionExtension);\n\n // Omit options that may spoil document finding\n data.$$options = _.omit(options, 'skip', 'limit');\n data.$$collection = collection;\n data.$$id = data._getId(selector);\n data._serverBackup = doc || {};\n\n return data;\n }\n\n AngularMeteorObject.getRawObject = function () {\n return angular.copy(_.omit(this, this.$$internalProps));\n };\n\n AngularMeteorObject.subscribe = function () {\n $meteorSubscribe.subscribe.apply(this, arguments);\n return this;\n };\n\n AngularMeteorObject.save = function(custom) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n var oldDoc = collection.findOne(this.$$id);\n var mods;\n\n // update\n if (oldDoc) {\n if (custom)\n mods = { $set: custom };\n else {\n mods = getUpdates(oldDoc, this.getRawObject());\n // If there are no updates, there is nothing to do here, returning\n if (_.isEmpty(mods)) {\n return $q.when({ action: 'updated' });\n }\n }\n\n // NOTE: do not use #upsert() method, since it does not exist in some collections\n this._updateDiff(mods, createFulfill({ action: 'updated' }));\n }\n // insert\n else {\n if (custom)\n mods = _.clone(custom);\n else\n mods = this.getRawObject();\n\n mods._id = mods._id || this.$$id;\n collection.insert(mods, createFulfill({ action: 'inserted' }));\n }\n\n return deferred.promise;\n };\n\n AngularMeteorObject._updateDiff = function(update, callback) {\n var selector = this.$$id;\n AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n };\n\n AngularMeteorObject.reset = function(keepClientProps) {\n var self = this;\n var options = this.$$options;\n var id = this.$$id;\n var doc = this.$$collection.findOne(id, options);\n\n if (doc) {\n // extend SubObject\n var docKeys = _.keys(doc);\n var docExtension = _.pick(doc, docKeys);\n var clientProps;\n\n _.extend(self, docExtension);\n _.extend(self._serverBackup, docExtension);\n\n if (keepClientProps) {\n clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\n } else {\n clientProps = _.keys(self);\n }\n\n var serverProps = _.keys(doc);\n var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\n\n removedKeys.forEach(function (prop) {\n delete self[prop];\n delete self._serverBackup[prop];\n });\n }\n\n else {\n _.keys(this.getRawObject()).forEach(function(prop) {\n delete self[prop];\n });\n\n self._serverBackup = {};\n }\n };\n\n AngularMeteorObject.stop = function () {\n if (this.unregisterAutoDestroy)\n this.unregisterAutoDestroy();\n\n if (this.unregisterAutoBind)\n this.unregisterAutoBind();\n\n if (this.autorunComputation && this.autorunComputation.stop)\n this.autorunComputation.stop();\n };\n\n AngularMeteorObject._getId = function(selector) {\n var options = _.extend({}, this.$$options, {\n fields: { _id: 1 },\n reactive: false,\n transform: null\n });\n\n var doc = this.$$collection.findOne(selector, options);\n\n if (doc) return doc._id;\n if (selector instanceof Mongo.ObjectID) return selector;\n if (_.isString(selector)) return selector;\n return new Mongo.ObjectID();\n };\n\n return AngularMeteorObject;\n}]);\n\n\nangularMeteorObject.factory('$meteorObject', [\n '$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject',\n function($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n function $meteorObject(collection, id, auto, options) {\n // Validate parameters\n if (!collection) {\n throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n }\n\n if (!angular.isFunction(collection.findOne)) {\n throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n }\n\n var data = new AngularMeteorObject(collection, id, options);\n // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n data._auto = auto !== false;\n _.extend(data, $meteorObject);\n data._setAutos();\n return data;\n }\n\n $meteorObject._setAutos = function() {\n var self = this;\n\n this.autorunComputation = $meteorUtils.autorun($rootScope, function() {\n self.reset(true);\n });\n\n // Deep watches the model and performs autobind\n this.unregisterAutoBind = this._auto && $rootScope.$watch(function(){\n return self.getRawObject();\n }, function (item, oldItem) {\n if (item !== oldItem) self.save();\n }, true);\n\n this.unregisterAutoDestroy = $rootScope.$on('$destroy', function() {\n if (self && self.stop) self.pop();\n });\n };\n\n return $meteorObject;\n}]);\n\nangularMeteorObject.run([\n '$rootScope', '$meteorObject', '$meteorStopper',\n function ($rootScope, $meteorObject, $meteorStopper) {\n var scopeProto = Object.getPrototypeOf($rootScope);\n scopeProto.$meteorObject = $meteorStopper($meteorObject);\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-object.js\n **/","/*global\n angular, _, Package, Meteor\n */\n\n'use strict';\n\nvar angularMeteorUser = angular.module('angular-meteor.user', [\n 'angular-meteor.utils',\n 'angular-meteor.core',\n 'angular-meteor.settings'\n]);\n\n// requires package 'accounts-password'\nangularMeteorUser.service('$meteorUser', [\n '$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings',\n function($rootScope, $meteorUtils, $q, $angularMeteorSettings){\n\n var pack = Package['accounts-base'];\n if (!pack) return;\n\n var self = this;\n var Accounts = pack.Accounts;\n\n this.waitForUser = function(){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var deferred = $q.defer();\n\n $meteorUtils.autorun($rootScope, function(){\n if ( !Meteor.loggingIn() )\n deferred.resolve( Meteor.user() );\n }, true);\n\n return deferred.promise;\n };\n\n this.requireUser = function(){\n if (!$angularMeteorSettings.suppressWarnings) {\n console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n }\n\n var deferred = $q.defer();\n\n $meteorUtils.autorun($rootScope, function(){\n if ( !Meteor.loggingIn() ) {\n if ( Meteor.user() === null)\n deferred.reject(\"AUTH_REQUIRED\");\n else\n deferred.resolve( Meteor.user() );\n }\n }, true);\n\n return deferred.promise;\n };\n\n this.requireValidUser = function(validatorFn) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n return self.requireUser(true).then(function(user){\n var valid = validatorFn( user );\n\n if ( valid === true )\n return user;\n else if ( typeof valid === \"string\" )\n return $q.reject( valid );\n else\n return $q.reject( \"FORBIDDEN\" );\n\t });\n\t };\n\n this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n this.logout = $meteorUtils.promissor(Meteor, 'logout');\n this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n }\n]);\n\nangularMeteorUser.run([\n '$rootScope', '$angularMeteorSettings', '$$Core',\n function($rootScope, $angularMeteorSettings, $$Core){\n\n let ScopeProto = Object.getPrototypeOf($rootScope);\n _.extend(ScopeProto, $$Core);\n\n $rootScope.autorun(function(){\n if (!Meteor.user) return;\n $rootScope.currentUser = Meteor.user();\n $rootScope.loggingIn = Meteor.loggingIn();\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-user.js\n **/","/*global\n angular, _, Meteor\n */\n\n'use strict';\n\nvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']);\n\nangularMeteorMethods.service('$meteorMethods', [\n '$q', '$meteorUtils', '$angularMeteorSettings',\n function($q, $meteorUtils, $angularMeteorSettings) {\n this.call = function(){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var deferred = $q.defer();\n var fulfill = $meteorUtils.fulfill(deferred);\n var args = _.toArray(arguments).concat(fulfill);\n Meteor.call.apply(this, args);\n return deferred.promise;\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-methods.js\n **/","/*global\n angular, Session\n */\n\n'use strict';\nvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']);\n\nangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings',\n function ($meteorUtils, $parse, $angularMeteorSettings) {\n return function (session) {\n\n return {\n\n bind: function(scope, model) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var getter = $parse(model);\n var setter = getter.assign;\n $meteorUtils.autorun(scope, function() {\n setter(scope, Session.get(session));\n });\n\n scope.$watch(model, function(newItem, oldItem) {\n Session.set(session, getter(scope));\n }, true);\n\n }\n };\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-session.js\n **/","/*global\n angular, Package\n */\n\n'use strict';\n\nvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']);\n\n// requires package 'mdg:camera'\nangularMeteorCamera.service('$meteorCamera', [\n '$q', '$meteorUtils', '$angularMeteorSettings',\n function ($q, $meteorUtils, $angularMeteorSettings) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n var pack = Package['mdg:camera'];\n if (!pack) return;\n\n var MeteorCamera = pack.MeteorCamera;\n\n this.getPicture = function(options){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n options = options || {};\n var deferred = $q.defer();\n MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n return deferred.promise;\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-camera.js\n **/","/*global\n angular\n */\n\n'use strict';\n\nvar angularMeteorStopper = angular.module('angular-meteor.stopper',\n ['angular-meteor.subscribe']);\n\nangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe',\n function($q, $meteorSubscribe) {\n function $meteorStopper($meteorEntity) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n var meteorEntity = $meteorEntity.apply(this, args);\n\n angular.extend(meteorEntity, $meteorStopper);\n meteorEntity.$$scope = this;\n\n this.$on('$destroy', function () {\n meteorEntity.stop();\n if (meteorEntity.subscription) meteorEntity.subscription.stop();\n });\n\n return meteorEntity;\n };\n }\n\n $meteorStopper.subscribe = function() {\n var args = Array.prototype.slice.call(arguments);\n this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n return this;\n };\n\n return $meteorStopper;\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-stopper.js\n **/","export const name = 'angular-meteor.utilities';\nexport const utils = '$$utils';\n\nangular.module(name, [])\n\n/*\n A utility service which is provided with general utility functions\n */\n.service(utils, [\n '$rootScope',\n\n function($rootScope) {\n const self = this;\n\n // Checks if an object is a cursor\n this.isCursor = (obj) => {\n return obj instanceof Meteor.Collection.Cursor;\n };\n\n // Cheecks if an object is a scope\n this.isScope = (obj) => {\n return obj instanceof $rootScope.constructor;\n };\n\n // Checks if an object is a view model\n this.isViewModel = (obj) => {\n return _.isObject(obj) && obj.$$dependencies;\n };\n\n // Checks if two objects are siblings\n this.areSiblings = (obj1, obj2) => {\n return _.isObject(obj1) && _.isObject(obj2) &&\n Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n };\n\n // Binds function into a scpecified context. If an object is provided, will bind every\n // value in the object which is a function. If a tap function is provided, it will be\n // called right after the function has been invoked.\n this.bind = (fn, context, tap) => {\n tap = _.isFunction(tap) ? tap : angular.noop;\n if (_.isFunction(fn)) return bindFn(fn, context, tap);\n if (_.isObject(fn)) return bindObj(fn, context, tap);\n return fn;\n };\n\n function bindFn(fn, context, tap) {\n return (...args) => {\n const result = fn.apply(context, args);\n tap.call(context, {\n result,\n args\n });\n return result;\n };\n }\n\n function bindObj(obj, context, tap) {\n return _.keys(obj).reduce((bound, k) => {\n bound[k] = self.bind(obj[k], context, tap);\n return bound;\n }, {});\n }\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/utils.js\n **/","export const name = 'angular-meteor.mixer';\nexport const Mixer = '$Mixer';\n\nangular.module(name, [])\n\n/*\n A service which lets us apply mixins into Scope.prototype.\n The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n and any time a `ChildScope` prototype is created\n it will be extended by the `$Mixer`.\n This concept is good because it keeps our code\n clean and simple, and easy to extend.\n So any time we would like to define a new behaviour to our scope,\n we will just use the `$Mixer` service.\n */\n.service(Mixer, function() {\n // Used to store method's caller\n let caller;\n\n this._mixins = [];\n // Apply mixins automatically on specified contexts\n this._autoExtend = [];\n this._autoConstruct = [];\n\n // Adds a new mixin\n this.mixin = (mixin) => {\n if (!_.isObject(mixin)) {\n throw Error('argument 1 must be an object');\n }\n\n this._mixins = _.union(this._mixins, [mixin]);\n // Apply mixins to stored contexts\n this._autoExtend.forEach(context => this._extend(context));\n this._autoConstruct.forEach(context => this._construct(context));\n return this;\n };\n\n // Removes a mixin. Useful mainly for test purposes\n this._mixout = (mixin) => {\n this._mixins = _.without(this._mixins, mixin);\n return this;\n };\n\n // Invoke function mixins with the provided context and arguments\n this._construct = (context, ...args) => {\n this._mixins.filter(_.isFunction).forEach((mixin) => {\n mixin.call(context, ...args);\n });\n\n return context;\n };\n\n // Extend prototype with the defined mixins\n this._extend = (obj, options) => {\n const { pattern, context } = _.defaults({}, options, {\n pattern: /.*/, // The patterns of the keys which will be filtered\n });\n\n const mixins = this._mixins.map((mixin) => {\n // Filtering the keys by the specified pattern\n const keys = _.keys(mixin)\n .filter(k => k.match(pattern))\n .filter(k => _.isFunction(mixin[k]));\n\n return keys.reduce((boundMixin, methodName) => {\n const methodHandler = mixin[methodName];\n\n // Note that this is not an arrow function so we can conserve the conetxt\n boundMixin[methodName] = function(...args) {\n // Storing original caller so we will know who actually called the\n // method event though it is bound to another context\n const methodContext = context || this;\n const recentCaller = caller;\n caller = this;\n\n try {\n return methodHandler.apply(methodContext, args);\n }\n finally {\n // No matter what happens, restore variable to the previous one\n caller = recentCaller;\n }\n };\n\n return boundMixin;\n }, {});\n });\n\n return _.extend(obj, ...mixins);\n };\n\n // Caller property can not be set\n Object.defineProperty(this, 'caller', {\n configurable: true,\n enumerable: true,\n\n get: () => {\n return caller;\n }\n });\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/mixer.js\n **/","import { name as mixerName, Mixer } from './mixer';\n\nexport const name = 'angular-meteor.scope';\n\nangular.module(name, [\n mixerName\n])\n\n.run([\n '$rootScope',\n Mixer,\n function($rootScope, $Mixer) {\n const Scope = $rootScope.constructor;\n const $new = $rootScope.$new;\n\n // Apply extensions whether a mixin in defined.\n // Note that this way mixins which are initialized later\n // can be applied on rootScope.\n $Mixer._autoExtend.push(Scope.prototype);\n $Mixer._autoConstruct.push($rootScope);\n\n Scope.prototype.$new = function() {\n const scope = $new.apply(this, arguments);\n // Apply constructors to newly created scopes\n return $Mixer._construct(scope);\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/scope.js\n **/","import { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\n\nexport const name = 'angular-meteor.core';\nexport const Core = '$$Core';\n\nangular.module(name, [\n utilsName,\n mixerName\n])\n\n\n/*\n A mixin which provides us with core Meteor functions.\n */\n.factory(Core, [\n '$q',\n utils,\n Mixer,\n\n function($q, $$utils, $Mixer) {\n function $$Core() {}\n\n // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n $$Core.autorun = function(fn, options = {}) {\n fn = this.$bindToContext($Mixer.caller, fn);\n\n if (!_.isFunction(fn)) {\n throw Error('argument 1 must be a function');\n }\n if (!_.isObject(options)) {\n throw Error('argument 2 must be an object');\n }\n\n const computation = Tracker.autorun(fn, options);\n this.$$autoStop(computation);\n return computation;\n };\n\n // Calls Meteor.subscribe() which will be digested after each invokation\n // and automatically destroyed\n $$Core.subscribe = function(subName, fn, cb) {\n fn = this.$bindToContext($Mixer.caller, fn || angular.noop);\n cb = cb ? this.$bindToContext($Mixer.caller, cb) : angular.noop;\n\n if (!_.isString(subName)) {\n throw Error('argument 1 must be a string');\n }\n if (!_.isFunction(fn)) {\n throw Error('argument 2 must be a function');\n }\n if (!_.isFunction(cb) && !_.isObject(cb)) {\n throw Error('argument 3 must be a function or an object');\n }\n\n const result = {};\n\n const computation = this.autorun(() => {\n let args = fn();\n if (angular.isUndefined(args)) args = [];\n\n if (!_.isArray(args)) {\n throw Error(`reactive function's return value must be an array`);\n }\n\n const subscription = Meteor.subscribe(subName, ...args, cb);\n result.ready = subscription.ready.bind(subscription);\n result.subscriptionId = subscription.subscriptionId;\n });\n\n // Once the computation has been stopped,\n // any subscriptions made inside will be stopped as well\n result.stop = computation.stop.bind(computation);\n return result;\n };\n\n // Calls Meteor.call() wrapped by a digestion cycle\n $$Core.callMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n return Meteor.call(...args, fn);\n };\n\n // Calls Meteor.apply() wrapped by a digestion cycle\n $$Core.applyMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n return Meteor.apply(...args, fn);\n };\n\n $$Core.$$autoStop = function(stoppable) {\n this.$on('$destroy', stoppable.stop.bind(stoppable));\n };\n\n // Digests scope only if there is no phase at the moment\n $$Core.$$throttledDigest = function() {\n const isDigestable = !this.$$destroyed &&\n !this.$$phase &&\n !this.$root.$$phase;\n\n if (isDigestable) this.$digest();\n };\n\n // Creates a promise only that the digestion cycle will be called at its fulfillment\n $$Core.$$defer = function() {\n const deferred = $q.defer();\n // Once promise has been fulfilled, digest\n deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n return deferred;\n };\n\n // Binds an object or a function to the provided context and digest it once it is invoked\n $$Core.$bindToContext = function(context, fn) {\n return $$utils.bind(fn, context, this.$$throttledDigest.bind(this));\n };\n\n return $$Core;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/core.js\n **/","import { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\nimport { name as coreName } from './core';\n\nexport const name = 'angular-meteor.view-model';\nexport const ViewModel = '$$ViewModel';\nexport const reactive = '$reactive';\n\nangular.module(name, [\n utilsName,\n mixerName,\n coreName\n])\n\n/*\n A mixin which lets us bind a view model into a scope.\n Note that only a single view model can be bound,\n otherwise the scope might behave unexpectedly.\n Mainly used to define the controller as the view model,\n and very useful when wanting to use Angular's `controllerAs` syntax.\n */\n.factory(ViewModel, [\n utils,\n Mixer,\n\n function($$utils, $Mixer) {\n function $$ViewModel() {}\n\n // Gets an object, wraps it with scope functions and returns it\n $$ViewModel.viewModel = function(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n // Extend view model with mixin functions\n $Mixer._extend(vm, {\n pattern: /^(?!\\$\\$).*$/, // Omitting methods which start with a $$ notation\n context: this // Binding methods to scope\n });\n\n // Apply mixin constructors on scope with view model\n $Mixer._construct(this, vm);\n return vm;\n };\n\n return $$ViewModel;\n }\n])\n\n\n/*\n Illustrates the old API where a view model is created using $reactive service\n */\n.service(reactive, [\n utils,\n\n function($$utils) {\n class Reactive {\n constructor(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n _.defer(() => {\n if (!this._attached) {\n console.warn('view model was not attached to any scope');\n }\n });\n\n this._vm = vm;\n }\n\n attach(scope) {\n this._attached = true;\n\n if (!$$utils.isScope(scope)) {\n throw Error('argument 1 must be a scope');\n }\n\n const viewModel = scope.viewModel(this._vm);\n\n // Similar to the old/Meteor API\n viewModel.call = viewModel.callMethod;\n viewModel.apply = viewModel.applyMethod;\n\n return viewModel;\n }\n }\n\n return (vm) => new Reactive(vm);\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/view-model.js\n **/","import { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\nimport { name as coreName } from './core';\nimport { name as viewModelName } from './view-model';\n\nexport const name = 'angular-meteor.reactive';\nexport const Reactive = '$$Reactive';\n\nangular.module(name, [\n utilsName,\n mixerName,\n coreName,\n viewModelName\n])\n\n\n/*\n A mixin which enhance our reactive abilities by providing methods\n that are capable of updating our scope reactively.\n */\n.factory(Reactive, [\n '$parse',\n utils,\n Mixer,\n\n function($parse, $$utils, $Mixer) {\n function $$Reactive(vm = this) {\n // Helps us track changes made in the view model\n vm.$$dependencies = {};\n }\n\n // Gets an object containing functions and define their results as reactive properties.\n // Once a return value has been changed the property will be reset.\n $$Reactive.helpers = function(vm, props) {\n if ($$utils.isViewModel(vm)) {\n if (!_.isObject(props)) {\n throw Error('argument 2 must be an object');\n }\n }\n else {\n props = vm;\n vm = $Mixer.caller;\n\n if (!_.isObject(props)) {\n throw Error('argument 1 must be an object');\n }\n }\n\n _.each(props, (v, k) => {\n if (!_.isFunction(v)) {\n throw Error(`helper '${k}' must be a function`);\n }\n });\n\n _.each(props, (v, k) => {\n if (!vm.$$dependencies[k]) {\n // Registers a new dependency to the specified helper\n vm.$$dependencies[k] = new Tracker.Dependency();\n }\n\n this.$$setFnHelper(vm, k, v);\n });\n };\n\n // Gets a model reactively\n $$Reactive.getReactively = function(vm, k, isDeep) {\n if ($$utils.isViewModel(vm)) {\n if (angular.isUndefined(isDeep)) isDeep = false;\n\n if (!_.isString(k)) {\n throw Error('argument 2 must be a string');\n }\n if (!_.isBoolean(isDeep)) {\n throw Error('argument 3 must be a boolean');\n }\n }\n else {\n isDeep = angular.isDefined(k) ? k : false;\n k = vm;\n vm = $Mixer.caller;\n\n if (!_.isString(k)) {\n throw Error('argument 1 must be a string');\n }\n if (!_.isBoolean(isDeep)) {\n throw Error('argument 2 must be a boolean');\n }\n }\n\n return this.$$reactivateEntity(vm, k, this.$watch, isDeep);\n };\n\n // Gets a collection reactively\n $$Reactive.getCollectionReactively = function(vm, k) {\n if ($$utils.isViewModel(vm)) {\n if (!_.isString(k)) {\n throw Error('argument 2 must be a string');\n }\n }\n else {\n k = vm;\n vm = $Mixer.caller;\n\n if (!_.isString(k)) {\n throw Error('argument 1 must be a string');\n }\n }\n\n return this.$$reactivateEntity(vm, k, this.$watchCollection);\n };\n\n // Gets an entity reactively, and once it has been changed the computation will be recomputed\n $$Reactive.$$reactivateEntity = function(vm, k, watcher, ...watcherArgs) {\n if (!vm.$$dependencies[k]) {\n vm.$$dependencies[k] = new Tracker.Dependency();\n this.$$watchEntity(vm, k, watcher, ...watcherArgs);\n }\n\n vm.$$dependencies[k].depend();\n return $parse(k)(vm);\n };\n\n // Watches for changes in the view model, and if so will notify a change\n $$Reactive.$$watchEntity = function(vm, k, watcher, ...watcherArgs) {\n // Gets a deep property from the caller\n const getVal = _.partial($parse(k), vm);\n const initialVal = getVal();\n\n // Watches for changes in the view model\n watcher.call(this, getVal, (val, oldVal) => {\n const hasChanged =\n val !== initialVal ||\n val !== oldVal;\n\n // Notify if a change has been detected\n if (hasChanged) this.$$changed(vm, k);\n }, ...watcherArgs);\n };\n\n // Invokes a function and sets the return value as a property\n $$Reactive.$$setFnHelper = function(vm, k, fn) {\n this.autorun((computation) => {\n // Invokes the reactive functon\n const model = fn.apply(vm);\n\n // Ignore notifications made by the following handler\n Tracker.nonreactive(() => {\n // If a cursor, observe its changes and update acoordingly\n if ($$utils.isCursor(model)) {\n const observation = this.$$handleCursor(vm, k, model);\n\n computation.onInvalidate(() => {\n observation.stop();\n vm[k].splice(0);\n });\n } else {\n this.$$handleNonCursor(vm, k, model);\n }\n\n // Notify change and update the view model\n this.$$changed(vm, k);\n });\n });\n };\n\n // Sets a value helper as a setter and a getter which will notify computations once used\n $$Reactive.$$setValHelper = function(vm, k, v, watch = true) {\n // If set, reactives property\n if (watch) {\n const isDeep = _.isObject(v);\n this.getReactively(vm, k, isDeep);\n }\n\n Object.defineProperty(vm, k, {\n configurable: true,\n enumerable: true,\n\n get: () => {\n return v;\n },\n set: (newVal) => {\n v = newVal;\n this.$$changed(vm, k);\n }\n });\n };\n\n // Fetching a cursor and updates properties once the result set has been changed\n $$Reactive.$$handleCursor = function(vm, k, cursor) {\n // If not defined set it\n if (angular.isUndefined(vm[k])) {\n this.$$setValHelper(vm, k, cursor.fetch(), false);\n }\n // If defined update it\n else {\n const diff = jsondiffpatch.diff(vm[k], cursor.fetch());\n jsondiffpatch.patch(vm[k], diff);\n }\n\n // Observe changes made in the result set\n const observation = cursor.observe({\n addedAt: (doc, atIndex) => {\n if (!observation) return;\n vm[k].splice(atIndex, 0, doc);\n this.$$changed(vm, k);\n },\n changedAt: (doc, oldDoc, atIndex) => {\n const diff = jsondiffpatch.diff(vm[k][atIndex], doc);\n jsondiffpatch.patch(vm[k][atIndex], diff);\n this.$$changed(vm, k);\n },\n movedTo: (doc, fromIndex, toIndex) => {\n vm[k].splice(fromIndex, 1);\n vm[k].splice(toIndex, 0, doc);\n this.$$changed(vm, k);\n },\n removedAt: (oldDoc, atIndex) => {\n vm[k].splice(atIndex, 1);\n this.$$changed(vm, k);\n }\n });\n\n return observation;\n };\n\n $$Reactive.$$handleNonCursor = function(vm, k, data) {\n let v = vm[k];\n\n if (angular.isDefined(v)) {\n delete vm[k];\n v = null;\n }\n\n if (angular.isUndefined(v)) {\n this.$$setValHelper(vm, k, data);\n }\n // Update property if the new value is from the same type\n else if ($$utils.areSiblings(v, data)) {\n const diff = jsondiffpatch.diff(v, data);\n jsondiffpatch.patch(v, diff);\n this.$$changed(vm, k);\n } else {\n vm[k] = data;\n }\n };\n\n // Notifies dependency in view model\n $$Reactive.$$depend = function(vm, k) {\n vm.$$dependencies[k].depend();\n };\n\n // Notifies change in view model\n $$Reactive.$$changed = function(vm, k) {\n this.$$throttledDigest();\n vm.$$dependencies[k].changed();\n };\n\n return $$Reactive;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/reactive.js\n **/","export const name = 'angular-templates';\n\ntry {\n angular.module(name);\n} catch (e) {\n angular.module(name, []);\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/templates.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/angular-meteor.min.js","webpack:///webpack/bootstrap f4a730afaadc2702df46","webpack:///./src/angular-meteor.js","webpack:///./src/lib/get-updates.js","webpack:///./src/lib/underscore.js","webpack:///external {\"root\":\"_\",\"amd\":\"underscore\",\"commonjs2\":\"underscore\",\"commonjs\":\"underscore\"}","webpack:///./src/lib/diff-array.js","webpack:///./src/modules/angular-meteor-settings.js","webpack:///./src/modules/angular-meteor-ironrouter.js","webpack:///./src/modules/angular-meteor-utils.js","webpack:///./src/modules/angular-meteor-subscribe.js","webpack:///./src/modules/angular-meteor-collection.js","webpack:///./src/modules/angular-meteor-object.js","webpack:///./src/modules/angular-meteor-user.js","webpack:///./src/modules/angular-meteor-methods.js","webpack:///./src/modules/angular-meteor-session.js","webpack:///./src/modules/angular-meteor-camera.js","webpack:///./src/modules/angular-meteor-stopper.js","webpack:///./src/modules/utils.js","webpack:///./src/modules/mixer.js","webpack:///./src/modules/scope.js","webpack:///./src/modules/core.js","webpack:///./src/modules/view-model.js","webpack:///./src/modules/reactive.js","webpack:///external \"jsondiffpatch\"","webpack:///./src/modules/templates.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_3__","__WEBPACK_EXTERNAL_MODULE_22__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","Object","defineProperty","value","_utils","_mixer","_scope","_core","_viewModel","_reactive","_templates","name","angular","run","Mixer","Core","ViewModel","Reactive","$Mixer","$$Core","$$ViewModel","$$Reactive","mixin","service","$meteorCollection","$meteorCollectionFS","$meteorObject","$meteorMethods","$meteorSession","$meteorSubscribe","$meteorUtils","$meteorCamera","$meteorUser","_this","collection","collectionFS","object","subscribe","session","autorun","getCollectionByName","getPicture","forEach","method","_interopRequireDefault","obj","__esModule","default","_underscore","_underscore2","utils","rip","level","reduce","clone","v","k","isObject","toPaths","keys","getKeyPaths","values","getDeepValues","map","isEmpty","isArray","subKey","flatten","arr","push","setFilled","assert","result","msg","throwErr","Error","getDifference","src","dst","isShallow","compare","srcKeys","dstKeys","chain","concat","uniq","without","diff","srcValue","dstValue","isDate","getTime","valueDiff","getUpdates","paths","set","createSet","unset","createUnset","pull","createPull","updates","undefinedKeys","getUndefinedKeys","omit","pick","arrKeyPaths","split","match","compact","filter","isUndefined","Package","underscore","_","_module","diffArray","lastSeqArray","seqArray","callbacks","preventNestedDiff","diffFn","minimongo","LocalCollection","_diffQueryOrderedChanges","DiffSequence","diffQueryOrderedChanges","oldObjIds","newObjIds","posOld","posNew","posCur","lengthCur","length","each","doc","i","_id","idStringify","addedBefore","before","position","pos","addedAt","movedBefore","prevPosition","movedTo","removed","removedAt","idString","has","idParse","newItem","oldItem","changedAt","_idStringify","MongoID","_idParse","shallow","deepCopyChanges","setDiff","$set","deepKey","setDeep","deepCopyRemovals","unsetDiff","$unset","unsetDeep","getChanges","newCollection","oldCollection","diffMethod","changes","added","changed","item","index","selector","modifier","fromIndex","toIndex","initialKeys","initial","lastKey","last","subObj","nextKey","isNumStr","parseInt","isHash","deepObj","getDeep","splice","getPrototypeOf","prototype","str","constant","suppressWarnings","$compile","$document","$rootScope","Router","isLoaded","onAfterAction","req","res","next","Tracker","afterFlush","$$phase","$apply","_typeof","Symbol","iterator","constructor","angularMeteorUtils","$q","$timeout","$angularMeteorSettings","self","scope","fn","console","warn","comp","firstRun","noop","$on","stop","stripDollarPrefixedKeys","data","Date","File","EJSON","toJSONValue","$type","FS","out","charAt","fulfill","deferred","boundError","boundResult","err","reject","resolve","promissor","defer","args","toArray","arguments","apply","promise","promiseAll","promises","allPromise","all","string","Mongo","Collection","get","findIndexById","foundDoc","find","colDoc","equals","indexOf","$meteorAutorun","angularMeteorSubscribe","_subscribe","subscription","lastArg","isFunction","onStop","_onStop","pop","onReady","$$state","status","Array","slice","Meteor","angularMeteorCollection","AngularMeteorCollection","curDefFunc","diffArrayFunc","autoClientSave","_serverBackup","_diffArrayFunc","_hObserve","_hNewCurAutorun","_hDataAutorun","isDefined","$$collection","cursor","extend","_startCurAutorun","onInvalidate","_stopCursor","_setAutoClientSave","_updateCursor","save","docs","useUnsetModifier","_upsertDoc","createFulfill","partial","docId","isExist","findOne","update","action","insert","_updateDiff","callback","setters","$pull","prop","puller","_updateParallel","done","after","affectedDocsNum","remove","keyOrDocs","keyOrDoc","pluck","check","Match","OneOf","String","ObjectID","key","_removeDoc","_stopObserving","observe","atIndex","_setServerUpdateMode","oldDoc","removedIndex","fetch","_serverMode","_unsetServerUpdateMode","_hUnsetTimeout","_unsetAutoClientSave","cancel","_saveChanges","_hRegAutoBind","$watch","nItems","oItems","addedDocs","reverse","descriptor","removedDocs","reactiveFunc","TypeError","bind","$meteorStopper","scopeProto","angularMeteorObject","AngularMeteorObject","options","helpers","_helpers","create","collectionExtension","$$options","$$id","_getId","$$internalProps","getRawObject","copy","custom","mods","when","reset","keepClientProps","clientProps","docKeys","docExtension","intersection","serverProps","removedKeys","difference","unregisterAutoDestroy","unregisterAutoBind","autorunComputation","fields","reactive","transform","isString","auto","_auto","_setAutos","angularMeteorUser","pack","Accounts","waitForUser","loggingIn","user","requireUser","requireValidUser","validatorFn","then","valid","loginWithPassword","createUser","changePassword","forgotPassword","resetPassword","verifyEmail","logout","logoutOtherClients","loginWithFacebook","loginWithTwitter","loginWithGoogle","loginWithGithub","loginWithMeteorDeveloperAccount","loginWithMeetup","loginWithWeibo","ScopeProto","currentUser","angularMeteorMethods","angularMeteorSession","$parse","model","getter","setter","assign","Session","angularMeteorCamera","MeteorCamera","angularMeteorStopper","$meteorEntity","meteorEntity","$$scope","undefined","bindFn","context","tap","_len","_key","bindObj","bound","isCursor","Cursor","isScope","isViewModel","$$dependencies","areSiblings","obj1","obj2","_toConsumableArray","arr2","from","caller","_mixins","_autoExtend","_autoConstruct","union","_extend","_construct","_mixout","_$defaults","defaults","pattern","mixins","boundMixin","methodName","methodHandler","methodContext","recentCaller","_len2","_key2","configurable","enumerable","Scope","$new","$$utils","$bindToContext","computation","$$autoStop","subName","cb","_Meteor","ready","subscriptionId","callMethod","_Meteor2","applyMethod","_Meteor3","stoppable","$$throttledDigest","isDigestable","$$destroyed","$root","$digest","$$defer","_classCallCheck","instance","Constructor","_createClass","defineProperties","target","props","writable","protoProps","staticProps","viewModel","vm","_attached","_vm","_jsondiffpatch","_jsondiffpatch2","Dependency","$$setFnHelper","getReactively","isDeep","isBoolean","$$reactivateEntity","getCollectionReactively","$watchCollection","watcher","watcherArgs","$$watchEntity","depend","_this2","getVal","initialVal","val","oldVal","hasChanged","$$changed","_this3","activeObservation","lastModel","lastModelData","nonreactive","modelData","$$setValHelper","handle","$$handleCursor","observation","patch","$$handleNonCursor","_this4","watch","newVal","_this5","$$depend","e"],"mappings":";CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,cAAAA,QAAA,kBACA,kBAAAC,gBAAAC,IACAD,QAAA,8BAAAJ,GACA,gBAAAC,SACAA,QAAA,cAAAD,EAAAG,QAAA,cAAAA,QAAA,kBAEAJ,EAAA,cAAAC,EAAAD,EAAA,EAAAA,EAAA,gBACCO,KAAA,SAAAC,EAAAC,GACD,MCCgB,UAAUC,GCP1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAV,OAGA,IAAAC,GAAAU,EAAAD,IACAV,WACAY,GAAAF,E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,EAAS,cAC7BoB,OAAO,GyBv4EH,IAAMQ,GAAA5B,EAAA4B,KAAO,mBAEpB,KACEC,QAAQ5B,OAAO2B,GACf,MAAO4hB,GACP3hB,QAAQ5B,OAAO2B","file":"dist/angular-meteor.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"underscore\"), require(\"jsondiffpatch\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"underscore\", \"jsondiffpatch\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angularMeteor\"] = factory(require(\"underscore\"), require(\"jsondiffpatch\"));\n\telse\n\t\troot[\"angularMeteor\"] = factory(root[\"_\"], root[\"jsondiffpatch\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_22__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","/*! angular-meteor v1.3.9 */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"underscore\"), require(\"jsondiffpatch\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"underscore\", \"jsondiffpatch\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angularMeteor\"] = factory(require(\"underscore\"), require(\"jsondiffpatch\"));\n\telse\n\t\troot[\"angularMeteor\"] = factory(root[\"_\"], root[\"jsondiffpatch\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_22__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\t__webpack_require__(1);\n\t\n\t__webpack_require__(4);\n\t\n\t__webpack_require__(5);\n\t\n\t__webpack_require__(6);\n\t\n\t__webpack_require__(7);\n\t\n\t__webpack_require__(8);\n\t\n\t__webpack_require__(9);\n\t\n\t__webpack_require__(10);\n\t\n\t__webpack_require__(11);\n\t\n\t__webpack_require__(12);\n\t\n\t__webpack_require__(13);\n\t\n\t__webpack_require__(14);\n\t\n\t__webpack_require__(15);\n\t\n\tvar _utils = __webpack_require__(16);\n\t\n\tvar _mixer = __webpack_require__(17);\n\t\n\tvar _scope = __webpack_require__(18);\n\t\n\tvar _core = __webpack_require__(19);\n\t\n\tvar _viewModel = __webpack_require__(20);\n\t\n\tvar _reactive = __webpack_require__(21);\n\t\n\tvar _templates = __webpack_require__(23);\n\t\n\t// legacy\n\t// lib\n\t\n\t\n\tvar name = 'angular-meteor';\n\t\n\t// new\n\t\n\texports.default = name;\n\t\n\t\n\tangular.module(name, [\n\t// new\n\t_utils.name, _mixer.name, _scope.name, _core.name, _viewModel.name, _reactive.name, _templates.name,\n\t\n\t// legacy\n\t'angular-meteor.ironrouter', 'angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'angular-meteor.object', 'angular-meteor.user', 'angular-meteor.methods', 'angular-meteor.session', 'angular-meteor.camera']).run([_mixer.Mixer, _core.Core, _viewModel.ViewModel, _reactive.Reactive, function ($Mixer, $$Core, $$ViewModel, $$Reactive) {\n\t // Load all mixins\n\t $Mixer.mixin($$Core).mixin($$ViewModel).mixin($$Reactive);\n\t}])\n\t\n\t// legacy\n\t// Putting all services under $meteor service for syntactic sugar\n\t.service('$meteor', ['$meteorCollection', '$meteorCollectionFS', '$meteorObject', '$meteorMethods', '$meteorSession', '$meteorSubscribe', '$meteorUtils', '$meteorCamera', '$meteorUser', function ($meteorCollection, $meteorCollectionFS, $meteorObject, $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils, $meteorCamera, $meteorUser) {\n\t var _this = this;\n\t\n\t this.collection = $meteorCollection;\n\t this.collectionFS = $meteorCollectionFS;\n\t this.object = $meteorObject;\n\t this.subscribe = $meteorSubscribe.subscribe;\n\t this.call = $meteorMethods.call;\n\t this.session = $meteorSession;\n\t this.autorun = $meteorUtils.autorun;\n\t this.getCollectionByName = $meteorUtils.getCollectionByName;\n\t this.getPicture = $meteorCamera.getPicture;\n\t\n\t // $meteorUser\n\t ['loginWithPassword', 'requireUser', 'requireValidUser', 'waitForUser', 'createUser', 'changePassword', 'forgotPassword', 'resetPassword', 'verifyEmail', 'loginWithMeteorDeveloperAccount', 'loginWithFacebook', 'loginWithGithub', 'loginWithGoogle', 'loginWithMeetup', 'loginWithTwitter', 'loginWithWeibo', 'logout', 'logoutOtherClients'].forEach(function (method) {\n\t _this[method] = $meteorUser[method];\n\t });\n\t}]);\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict';\n\t\n\t// https://github.com/DAB0mB/get-updates\n\t/*global\n\t angular, _\n\t */\n\t\n\t(function () {\n\t var module = angular.module('getUpdates', []);\n\t\n\t var utils = function () {\n\t var rip = function rip(obj, level) {\n\t if (level < 1) return {};\n\t\n\t return _underscore2.default.reduce(obj, function (clone, v, k) {\n\t v = _underscore2.default.isObject(v) ? rip(v, --level) : v;\n\t clone[k] = v;\n\t return clone;\n\t }, {});\n\t };\n\t\n\t var toPaths = function toPaths(obj) {\n\t var keys = getKeyPaths(obj);\n\t var values = getDeepValues(obj);\n\t return _underscore2.default.object(keys, values);\n\t };\n\t\n\t var getKeyPaths = function getKeyPaths(obj) {\n\t var keys = _underscore2.default.keys(obj).map(function (k) {\n\t var v = obj[k];\n\t if (!_underscore2.default.isObject(v) || _underscore2.default.isEmpty(v) || _underscore2.default.isArray(v)) return k;\n\t\n\t return getKeyPaths(v).map(function (subKey) {\n\t return k + '.' + subKey;\n\t });\n\t });\n\t\n\t return _underscore2.default.flatten(keys);\n\t };\n\t\n\t var getDeepValues = function getDeepValues(obj, arr) {\n\t arr = arr || [];\n\t\n\t _underscore2.default.values(obj).forEach(function (v) {\n\t if (!_underscore2.default.isObject(v) || _underscore2.default.isEmpty(v) || _underscore2.default.isArray(v)) arr.push(v);else getDeepValues(v, arr);\n\t });\n\t\n\t return arr;\n\t };\n\t\n\t var flatten = function flatten(arr) {\n\t return arr.reduce(function (flattened, v, i) {\n\t if (_underscore2.default.isArray(v) && !_underscore2.default.isEmpty(v)) flattened.push.apply(flattened, flatten(v));else flattened.push(v);\n\t\n\t return flattened;\n\t }, []);\n\t };\n\t\n\t var setFilled = function setFilled(obj, k, v) {\n\t if (!_underscore2.default.isEmpty(v)) obj[k] = v;\n\t };\n\t\n\t var assert = function assert(result, msg) {\n\t if (!result) throwErr(msg);\n\t };\n\t\n\t var throwErr = function throwErr(msg) {\n\t throw Error('get-updates error - ' + msg);\n\t };\n\t\n\t return {\n\t rip: rip,\n\t toPaths: toPaths,\n\t getKeyPaths: getKeyPaths,\n\t getDeepValues: getDeepValues,\n\t setFilled: setFilled,\n\t assert: assert,\n\t throwErr: throwErr\n\t };\n\t }();\n\t\n\t var getDifference = function () {\n\t var getDifference = function getDifference(src, dst, isShallow) {\n\t var level;\n\t\n\t if (isShallow > 1) level = isShallow;else if (isShallow) level = 1;\n\t\n\t if (level) {\n\t src = utils.rip(src, level);\n\t dst = utils.rip(dst, level);\n\t }\n\t\n\t return compare(src, dst);\n\t };\n\t\n\t var compare = function compare(src, dst) {\n\t var srcKeys = _underscore2.default.keys(src);\n\t var dstKeys = _underscore2.default.keys(dst);\n\t\n\t var keys = _underscore2.default.chain([]).concat(srcKeys).concat(dstKeys).uniq().without('$$hashKey').value();\n\t\n\t return keys.reduce(function (diff, k) {\n\t var srcValue = src[k];\n\t var dstValue = dst[k];\n\t\n\t if (_underscore2.default.isDate(srcValue) && _underscore2.default.isDate(dstValue)) {\n\t if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n\t }\n\t\n\t if (_underscore2.default.isObject(srcValue) && _underscore2.default.isObject(dstValue)) {\n\t var valueDiff = getDifference(srcValue, dstValue);\n\t utils.setFilled(diff, k, valueDiff);\n\t } else if (srcValue !== dstValue) {\n\t diff[k] = dstValue;\n\t }\n\t\n\t return diff;\n\t }, {});\n\t };\n\t\n\t return getDifference;\n\t }();\n\t\n\t var getUpdates = function () {\n\t var getUpdates = function getUpdates(src, dst, isShallow) {\n\t utils.assert(_underscore2.default.isObject(src), 'first argument must be an object');\n\t utils.assert(_underscore2.default.isObject(dst), 'second argument must be an object');\n\t\n\t var diff = getDifference(src, dst, isShallow);\n\t var paths = utils.toPaths(diff);\n\t\n\t var set = createSet(paths);\n\t var unset = createUnset(paths);\n\t var pull = createPull(unset);\n\t\n\t var updates = {};\n\t utils.setFilled(updates, '$set', set);\n\t utils.setFilled(updates, '$unset', unset);\n\t utils.setFilled(updates, '$pull', pull);\n\t\n\t return updates;\n\t };\n\t\n\t var createSet = function createSet(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t return _underscore2.default.omit(paths, undefinedKeys);\n\t };\n\t\n\t var createUnset = function createUnset(paths) {\n\t var undefinedKeys = getUndefinedKeys(paths);\n\t var unset = _underscore2.default.pick(paths, undefinedKeys);\n\t\n\t return _underscore2.default.reduce(unset, function (result, v, k) {\n\t result[k] = true;\n\t return result;\n\t }, {});\n\t };\n\t\n\t var createPull = function createPull(unset) {\n\t var arrKeyPaths = _underscore2.default.keys(unset).map(function (k) {\n\t var split = k.match(/(.*)\\.\\d+$/);\n\t return split && split[1];\n\t });\n\t\n\t return _underscore2.default.compact(arrKeyPaths).reduce(function (pull, k) {\n\t pull[k] = null;\n\t return pull;\n\t }, {});\n\t };\n\t\n\t var getUndefinedKeys = function getUndefinedKeys(obj) {\n\t return _underscore2.default.keys(obj).filter(function (k) {\n\t var v = obj[k];\n\t return _underscore2.default.isUndefined(v);\n\t });\n\t };\n\t\n\t return getUpdates;\n\t }();\n\t\n\t module.value('getUpdates', getUpdates);\n\t})();\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _underscore = __webpack_require__(3);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tif (typeof _underscore2.default === 'undefined') {\n\t if (typeof Package.underscore === 'undefined') {\n\t throw new Error('underscore is missing');\n\t }\n\t}\n\t\n\texports.default = _underscore2.default || Package.underscore._;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict'; /*global\n\t angular, _, Package\n\t */\n\t\n\tvar _module = angular.module('diffArray', ['getUpdates']);\n\t\n\t_module.factory('diffArray', ['getUpdates', function (getUpdates) {\n\t var LocalCollection = Package.minimongo.LocalCollection;\n\t var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n\t var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\t\n\t // Calculates the differences between `lastSeqArray` and\n\t // `seqArray` and calls appropriate functions from `callbacks`.\n\t // Reuses Minimongo's diff algorithm implementation.\n\t // XXX Should be replaced with the original diffArray function here:\n\t // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n\t // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n\t function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n\t preventNestedDiff = !!preventNestedDiff;\n\t\n\t var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges || Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\t\n\t var oldObjIds = [];\n\t var newObjIds = [];\n\t var posOld = {}; // maps from idStringify'd ids\n\t var posNew = {}; // ditto\n\t var posCur = {};\n\t var lengthCur = lastSeqArray.length;\n\t\n\t _underscore2.default.each(seqArray, function (doc, i) {\n\t newObjIds.push({ _id: doc._id });\n\t posNew[idStringify(doc._id)] = i;\n\t });\n\t\n\t _underscore2.default.each(lastSeqArray, function (doc, i) {\n\t oldObjIds.push({ _id: doc._id });\n\t posOld[idStringify(doc._id)] = i;\n\t posCur[idStringify(doc._id)] = i;\n\t });\n\t\n\t // Arrays can contain arbitrary objects. We don't diff the\n\t // objects. Instead we always fire 'changedAt' callback on every\n\t // object. The consumer of `observe-sequence` should deal with\n\t // it appropriately.\n\t diffFn(oldObjIds, newObjIds, {\n\t addedBefore: function addedBefore(id, doc, before) {\n\t var position = before ? posCur[idStringify(before)] : lengthCur;\n\t\n\t _underscore2.default.each(posCur, function (pos, id) {\n\t if (pos >= position) posCur[id]++;\n\t });\n\t\n\t lengthCur++;\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.addedAt(id, seqArray[posNew[idStringify(id)]], position, before);\n\t },\n\t\n\t movedBefore: function movedBefore(id, before) {\n\t var prevPosition = posCur[idStringify(id)];\n\t var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\t\n\t _underscore2.default.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition && pos <= position) posCur[id]--;else if (pos <= prevPosition && pos >= position) posCur[id]++;\n\t });\n\t\n\t posCur[idStringify(id)] = position;\n\t\n\t callbacks.movedTo(id, seqArray[posNew[idStringify(id)]], prevPosition, position, before);\n\t },\n\t removed: function removed(id) {\n\t var prevPosition = posCur[idStringify(id)];\n\t\n\t _underscore2.default.each(posCur, function (pos, id) {\n\t if (pos >= prevPosition) posCur[id]--;\n\t });\n\t\n\t delete posCur[idStringify(id)];\n\t lengthCur--;\n\t\n\t callbacks.removedAt(id, lastSeqArray[posOld[idStringify(id)]], prevPosition);\n\t }\n\t });\n\t\n\t _underscore2.default.each(posNew, function (pos, idString) {\n\t if (!_underscore2.default.has(posOld, idString)) return;\n\t\n\t var id = idParse(idString);\n\t var newItem = seqArray[pos] || {};\n\t var oldItem = lastSeqArray[posOld[idString]];\n\t var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\t\n\t if (!_underscore2.default.isEmpty(updates)) callbacks.changedAt(id, updates, pos, oldItem);\n\t });\n\t }\n\t\n\t diffArray.shallow = function (lastSeqArray, seqArray, callbacks) {\n\t return diffArray(lastSeqArray, seqArray, callbacks, true);\n\t };\n\t\n\t diffArray.deepCopyChanges = function (oldItem, newItem) {\n\t var setDiff = getUpdates(oldItem, newItem).$set;\n\t\n\t _underscore2.default.each(setDiff, function (v, deepKey) {\n\t setDeep(oldItem, deepKey, v);\n\t });\n\t };\n\t\n\t diffArray.deepCopyRemovals = function (oldItem, newItem) {\n\t var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\t\n\t _underscore2.default.each(unsetDiff, function (v, deepKey) {\n\t unsetDeep(oldItem, deepKey);\n\t });\n\t };\n\t\n\t // Finds changes between two collections\n\t diffArray.getChanges = function (newCollection, oldCollection, diffMethod) {\n\t var changes = { added: [], removed: [], changed: [] };\n\t\n\t diffMethod(oldCollection, newCollection, {\n\t addedAt: function addedAt(id, item, index) {\n\t changes.added.push({ item: item, index: index });\n\t },\n\t\n\t removedAt: function removedAt(id, item, index) {\n\t changes.removed.push({ item: item, index: index });\n\t },\n\t\n\t changedAt: function changedAt(id, updates, index, oldItem) {\n\t changes.changed.push({ selector: id, modifier: updates });\n\t },\n\t\n\t movedTo: function movedTo(id, item, fromIndex, toIndex) {\n\t // XXX do we need this?\n\t }\n\t });\n\t\n\t return changes;\n\t };\n\t\n\t var setDeep = function setDeep(obj, deepKey, v) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _underscore2.default.initial(split);\n\t var lastKey = _underscore2.default.last(split);\n\t\n\t initialKeys.reduce(function (subObj, k, i) {\n\t var nextKey = split[i + 1];\n\t\n\t if (isNumStr(nextKey)) {\n\t if (subObj[k] === null) subObj[k] = [];\n\t if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n\t } else if (subObj[k] === null || !isHash(subObj[k])) {\n\t subObj[k] = {};\n\t }\n\t\n\t return subObj[k];\n\t }, obj);\n\t\n\t var deepObj = getDeep(obj, initialKeys);\n\t deepObj[lastKey] = v;\n\t return v;\n\t };\n\t\n\t var unsetDeep = function unsetDeep(obj, deepKey) {\n\t var split = deepKey.split('.');\n\t var initialKeys = _underscore2.default.initial(split);\n\t var lastKey = _underscore2.default.last(split);\n\t var deepObj = getDeep(obj, initialKeys);\n\t\n\t if (_underscore2.default.isArray(deepObj) && isNumStr(lastKey)) return !!deepObj.splice(lastKey, 1);else return delete deepObj[lastKey];\n\t };\n\t\n\t var getDeep = function getDeep(obj, keys) {\n\t return keys.reduce(function (subObj, k) {\n\t return subObj[k];\n\t }, obj);\n\t };\n\t\n\t var isHash = function isHash(obj) {\n\t return _underscore2.default.isObject(obj) && Object.getPrototypeOf(obj) === Object.prototype;\n\t };\n\t\n\t var isNumStr = function isNumStr(str) {\n\t return str.match(/^\\d+$/);\n\t };\n\t\n\t return diffArray;\n\t}]);\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.settings', []).constant('$angularMeteorSettings', {\n\t suppressWarnings: true\n\t});\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tangular.module('angular-meteor.ironrouter', []).run(['$compile', '$document', '$rootScope', function ($compile, $document, $rootScope) {\n\t var Router = (Package['iron:router'] || {}).Router;\n\t if (!Router) return;\n\t\n\t var isLoaded = false;\n\t\n\t // Recompile after iron:router builds page\n\t Router.onAfterAction(function (req, res, next) {\n\t Tracker.afterFlush(function () {\n\t if (isLoaded) return;\n\t $compile($document)($rootScope);\n\t if (!$rootScope.$$phase) $rootScope.$apply();\n\t isLoaded = true;\n\t });\n\t });\n\t}]);\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; }; /*global\n\t angular, _, Tracker, EJSON, FS, Mongo\n\t */\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict';\n\t\n\tvar angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']);\n\t\n\tangularMeteorUtils.service('$meteorUtils', ['$q', '$timeout', '$angularMeteorSettings', function ($q, $timeout, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this.autorun = function (scope, fn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t // wrapping around Deps.autorun\n\t var comp = Tracker.autorun(function (c) {\n\t fn(c);\n\t // this is run immediately for the first call\n\t // but after that, we need to $apply to start Angular digest\n\t if (!c.firstRun) $timeout(angular.noop, 0);\n\t });\n\t\n\t // stop autorun when scope is destroyed\n\t scope.$on('$destroy', function () {\n\t comp.stop();\n\t });\n\t\n\t // return autorun object so that it can be stopped manually\n\t return comp;\n\t };\n\t\n\t // Borrowed from angularFire\n\t // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n\t this.stripDollarPrefixedKeys = function (data) {\n\t if (!_underscore2.default.isObject(data) || data instanceof Date || data instanceof File || EJSON.toJSONValue(data).$type === 'oid' || (typeof FS === 'undefined' ? 'undefined' : _typeof(FS)) === 'object' && data instanceof FS.File) return data;\n\t\n\t var out = _underscore2.default.isArray(data) ? [] : {};\n\t\n\t _underscore2.default.each(data, function (v, k) {\n\t if (typeof k !== 'string' || k.charAt(0) !== '$') out[k] = self.stripDollarPrefixedKeys(v);\n\t });\n\t\n\t return out;\n\t };\n\t\n\t // Returns a callback which fulfills promise\n\t this.fulfill = function (deferred, boundError, boundResult) {\n\t return function (err, result) {\n\t if (err) deferred.reject(boundError == null ? err : boundError);else if (typeof boundResult == \"function\") deferred.resolve(boundResult == null ? result : boundResult(result));else deferred.resolve(boundResult == null ? result : boundResult);\n\t };\n\t };\n\t\n\t // creates a function which invokes method with the given arguments and returns a promise\n\t this.promissor = function (obj, method) {\n\t return function () {\n\t var deferred = $q.defer();\n\t var fulfill = self.fulfill(deferred);\n\t var args = _underscore2.default.toArray(arguments).concat(fulfill);\n\t obj[method].apply(obj, args);\n\t return deferred.promise;\n\t };\n\t };\n\t\n\t // creates a $q.all() promise and call digestion loop on fulfillment\n\t this.promiseAll = function (promises) {\n\t var allPromise = $q.all(promises);\n\t\n\t allPromise.finally(function () {\n\t // calls digestion loop with no conflicts\n\t $timeout(angular.noop);\n\t });\n\t\n\t return allPromise;\n\t };\n\t\n\t this.getCollectionByName = function (string) {\n\t return Mongo.Collection.get(string);\n\t };\n\t\n\t this.findIndexById = function (collection, doc) {\n\t var foundDoc = _underscore2.default.find(collection, function (colDoc) {\n\t // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n\t return EJSON.equals(colDoc._id, doc._id);\n\t });\n\t\n\t return _underscore2.default.indexOf(collection, foundDoc);\n\t };\n\t}]);\n\t\n\tangularMeteorUtils.run(['$rootScope', '$meteorUtils', function ($rootScope, $meteorUtils) {\n\t Object.getPrototypeOf($rootScope).$meteorAutorun = function (fn) {\n\t return $meteorUtils.autorun(this, fn);\n\t };\n\t}]);\n\n/***/ },\n/* 8 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Meteor\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']);\n\t\n\tangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings', function ($q, $angularMeteorSettings) {\n\t\n\t var self = this;\n\t\n\t this._subscribe = function (scope, deferred, args) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var subscription = null;\n\t var lastArg = args[args.length - 1];\n\t\n\t // User supplied onStop callback\n\t // save it for later use and remove\n\t // from subscription arguments\n\t if (angular.isObject(lastArg) && angular.isFunction(lastArg.onStop)) {\n\t var _onStop = lastArg.onStop;\n\t\n\t args.pop();\n\t }\n\t\n\t args.push({\n\t onReady: function onReady() {\n\t deferred.resolve(subscription);\n\t },\n\t onStop: function onStop(err) {\n\t if (!deferred.promise.$$state.status) {\n\t if (err) deferred.reject(err);else deferred.reject(new Meteor.Error(\"Subscription Stopped\", \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n\t } else if (_onStop)\n\t // After promise was resolved or rejected\n\t // call user supplied onStop callback.\n\t _onStop.apply(this, Array.prototype.slice.call(arguments));\n\t }\n\t });\n\t\n\t subscription = Meteor.subscribe.apply(scope, args);\n\t\n\t return subscription;\n\t };\n\t\n\t this.subscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t var subscription = null;\n\t\n\t self._subscribe(this, deferred, args);\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\t\n\tangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe', function ($rootScope, $q, $meteorSubscribe) {\n\t Object.getPrototypeOf($rootScope).$meteorSubscribe = function () {\n\t var deferred = $q.defer();\n\t var args = Array.prototype.slice.call(arguments);\n\t\n\t var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\t\n\t this.$on('$destroy', function () {\n\t subscription.stop();\n\t });\n\t\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict'; /*global\n\t angular, _, Tracker, check, Match, Mongo\n\t */\n\t\n\tvar angularMeteorCollection = angular.module('angular-meteor.collection', ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']);\n\t\n\t// The reason angular meteor collection is a factory function and not something\n\t// that inherit from array comes from here:\n\t// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n\t// We went with the direct extensions approach.\n\tangularMeteorCollection.factory('AngularMeteorCollection', ['$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\t\n\t function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var data = [];\n\t // Server backup data to evaluate what changes come from client\n\t // after each server update.\n\t data._serverBackup = [];\n\t // Array differ function.\n\t data._diffArrayFunc = diffArrayFunc;\n\t // Handler of the cursor observer.\n\t data._hObserve = null;\n\t // On new cursor autorun handler\n\t // (autorun for reactive variables).\n\t data._hNewCurAutorun = null;\n\t // On new data autorun handler\n\t // (autorun for cursor.fetch).\n\t data._hDataAutorun = null;\n\t\n\t if (angular.isDefined(collection)) {\n\t data.$$collection = collection;\n\t } else {\n\t var cursor = curDefFunc();\n\t data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n\t }\n\t\n\t _underscore2.default.extend(data, AngularMeteorCollection);\n\t data._startCurAutorun(curDefFunc, autoClientSave);\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorCollection._startCurAutorun = function (curDefFunc, autoClientSave) {\n\t var self = this;\n\t\n\t self._hNewCurAutorun = Tracker.autorun(function () {\n\t // When the reactive func gets recomputated we need to stop any previous\n\t // observeChanges.\n\t Tracker.onInvalidate(function () {\n\t self._stopCursor();\n\t });\n\t\n\t if (autoClientSave) self._setAutoClientSave();\n\t self._updateCursor(curDefFunc(), autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorCollection.save = function (docs, useUnsetModifier) {\n\t // save whole collection\n\t if (!docs) docs = this;\n\t // save single doc\n\t docs = [].concat(docs);\n\t\n\t var promises = docs.map(function (doc) {\n\t return this._upsertDoc(doc, useUnsetModifier);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._upsertDoc = function (doc, useUnsetModifier) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _underscore2.default.partial($meteorUtils.fulfill, deferred, null);\n\t\n\t // delete $$hashkey\n\t doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n\t var docId = doc._id;\n\t var isExist = collection.findOne(docId);\n\t\n\t // update\n\t if (isExist) {\n\t // Deletes _id property (from the copy) so that\n\t // it can be $set using update.\n\t delete doc._id;\n\t var modifier = useUnsetModifier ? { $unset: doc } : { $set: doc };\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t collection.update(docId, modifier, createFulfill(function () {\n\t return { _id: docId, action: 'updated' };\n\t }));\n\t }\n\t // insert\n\t else {\n\t collection.insert(doc, createFulfill(function (id) {\n\t return { _id: id, action: 'inserted' };\n\t }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t // performs $pull operations parallely.\n\t // used for handling splice operations returned from getUpdates() to prevent conflicts.\n\t // see issue: https://github.com/Urigo/angular-meteor/issues/793\n\t AngularMeteorCollection._updateDiff = function (selector, update, callback) {\n\t callback = callback || angular.noop;\n\t var setters = _underscore2.default.omit(update, '$pull');\n\t var updates = [setters];\n\t\n\t _underscore2.default.each(update.$pull, function (pull, prop) {\n\t var puller = {};\n\t puller[prop] = pull;\n\t updates.push({ $pull: puller });\n\t });\n\t\n\t this._updateParallel(selector, updates, callback);\n\t };\n\t\n\t // performs each update operation parallely\n\t AngularMeteorCollection._updateParallel = function (selector, updates, callback) {\n\t var self = this;\n\t var done = _underscore2.default.after(updates.length, callback);\n\t\n\t var next = function next(err, affectedDocsNum) {\n\t if (err) return callback(err);\n\t done(null, affectedDocsNum);\n\t };\n\t\n\t _underscore2.default.each(updates, function (update) {\n\t self.$$collection.update(selector, update, next);\n\t });\n\t };\n\t\n\t AngularMeteorCollection.remove = function (keyOrDocs) {\n\t var keys;\n\t\n\t // remove whole collection\n\t if (!keyOrDocs) {\n\t keys = _underscore2.default.pluck(this, '_id');\n\t }\n\t // remove docs\n\t else {\n\t keyOrDocs = [].concat(keyOrDocs);\n\t\n\t keys = _underscore2.default.map(keyOrDocs, function (keyOrDoc) {\n\t return keyOrDoc._id || keyOrDoc;\n\t });\n\t }\n\t\n\t // Checks if all keys are correct.\n\t check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\t\n\t var promises = keys.map(function (key) {\n\t return this._removeDoc(key);\n\t }, this);\n\t\n\t return $meteorUtils.promiseAll(promises);\n\t };\n\t\n\t AngularMeteorCollection._removeDoc = function (id) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n\t collection.remove(id, fulfill);\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorCollection._updateCursor = function (cursor, autoClientSave) {\n\t var self = this;\n\t // XXX - consider adding an option for a non-orderd result for faster performance\n\t if (self._hObserve) self._stopObserving();\n\t\n\t self._hObserve = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t self.splice(atIndex, 0, doc);\n\t self._serverBackup.splice(atIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t diffArray.deepCopyChanges(self[atIndex], doc);\n\t diffArray.deepCopyRemovals(self[atIndex], doc);\n\t self._serverBackup[atIndex] = self[atIndex];\n\t self._setServerUpdateMode();\n\t },\n\t\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t self.splice(fromIndex, 1);\n\t self.splice(toIndex, 0, doc);\n\t self._serverBackup.splice(fromIndex, 1);\n\t self._serverBackup.splice(toIndex, 0, doc);\n\t self._setServerUpdateMode();\n\t },\n\t\n\t removedAt: function removedAt(oldDoc) {\n\t var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self.splice(removedIndex, 1);\n\t self._serverBackup.splice(removedIndex, 1);\n\t self._setServerUpdateMode();\n\t } else {\n\t // If it's been removed on client then it's already not in collection\n\t // itself but still is in the _serverBackup.\n\t removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\t\n\t if (removedIndex != -1) {\n\t self._serverBackup.splice(removedIndex, 1);\n\t }\n\t }\n\t }\n\t });\n\t\n\t self._hDataAutorun = Tracker.autorun(function () {\n\t cursor.fetch();\n\t if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n\t });\n\t };\n\t\n\t AngularMeteorCollection._stopObserving = function () {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t delete this._serverMode;\n\t delete this._hUnsetTimeout;\n\t };\n\t\n\t AngularMeteorCollection._setServerUpdateMode = function (name) {\n\t this._serverMode = true;\n\t // To simplify server update logic, we don't follow\n\t // updates from the client at the same time.\n\t this._unsetAutoClientSave();\n\t };\n\t\n\t // Here we use $timeout to combine multiple updates that go\n\t // each one after another.\n\t AngularMeteorCollection._unsetServerUpdateMode = function (autoClientSave) {\n\t var self = this;\n\t\n\t if (self._hUnsetTimeout) {\n\t $timeout.cancel(self._hUnsetTimeout);\n\t self._hUnsetTimeout = null;\n\t }\n\t\n\t self._hUnsetTimeout = $timeout(function () {\n\t self._serverMode = false;\n\t // Finds updates that was potentially done from the client side\n\t // and saves them.\n\t var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n\t self._saveChanges(changes);\n\t // After, continues following client updates.\n\t if (autoClientSave) self._setAutoClientSave();\n\t }, 0);\n\t };\n\t\n\t AngularMeteorCollection.stop = function () {\n\t this._stopCursor();\n\t this._hNewCurAutorun.stop();\n\t };\n\t\n\t AngularMeteorCollection._stopCursor = function () {\n\t this._unsetAutoClientSave();\n\t\n\t if (this._hObserve) {\n\t this._hObserve.stop();\n\t this._hDataAutorun.stop();\n\t }\n\t\n\t this.splice(0);\n\t this._serverBackup.splice(0);\n\t };\n\t\n\t AngularMeteorCollection._unsetAutoClientSave = function (name) {\n\t if (this._hRegAutoBind) {\n\t this._hRegAutoBind();\n\t this._hRegAutoBind = null;\n\t }\n\t };\n\t\n\t AngularMeteorCollection._setAutoClientSave = function () {\n\t var self = this;\n\t\n\t // Always unsets auto save to keep only one $watch handler.\n\t self._unsetAutoClientSave();\n\t\n\t self._hRegAutoBind = $rootScope.$watch(function () {\n\t return self;\n\t }, function (nItems, oItems) {\n\t if (nItems === oItems) return;\n\t\n\t var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n\t self._unsetAutoClientSave();\n\t self._saveChanges(changes);\n\t self._setAutoClientSave();\n\t }, true);\n\t };\n\t\n\t AngularMeteorCollection._saveChanges = function (changes) {\n\t var self = this;\n\t\n\t // Saves added documents\n\t // Using reversed iteration to prevent indexes from changing during splice\n\t var addedDocs = changes.added.reverse().map(function (descriptor) {\n\t self.splice(descriptor.index, 1);\n\t return descriptor.item;\n\t });\n\t\n\t if (addedDocs.length) self.save(addedDocs);\n\t\n\t // Removes deleted documents\n\t var removedDocs = changes.removed.map(function (descriptor) {\n\t return descriptor.item;\n\t });\n\t\n\t if (removedDocs.length) self.remove(removedDocs);\n\t\n\t // Updates changed documents\n\t changes.changed.forEach(function (descriptor) {\n\t self._updateDiff(descriptor.selector, descriptor.modifier);\n\t });\n\t };\n\t\n\t return AngularMeteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollectionFS', ['$meteorCollection', 'diffArray', '$angularMeteorSettings', function ($meteorCollection, diffArray, $angularMeteorSettings) {\n\t function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\t\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n\t }\n\t\n\t return $meteorCollectionFS;\n\t}]);\n\t\n\tangularMeteorCollection.factory('$meteorCollection', ['AngularMeteorCollection', '$rootScope', 'diffArray', function (AngularMeteorCollection, $rootScope, diffArray) {\n\t function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n\t // Validate parameters\n\t if (!reactiveFunc) {\n\t throw new TypeError('The first argument of $meteorCollection is undefined.');\n\t }\n\t\n\t if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n\t throw new TypeError('The first argument of $meteorCollection must be a function or ' + 'a have a find function property.');\n\t }\n\t\n\t if (!angular.isFunction(reactiveFunc)) {\n\t collection = angular.isDefined(collection) ? collection : reactiveFunc;\n\t reactiveFunc = _underscore2.default.bind(reactiveFunc.find, reactiveFunc);\n\t }\n\t\n\t // By default auto save - true.\n\t autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n\t diffFn = diffFn || diffArray;\n\t return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n\t }\n\t\n\t return $meteorCollection;\n\t}]);\n\t\n\tangularMeteorCollection.run(['$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper', function ($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n\t scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n\t}]);\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict'; /*global\n\t angular, _, Mongo\n\t */\n\t\n\tvar angularMeteorObject = angular.module('angular-meteor.object', ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']);\n\t\n\tangularMeteorObject.factory('AngularMeteorObject', ['$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings', function ($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\t\n\t // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n\t AngularMeteorObject.$$internalProps = ['$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope', 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject', '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'];\n\t\n\t function AngularMeteorObject(collection, selector, options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t // Make data not be an object so we can extend it to preserve\n\t // Collection Helpers and the like\n\t var helpers = collection._helpers;\n\t var data = _underscore2.default.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n\t var doc = collection.findOne(selector, options);\n\t var collectionExtension = _underscore2.default.pick(AngularMeteorCollection, '_updateParallel');\n\t _underscore2.default.extend(data, doc);\n\t _underscore2.default.extend(data, AngularMeteorObject);\n\t _underscore2.default.extend(data, collectionExtension);\n\t\n\t // Omit options that may spoil document finding\n\t data.$$options = _underscore2.default.omit(options, 'skip', 'limit');\n\t data.$$collection = collection;\n\t data.$$id = data._getId(selector);\n\t data._serverBackup = doc || {};\n\t\n\t return data;\n\t }\n\t\n\t AngularMeteorObject.getRawObject = function () {\n\t return angular.copy(_underscore2.default.omit(this, this.$$internalProps));\n\t };\n\t\n\t AngularMeteorObject.subscribe = function () {\n\t $meteorSubscribe.subscribe.apply(this, arguments);\n\t return this;\n\t };\n\t\n\t AngularMeteorObject.save = function (custom) {\n\t var deferred = $q.defer();\n\t var collection = this.$$collection;\n\t var createFulfill = _underscore2.default.partial($meteorUtils.fulfill, deferred, null);\n\t var oldDoc = collection.findOne(this.$$id);\n\t var mods;\n\t\n\t // update\n\t if (oldDoc) {\n\t if (custom) mods = { $set: custom };else {\n\t mods = getUpdates(oldDoc, this.getRawObject());\n\t // If there are no updates, there is nothing to do here, returning\n\t if (_underscore2.default.isEmpty(mods)) {\n\t return $q.when({ action: 'updated' });\n\t }\n\t }\n\t\n\t // NOTE: do not use #upsert() method, since it does not exist in some collections\n\t this._updateDiff(mods, createFulfill({ action: 'updated' }));\n\t }\n\t // insert\n\t else {\n\t if (custom) mods = _underscore2.default.clone(custom);else mods = this.getRawObject();\n\t\n\t mods._id = mods._id || this.$$id;\n\t collection.insert(mods, createFulfill({ action: 'inserted' }));\n\t }\n\t\n\t return deferred.promise;\n\t };\n\t\n\t AngularMeteorObject._updateDiff = function (update, callback) {\n\t var selector = this.$$id;\n\t AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n\t };\n\t\n\t AngularMeteorObject.reset = function (keepClientProps) {\n\t var self = this;\n\t var options = this.$$options;\n\t var id = this.$$id;\n\t var doc = this.$$collection.findOne(id, options);\n\t\n\t if (doc) {\n\t // extend SubObject\n\t var docKeys = _underscore2.default.keys(doc);\n\t var docExtension = _underscore2.default.pick(doc, docKeys);\n\t var clientProps;\n\t\n\t _underscore2.default.extend(self, docExtension);\n\t _underscore2.default.extend(self._serverBackup, docExtension);\n\t\n\t if (keepClientProps) {\n\t clientProps = _underscore2.default.intersection(_underscore2.default.keys(self), _underscore2.default.keys(self._serverBackup));\n\t } else {\n\t clientProps = _underscore2.default.keys(self);\n\t }\n\t\n\t var serverProps = _underscore2.default.keys(doc);\n\t var removedKeys = _underscore2.default.difference(clientProps, serverProps, self.$$internalProps);\n\t\n\t removedKeys.forEach(function (prop) {\n\t delete self[prop];\n\t delete self._serverBackup[prop];\n\t });\n\t } else {\n\t _underscore2.default.keys(this.getRawObject()).forEach(function (prop) {\n\t delete self[prop];\n\t });\n\t\n\t self._serverBackup = {};\n\t }\n\t };\n\t\n\t AngularMeteorObject.stop = function () {\n\t if (this.unregisterAutoDestroy) this.unregisterAutoDestroy();\n\t\n\t if (this.unregisterAutoBind) this.unregisterAutoBind();\n\t\n\t if (this.autorunComputation && this.autorunComputation.stop) this.autorunComputation.stop();\n\t };\n\t\n\t AngularMeteorObject._getId = function (selector) {\n\t var options = _underscore2.default.extend({}, this.$$options, {\n\t fields: { _id: 1 },\n\t reactive: false,\n\t transform: null\n\t });\n\t\n\t var doc = this.$$collection.findOne(selector, options);\n\t\n\t if (doc) return doc._id;\n\t if (selector instanceof Mongo.ObjectID) return selector;\n\t if (_underscore2.default.isString(selector)) return selector;\n\t return new Mongo.ObjectID();\n\t };\n\t\n\t return AngularMeteorObject;\n\t}]);\n\t\n\tangularMeteorObject.factory('$meteorObject', ['$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject', function ($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n\t function $meteorObject(collection, id, auto, options) {\n\t // Validate parameters\n\t if (!collection) {\n\t throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n\t }\n\t\n\t if (!angular.isFunction(collection.findOne)) {\n\t throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n\t }\n\t\n\t var data = new AngularMeteorObject(collection, id, options);\n\t // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n\t data._auto = auto !== false;\n\t _underscore2.default.extend(data, $meteorObject);\n\t data._setAutos();\n\t return data;\n\t }\n\t\n\t $meteorObject._setAutos = function () {\n\t var self = this;\n\t\n\t this.autorunComputation = $meteorUtils.autorun($rootScope, function () {\n\t self.reset(true);\n\t });\n\t\n\t // Deep watches the model and performs autobind\n\t this.unregisterAutoBind = this._auto && $rootScope.$watch(function () {\n\t return self.getRawObject();\n\t }, function (item, oldItem) {\n\t if (item !== oldItem) self.save();\n\t }, true);\n\t\n\t this.unregisterAutoDestroy = $rootScope.$on('$destroy', function () {\n\t if (self && self.stop) self.pop();\n\t });\n\t };\n\t\n\t return $meteorObject;\n\t}]);\n\t\n\tangularMeteorObject.run(['$rootScope', '$meteorObject', '$meteorStopper', function ($rootScope, $meteorObject, $meteorStopper) {\n\t var scopeProto = Object.getPrototypeOf($rootScope);\n\t scopeProto.$meteorObject = $meteorStopper($meteorObject);\n\t}]);\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict'; /*global\n\t angular, _, Package, Meteor\n\t */\n\t\n\tvar angularMeteorUser = angular.module('angular-meteor.user', ['angular-meteor.utils', 'angular-meteor.core', 'angular-meteor.settings']);\n\t\n\t// requires package 'accounts-password'\n\tangularMeteorUser.service('$meteorUser', ['$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings', function ($rootScope, $meteorUtils, $q, $angularMeteorSettings) {\n\t\n\t var pack = Package['accounts-base'];\n\t if (!pack) return;\n\t\n\t var self = this;\n\t var Accounts = pack.Accounts;\n\t\n\t this.waitForUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) deferred.resolve(Meteor.user());\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireUser = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) {\n\t console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t }\n\t\n\t var deferred = $q.defer();\n\t\n\t $meteorUtils.autorun($rootScope, function () {\n\t if (!Meteor.loggingIn()) {\n\t if (Meteor.user() === null) deferred.reject(\"AUTH_REQUIRED\");else deferred.resolve(Meteor.user());\n\t }\n\t }, true);\n\t\n\t return deferred.promise;\n\t };\n\t\n\t this.requireValidUser = function (validatorFn) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t return self.requireUser(true).then(function (user) {\n\t var valid = validatorFn(user);\n\t\n\t if (valid === true) return user;else if (typeof valid === \"string\") return $q.reject(valid);else return $q.reject(\"FORBIDDEN\");\n\t });\n\t };\n\t\n\t this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n\t this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n\t this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n\t this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n\t this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n\t this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n\t this.logout = $meteorUtils.promissor(Meteor, 'logout');\n\t this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n\t this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n\t this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n\t this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n\t this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n\t this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n\t this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n\t this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n\t}]);\n\t\n\tangularMeteorUser.run(['$rootScope', '$angularMeteorSettings', '$$Core', function ($rootScope, $angularMeteorSettings, $$Core) {\n\t\n\t var ScopeProto = Object.getPrototypeOf($rootScope);\n\t _underscore2.default.extend(ScopeProto, $$Core);\n\t\n\t $rootScope.autorun(function () {\n\t if (!Meteor.user) return;\n\t $rootScope.currentUser = Meteor.user();\n\t $rootScope.loggingIn = Meteor.loggingIn();\n\t });\n\t}]);\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t'use strict'; /*global\n\t angular, _, Meteor\n\t */\n\t\n\tvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\tangularMeteorMethods.service('$meteorMethods', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t this.call = function () {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var deferred = $q.defer();\n\t var fulfill = $meteorUtils.fulfill(deferred);\n\t var args = _underscore2.default.toArray(arguments).concat(fulfill);\n\t Meteor.call.apply(this, args);\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Session\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\tangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings', function ($meteorUtils, $parse, $angularMeteorSettings) {\n\t return function (session) {\n\t\n\t return {\n\t\n\t bind: function bind(scope, model) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t var getter = $parse(model);\n\t var setter = getter.assign;\n\t $meteorUtils.autorun(scope, function () {\n\t setter(scope, Session.get(session));\n\t });\n\t\n\t scope.$watch(model, function (newItem, oldItem) {\n\t Session.set(session, getter(scope));\n\t }, true);\n\t }\n\t };\n\t };\n\t}]);\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular, Package\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']);\n\t\n\t// requires package 'mdg:camera'\n\tangularMeteorCamera.service('$meteorCamera', ['$q', '$meteorUtils', '$angularMeteorSettings', function ($q, $meteorUtils, $angularMeteorSettings) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t var pack = Package['mdg:camera'];\n\t if (!pack) return;\n\t\n\t var MeteorCamera = pack.MeteorCamera;\n\t\n\t this.getPicture = function (options) {\n\t if (!$angularMeteorSettings.suppressWarnings) console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\t\n\t options = options || {};\n\t var deferred = $q.defer();\n\t MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n\t return deferred.promise;\n\t };\n\t}]);\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t/*global\n\t angular\n\t */\n\t\n\t'use strict';\n\t\n\tvar angularMeteorStopper = angular.module('angular-meteor.stopper', ['angular-meteor.subscribe']);\n\t\n\tangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe', function ($q, $meteorSubscribe) {\n\t function $meteorStopper($meteorEntity) {\n\t return function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t var meteorEntity = $meteorEntity.apply(this, args);\n\t\n\t angular.extend(meteorEntity, $meteorStopper);\n\t meteorEntity.$$scope = this;\n\t\n\t this.$on('$destroy', function () {\n\t meteorEntity.stop();\n\t if (meteorEntity.subscription) meteorEntity.subscription.stop();\n\t });\n\t\n\t return meteorEntity;\n\t };\n\t }\n\t\n\t $meteorStopper.subscribe = function () {\n\t var args = Array.prototype.slice.call(arguments);\n\t this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n\t return this;\n\t };\n\t\n\t return $meteorStopper;\n\t}]);\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.utils = exports.name = undefined;\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar name = exports.name = 'angular-meteor.utilities';\n\tvar utils = exports.utils = '$$utils';\n\t\n\tangular.module(name, [])\n\t\n\t/*\n\t A utility service which is provided with general utility functions\n\t */\n\t.service(utils, ['$rootScope', function ($rootScope) {\n\t var self = this;\n\t\n\t // Checks if an object is a cursor\n\t this.isCursor = function (obj) {\n\t return obj instanceof Meteor.Collection.Cursor;\n\t };\n\t\n\t // Cheecks if an object is a scope\n\t this.isScope = function (obj) {\n\t return obj instanceof $rootScope.constructor;\n\t };\n\t\n\t // Checks if an object is a view model\n\t this.isViewModel = function (obj) {\n\t return _underscore2.default.isObject(obj) && obj.$$dependencies;\n\t };\n\t\n\t // Checks if two objects are siblings\n\t this.areSiblings = function (obj1, obj2) {\n\t return _underscore2.default.isObject(obj1) && _underscore2.default.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n\t };\n\t\n\t // Binds function into a scpecified context. If an object is provided, will bind every\n\t // value in the object which is a function. If a tap function is provided, it will be\n\t // called right after the function has been invoked.\n\t this.bind = function (fn, context, tap) {\n\t tap = _underscore2.default.isFunction(tap) ? tap : angular.noop;\n\t if (_underscore2.default.isFunction(fn)) return bindFn(fn, context, tap);\n\t if (_underscore2.default.isObject(fn)) return bindObj(fn, context, tap);\n\t return fn;\n\t };\n\t\n\t function bindFn(fn, context, tap) {\n\t return function () {\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var result = fn.apply(context, args);\n\t tap.call(context, {\n\t result: result,\n\t args: args\n\t });\n\t return result;\n\t };\n\t }\n\t\n\t function bindObj(obj, context, tap) {\n\t return _underscore2.default.keys(obj).reduce(function (bound, k) {\n\t bound[k] = self.bind(obj[k], context, tap);\n\t return bound;\n\t }, {});\n\t }\n\t}]);\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Mixer = exports.name = undefined;\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar name = exports.name = 'angular-meteor.mixer';\n\tvar Mixer = exports.Mixer = '$Mixer';\n\t\n\tangular.module(name, [])\n\t\n\t/*\n\t A service which lets us apply mixins into Scope.prototype.\n\t The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n\t and any time a `ChildScope` prototype is created\n\t it will be extended by the `$Mixer`.\n\t This concept is good because it keeps our code\n\t clean and simple, and easy to extend.\n\t So any time we would like to define a new behaviour to our scope,\n\t we will just use the `$Mixer` service.\n\t */\n\t.service(Mixer, function () {\n\t var _this = this;\n\t\n\t // Used to store method's caller\n\t var caller = undefined;\n\t\n\t this._mixins = [];\n\t // Apply mixins automatically on specified contexts\n\t this._autoExtend = [];\n\t this._autoConstruct = [];\n\t\n\t // Adds a new mixin\n\t this.mixin = function (mixin) {\n\t if (!_underscore2.default.isObject(mixin)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _this._mixins = _underscore2.default.union(_this._mixins, [mixin]);\n\t // Apply mixins to stored contexts\n\t _this._autoExtend.forEach(function (context) {\n\t return _this._extend(context);\n\t });\n\t _this._autoConstruct.forEach(function (context) {\n\t return _this._construct(context);\n\t });\n\t return _this;\n\t };\n\t\n\t // Removes a mixin. Useful mainly for test purposes\n\t this._mixout = function (mixin) {\n\t _this._mixins = _underscore2.default.without(_this._mixins, mixin);\n\t return _this;\n\t };\n\t\n\t // Invoke function mixins with the provided context and arguments\n\t this._construct = function (context) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t _this._mixins.filter(_underscore2.default.isFunction).forEach(function (mixin) {\n\t mixin.call.apply(mixin, [context].concat(args));\n\t });\n\t\n\t return context;\n\t };\n\t\n\t // Extend prototype with the defined mixins\n\t this._extend = function (obj, options) {\n\t var _$defaults = _underscore2.default.defaults({}, options, {\n\t pattern: /.*/ });\n\t\n\t var pattern = _$defaults.pattern;\n\t var context = _$defaults.context;\n\t // The patterns of the keys which will be filtered\n\t\n\t\n\t var mixins = _this._mixins.map(function (mixin) {\n\t // Filtering the keys by the specified pattern\n\t var keys = _underscore2.default.keys(mixin).filter(function (k) {\n\t return k.match(pattern);\n\t }).filter(function (k) {\n\t return _underscore2.default.isFunction(mixin[k]);\n\t });\n\t\n\t return keys.reduce(function (boundMixin, methodName) {\n\t var methodHandler = mixin[methodName];\n\t\n\t // Note that this is not an arrow function so we can conserve the conetxt\n\t boundMixin[methodName] = function () {\n\t // Storing original caller so we will know who actually called the\n\t // method event though it is bound to another context\n\t var methodContext = context || this;\n\t var recentCaller = caller;\n\t caller = this;\n\t\n\t try {\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t return methodHandler.apply(methodContext, args);\n\t } finally {\n\t // No matter what happens, restore variable to the previous one\n\t caller = recentCaller;\n\t }\n\t };\n\t\n\t return boundMixin;\n\t }, {});\n\t });\n\t\n\t return _underscore2.default.extend.apply(_underscore2.default, [obj].concat(_toConsumableArray(mixins)));\n\t };\n\t\n\t // Caller property can not be set\n\t Object.defineProperty(this, 'caller', {\n\t configurable: true,\n\t enumerable: true,\n\t\n\t get: function get() {\n\t return caller;\n\t }\n\t });\n\t});\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.name = undefined;\n\t\n\tvar _mixer = __webpack_require__(17);\n\t\n\tvar name = exports.name = 'angular-meteor.scope';\n\t\n\tangular.module(name, [_mixer.name]).run(['$rootScope', _mixer.Mixer, function ($rootScope, $Mixer) {\n\t var Scope = $rootScope.constructor;\n\t var $new = $rootScope.$new;\n\t\n\t // Apply extensions whether a mixin in defined.\n\t // Note that this way mixins which are initialized later\n\t // can be applied on rootScope.\n\t $Mixer._autoExtend.push(Scope.prototype);\n\t $Mixer._autoConstruct.push($rootScope);\n\t\n\t Scope.prototype.$new = function () {\n\t var scope = $new.apply(this, arguments);\n\t // Apply constructors to newly created scopes\n\t return $Mixer._construct(scope);\n\t };\n\t}]);\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Core = exports.name = undefined;\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tvar _utils = __webpack_require__(16);\n\t\n\tvar _mixer = __webpack_require__(17);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\t\n\tvar name = exports.name = 'angular-meteor.core';\n\tvar Core = exports.Core = '$$Core';\n\t\n\tangular.module(name, [_utils.name, _mixer.name])\n\t\n\t/*\n\t A mixin which provides us with core Meteor functions.\n\t */\n\t.factory(Core, ['$q', _utils.utils, _mixer.Mixer, function ($q, $$utils, $Mixer) {\n\t function $$Core() {}\n\t\n\t // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n\t $$Core.autorun = function (fn) {\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t fn = this.$bindToContext($Mixer.caller, fn);\n\t\n\t if (!_underscore2.default.isFunction(fn)) {\n\t throw Error('argument 1 must be a function');\n\t }\n\t if (!_underscore2.default.isObject(options)) {\n\t throw Error('argument 2 must be an object');\n\t }\n\t\n\t var computation = Tracker.autorun(fn, options);\n\t this.$$autoStop(computation);\n\t return computation;\n\t };\n\t\n\t // Calls Meteor.subscribe() which will be digested after each invokation\n\t // and automatically destroyed\n\t $$Core.subscribe = function (subName, fn, cb) {\n\t fn = this.$bindToContext($Mixer.caller, fn || angular.noop);\n\t cb = cb ? this.$bindToContext($Mixer.caller, cb) : angular.noop;\n\t\n\t if (!_underscore2.default.isString(subName)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t if (!_underscore2.default.isFunction(fn)) {\n\t throw Error('argument 2 must be a function');\n\t }\n\t if (!_underscore2.default.isFunction(cb) && !_underscore2.default.isObject(cb)) {\n\t throw Error('argument 3 must be a function or an object');\n\t }\n\t\n\t var result = {};\n\t\n\t var computation = this.autorun(function () {\n\t var _Meteor;\n\t\n\t var args = fn();\n\t if (angular.isUndefined(args)) args = [];\n\t\n\t if (!_underscore2.default.isArray(args)) {\n\t throw Error('reactive function\\'s return value must be an array');\n\t }\n\t\n\t var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb]));\n\t result.ready = subscription.ready.bind(subscription);\n\t result.subscriptionId = subscription.subscriptionId;\n\t });\n\t\n\t // Once the computation has been stopped,\n\t // any subscriptions made inside will be stopped as well\n\t result.stop = computation.stop.bind(computation);\n\t return result;\n\t };\n\t\n\t // Calls Meteor.call() wrapped by a digestion cycle\n\t $$Core.callMethod = function () {\n\t var _Meteor2;\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_underscore2.default.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n\t return (_Meteor2 = Meteor).call.apply(_Meteor2, args.concat([fn]));\n\t };\n\t\n\t // Calls Meteor.apply() wrapped by a digestion cycle\n\t $$Core.applyMethod = function () {\n\t var _Meteor3;\n\t\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t var fn = args.pop();\n\t if (_underscore2.default.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n\t return (_Meteor3 = Meteor).apply.apply(_Meteor3, args.concat([fn]));\n\t };\n\t\n\t $$Core.$$autoStop = function (stoppable) {\n\t this.$on('$destroy', stoppable.stop.bind(stoppable));\n\t };\n\t\n\t // Digests scope only if there is no phase at the moment\n\t $$Core.$$throttledDigest = function () {\n\t var isDigestable = !this.$$destroyed && !this.$$phase && !this.$root.$$phase;\n\t\n\t if (isDigestable) this.$digest();\n\t };\n\t\n\t // Creates a promise only that the digestion cycle will be called at its fulfillment\n\t $$Core.$$defer = function () {\n\t var deferred = $q.defer();\n\t // Once promise has been fulfilled, digest\n\t deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n\t return deferred;\n\t };\n\t\n\t // Binds an object or a function to the provided context and digest it once it is invoked\n\t $$Core.$bindToContext = function (context, fn) {\n\t return $$utils.bind(fn, context, this.$$throttledDigest.bind(this));\n\t };\n\t\n\t return $$Core;\n\t}]);\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.reactive = exports.ViewModel = exports.name = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tvar _utils = __webpack_require__(16);\n\t\n\tvar _mixer = __webpack_require__(17);\n\t\n\tvar _core = __webpack_require__(19);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar name = exports.name = 'angular-meteor.view-model';\n\tvar ViewModel = exports.ViewModel = '$$ViewModel';\n\tvar reactive = exports.reactive = '$reactive';\n\t\n\tangular.module(name, [_utils.name, _mixer.name, _core.name])\n\t\n\t/*\n\t A mixin which lets us bind a view model into a scope.\n\t Note that only a single view model can be bound,\n\t otherwise the scope might behave unexpectedly.\n\t Mainly used to define the controller as the view model,\n\t and very useful when wanting to use Angular's `controllerAs` syntax.\n\t */\n\t.factory(ViewModel, [_utils.utils, _mixer.Mixer, function ($$utils, $Mixer) {\n\t function $$ViewModel() {}\n\t\n\t // Gets an object, wraps it with scope functions and returns it\n\t $$ViewModel.viewModel = function (vm) {\n\t if (!_underscore2.default.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t // Extend view model with mixin functions\n\t $Mixer._extend(vm, {\n\t pattern: /^(?!\\$\\$).*$/, // Omitting methods which start with a $$ notation\n\t context: this // Binding methods to scope\n\t });\n\t\n\t // Apply mixin constructors on scope with view model\n\t $Mixer._construct(this, vm);\n\t return vm;\n\t };\n\t\n\t return $$ViewModel;\n\t}])\n\t\n\t/*\n\t Illustrates the old API where a view model is created using $reactive service\n\t */\n\t.service(reactive, [_utils.utils, function ($$utils) {\n\t var Reactive = function () {\n\t function Reactive(vm) {\n\t var _this = this;\n\t\n\t _classCallCheck(this, Reactive);\n\t\n\t if (!_underscore2.default.isObject(vm)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t\n\t _underscore2.default.defer(function () {\n\t if (!_this._attached) {\n\t console.warn('view model was not attached to any scope');\n\t }\n\t });\n\t\n\t this._vm = vm;\n\t }\n\t\n\t _createClass(Reactive, [{\n\t key: 'attach',\n\t value: function attach(scope) {\n\t this._attached = true;\n\t\n\t if (!$$utils.isScope(scope)) {\n\t throw Error('argument 1 must be a scope');\n\t }\n\t\n\t var viewModel = scope.viewModel(this._vm);\n\t\n\t // Similar to the old/Meteor API\n\t viewModel.call = viewModel.callMethod;\n\t viewModel.apply = viewModel.applyMethod;\n\t\n\t return viewModel;\n\t }\n\t }]);\n\t\n\t return Reactive;\n\t }();\n\t\n\t return function (vm) {\n\t return new Reactive(vm);\n\t };\n\t}]);\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Reactive = exports.name = undefined;\n\t\n\tvar _jsondiffpatch = __webpack_require__(22);\n\t\n\tvar _jsondiffpatch2 = _interopRequireDefault(_jsondiffpatch);\n\t\n\tvar _underscore = __webpack_require__(2);\n\t\n\tvar _underscore2 = _interopRequireDefault(_underscore);\n\t\n\tvar _utils = __webpack_require__(16);\n\t\n\tvar _mixer = __webpack_require__(17);\n\t\n\tvar _core = __webpack_require__(19);\n\t\n\tvar _viewModel = __webpack_require__(20);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar name = exports.name = 'angular-meteor.reactive';\n\tvar Reactive = exports.Reactive = '$$Reactive';\n\t\n\tangular.module(name, [_utils.name, _mixer.name, _core.name, _viewModel.name])\n\t\n\t/*\n\t A mixin which enhance our reactive abilities by providing methods\n\t that are capable of updating our scope reactively.\n\t */\n\t.factory(Reactive, ['$parse', _utils.utils, _mixer.Mixer, function ($parse, $$utils, $Mixer) {\n\t function $$Reactive() {\n\t var vm = arguments.length <= 0 || arguments[0] === undefined ? this : arguments[0];\n\t\n\t // Helps us track changes made in the view model\n\t vm.$$dependencies = {};\n\t }\n\t\n\t // Gets an object containing functions and define their results as reactive properties.\n\t // Once a return value has been changed the property will be reset.\n\t $$Reactive.helpers = function (vm, props) {\n\t var _this = this;\n\t\n\t if ($$utils.isViewModel(vm)) {\n\t if (!_underscore2.default.isObject(props)) {\n\t throw Error('argument 2 must be an object');\n\t }\n\t } else {\n\t props = vm;\n\t vm = $Mixer.caller;\n\t\n\t if (!_underscore2.default.isObject(props)) {\n\t throw Error('argument 1 must be an object');\n\t }\n\t }\n\t\n\t _underscore2.default.each(props, function (v, k) {\n\t if (!_underscore2.default.isFunction(v)) {\n\t throw Error('helper \\'' + k + '\\' must be a function');\n\t }\n\t });\n\t\n\t _underscore2.default.each(props, function (v, k) {\n\t if (!vm.$$dependencies[k]) {\n\t // Registers a new dependency to the specified helper\n\t vm.$$dependencies[k] = new Tracker.Dependency();\n\t }\n\t\n\t _this.$$setFnHelper(vm, k, v);\n\t });\n\t };\n\t\n\t // Gets a model reactively\n\t $$Reactive.getReactively = function (vm, k, isDeep) {\n\t if ($$utils.isViewModel(vm)) {\n\t if (angular.isUndefined(isDeep)) isDeep = false;\n\t\n\t if (!_underscore2.default.isString(k)) {\n\t throw Error('argument 2 must be a string');\n\t }\n\t if (!_underscore2.default.isBoolean(isDeep)) {\n\t throw Error('argument 3 must be a boolean');\n\t }\n\t } else {\n\t isDeep = angular.isDefined(k) ? k : false;\n\t k = vm;\n\t vm = $Mixer.caller;\n\t\n\t if (!_underscore2.default.isString(k)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t if (!_underscore2.default.isBoolean(isDeep)) {\n\t throw Error('argument 2 must be a boolean');\n\t }\n\t }\n\t\n\t return this.$$reactivateEntity(vm, k, this.$watch, isDeep);\n\t };\n\t\n\t // Gets a collection reactively\n\t $$Reactive.getCollectionReactively = function (vm, k) {\n\t if ($$utils.isViewModel(vm)) {\n\t if (!_underscore2.default.isString(k)) {\n\t throw Error('argument 2 must be a string');\n\t }\n\t } else {\n\t k = vm;\n\t vm = $Mixer.caller;\n\t\n\t if (!_underscore2.default.isString(k)) {\n\t throw Error('argument 1 must be a string');\n\t }\n\t }\n\t\n\t return this.$$reactivateEntity(vm, k, this.$watchCollection);\n\t };\n\t\n\t // Gets an entity reactively, and once it has been changed the computation will be recomputed\n\t $$Reactive.$$reactivateEntity = function (vm, k, watcher) {\n\t if (!vm.$$dependencies[k]) {\n\t vm.$$dependencies[k] = new Tracker.Dependency();\n\t\n\t for (var _len = arguments.length, watcherArgs = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n\t watcherArgs[_key - 3] = arguments[_key];\n\t }\n\t\n\t this.$$watchEntity.apply(this, [vm, k, watcher].concat(watcherArgs));\n\t }\n\t\n\t vm.$$dependencies[k].depend();\n\t return $parse(k)(vm);\n\t };\n\t\n\t // Watches for changes in the view model, and if so will notify a change\n\t $$Reactive.$$watchEntity = function (vm, k, watcher) {\n\t var _this2 = this;\n\t\n\t // Gets a deep property from the caller\n\t var getVal = _underscore2.default.partial($parse(k), vm);\n\t var initialVal = getVal();\n\t\n\t // Watches for changes in the view model\n\t\n\t for (var _len2 = arguments.length, watcherArgs = Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {\n\t watcherArgs[_key2 - 3] = arguments[_key2];\n\t }\n\t\n\t watcher.call.apply(watcher, [this, getVal, function (val, oldVal) {\n\t var hasChanged = val !== initialVal || val !== oldVal;\n\t\n\t // Notify if a change has been detected\n\t if (hasChanged) _this2.$$changed(vm, k);\n\t }].concat(watcherArgs));\n\t };\n\t\n\t // Invokes a function and sets the return value as a property\n\t $$Reactive.$$setFnHelper = function (vm, k, fn) {\n\t var _this3 = this;\n\t\n\t var activeObservation = null;\n\t var lastModel = null;\n\t var lastModelData = [];\n\t\n\t this.autorun(function () /* computation */{\n\t // Invokes the reactive functon\n\t var model = fn.apply(vm);\n\t\n\t // Ignore notifications made by the following handler\n\t Tracker.nonreactive(function () {\n\t // If a cursor, observe its changes and update acoordingly\n\t if ($$utils.isCursor(model)) {\n\t var modelData = undefined;\n\t\n\t if (angular.isUndefined(vm[k])) {\n\t _this3.$$setValHelper(vm, k, [], false);\n\t }\n\t\n\t if (activeObservation) {\n\t lastModelData = lastModel.fetch();\n\t activeObservation.stop();\n\t activeObservation = null;\n\t }\n\t\n\t var handle = _this3.$$handleCursor(vm, k, model);\n\t\n\t activeObservation = handle.observation;\n\t modelData = handle.data;\n\t\n\t if (lastModelData.length !== 0) {\n\t var diff = _jsondiffpatch2.default.diff(lastModelData, modelData);\n\t vm[k] = _jsondiffpatch2.default.patch(lastModelData, diff);\n\t } else {\n\t vm[k] = modelData;\n\t }\n\t\n\t lastModel = model;\n\t lastModelData = modelData;\n\t\n\t /* computation.onInvalidate(() => {\n\t activeObservation.stop();\n\t });*/\n\t } else {\n\t _this3.$$handleNonCursor(vm, k, model);\n\t }\n\t\n\t // Notify change and update the view model\n\t _this3.$$changed(vm, k);\n\t });\n\t });\n\t };\n\t\n\t // Sets a value helper as a setter and a getter which will notify computations once used\n\t $$Reactive.$$setValHelper = function (vm, k, v) {\n\t var _this4 = this;\n\t\n\t var watch = arguments.length <= 3 || arguments[3] === undefined ? true : arguments[3];\n\t\n\t // If set, reactives property\n\t if (watch) {\n\t var isDeep = _underscore2.default.isObject(v);\n\t this.getReactively(vm, k, isDeep);\n\t }\n\t\n\t Object.defineProperty(vm, k, {\n\t configurable: true,\n\t enumerable: true,\n\t\n\t get: function get() {\n\t return v;\n\t },\n\t set: function set(newVal) {\n\t v = newVal;\n\t _this4.$$changed(vm, k);\n\t }\n\t });\n\t };\n\t\n\t // Fetching a cursor and updates properties once the result set has been changed\n\t $$Reactive.$$handleCursor = function (vm, k, cursor) {\n\t var _this5 = this;\n\t\n\t var data = [];\n\t // Observe changes made in the result set\n\t var observation = cursor.observe({\n\t addedAt: function addedAt(doc, atIndex) {\n\t if (!observation) {\n\t data.push(doc);\n\t return;\n\t }\n\t vm[k].splice(atIndex, 0, doc);\n\t _this5.$$changed(vm, k);\n\t },\n\t changedAt: function changedAt(doc, oldDoc, atIndex) {\n\t var diff = _jsondiffpatch2.default.diff(vm[k][atIndex], doc);\n\t _jsondiffpatch2.default.patch(vm[k][atIndex], diff);\n\t _this5.$$changed(vm, k);\n\t },\n\t movedTo: function movedTo(doc, fromIndex, toIndex) {\n\t vm[k].splice(fromIndex, 1);\n\t vm[k].splice(toIndex, 0, doc);\n\t _this5.$$changed(vm, k);\n\t },\n\t removedAt: function removedAt(oldDoc, atIndex) {\n\t vm[k].splice(atIndex, 1);\n\t _this5.$$changed(vm, k);\n\t }\n\t });\n\t\n\t return {\n\t observation: observation,\n\t data: data\n\t };\n\t };\n\t\n\t $$Reactive.$$handleNonCursor = function (vm, k, data) {\n\t var v = vm[k];\n\t\n\t if (angular.isDefined(v)) {\n\t delete vm[k];\n\t v = null;\n\t }\n\t\n\t if (angular.isUndefined(v)) {\n\t this.$$setValHelper(vm, k, data);\n\t }\n\t // Update property if the new value is from the same type\n\t else if ($$utils.areSiblings(v, data)) {\n\t var diff = _jsondiffpatch2.default.diff(v, data);\n\t _jsondiffpatch2.default.patch(v, diff);\n\t this.$$changed(vm, k);\n\t } else {\n\t vm[k] = data;\n\t }\n\t };\n\t\n\t // Notifies dependency in view model\n\t $$Reactive.$$depend = function (vm, k) {\n\t vm.$$dependencies[k].depend();\n\t };\n\t\n\t // Notifies change in view model\n\t $$Reactive.$$changed = function (vm, k) {\n\t this.$$throttledDigest();\n\t vm.$$dependencies[k].changed();\n\t };\n\t\n\t return $$Reactive;\n\t}]);\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_22__;\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar name = exports.name = 'angular-templates';\n\t\n\ttry {\n\t angular.module(name);\n\t} catch (e) {\n\t angular.module(name, []);\n\t}\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** dist/angular-meteor.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap f4a730afaadc2702df46\n **/","// lib\nimport './lib/get-updates';\nimport './lib/diff-array';\n// legacy\nimport './modules/angular-meteor-settings';\nimport './modules/angular-meteor-ironrouter';\nimport './modules/angular-meteor-utils';\nimport './modules/angular-meteor-subscribe';\nimport './modules/angular-meteor-collection';\nimport './modules/angular-meteor-object';\nimport './modules/angular-meteor-user';\nimport './modules/angular-meteor-methods';\nimport './modules/angular-meteor-session';\nimport './modules/angular-meteor-camera';\nimport './modules/angular-meteor-stopper';\n\n// new\nimport { name as utilsName } from './modules/utils';\nimport { name as mixerName, Mixer } from './modules/mixer';\nimport { name as scopeName } from './modules/scope';\nimport { name as coreName, Core } from './modules/core';\nimport { name as viewModelName, ViewModel } from './modules/view-model';\nimport { name as reactiveName, Reactive } from './modules/reactive';\nimport { name as templatesName } from './modules/templates';\n\nconst name = 'angular-meteor';\nexport default name;\n\nangular.module(name, [\n // new\n utilsName,\n mixerName,\n scopeName,\n coreName,\n viewModelName,\n reactiveName,\n templatesName,\n\n // legacy\n 'angular-meteor.ironrouter',\n 'angular-meteor.utils',\n 'angular-meteor.subscribe',\n 'angular-meteor.collection',\n 'angular-meteor.object',\n 'angular-meteor.user',\n 'angular-meteor.methods',\n 'angular-meteor.session',\n 'angular-meteor.camera'\n\n])\n\n.run([\n Mixer,\n Core,\n ViewModel,\n Reactive,\n\n function($Mixer, $$Core, $$ViewModel, $$Reactive) {\n // Load all mixins\n $Mixer\n .mixin($$Core)\n .mixin($$ViewModel)\n .mixin($$Reactive);\n }\n])\n\n// legacy\n// Putting all services under $meteor service for syntactic sugar\n.service('$meteor', [\n '$meteorCollection',\n '$meteorCollectionFS',\n '$meteorObject',\n '$meteorMethods',\n '$meteorSession',\n '$meteorSubscribe',\n '$meteorUtils',\n '$meteorCamera',\n '$meteorUser',\n function($meteorCollection, $meteorCollectionFS, $meteorObject,\n $meteorMethods, $meteorSession, $meteorSubscribe, $meteorUtils,\n $meteorCamera, $meteorUser) {\n this.collection = $meteorCollection;\n this.collectionFS = $meteorCollectionFS;\n this.object = $meteorObject;\n this.subscribe = $meteorSubscribe.subscribe;\n this.call = $meteorMethods.call;\n this.session = $meteorSession;\n this.autorun = $meteorUtils.autorun;\n this.getCollectionByName = $meteorUtils.getCollectionByName;\n this.getPicture = $meteorCamera.getPicture;\n\n // $meteorUser\n [\n 'loginWithPassword',\n 'requireUser',\n 'requireValidUser',\n 'waitForUser',\n 'createUser',\n 'changePassword',\n 'forgotPassword',\n 'resetPassword',\n 'verifyEmail',\n 'loginWithMeteorDeveloperAccount',\n 'loginWithFacebook',\n 'loginWithGithub',\n 'loginWithGoogle',\n 'loginWithMeetup',\n 'loginWithTwitter',\n 'loginWithWeibo',\n 'logout',\n 'logoutOtherClients'\n ].forEach((method) => {\n this[method] = $meteorUser[method];\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/angular-meteor.js\n **/","/*global\n angular, _\n */\n\nimport _ from './underscore';\n\n'use strict';\n\n// https://github.com/DAB0mB/get-updates\n(function() {\n var module = angular.module('getUpdates', []);\n\n var utils = (function() {\n var rip = function(obj, level) {\n if (level < 1) return {};\n\n return _.reduce(obj, function(clone, v, k) {\n v = _.isObject(v) ? rip(v, --level) : v;\n clone[k] = v;\n return clone;\n }, {});\n };\n\n var toPaths = function(obj) {\n var keys = getKeyPaths(obj);\n var values = getDeepValues(obj);\n return _.object(keys, values);\n };\n\n var getKeyPaths = function(obj) {\n var keys = _.keys(obj).map(function(k) {\n var v = obj[k];\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v)) return k;\n\n return getKeyPaths(v).map(function(subKey) {\n return k + '.' + subKey;\n });\n });\n\n return _.flatten(keys);\n };\n\n var getDeepValues = function(obj,arr) {\n arr = arr || [];\n\n _.values(obj).forEach(function(v) {\n if (!_.isObject(v) || _.isEmpty(v) || _.isArray(v))\n arr.push(v);\n else\n getDeepValues(v, arr);\n });\n\n return arr;\n };\n\n var flatten = function(arr) {\n return arr.reduce(function(flattened, v, i) {\n if (_.isArray(v) && !_.isEmpty(v))\n flattened.push.apply(flattened, flatten(v));\n else\n flattened.push(v);\n\n return flattened;\n }, []);\n };\n\n var setFilled = function(obj, k, v) {\n if (!_.isEmpty(v)) obj[k] = v;\n };\n\n var assert = function(result, msg) {\n if (!result) throwErr(msg);\n };\n\n var throwErr = function(msg) {\n throw Error('get-updates error - ' + msg);\n };\n\n return {\n rip: rip,\n toPaths: toPaths,\n getKeyPaths: getKeyPaths,\n getDeepValues: getDeepValues,\n setFilled: setFilled,\n assert: assert,\n throwErr: throwErr\n };\n })();\n\n var getDifference = (function() {\n var getDifference = function(src, dst, isShallow) {\n var level;\n\n if (isShallow > 1)\n level = isShallow;\n else if (isShallow)\n level = 1;\n\n if (level) {\n src = utils.rip(src, level);\n dst = utils.rip(dst, level);\n }\n\n return compare(src, dst);\n };\n\n var compare = function(src, dst) {\n var srcKeys = _.keys(src);\n var dstKeys = _.keys(dst);\n\n var keys = _.chain([])\n .concat(srcKeys)\n .concat(dstKeys)\n .uniq()\n .without('$$hashKey')\n .value();\n\n return keys.reduce(function(diff, k) {\n var srcValue = src[k];\n var dstValue = dst[k];\n\n if (_.isDate(srcValue) && _.isDate(dstValue)) {\n if (srcValue.getTime() != dstValue.getTime()) diff[k] = dstValue;\n }\n\n if (_.isObject(srcValue) && _.isObject(dstValue)) {\n var valueDiff = getDifference(srcValue, dstValue);\n utils.setFilled(diff, k, valueDiff);\n }\n\n else if (srcValue !== dstValue) {\n diff[k] = dstValue;\n }\n\n return diff;\n }, {});\n };\n\n return getDifference;\n })();\n\n var getUpdates = (function() {\n var getUpdates = function(src, dst, isShallow) {\n utils.assert(_.isObject(src), 'first argument must be an object');\n utils.assert(_.isObject(dst), 'second argument must be an object');\n\n var diff = getDifference(src, dst, isShallow);\n var paths = utils.toPaths(diff);\n\n var set = createSet(paths);\n var unset = createUnset(paths);\n var pull = createPull(unset);\n\n var updates = {};\n utils.setFilled(updates, '$set', set);\n utils.setFilled(updates, '$unset', unset);\n utils.setFilled(updates, '$pull', pull);\n\n return updates;\n };\n\n var createSet = function(paths) {\n var undefinedKeys = getUndefinedKeys(paths);\n return _.omit(paths, undefinedKeys);\n };\n\n var createUnset = function(paths) {\n var undefinedKeys = getUndefinedKeys(paths);\n var unset = _.pick(paths, undefinedKeys);\n\n return _.reduce(unset, function(result, v, k) {\n result[k] = true;\n return result;\n }, {});\n };\n\n var createPull = function(unset) {\n var arrKeyPaths = _.keys(unset).map(function(k) {\n var split = k.match(/(.*)\\.\\d+$/);\n return split && split[1];\n });\n\n return _.compact(arrKeyPaths).reduce(function(pull, k) {\n pull[k] = null;\n return pull;\n }, {});\n };\n\n var getUndefinedKeys = function(obj) {\n return _.keys(obj).filter(function (k) {\n var v = obj[k];\n return _.isUndefined(v);\n });\n };\n\n return getUpdates;\n })();\n\n module.value('getUpdates', getUpdates);\n})();\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/get-updates.js\n **/","import _ from 'underscore';\n\nif (typeof _ === 'undefined') {\n if (typeof Package.underscore === 'undefined') {\n throw new Error('underscore is missing');\n }\n}\n\nexport default _ || Package.underscore._;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/underscore.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"_\",\"amd\":\"underscore\",\"commonjs2\":\"underscore\",\"commonjs\":\"underscore\"}\n ** module id = 3\n ** module chunks = 0\n **/","/*global\n angular, _, Package\n */\n\nimport _ from './underscore';\n\n'use strict';\n\nvar _module = angular.module('diffArray', ['getUpdates']);\n\n_module.factory('diffArray', ['getUpdates',\n function(getUpdates) {\n var LocalCollection = Package.minimongo.LocalCollection;\n var idStringify = LocalCollection._idStringify || Package['mongo-id'].MongoID.idStringify;\n var idParse = LocalCollection._idParse || Package['mongo-id'].MongoID.idParse;\n\n // Calculates the differences between `lastSeqArray` and\n // `seqArray` and calls appropriate functions from `callbacks`.\n // Reuses Minimongo's diff algorithm implementation.\n // XXX Should be replaced with the original diffArray function here:\n // https://github.com/meteor/meteor/blob/devel/packages/observe-sequence/observe_sequence.js#L152\n // When it will become nested as well, tracking here: https://github.com/meteor/meteor/issues/3764\n function diffArray(lastSeqArray, seqArray, callbacks, preventNestedDiff) {\n preventNestedDiff = !!preventNestedDiff;\n\n var diffFn = Package.minimongo.LocalCollection._diffQueryOrderedChanges ||\n Package['diff-sequence'].DiffSequence.diffQueryOrderedChanges;\n\n var oldObjIds = [];\n var newObjIds = [];\n var posOld = {}; // maps from idStringify'd ids\n var posNew = {}; // ditto\n var posCur = {};\n var lengthCur = lastSeqArray.length;\n\n _.each(seqArray, function (doc, i) {\n newObjIds.push({_id: doc._id});\n posNew[idStringify(doc._id)] = i;\n });\n\n _.each(lastSeqArray, function (doc, i) {\n oldObjIds.push({_id: doc._id});\n posOld[idStringify(doc._id)] = i;\n posCur[idStringify(doc._id)] = i;\n });\n\n // Arrays can contain arbitrary objects. We don't diff the\n // objects. Instead we always fire 'changedAt' callback on every\n // object. The consumer of `observe-sequence` should deal with\n // it appropriately.\n diffFn(oldObjIds, newObjIds, {\n addedBefore: function (id, doc, before) {\n var position = before ? posCur[idStringify(before)] : lengthCur;\n\n _.each(posCur, function (pos, id) {\n if (pos >= position) posCur[id]++;\n });\n\n lengthCur++;\n posCur[idStringify(id)] = position;\n\n callbacks.addedAt(\n id,\n seqArray[posNew[idStringify(id)]],\n position,\n before\n );\n },\n\n movedBefore: function (id, before) {\n var prevPosition = posCur[idStringify(id)];\n var position = before ? posCur[idStringify(before)] : lengthCur - 1;\n\n _.each(posCur, function (pos, id) {\n if (pos >= prevPosition && pos <= position)\n posCur[id]--;\n else if (pos <= prevPosition && pos >= position)\n posCur[id]++;\n });\n\n posCur[idStringify(id)] = position;\n\n callbacks.movedTo(\n id,\n seqArray[posNew[idStringify(id)]],\n prevPosition,\n position,\n before\n );\n },\n removed: function (id) {\n var prevPosition = posCur[idStringify(id)];\n\n _.each(posCur, function (pos, id) {\n if (pos >= prevPosition) posCur[id]--;\n });\n\n delete posCur[idStringify(id)];\n lengthCur--;\n\n callbacks.removedAt(\n id,\n lastSeqArray[posOld[idStringify(id)]],\n prevPosition\n );\n }\n });\n\n _.each(posNew, function (pos, idString) {\n if (!_.has(posOld, idString)) return;\n\n var id = idParse(idString);\n var newItem = seqArray[pos] || {};\n var oldItem = lastSeqArray[posOld[idString]];\n var updates = getUpdates(oldItem, newItem, preventNestedDiff);\n\n if (!_.isEmpty(updates))\n callbacks.changedAt(id, updates, pos, oldItem);\n });\n }\n\n diffArray.shallow = function(lastSeqArray, seqArray, callbacks) {\n return diffArray(lastSeqArray, seqArray, callbacks, true);\n };\n\n diffArray.deepCopyChanges = function (oldItem, newItem) {\n var setDiff = getUpdates(oldItem, newItem).$set;\n\n _.each(setDiff, function(v, deepKey) {\n setDeep(oldItem, deepKey, v);\n });\n };\n\n diffArray.deepCopyRemovals = function (oldItem, newItem) {\n var unsetDiff = getUpdates(oldItem, newItem).$unset;\n\n _.each(unsetDiff, function(v, deepKey) {\n unsetDeep(oldItem, deepKey);\n });\n };\n\n // Finds changes between two collections\n diffArray.getChanges = function(newCollection, oldCollection, diffMethod) {\n var changes = {added: [], removed: [], changed: []};\n\n diffMethod(oldCollection, newCollection, {\n addedAt: function(id, item, index) {\n changes.added.push({item: item, index: index});\n },\n\n removedAt: function(id, item, index) {\n changes.removed.push({item: item, index: index});\n },\n\n changedAt: function(id, updates, index, oldItem) {\n changes.changed.push({selector: id, modifier: updates});\n },\n\n movedTo: function(id, item, fromIndex, toIndex) {\n // XXX do we need this?\n }\n });\n\n return changes;\n };\n\n var setDeep = function(obj, deepKey, v) {\n var split = deepKey.split('.');\n var initialKeys = _.initial(split);\n var lastKey = _.last(split);\n\n initialKeys.reduce(function(subObj, k, i) {\n var nextKey = split[i + 1];\n\n if (isNumStr(nextKey)) {\n if (subObj[k] === null) subObj[k] = [];\n if (subObj[k].length == parseInt(nextKey)) subObj[k].push(null);\n }\n\n else if (subObj[k] === null || !isHash(subObj[k])) {\n subObj[k] = {};\n }\n\n return subObj[k];\n }, obj);\n\n var deepObj = getDeep(obj, initialKeys);\n deepObj[lastKey] = v;\n return v;\n };\n\n var unsetDeep = function(obj, deepKey) {\n var split = deepKey.split('.');\n var initialKeys = _.initial(split);\n var lastKey = _.last(split);\n var deepObj = getDeep(obj, initialKeys);\n\n if (_.isArray(deepObj) && isNumStr(lastKey))\n return !!deepObj.splice(lastKey, 1);\n else\n return delete deepObj[lastKey];\n };\n\n var getDeep = function(obj, keys) {\n return keys.reduce(function(subObj, k) {\n return subObj[k];\n }, obj);\n };\n\n var isHash = function(obj) {\n return _.isObject(obj) &&\n Object.getPrototypeOf(obj) === Object.prototype;\n };\n\n var isNumStr = function(str) {\n return str.match(/^\\d+$/);\n };\n\n return diffArray;\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/lib/diff-array.js\n **/","angular.module('angular-meteor.settings', [])\n .constant('$angularMeteorSettings', {\n suppressWarnings: true\n });\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-settings.js\n **/","angular.module('angular-meteor.ironrouter', [])\n\n\n.run([\n '$compile',\n '$document',\n '$rootScope',\n\nfunction ($compile, $document, $rootScope) {\n const Router = (Package['iron:router'] || {}).Router;\n if (!Router) return;\n\n let isLoaded = false;\n\n // Recompile after iron:router builds page\n Router.onAfterAction((req, res, next) => {\n Tracker.afterFlush(() => {\n if (isLoaded) return;\n $compile($document)($rootScope);\n if (!$rootScope.$$phase) $rootScope.$apply();\n isLoaded = true;\n });\n });\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-ironrouter.js\n **/","/*global\n angular, _, Tracker, EJSON, FS, Mongo\n */\n\nimport _ from '../lib/underscore';\n\n'use strict';\n\nvar angularMeteorUtils = angular.module('angular-meteor.utils', ['angular-meteor.settings']);\n\nangularMeteorUtils.service('$meteorUtils', [\n '$q', '$timeout', '$angularMeteorSettings',\n function ($q, $timeout, $angularMeteorSettings) {\n\n var self = this;\n\n this.autorun = function(scope, fn) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.utils.autorun] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.6/autorun. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n\n // wrapping around Deps.autorun\n var comp = Tracker.autorun(function(c) {\n fn(c);\n // this is run immediately for the first call\n // but after that, we need to $apply to start Angular digest\n if (!c.firstRun) $timeout(angular.noop, 0);\n });\n\n // stop autorun when scope is destroyed\n scope.$on('$destroy', function() {\n comp.stop();\n });\n\n // return autorun object so that it can be stopped manually\n return comp;\n };\n\n // Borrowed from angularFire\n // https://github.com/firebase/angularfire/blob/master/src/utils.js#L445-L454\n this.stripDollarPrefixedKeys = function (data) {\n if (!_.isObject(data) ||\n data instanceof Date ||\n data instanceof File ||\n EJSON.toJSONValue(data).$type === 'oid' ||\n (typeof FS === 'object' && data instanceof FS.File))\n return data;\n\n var out = _.isArray(data) ? [] : {};\n\n _.each(data, function(v,k) {\n if(typeof k !== 'string' || k.charAt(0) !== '$')\n out[k] = self.stripDollarPrefixedKeys(v);\n });\n\n return out;\n };\n\n // Returns a callback which fulfills promise\n this.fulfill = function(deferred, boundError, boundResult) {\n return function(err, result) {\n if (err)\n deferred.reject(boundError == null ? err : boundError);\n else if (typeof boundResult == \"function\")\n deferred.resolve(boundResult == null ? result : boundResult(result));\n else\n deferred.resolve(boundResult == null ? result : boundResult);\n };\n };\n\n // creates a function which invokes method with the given arguments and returns a promise\n this.promissor = function(obj, method) {\n return function() {\n var deferred = $q.defer();\n var fulfill = self.fulfill(deferred);\n var args = _.toArray(arguments).concat(fulfill);\n obj[method].apply(obj, args);\n return deferred.promise;\n };\n };\n\n // creates a $q.all() promise and call digestion loop on fulfillment\n this.promiseAll = function(promises) {\n var allPromise = $q.all(promises);\n\n allPromise.finally(function() {\n // calls digestion loop with no conflicts\n $timeout(angular.noop);\n });\n\n return allPromise;\n };\n\n this.getCollectionByName = function(string){\n return Mongo.Collection.get(string);\n };\n\n this.findIndexById = function(collection, doc) {\n var foundDoc = _.find(collection, function(colDoc) {\n // EJSON.equals used to compare Mongo.ObjectIDs and Strings.\n return EJSON.equals(colDoc._id, doc._id);\n });\n\n return _.indexOf(collection, foundDoc);\n };\n }\n]);\n\nangularMeteorUtils.run([\n '$rootScope', '$meteorUtils',\n function($rootScope, $meteorUtils) {\n Object.getPrototypeOf($rootScope).$meteorAutorun = function(fn) {\n return $meteorUtils.autorun(this, fn);\n };\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-utils.js\n **/","/*global\n angular, Meteor\n */\n\n'use strict';\nvar angularMeteorSubscribe = angular.module('angular-meteor.subscribe', ['angular-meteor.settings']);\n\nangularMeteorSubscribe.service('$meteorSubscribe', ['$q', '$angularMeteorSettings',\n function ($q, $angularMeteorSettings) {\n\n var self = this;\n\n this._subscribe = function(scope, deferred, args) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.subscribe] Please note that this module is deprecated since 1.3.0 and will be removed in 1.4.0! Replace it with the new syntax described here: http://www.angular-meteor.com/api/1.3.6/subscribe. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var subscription = null;\n var lastArg = args[args.length - 1];\n\n // User supplied onStop callback\n // save it for later use and remove\n // from subscription arguments\n if (angular.isObject(lastArg) &&\n angular.isFunction(lastArg.onStop)) {\n var onStop = lastArg.onStop;\n\n args.pop();\n }\n\n args.push({\n onReady: function() {\n deferred.resolve(subscription);\n },\n onStop: function(err) {\n if (!deferred.promise.$$state.status) {\n if (err)\n deferred.reject(err);\n else\n deferred.reject(new Meteor.Error(\"Subscription Stopped\",\n \"Subscription stopped by a call to stop method. Either by the client or by the server.\"));\n } else if (onStop)\n // After promise was resolved or rejected\n // call user supplied onStop callback.\n onStop.apply(this, Array.prototype.slice.call(arguments));\n\n }\n });\n\n subscription = Meteor.subscribe.apply(scope, args);\n\n return subscription;\n };\n\n this.subscribe = function(){\n var deferred = $q.defer();\n var args = Array.prototype.slice.call(arguments);\n var subscription = null;\n\n self._subscribe(this, deferred, args);\n\n return deferred.promise;\n };\n }]);\n\nangularMeteorSubscribe.run(['$rootScope', '$q', '$meteorSubscribe',\n function($rootScope, $q, $meteorSubscribe) {\n Object.getPrototypeOf($rootScope).$meteorSubscribe = function() {\n var deferred = $q.defer();\n var args = Array.prototype.slice.call(arguments);\n\n var subscription = $meteorSubscribe._subscribe(this, deferred, args);\n\n this.$on('$destroy', function() {\n subscription.stop();\n });\n\n return deferred.promise;\n };\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-subscribe.js\n **/","/*global\n angular, _, Tracker, check, Match, Mongo\n */\n\nimport _ from '../lib/underscore';\n\n'use strict';\n\nvar angularMeteorCollection = angular.module('angular-meteor.collection',\n ['angular-meteor.stopper', 'angular-meteor.subscribe', 'angular-meteor.utils', 'diffArray', 'angular-meteor.settings']);\n\n// The reason angular meteor collection is a factory function and not something\n// that inherit from array comes from here:\n// http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/\n// We went with the direct extensions approach.\nangularMeteorCollection.factory('AngularMeteorCollection', [\n '$q', '$meteorSubscribe', '$meteorUtils', '$rootScope', '$timeout', 'diffArray', '$angularMeteorSettings',\n function($q, $meteorSubscribe, $meteorUtils, $rootScope, $timeout, diffArray, $angularMeteorSettings) {\n\n function AngularMeteorCollection(curDefFunc, collection, diffArrayFunc, autoClientSave) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorCollection] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorCollection. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var data = [];\n // Server backup data to evaluate what changes come from client\n // after each server update.\n data._serverBackup = [];\n // Array differ function.\n data._diffArrayFunc = diffArrayFunc;\n // Handler of the cursor observer.\n data._hObserve = null;\n // On new cursor autorun handler\n // (autorun for reactive variables).\n data._hNewCurAutorun = null;\n // On new data autorun handler\n // (autorun for cursor.fetch).\n data._hDataAutorun = null;\n\n if (angular.isDefined(collection)) {\n data.$$collection = collection;\n } else {\n var cursor = curDefFunc();\n data.$$collection = $meteorUtils.getCollectionByName(cursor.collection.name);\n }\n\n _.extend(data, AngularMeteorCollection);\n data._startCurAutorun(curDefFunc, autoClientSave);\n\n return data;\n }\n\n AngularMeteorCollection._startCurAutorun = function(curDefFunc, autoClientSave) {\n var self = this;\n\n self._hNewCurAutorun = Tracker.autorun(function() {\n // When the reactive func gets recomputated we need to stop any previous\n // observeChanges.\n Tracker.onInvalidate(function() {\n self._stopCursor();\n });\n\n if (autoClientSave) self._setAutoClientSave();\n self._updateCursor(curDefFunc(), autoClientSave);\n });\n };\n\n AngularMeteorCollection.subscribe = function() {\n $meteorSubscribe.subscribe.apply(this, arguments);\n return this;\n };\n\n AngularMeteorCollection.save = function(docs, useUnsetModifier) {\n // save whole collection\n if (!docs) docs = this;\n // save single doc\n docs = [].concat(docs);\n\n var promises = docs.map(function(doc) {\n return this._upsertDoc(doc, useUnsetModifier);\n }, this);\n\n return $meteorUtils.promiseAll(promises);\n };\n\n AngularMeteorCollection._upsertDoc = function(doc, useUnsetModifier) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n\n // delete $$hashkey\n doc = $meteorUtils.stripDollarPrefixedKeys(doc);\n var docId = doc._id;\n var isExist = collection.findOne(docId);\n\n // update\n if (isExist) {\n // Deletes _id property (from the copy) so that\n // it can be $set using update.\n delete doc._id;\n var modifier = useUnsetModifier ? {$unset: doc} : {$set: doc};\n // NOTE: do not use #upsert() method, since it does not exist in some collections\n collection.update(docId, modifier, createFulfill(function() {\n return {_id: docId, action: 'updated'};\n }));\n }\n // insert\n else {\n collection.insert(doc, createFulfill(function(id) {\n return {_id: id, action: 'inserted'};\n }));\n }\n\n return deferred.promise;\n };\n\n // performs $pull operations parallely.\n // used for handling splice operations returned from getUpdates() to prevent conflicts.\n // see issue: https://github.com/Urigo/angular-meteor/issues/793\n AngularMeteorCollection._updateDiff = function(selector, update, callback) {\n callback = callback || angular.noop;\n var setters = _.omit(update, '$pull');\n var updates = [setters];\n\n _.each(update.$pull, function(pull, prop) {\n var puller = {};\n puller[prop] = pull;\n updates.push({ $pull: puller });\n });\n\n this._updateParallel(selector, updates, callback);\n };\n\n // performs each update operation parallely\n AngularMeteorCollection._updateParallel = function(selector, updates, callback) {\n var self = this;\n var done = _.after(updates.length, callback);\n\n var next = function(err, affectedDocsNum) {\n if (err) return callback(err);\n done(null, affectedDocsNum);\n };\n\n _.each(updates, function(update) {\n self.$$collection.update(selector, update, next);\n });\n };\n\n AngularMeteorCollection.remove = function(keyOrDocs) {\n var keys;\n\n // remove whole collection\n if (!keyOrDocs) {\n keys = _.pluck(this, '_id');\n }\n // remove docs\n else {\n keyOrDocs = [].concat(keyOrDocs);\n\n keys = _.map(keyOrDocs, function(keyOrDoc) {\n return keyOrDoc._id || keyOrDoc;\n });\n }\n\n // Checks if all keys are correct.\n check(keys, [Match.OneOf(String, Mongo.ObjectID)]);\n\n var promises = keys.map(function(key) {\n return this._removeDoc(key);\n }, this);\n\n return $meteorUtils.promiseAll(promises);\n };\n\n AngularMeteorCollection._removeDoc = function(id) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var fulfill = $meteorUtils.fulfill(deferred, null, { _id: id, action: 'removed' });\n collection.remove(id, fulfill);\n return deferred.promise;\n };\n\n AngularMeteorCollection._updateCursor = function(cursor, autoClientSave) {\n var self = this;\n // XXX - consider adding an option for a non-orderd result for faster performance\n if (self._hObserve) self._stopObserving();\n\n\n self._hObserve = cursor.observe({\n addedAt: function(doc, atIndex) {\n self.splice(atIndex, 0, doc);\n self._serverBackup.splice(atIndex, 0, doc);\n self._setServerUpdateMode();\n },\n\n changedAt: function(doc, oldDoc, atIndex) {\n diffArray.deepCopyChanges(self[atIndex], doc);\n diffArray.deepCopyRemovals(self[atIndex], doc);\n self._serverBackup[atIndex] = self[atIndex];\n self._setServerUpdateMode();\n },\n\n movedTo: function(doc, fromIndex, toIndex) {\n self.splice(fromIndex, 1);\n self.splice(toIndex, 0, doc);\n self._serverBackup.splice(fromIndex, 1);\n self._serverBackup.splice(toIndex, 0, doc);\n self._setServerUpdateMode();\n },\n\n removedAt: function(oldDoc) {\n var removedIndex = $meteorUtils.findIndexById(self, oldDoc);\n\n if (removedIndex != -1) {\n self.splice(removedIndex, 1);\n self._serverBackup.splice(removedIndex, 1);\n self._setServerUpdateMode();\n } else {\n // If it's been removed on client then it's already not in collection\n // itself but still is in the _serverBackup.\n removedIndex = $meteorUtils.findIndexById(self._serverBackup, oldDoc);\n\n if (removedIndex != -1) {\n self._serverBackup.splice(removedIndex, 1);\n }\n }\n }\n });\n\n self._hDataAutorun = Tracker.autorun(function() {\n cursor.fetch();\n if (self._serverMode) self._unsetServerUpdateMode(autoClientSave);\n });\n };\n\n AngularMeteorCollection._stopObserving = function() {\n this._hObserve.stop();\n this._hDataAutorun.stop();\n delete this._serverMode;\n delete this._hUnsetTimeout;\n };\n\n AngularMeteorCollection._setServerUpdateMode = function(name) {\n this._serverMode = true;\n // To simplify server update logic, we don't follow\n // updates from the client at the same time.\n this._unsetAutoClientSave();\n };\n\n // Here we use $timeout to combine multiple updates that go\n // each one after another.\n AngularMeteorCollection._unsetServerUpdateMode = function(autoClientSave) {\n var self = this;\n\n if (self._hUnsetTimeout) {\n $timeout.cancel(self._hUnsetTimeout);\n self._hUnsetTimeout = null;\n }\n\n self._hUnsetTimeout = $timeout(function() {\n self._serverMode = false;\n // Finds updates that was potentially done from the client side\n // and saves them.\n var changes = diffArray.getChanges(self, self._serverBackup, self._diffArrayFunc);\n self._saveChanges(changes);\n // After, continues following client updates.\n if (autoClientSave) self._setAutoClientSave();\n }, 0);\n };\n\n AngularMeteorCollection.stop = function() {\n this._stopCursor();\n this._hNewCurAutorun.stop();\n };\n\n AngularMeteorCollection._stopCursor = function() {\n this._unsetAutoClientSave();\n\n if (this._hObserve) {\n this._hObserve.stop();\n this._hDataAutorun.stop();\n }\n\n this.splice(0);\n this._serverBackup.splice(0);\n };\n\n AngularMeteorCollection._unsetAutoClientSave = function(name) {\n if (this._hRegAutoBind) {\n this._hRegAutoBind();\n this._hRegAutoBind = null;\n }\n };\n\n AngularMeteorCollection._setAutoClientSave = function() {\n var self = this;\n\n // Always unsets auto save to keep only one $watch handler.\n self._unsetAutoClientSave();\n\n self._hRegAutoBind = $rootScope.$watch(function() {\n return self;\n }, function(nItems, oItems) {\n if (nItems === oItems) return;\n\n var changes = diffArray.getChanges(self, oItems, self._diffArrayFunc);\n self._unsetAutoClientSave();\n self._saveChanges(changes);\n self._setAutoClientSave();\n }, true);\n };\n\n AngularMeteorCollection._saveChanges = function(changes) {\n var self = this;\n\n // Saves added documents\n // Using reversed iteration to prevent indexes from changing during splice\n var addedDocs = changes.added.reverse().map(function(descriptor) {\n self.splice(descriptor.index, 1);\n return descriptor.item;\n });\n\n if (addedDocs.length) self.save(addedDocs);\n\n // Removes deleted documents\n var removedDocs = changes.removed.map(function(descriptor) {\n return descriptor.item;\n });\n\n if (removedDocs.length) self.remove(removedDocs);\n\n // Updates changed documents\n changes.changed.forEach(function(descriptor) {\n self._updateDiff(descriptor.selector, descriptor.modifier);\n });\n };\n\n return AngularMeteorCollection;\n}]);\n\nangularMeteorCollection.factory('$meteorCollectionFS', [\n '$meteorCollection', 'diffArray', '$angularMeteorSettings',\n function($meteorCollection, diffArray, $angularMeteorSettings) {\n function $meteorCollectionFS(reactiveFunc, autoClientSave, collection) {\n\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorCollectionFS] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/files. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n return new $meteorCollection(reactiveFunc, autoClientSave, collection, diffArray.shallow);\n }\n\n return $meteorCollectionFS;\n}]);\n\nangularMeteorCollection.factory('$meteorCollection', [\n 'AngularMeteorCollection', '$rootScope', 'diffArray',\n function(AngularMeteorCollection, $rootScope, diffArray) {\n function $meteorCollection(reactiveFunc, autoClientSave, collection, diffFn) {\n // Validate parameters\n if (!reactiveFunc) {\n throw new TypeError('The first argument of $meteorCollection is undefined.');\n }\n\n if (!(angular.isFunction(reactiveFunc) || angular.isFunction(reactiveFunc.find))) {\n throw new TypeError(\n 'The first argument of $meteorCollection must be a function or ' +\n 'a have a find function property.');\n }\n\n if (!angular.isFunction(reactiveFunc)) {\n collection = angular.isDefined(collection) ? collection : reactiveFunc;\n reactiveFunc = _.bind(reactiveFunc.find, reactiveFunc);\n }\n\n // By default auto save - true.\n autoClientSave = angular.isDefined(autoClientSave) ? autoClientSave : true;\n diffFn = diffFn || diffArray;\n return new AngularMeteorCollection(reactiveFunc, collection, diffFn, autoClientSave);\n }\n\n return $meteorCollection;\n}]);\n\nangularMeteorCollection.run([\n '$rootScope', '$meteorCollection', '$meteorCollectionFS', '$meteorStopper',\n function($rootScope, $meteorCollection, $meteorCollectionFS, $meteorStopper) {\n var scopeProto = Object.getPrototypeOf($rootScope);\n scopeProto.$meteorCollection = $meteorStopper($meteorCollection);\n scopeProto.$meteorCollectionFS = $meteorStopper($meteorCollectionFS);\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-collection.js\n **/","/*global\n angular, _, Mongo\n*/\n\nimport _ from '../lib/underscore';\n\n'use strict';\n\nvar angularMeteorObject = angular.module('angular-meteor.object',\n ['angular-meteor.utils', 'angular-meteor.subscribe', 'angular-meteor.collection', 'getUpdates', 'diffArray', 'angular-meteor.settings']);\n\nangularMeteorObject.factory('AngularMeteorObject', [\n '$q', '$meteorSubscribe', '$meteorUtils', 'diffArray', 'getUpdates', 'AngularMeteorCollection', '$angularMeteorSettings',\n function($q, $meteorSubscribe, $meteorUtils, diffArray, getUpdates, AngularMeteorCollection, $angularMeteorSettings) {\n\n // A list of internals properties to not watch for, nor pass to the Document on update and etc.\n AngularMeteorObject.$$internalProps = [\n '$$collection', '$$options', '$$id', '$$hashkey', '$$internalProps', '$$scope',\n 'bind', 'save', 'reset', 'subscribe', 'stop', 'autorunComputation', 'unregisterAutoBind', 'unregisterAutoDestroy', 'getRawObject',\n '_auto', '_setAutos', '_eventEmitter', '_serverBackup', '_updateDiff', '_updateParallel', '_getId'\n ];\n\n function AngularMeteorObject (collection, selector, options){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteorObject] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/meteorObject. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n // Make data not be an object so we can extend it to preserve\n // Collection Helpers and the like\n var helpers = collection._helpers;\n var data = _.isFunction(helpers) ? Object.create(helpers.prototype) : {};\n var doc = collection.findOne(selector, options);\n var collectionExtension = _.pick(AngularMeteorCollection, '_updateParallel');\n _.extend(data, doc);\n _.extend(data, AngularMeteorObject);\n _.extend(data, collectionExtension);\n\n // Omit options that may spoil document finding\n data.$$options = _.omit(options, 'skip', 'limit');\n data.$$collection = collection;\n data.$$id = data._getId(selector);\n data._serverBackup = doc || {};\n\n return data;\n }\n\n AngularMeteorObject.getRawObject = function () {\n return angular.copy(_.omit(this, this.$$internalProps));\n };\n\n AngularMeteorObject.subscribe = function () {\n $meteorSubscribe.subscribe.apply(this, arguments);\n return this;\n };\n\n AngularMeteorObject.save = function(custom) {\n var deferred = $q.defer();\n var collection = this.$$collection;\n var createFulfill = _.partial($meteorUtils.fulfill, deferred, null);\n var oldDoc = collection.findOne(this.$$id);\n var mods;\n\n // update\n if (oldDoc) {\n if (custom)\n mods = { $set: custom };\n else {\n mods = getUpdates(oldDoc, this.getRawObject());\n // If there are no updates, there is nothing to do here, returning\n if (_.isEmpty(mods)) {\n return $q.when({ action: 'updated' });\n }\n }\n\n // NOTE: do not use #upsert() method, since it does not exist in some collections\n this._updateDiff(mods, createFulfill({ action: 'updated' }));\n }\n // insert\n else {\n if (custom)\n mods = _.clone(custom);\n else\n mods = this.getRawObject();\n\n mods._id = mods._id || this.$$id;\n collection.insert(mods, createFulfill({ action: 'inserted' }));\n }\n\n return deferred.promise;\n };\n\n AngularMeteorObject._updateDiff = function(update, callback) {\n var selector = this.$$id;\n AngularMeteorCollection._updateDiff.call(this, selector, update, callback);\n };\n\n AngularMeteorObject.reset = function(keepClientProps) {\n var self = this;\n var options = this.$$options;\n var id = this.$$id;\n var doc = this.$$collection.findOne(id, options);\n\n if (doc) {\n // extend SubObject\n var docKeys = _.keys(doc);\n var docExtension = _.pick(doc, docKeys);\n var clientProps;\n\n _.extend(self, docExtension);\n _.extend(self._serverBackup, docExtension);\n\n if (keepClientProps) {\n clientProps = _.intersection(_.keys(self), _.keys(self._serverBackup));\n } else {\n clientProps = _.keys(self);\n }\n\n var serverProps = _.keys(doc);\n var removedKeys = _.difference(clientProps, serverProps, self.$$internalProps);\n\n removedKeys.forEach(function (prop) {\n delete self[prop];\n delete self._serverBackup[prop];\n });\n }\n\n else {\n _.keys(this.getRawObject()).forEach(function(prop) {\n delete self[prop];\n });\n\n self._serverBackup = {};\n }\n };\n\n AngularMeteorObject.stop = function () {\n if (this.unregisterAutoDestroy)\n this.unregisterAutoDestroy();\n\n if (this.unregisterAutoBind)\n this.unregisterAutoBind();\n\n if (this.autorunComputation && this.autorunComputation.stop)\n this.autorunComputation.stop();\n };\n\n AngularMeteorObject._getId = function(selector) {\n var options = _.extend({}, this.$$options, {\n fields: { _id: 1 },\n reactive: false,\n transform: null\n });\n\n var doc = this.$$collection.findOne(selector, options);\n\n if (doc) return doc._id;\n if (selector instanceof Mongo.ObjectID) return selector;\n if (_.isString(selector)) return selector;\n return new Mongo.ObjectID();\n };\n\n return AngularMeteorObject;\n}]);\n\n\nangularMeteorObject.factory('$meteorObject', [\n '$rootScope', '$meteorUtils', 'getUpdates', 'AngularMeteorObject',\n function($rootScope, $meteorUtils, getUpdates, AngularMeteorObject) {\n function $meteorObject(collection, id, auto, options) {\n // Validate parameters\n if (!collection) {\n throw new TypeError(\"The first argument of $meteorObject is undefined.\");\n }\n\n if (!angular.isFunction(collection.findOne)) {\n throw new TypeError(\"The first argument of $meteorObject must be a function or a have a findOne function property.\");\n }\n\n var data = new AngularMeteorObject(collection, id, options);\n // Making auto default true - http://stackoverflow.com/a/15464208/1426570\n data._auto = auto !== false;\n _.extend(data, $meteorObject);\n data._setAutos();\n return data;\n }\n\n $meteorObject._setAutos = function() {\n var self = this;\n\n this.autorunComputation = $meteorUtils.autorun($rootScope, function() {\n self.reset(true);\n });\n\n // Deep watches the model and performs autobind\n this.unregisterAutoBind = this._auto && $rootScope.$watch(function(){\n return self.getRawObject();\n }, function (item, oldItem) {\n if (item !== oldItem) self.save();\n }, true);\n\n this.unregisterAutoDestroy = $rootScope.$on('$destroy', function() {\n if (self && self.stop) self.pop();\n });\n };\n\n return $meteorObject;\n}]);\n\nangularMeteorObject.run([\n '$rootScope', '$meteorObject', '$meteorStopper',\n function ($rootScope, $meteorObject, $meteorStopper) {\n var scopeProto = Object.getPrototypeOf($rootScope);\n scopeProto.$meteorObject = $meteorStopper($meteorObject);\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-object.js\n **/","/*global\n angular, _, Package, Meteor\n */\n\nimport _ from '../lib/underscore';\n\n'use strict';\n\nvar angularMeteorUser = angular.module('angular-meteor.user', [\n 'angular-meteor.utils',\n 'angular-meteor.core',\n 'angular-meteor.settings'\n]);\n\n// requires package 'accounts-password'\nangularMeteorUser.service('$meteorUser', [\n '$rootScope', '$meteorUtils', '$q', '$angularMeteorSettings',\n function($rootScope, $meteorUtils, $q, $angularMeteorSettings){\n\n var pack = Package['accounts-base'];\n if (!pack) return;\n\n var self = this;\n var Accounts = pack.Accounts;\n\n this.waitForUser = function(){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.waitForUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var deferred = $q.defer();\n\n $meteorUtils.autorun($rootScope, function(){\n if ( !Meteor.loggingIn() )\n deferred.resolve( Meteor.user() );\n }, true);\n\n return deferred.promise;\n };\n\n this.requireUser = function(){\n if (!$angularMeteorSettings.suppressWarnings) {\n console.warn('[angular-meteor.requireUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n }\n\n var deferred = $q.defer();\n\n $meteorUtils.autorun($rootScope, function(){\n if ( !Meteor.loggingIn() ) {\n if ( Meteor.user() === null)\n deferred.reject(\"AUTH_REQUIRED\");\n else\n deferred.resolve( Meteor.user() );\n }\n }, true);\n\n return deferred.promise;\n };\n\n this.requireValidUser = function(validatorFn) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.requireValidUser] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://info.meteor.com/blog/angular-meteor-1.3. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n return self.requireUser(true).then(function(user){\n var valid = validatorFn( user );\n\n if ( valid === true )\n return user;\n else if ( typeof valid === \"string\" )\n return $q.reject( valid );\n else\n return $q.reject( \"FORBIDDEN\" );\n\t });\n\t };\n\n this.loginWithPassword = $meteorUtils.promissor(Meteor, 'loginWithPassword');\n this.createUser = $meteorUtils.promissor(Accounts, 'createUser');\n this.changePassword = $meteorUtils.promissor(Accounts, 'changePassword');\n this.forgotPassword = $meteorUtils.promissor(Accounts, 'forgotPassword');\n this.resetPassword = $meteorUtils.promissor(Accounts, 'resetPassword');\n this.verifyEmail = $meteorUtils.promissor(Accounts, 'verifyEmail');\n this.logout = $meteorUtils.promissor(Meteor, 'logout');\n this.logoutOtherClients = $meteorUtils.promissor(Meteor, 'logoutOtherClients');\n this.loginWithFacebook = $meteorUtils.promissor(Meteor, 'loginWithFacebook');\n this.loginWithTwitter = $meteorUtils.promissor(Meteor, 'loginWithTwitter');\n this.loginWithGoogle = $meteorUtils.promissor(Meteor, 'loginWithGoogle');\n this.loginWithGithub = $meteorUtils.promissor(Meteor, 'loginWithGithub');\n this.loginWithMeteorDeveloperAccount = $meteorUtils.promissor(Meteor, 'loginWithMeteorDeveloperAccount');\n this.loginWithMeetup = $meteorUtils.promissor(Meteor, 'loginWithMeetup');\n this.loginWithWeibo = $meteorUtils.promissor(Meteor, 'loginWithWeibo');\n }\n]);\n\nangularMeteorUser.run([\n '$rootScope', '$angularMeteorSettings', '$$Core',\n function($rootScope, $angularMeteorSettings, $$Core){\n\n let ScopeProto = Object.getPrototypeOf($rootScope);\n _.extend(ScopeProto, $$Core);\n\n $rootScope.autorun(function(){\n if (!Meteor.user) return;\n $rootScope.currentUser = Meteor.user();\n $rootScope.loggingIn = Meteor.loggingIn();\n });\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-user.js\n **/","/*global\n angular, _, Meteor\n */\n\nimport _ from '../lib/underscore';\n\n'use strict';\n\nvar angularMeteorMethods = angular.module('angular-meteor.methods', ['angular-meteor.utils', 'angular-meteor.settings']);\n\nangularMeteorMethods.service('$meteorMethods', [\n '$q', '$meteorUtils', '$angularMeteorSettings',\n function($q, $meteorUtils, $angularMeteorSettings) {\n this.call = function(){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.$meteor.call] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/methods. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var deferred = $q.defer();\n var fulfill = $meteorUtils.fulfill(deferred);\n var args = _.toArray(arguments).concat(fulfill);\n Meteor.call.apply(this, args);\n return deferred.promise;\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-methods.js\n **/","/*global\n angular, Session\n */\n\n'use strict';\nvar angularMeteorSession = angular.module('angular-meteor.session', ['angular-meteor.utils', 'angular-meteor.settings']);\n\nangularMeteorSession.factory('$meteorSession', ['$meteorUtils', '$parse', '$angularMeteorSettings',\n function ($meteorUtils, $parse, $angularMeteorSettings) {\n return function (session) {\n\n return {\n\n bind: function(scope, model) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.session.bind] Please note that this method is deprecated since 1.3.0 and will be removed in 1.4.0! http://www.angular-meteor.com/api/1.3.0/session. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n var getter = $parse(model);\n var setter = getter.assign;\n $meteorUtils.autorun(scope, function() {\n setter(scope, Session.get(session));\n });\n\n scope.$watch(model, function(newItem, oldItem) {\n Session.set(session, getter(scope));\n }, true);\n\n }\n };\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-session.js\n **/","/*global\n angular, Package\n */\n\n'use strict';\n\nvar angularMeteorCamera = angular.module('angular-meteor.camera', ['angular-meteor.utils', 'angular-meteor.settings']);\n\n// requires package 'mdg:camera'\nangularMeteorCamera.service('$meteorCamera', [\n '$q', '$meteorUtils', '$angularMeteorSettings',\n function ($q, $meteorUtils, $angularMeteorSettings) {\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n var pack = Package['mdg:camera'];\n if (!pack) return;\n\n var MeteorCamera = pack.MeteorCamera;\n\n this.getPicture = function(options){\n if (!$angularMeteorSettings.suppressWarnings)\n console.warn('[angular-meteor.camera] Please note that this module has moved to a separate package and is deprecated since 1.3.0 and will be removed in 1.4.0! For more info: http://www.angular-meteor.com/api/1.3.0/camera. You can disable this warning by following this guide http://www.angular-meteor.com/api/1.3.6/settings');\n\n options = options || {};\n var deferred = $q.defer();\n MeteorCamera.getPicture(options, $meteorUtils.fulfill(deferred));\n return deferred.promise;\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-camera.js\n **/","/*global\n angular\n */\n\n'use strict';\n\nvar angularMeteorStopper = angular.module('angular-meteor.stopper',\n ['angular-meteor.subscribe']);\n\nangularMeteorStopper.factory('$meteorStopper', ['$q', '$meteorSubscribe',\n function($q, $meteorSubscribe) {\n function $meteorStopper($meteorEntity) {\n return function() {\n var args = Array.prototype.slice.call(arguments);\n var meteorEntity = $meteorEntity.apply(this, args);\n\n angular.extend(meteorEntity, $meteorStopper);\n meteorEntity.$$scope = this;\n\n this.$on('$destroy', function () {\n meteorEntity.stop();\n if (meteorEntity.subscription) meteorEntity.subscription.stop();\n });\n\n return meteorEntity;\n };\n }\n\n $meteorStopper.subscribe = function() {\n var args = Array.prototype.slice.call(arguments);\n this.subscription = $meteorSubscribe._subscribe(this.$$scope, $q.defer(), args);\n return this;\n };\n\n return $meteorStopper;\n}]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/angular-meteor-stopper.js\n **/","import _ from '../lib/underscore';\n\nexport const name = 'angular-meteor.utilities';\nexport const utils = '$$utils';\n\nangular.module(name, [])\n\n/*\n A utility service which is provided with general utility functions\n */\n.service(utils, [\n '$rootScope',\n\n function($rootScope) {\n const self = this;\n\n // Checks if an object is a cursor\n this.isCursor = (obj) => {\n return obj instanceof Meteor.Collection.Cursor;\n };\n\n // Cheecks if an object is a scope\n this.isScope = (obj) => {\n return obj instanceof $rootScope.constructor;\n };\n\n // Checks if an object is a view model\n this.isViewModel = (obj) => {\n return _.isObject(obj) && obj.$$dependencies;\n };\n\n // Checks if two objects are siblings\n this.areSiblings = (obj1, obj2) => {\n return _.isObject(obj1) && _.isObject(obj2) &&\n Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n };\n\n // Binds function into a scpecified context. If an object is provided, will bind every\n // value in the object which is a function. If a tap function is provided, it will be\n // called right after the function has been invoked.\n this.bind = (fn, context, tap) => {\n tap = _.isFunction(tap) ? tap : angular.noop;\n if (_.isFunction(fn)) return bindFn(fn, context, tap);\n if (_.isObject(fn)) return bindObj(fn, context, tap);\n return fn;\n };\n\n function bindFn(fn, context, tap) {\n return (...args) => {\n const result = fn.apply(context, args);\n tap.call(context, {\n result,\n args\n });\n return result;\n };\n }\n\n function bindObj(obj, context, tap) {\n return _.keys(obj).reduce((bound, k) => {\n bound[k] = self.bind(obj[k], context, tap);\n return bound;\n }, {});\n }\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/utils.js\n **/","import _ from '../lib/underscore';\n\nexport const name = 'angular-meteor.mixer';\nexport const Mixer = '$Mixer';\n\nangular.module(name, [])\n\n/*\n A service which lets us apply mixins into Scope.prototype.\n The flow is simple. Once we define a mixin, it will be stored in the `$Mixer`,\n and any time a `ChildScope` prototype is created\n it will be extended by the `$Mixer`.\n This concept is good because it keeps our code\n clean and simple, and easy to extend.\n So any time we would like to define a new behaviour to our scope,\n we will just use the `$Mixer` service.\n */\n.service(Mixer, function() {\n // Used to store method's caller\n let caller;\n\n this._mixins = [];\n // Apply mixins automatically on specified contexts\n this._autoExtend = [];\n this._autoConstruct = [];\n\n // Adds a new mixin\n this.mixin = (mixin) => {\n if (!_.isObject(mixin)) {\n throw Error('argument 1 must be an object');\n }\n\n this._mixins = _.union(this._mixins, [mixin]);\n // Apply mixins to stored contexts\n this._autoExtend.forEach(context => this._extend(context));\n this._autoConstruct.forEach(context => this._construct(context));\n return this;\n };\n\n // Removes a mixin. Useful mainly for test purposes\n this._mixout = (mixin) => {\n this._mixins = _.without(this._mixins, mixin);\n return this;\n };\n\n // Invoke function mixins with the provided context and arguments\n this._construct = (context, ...args) => {\n this._mixins.filter(_.isFunction).forEach((mixin) => {\n mixin.call(context, ...args);\n });\n\n return context;\n };\n\n // Extend prototype with the defined mixins\n this._extend = (obj, options) => {\n const { pattern, context } = _.defaults({}, options, {\n pattern: /.*/, // The patterns of the keys which will be filtered\n });\n\n const mixins = this._mixins.map((mixin) => {\n // Filtering the keys by the specified pattern\n const keys = _.keys(mixin)\n .filter(k => k.match(pattern))\n .filter(k => _.isFunction(mixin[k]));\n\n return keys.reduce((boundMixin, methodName) => {\n const methodHandler = mixin[methodName];\n\n // Note that this is not an arrow function so we can conserve the conetxt\n boundMixin[methodName] = function(...args) {\n // Storing original caller so we will know who actually called the\n // method event though it is bound to another context\n const methodContext = context || this;\n const recentCaller = caller;\n caller = this;\n\n try {\n return methodHandler.apply(methodContext, args);\n }\n finally {\n // No matter what happens, restore variable to the previous one\n caller = recentCaller;\n }\n };\n\n return boundMixin;\n }, {});\n });\n\n return _.extend(obj, ...mixins);\n };\n\n // Caller property can not be set\n Object.defineProperty(this, 'caller', {\n configurable: true,\n enumerable: true,\n\n get: () => {\n return caller;\n }\n });\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/mixer.js\n **/","import { name as mixerName, Mixer } from './mixer';\n\nexport const name = 'angular-meteor.scope';\n\nangular.module(name, [\n mixerName\n])\n\n.run([\n '$rootScope',\n Mixer,\n function($rootScope, $Mixer) {\n const Scope = $rootScope.constructor;\n const $new = $rootScope.$new;\n\n // Apply extensions whether a mixin in defined.\n // Note that this way mixins which are initialized later\n // can be applied on rootScope.\n $Mixer._autoExtend.push(Scope.prototype);\n $Mixer._autoConstruct.push($rootScope);\n\n Scope.prototype.$new = function() {\n const scope = $new.apply(this, arguments);\n // Apply constructors to newly created scopes\n return $Mixer._construct(scope);\n };\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/scope.js\n **/","import _ from '../lib/underscore';\nimport { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\n\nexport const name = 'angular-meteor.core';\nexport const Core = '$$Core';\n\nangular.module(name, [\n utilsName,\n mixerName\n])\n\n\n/*\n A mixin which provides us with core Meteor functions.\n */\n.factory(Core, [\n '$q',\n utils,\n Mixer,\n\n function($q, $$utils, $Mixer) {\n function $$Core() {}\n\n // Calls Meteor.autorun() which will be digested after each run and automatically destroyed\n $$Core.autorun = function(fn, options = {}) {\n fn = this.$bindToContext($Mixer.caller, fn);\n\n if (!_.isFunction(fn)) {\n throw Error('argument 1 must be a function');\n }\n if (!_.isObject(options)) {\n throw Error('argument 2 must be an object');\n }\n\n const computation = Tracker.autorun(fn, options);\n this.$$autoStop(computation);\n return computation;\n };\n\n // Calls Meteor.subscribe() which will be digested after each invokation\n // and automatically destroyed\n $$Core.subscribe = function(subName, fn, cb) {\n fn = this.$bindToContext($Mixer.caller, fn || angular.noop);\n cb = cb ? this.$bindToContext($Mixer.caller, cb) : angular.noop;\n\n if (!_.isString(subName)) {\n throw Error('argument 1 must be a string');\n }\n if (!_.isFunction(fn)) {\n throw Error('argument 2 must be a function');\n }\n if (!_.isFunction(cb) && !_.isObject(cb)) {\n throw Error('argument 3 must be a function or an object');\n }\n\n const result = {};\n\n const computation = this.autorun(() => {\n let args = fn();\n if (angular.isUndefined(args)) args = [];\n\n if (!_.isArray(args)) {\n throw Error(`reactive function's return value must be an array`);\n }\n\n const subscription = Meteor.subscribe(subName, ...args, cb);\n result.ready = subscription.ready.bind(subscription);\n result.subscriptionId = subscription.subscriptionId;\n });\n\n // Once the computation has been stopped,\n // any subscriptions made inside will be stopped as well\n result.stop = computation.stop.bind(computation);\n return result;\n };\n\n // Calls Meteor.call() wrapped by a digestion cycle\n $$Core.callMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n return Meteor.call(...args, fn);\n };\n\n // Calls Meteor.apply() wrapped by a digestion cycle\n $$Core.applyMethod = function(...args) {\n let fn = args.pop();\n if (_.isFunction(fn)) fn = this.$bindToContext($Mixer.caller, fn);\n return Meteor.apply(...args, fn);\n };\n\n $$Core.$$autoStop = function(stoppable) {\n this.$on('$destroy', stoppable.stop.bind(stoppable));\n };\n\n // Digests scope only if there is no phase at the moment\n $$Core.$$throttledDigest = function() {\n const isDigestable = !this.$$destroyed &&\n !this.$$phase &&\n !this.$root.$$phase;\n\n if (isDigestable) this.$digest();\n };\n\n // Creates a promise only that the digestion cycle will be called at its fulfillment\n $$Core.$$defer = function() {\n const deferred = $q.defer();\n // Once promise has been fulfilled, digest\n deferred.promise = deferred.promise.finally(this.$$throttledDigest.bind(this));\n return deferred;\n };\n\n // Binds an object or a function to the provided context and digest it once it is invoked\n $$Core.$bindToContext = function(context, fn) {\n return $$utils.bind(fn, context, this.$$throttledDigest.bind(this));\n };\n\n return $$Core;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/core.js\n **/","import _ from '../lib/underscore';\nimport { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\nimport { name as coreName } from './core';\n\nexport const name = 'angular-meteor.view-model';\nexport const ViewModel = '$$ViewModel';\nexport const reactive = '$reactive';\n\nangular.module(name, [\n utilsName,\n mixerName,\n coreName\n])\n\n/*\n A mixin which lets us bind a view model into a scope.\n Note that only a single view model can be bound,\n otherwise the scope might behave unexpectedly.\n Mainly used to define the controller as the view model,\n and very useful when wanting to use Angular's `controllerAs` syntax.\n */\n.factory(ViewModel, [\n utils,\n Mixer,\n\n function($$utils, $Mixer) {\n function $$ViewModel() {}\n\n // Gets an object, wraps it with scope functions and returns it\n $$ViewModel.viewModel = function(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n // Extend view model with mixin functions\n $Mixer._extend(vm, {\n pattern: /^(?!\\$\\$).*$/, // Omitting methods which start with a $$ notation\n context: this // Binding methods to scope\n });\n\n // Apply mixin constructors on scope with view model\n $Mixer._construct(this, vm);\n return vm;\n };\n\n return $$ViewModel;\n }\n])\n\n\n/*\n Illustrates the old API where a view model is created using $reactive service\n */\n.service(reactive, [\n utils,\n\n function($$utils) {\n class Reactive {\n constructor(vm) {\n if (!_.isObject(vm)) {\n throw Error('argument 1 must be an object');\n }\n\n _.defer(() => {\n if (!this._attached) {\n console.warn('view model was not attached to any scope');\n }\n });\n\n this._vm = vm;\n }\n\n attach(scope) {\n this._attached = true;\n\n if (!$$utils.isScope(scope)) {\n throw Error('argument 1 must be a scope');\n }\n\n const viewModel = scope.viewModel(this._vm);\n\n // Similar to the old/Meteor API\n viewModel.call = viewModel.callMethod;\n viewModel.apply = viewModel.applyMethod;\n\n return viewModel;\n }\n }\n\n return (vm) => new Reactive(vm);\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/view-model.js\n **/","import jsondiffpatch from 'jsondiffpatch';\nimport _ from '../lib/underscore';\nimport { name as utilsName, utils } from './utils';\nimport { name as mixerName, Mixer } from './mixer';\nimport { name as coreName } from './core';\nimport { name as viewModelName } from './view-model';\n\nexport const name = 'angular-meteor.reactive';\nexport const Reactive = '$$Reactive';\n\nangular.module(name, [\n utilsName,\n mixerName,\n coreName,\n viewModelName\n])\n\n\n/*\n A mixin which enhance our reactive abilities by providing methods\n that are capable of updating our scope reactively.\n */\n.factory(Reactive, [\n '$parse',\n utils,\n Mixer,\n\n function($parse, $$utils, $Mixer) {\n function $$Reactive(vm = this) {\n // Helps us track changes made in the view model\n vm.$$dependencies = {};\n }\n\n // Gets an object containing functions and define their results as reactive properties.\n // Once a return value has been changed the property will be reset.\n $$Reactive.helpers = function(vm, props) {\n if ($$utils.isViewModel(vm)) {\n if (!_.isObject(props)) {\n throw Error('argument 2 must be an object');\n }\n } else {\n props = vm;\n vm = $Mixer.caller;\n\n if (!_.isObject(props)) {\n throw Error('argument 1 must be an object');\n }\n }\n\n _.each(props, (v, k) => {\n if (!_.isFunction(v)) {\n throw Error(`helper '${k}' must be a function`);\n }\n });\n\n _.each(props, (v, k) => {\n if (!vm.$$dependencies[k]) {\n // Registers a new dependency to the specified helper\n vm.$$dependencies[k] = new Tracker.Dependency();\n }\n\n this.$$setFnHelper(vm, k, v);\n });\n };\n\n // Gets a model reactively\n $$Reactive.getReactively = function(vm, k, isDeep) {\n if ($$utils.isViewModel(vm)) {\n if (angular.isUndefined(isDeep)) isDeep = false;\n\n if (!_.isString(k)) {\n throw Error('argument 2 must be a string');\n }\n if (!_.isBoolean(isDeep)) {\n throw Error('argument 3 must be a boolean');\n }\n } else {\n isDeep = angular.isDefined(k) ? k : false;\n k = vm;\n vm = $Mixer.caller;\n\n if (!_.isString(k)) {\n throw Error('argument 1 must be a string');\n }\n if (!_.isBoolean(isDeep)) {\n throw Error('argument 2 must be a boolean');\n }\n }\n\n return this.$$reactivateEntity(vm, k, this.$watch, isDeep);\n };\n\n // Gets a collection reactively\n $$Reactive.getCollectionReactively = function(vm, k) {\n if ($$utils.isViewModel(vm)) {\n if (!_.isString(k)) {\n throw Error('argument 2 must be a string');\n }\n } else {\n k = vm;\n vm = $Mixer.caller;\n\n if (!_.isString(k)) {\n throw Error('argument 1 must be a string');\n }\n }\n\n return this.$$reactivateEntity(vm, k, this.$watchCollection);\n };\n\n // Gets an entity reactively, and once it has been changed the computation will be recomputed\n $$Reactive.$$reactivateEntity = function(vm, k, watcher, ...watcherArgs) {\n if (!vm.$$dependencies[k]) {\n vm.$$dependencies[k] = new Tracker.Dependency();\n this.$$watchEntity(vm, k, watcher, ...watcherArgs);\n }\n\n vm.$$dependencies[k].depend();\n return $parse(k)(vm);\n };\n\n // Watches for changes in the view model, and if so will notify a change\n $$Reactive.$$watchEntity = function(vm, k, watcher, ...watcherArgs) {\n // Gets a deep property from the caller\n const getVal = _.partial($parse(k), vm);\n const initialVal = getVal();\n\n // Watches for changes in the view model\n watcher.call(this, getVal, (val, oldVal) => {\n const hasChanged =\n val !== initialVal ||\n val !== oldVal;\n\n // Notify if a change has been detected\n if (hasChanged) this.$$changed(vm, k);\n }, ...watcherArgs);\n };\n\n // Invokes a function and sets the return value as a property\n $$Reactive.$$setFnHelper = function(vm, k, fn) {\n let activeObservation = null;\n let lastModel = null;\n let lastModelData = [];\n\n this.autorun((/* computation */) => {\n // Invokes the reactive functon\n const model = fn.apply(vm);\n\n // Ignore notifications made by the following handler\n Tracker.nonreactive(() => {\n // If a cursor, observe its changes and update acoordingly\n if ($$utils.isCursor(model)) {\n let modelData;\n\n if (angular.isUndefined(vm[k])) {\n this.$$setValHelper(vm, k, [], false);\n }\n\n if (activeObservation) {\n lastModelData = lastModel.fetch();\n activeObservation.stop();\n activeObservation = null;\n }\n\n const handle = this.$$handleCursor(vm, k, model);\n\n activeObservation = handle.observation;\n modelData = handle.data;\n\n if (lastModelData.length !== 0) {\n const diff = jsondiffpatch.diff(lastModelData, modelData);\n vm[k] = jsondiffpatch.patch(lastModelData, diff);\n } else {\n vm[k] = modelData;\n }\n\n lastModel = model;\n lastModelData = modelData;\n\n /* computation.onInvalidate(() => {\n activeObservation.stop();\n });*/\n } else {\n this.$$handleNonCursor(vm, k, model);\n }\n\n // Notify change and update the view model\n this.$$changed(vm, k);\n });\n });\n };\n\n // Sets a value helper as a setter and a getter which will notify computations once used\n $$Reactive.$$setValHelper = function(vm, k, v, watch = true) {\n // If set, reactives property\n if (watch) {\n const isDeep = _.isObject(v);\n this.getReactively(vm, k, isDeep);\n }\n\n Object.defineProperty(vm, k, {\n configurable: true,\n enumerable: true,\n\n get: () => {\n return v;\n },\n set: (newVal) => {\n v = newVal;\n this.$$changed(vm, k);\n }\n });\n };\n\n // Fetching a cursor and updates properties once the result set has been changed\n $$Reactive.$$handleCursor = function(vm, k, cursor) {\n const data = [];\n // Observe changes made in the result set\n const observation = cursor.observe({\n addedAt: (doc, atIndex) => {\n if (!observation) {\n data.push(doc);\n return;\n }\n vm[k].splice(atIndex, 0, doc);\n this.$$changed(vm, k);\n },\n changedAt: (doc, oldDoc, atIndex) => {\n const diff = jsondiffpatch.diff(vm[k][atIndex], doc);\n jsondiffpatch.patch(vm[k][atIndex], diff);\n this.$$changed(vm, k);\n },\n movedTo: (doc, fromIndex, toIndex) => {\n vm[k].splice(fromIndex, 1);\n vm[k].splice(toIndex, 0, doc);\n this.$$changed(vm, k);\n },\n removedAt: (oldDoc, atIndex) => {\n vm[k].splice(atIndex, 1);\n this.$$changed(vm, k);\n }\n });\n\n return {\n observation,\n data\n };\n };\n\n $$Reactive.$$handleNonCursor = function(vm, k, data) {\n let v = vm[k];\n\n if (angular.isDefined(v)) {\n delete vm[k];\n v = null;\n }\n\n if (angular.isUndefined(v)) {\n this.$$setValHelper(vm, k, data);\n }\n // Update property if the new value is from the same type\n else if ($$utils.areSiblings(v, data)) {\n const diff = jsondiffpatch.diff(v, data);\n jsondiffpatch.patch(v, diff);\n this.$$changed(vm, k);\n } else {\n vm[k] = data;\n }\n };\n\n // Notifies dependency in view model\n $$Reactive.$$depend = function(vm, k) {\n vm.$$dependencies[k].depend();\n };\n\n // Notifies change in view model\n $$Reactive.$$changed = function(vm, k) {\n this.$$throttledDigest();\n vm.$$dependencies[k].changed();\n };\n\n return $$Reactive;\n }\n]);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/reactive.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_22__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"jsondiffpatch\"\n ** module id = 22\n ** module chunks = 0\n **/","export const name = 'angular-templates';\n\ntry {\n angular.module(name);\n} catch (e) {\n angular.module(name, []);\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/modules/templates.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index a74348215..e8537cca0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-meteor", - "version": "1.3.7", + "version": "1.3.9", "main": "dist/angular-meteor.js", "description": "Combining the simplicity and power of AngularJS and Meteor", "keywords": [ diff --git a/packages/angular-meteor-data/.versions b/packages/angular-meteor-data/.versions index 2f3e594da..a9c757596 100644 --- a/packages/angular-meteor-data/.versions +++ b/packages/angular-meteor-data/.versions @@ -1,4 +1,4 @@ -angular-meteor-data@0.3.0 +angular-meteor-data@1.3.9 angular:angular@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 diff --git a/packages/angular-meteor-data/package.js b/packages/angular-meteor-data/package.js index c25857bdd..d36d78017 100644 --- a/packages/angular-meteor-data/package.js +++ b/packages/angular-meteor-data/package.js @@ -1,12 +1,12 @@ Package.describe({ name: 'angular-meteor-data', summary: 'Everything you need to use AngularJS in your Meteor app', - version: '0.3.0', + version: '1.3.9', git: 'https://github.com/Urigo/angular-meteor.git' }); Npm.depends({ - 'angular-meteor': '1.3.7' + 'angular-meteor': '1.3.9' }); Package.onUse(function (api) { diff --git a/packages/angular-templates/.versions b/packages/angular-templates/.versions index b546a7040..bd17a79a8 100644 --- a/packages/angular-templates/.versions +++ b/packages/angular-templates/.versions @@ -1,4 +1,4 @@ -angular-templates@1.0.0 +angular-templates@1.0.2 babel-compiler@5.8.24_1 babel-runtime@0.1.4 base64@1.0.4 diff --git a/packages/angular-templates/package.js b/packages/angular-templates/package.js index 576253851..3b6dc46bf 100644 --- a/packages/angular-templates/package.js +++ b/packages/angular-templates/package.js @@ -1,7 +1,7 @@ Package.describe({ name: 'angular-templates', summary: 'Compile angular templates into the template cache', - version: '1.0.0', + version: '1.0.2', git: 'https://github.com/Urigo/angular-meteor.git', documentation: null }); @@ -30,7 +30,7 @@ Package.registerBuildPlugin({ Package.onUse(function(api) { api.versionsFrom('METEOR@1.2.0.1'); api.use('isobuild:compiler-plugin@1.0.0'); - api.use('angular-meteor-data@0.0.8', 'client', { weak: true }); + api.use('angular-meteor-data@1.3.9', 'client', { weak: true }); api.use('angular:angular@1.4.8', 'client', { weak: true }); api.addFiles('templates-handler.js', 'client'); diff --git a/packages/angular-with-blaze/.versions b/packages/angular-with-blaze/.versions index 921ca6fbe..e8d99ff32 100644 --- a/packages/angular-with-blaze/.versions +++ b/packages/angular-with-blaze/.versions @@ -1,6 +1,6 @@ angular-blaze-templates-compiler@0.0.1 -angular-meteor-data@0.3.0 -angular-with-blaze@1.3.7 +angular-meteor-data@1.3.9 +angular-with-blaze@1.3.9 angular:angular@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 diff --git a/packages/angular-with-blaze/package.js b/packages/angular-with-blaze/package.js index 28758b419..57401f33a 100644 --- a/packages/angular-with-blaze/package.js +++ b/packages/angular-with-blaze/package.js @@ -1,7 +1,7 @@ Package.describe({ name: "angular-with-blaze", summary: "Everything you need to use both AngularJS and Blaze templates in your Meteor app", - version: "1.3.7", + version: "1.3.9", git: "https://github.com/Urigo/angular-meteor.git", documentation: "../../README.md" }); @@ -12,7 +12,7 @@ Package.onUse(function (api) { api.imply([ 'blaze-html-templates', - 'angular-meteor-data@0.3.0', + 'angular-meteor-data@1.3.9', 'angular-blaze-templates-compiler@0.0.1' ]); }); diff --git a/packages/angular/.versions b/packages/angular/.versions index c47b76921..57b567114 100644 --- a/packages/angular/.versions +++ b/packages/angular/.versions @@ -1,6 +1,6 @@ -angular@1.3.7 -angular-meteor-data@0.3.0 -angular-templates@1.0.0 +angular@1.3.9 +angular-meteor-data@1.3.9 +angular-templates@1.0.2 angular:angular@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 diff --git a/packages/angular/package.js b/packages/angular/package.js index fa0e01c1b..e90419a16 100644 --- a/packages/angular/package.js +++ b/packages/angular/package.js @@ -1,7 +1,7 @@ Package.describe({ name: "angular", summary: "Everything you need to use AngularJS in your Meteor app", - version: "1.3.7", + version: "1.3.9", git: "https://github.com/Urigo/angular-meteor.git", documentation: "../../README.md" }); @@ -10,8 +10,8 @@ Package.onUse(function (api) { api.versionsFrom('METEOR@1.2.0.1'); api.imply([ - 'angular-meteor-data@0.3.0', - 'angular-templates@1.0.0', + 'angular-meteor-data@1.3.9', + 'angular-templates@1.0.2', 'pbastowski:angular-babel@1.0.9' ]); }); diff --git a/packages/urigo-angular/.versions b/packages/urigo-angular/.versions index 19bc91134..26aedc4e0 100644 --- a/packages/urigo-angular/.versions +++ b/packages/urigo-angular/.versions @@ -1,6 +1,6 @@ -angular@1.3.7 -angular-meteor-data@0.3.0 -angular-templates@1.0.0 +angular@1.3.9 +angular-meteor-data@1.3.9 +angular-templates@1.0.2 angular:angular@1.4.8 babel-compiler@5.8.24_1 babel-runtime@0.1.4 @@ -53,6 +53,6 @@ templating-tools@1.0.0 tracker@1.0.9 ui@1.0.8 underscore@1.0.4 -urigo:angular@1.3.7 +urigo:angular@1.3.9 webapp@1.2.3 webapp-hashing@1.0.5 diff --git a/packages/urigo-angular/package.js b/packages/urigo-angular/package.js index 53fe94fa2..50dff15a5 100644 --- a/packages/urigo-angular/package.js +++ b/packages/urigo-angular/package.js @@ -1,11 +1,11 @@ Package.describe({ name: "urigo:angular", summary: "Deprecated: use the official `angular` package instead!", - version: "1.3.7", + version: "1.3.9", git: "https://github.com/Urigo/angular-meteor.git", documentation: null }); Package.on_use(function (api) { - api.imply("angular@1.3.7"); + api.imply("angular@1.3.9"); });