From 1a89a261c0c3be2113dad0afab54cc376a229bfc Mon Sep 17 00:00:00 2001 From: Molly Jones Date: Tue, 23 Feb 2016 13:59:37 -0800 Subject: [PATCH] Release v1.6.3 --- Gruntfile.js | 2 +- bower.json | 2 +- dist/CHANGELOG.md | 7 + dist/components/assignment/assignment.js | 2 +- dist/components/assignment/index.html | 6 +- dist/components/login/index.html | 6 +- .../epicenter-multiplayer-dependencies.min.js | 2 +- ...center-multiplayer-dependencies.min.js.map | 2 +- dist/epicenter.js | 1430 ++++++++++------- dist/epicenter.min.js | 35 +- dist/epicenter.min.js.map | 2 +- package.json | 2 +- 12 files changed, 910 insertions(+), 588 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 47de718c..80040bd4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,7 +19,7 @@ module.exports = function (grunt) { grunt.registerTask('release', function (type) { //TODO: Integrate 'changelog' in here when it's stable type = type ? type : 'patch'; - ['bump-only:' + type, 'changelog', 'production', 'bump-commit'].forEach(function (task) { + ['bump-only:' + type, 'production', 'bump-commit'].forEach(function (task) { grunt.task.run(task); }); }); diff --git a/bower.json b/bower.json index 3569232d..47cd0646 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "epicenter-js-libs", - "version": "1.6.2", + "version": "1.6.3", "homepage": "https://github.com/forio/epicenter-js-libs", "authors": [ "Naren Ranjit " diff --git a/dist/CHANGELOG.md b/dist/CHANGELOG.md index 27322bcb..5740d28b 100644 --- a/dist/CHANGELOG.md +++ b/dist/CHANGELOG.md @@ -1,3 +1,10 @@ + +### 1.6.3 (2016-02-24) + - Updates for the [run strategies](https://forio.com/epicenter/docs/public/api_adapters/strategy/) to use group name rather than group id to create runs with specific scope. + - Addition of the `Auto-Restore` header to the Variables API Service `query()` call; previously it had only been set for the `load()` call. This header means that runs are automatically pulled from the Epicenter backend database into memory (and replayed) when they are queried. A run must be in memory in order to update model variables or call model operations. + - Clean up of the Authentication API Service `logout()` call; it no longer calls the (unsupported) Epicenter delete. + - Documentation improvements, including more information on running Epicenter projects locally and additional examples when using Asset API Adapter. + ### 1.6.2 (2015-12-29) - Internal refactoring to add support for version numbers in upcoming Epicenter APIs. diff --git a/dist/components/assignment/assignment.js b/dist/components/assignment/assignment.js index 6131edfa..74ae582d 100644 --- a/dist/components/assignment/assignment.js +++ b/dist/components/assignment/assignment.js @@ -1231,4 +1231,4 @@ module.exports = function (base, props, staticProps) { }; },{}]},{},[6]) -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9ncnVudC1icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL2Fzc2lnbm1lbnQtcm93LmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy9hc3NpZ25tZW50LmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy9iYXNlLWNvbGxlY3Rpb24uanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL2Jhc2UtbW9kZWwuanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL2RlZmF1bHRzLmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy9pbmRleC5qcyIsInNyYy9jb21wb25lbnRzL2Fzc2lnbm1lbnQvanMvcHJvamVjdC1tb2RlbC5qcyIsInNyYy9jb21wb25lbnRzL2Fzc2lnbm1lbnQvanMvc2VydmljZS1sb2NhdG9yLmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy90ZW1wbGF0ZXMuanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL3VzZXItbW9kZWwuanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL3VzZ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7XG4gICAgICAgICAgICAgICAgcXVldWUuYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZXcubWFrZUluYWN0aXZlKClcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgICAgICBxdWV1ZS5leGVjdXRlKHRoaXMpLnRoZW4oZG9uZSk7XG4gICAgICAgIH0uYmluZCh0aGlzKTtcblxuICAgICAgICByZXR1cm4gdGhpcy51bmFzc2lnblVzZXJzKGlkcylcbiAgICAgICAgICAgIC50aGVuKG1ha2VVc2Vyc0luYWN0aXZlKTtcblxuXG4gICAgfSxcblxuICAgIHJlbmRlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLiQoJ3RhYmxlIHRib2R5JykuZW1wdHkoKTtcbiAgICAgICAgdGhpcy5yZW5kZXJUYWJsZSgpO1xuICAgICAgICB0aGlzLnRvZ2dsZUNvbnRyb2xscygpO1xuICAgIH0sXG5cbiAgICByZW5kZXJUYWJsZTogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLnJvd1ZpZXdzID0ge307XG4gICAgICAgIHZhciByb3dzID0gW107XG4gICAgICAgIHRoaXMudXNlcnMuZWFjaChmdW5jdGlvbiAodSkge1xuICAgICAgICAgICAgdmFyIHZpZXcgPSBuZXcgQXNzaWduZW1udFJvdyh7IG1vZGVsOiB1LCB3b3JsZHM6IHRoaXMud29ybGRzLCBwcm9qZWN0OiB0aGlzLnByb2plY3QgfSk7XG4gICAgICAgICAgICB0aGlzLnJvd1ZpZXdzW3UuZ2V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XG4gICAgICAgIGlmICghbW9kZWxzKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBtb2RlbHMgPSBbXS5jb25jYXQobW9kZWxzKTtcblxuICAgICAgICBpZiAoIW1vZGVscy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIF8uZWFjaChtb2RlbHMsIGZ1bmN0aW9uIChtKSB7XG4gICAgICAgICAgICBpZiAoIShtIGluc3RhbmNlb2YgdGhpcy5tb2RlbCkpIHtcbiAgICAgICAgICAgICAgICBtID0gbmV3IHRoaXMubW9kZWwobSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG0uY29sbGVjdGlvbiA9IHRoaXM7XG5cbiAgICAgICAgICAgIHRoaXMuX21vZGVscy5wdXNoKG0pO1xuICAgICAgICB9LCB0aGlzKTtcblxuICAgICAgICB0aGlzLnNvcnQuY2FsbCh0aGlzKTtcblxuICAgICAgICByZXR1cm4gbW9kZWxzO1xuICAgIH0sXG5cbiAgICBzb3J0Rm46IGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICAgIHJldHVybiBiLl9kYXRhW3RoaXMuaWRBdHRyaWJ1dGVdIC0gYS5fZGF0YVt0aGlzLmlkQXR0cmlidXRlXTtcbiAgICB9LFxuXG4gICAgc29ydDogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLl9tb2RlbHMgPSB0aGlzLl9tb2RlbHMuc29ydCh0aGlzLnNvcnRGbi5iaW5kKHRoaXMpKTtcblxuICAgICAgICByZXR1cm4gdGhpcy5fbW9kZWxzO1xuICAgIH0sXG5cbiAgICBnZXRCeUlkOiBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgcmV0dXJuIF8uZmluZCh0aGlzLl9tb2RlbHMsIGZ1bmN0aW9uIChtKSB7XG4gICAgICAgICAgICByZXR1cm4gbS5nZXQodGhpcy5pZEF0dHJpYnV0ZSkgPT09IGlkO1x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iAoKSB7XG4gICAgICAgIHZhciBkdGQgPSAkLkRlZmVycmVkKCk7XG4gICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgIHZhciBncm91cElkID0gZW52LmdldCgpLmdyb3VwSWQ7XG5cbiAgICAgICAgdmFyIGdldEdyb3VwVXNlcnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgbWVtYmVyQXBpID0gc2VydmljZUxvY2F0b3IubWVtYmVyQXBpKCk7XG4gICAgICAgICAgICB2YXIgdXNlckFwaSA9IHNlcnZpY2VMb2NhdG9yLnVzZXJBcGkoKTtcblxuICAgICAgICAgICAgdmFyIGxvYWRHcm91cE1lbWJlcnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1lbWJlckFwaS5nZXRHcm91cERldGFpbHMoKTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciBsb2FkVXNlcnNJbmZvID0gZnVuY3Rpb24gKGdyb3VwKSB7XG4gICAgICAgICAgICAgICAgdmFyIG5vbkZhY0FuZEFjdGl2ZSA9IGZ1bmN0aW9uICh1KSB7IHJldHVybiB1LmFjdGl2ZSAmJiB1LnJvbGUgIT09ICdmYWNpbGl0YXRvcic7IH07XG4gICAgICAgICAgICAgICAgdmFyIHVzZXJzID0gXy5wbHVjayhfLmZpbHRlcihncm91cC5tZW1iZXJzLCBub25GYWNBbmRBY3RpdmUpLCAndXNlcklkJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVzZXJBcGkuZ2V0KHsgaWQ6IHVzZXJzIH0pO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgcmV0dXJuIGxvYWRHcm91cE1lbWJlcnMoKVxuICAgICAgICAgICAgICAgIC50aGVuKGxvYWRVc2Vyc0luZm8pXG4gICAgICAgICAgICAgICAgLmZhaWwoZHRkLnJlamVjdCk7XG4gICAgICAgIH07XG5cbiAgICAgICAgZ2V0R3JvdXBVc2V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gdGhpcy5nZXRPckNyZWF0ZVdvcmxkKHdvcmxkTmFtZSk7XG4gICAgICAgIHZhciBkb25lID0gZG9uZUZuKGR0ZCwgMSk7XG5cbiAgICAgICAgLy8gY2hlY2sgaWYgdGhlcmUncyBhbnl0aGluZyB0byBkb1xuICAgICAgICBpZiAoIXByZXZXb3JsZCAmJiAhY3VyV29ybGQpIHtcbiAgICAgICAgICAgIHJldHVybiBkdGQucmVzb2x2ZSgpLnByb21pc2UoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChwcmV2V29ybGQpIHtcbiAgICAgICAgICAgIHByZXZXb3JsZC5yZW1vdmVVc2VyKHVzZXIpXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VyV29ybGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJXb3JsZC5hZGRVc2VyKHVzZXIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAudGhlbihkb25lKTtcbiAgICAgICAgfSBlbHNlIGlmIChjdXJXb3JsZCkge1xuICAgICAgICAgICAgY3VyV29ybGQuYWRkVXNlcih1c2VyKVxuICAgICAgICAgICAgICAgIC50aGVuKGRvbmUpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGR0ZC5wcm9taXNlKCk7XG4gICAgfSxcblxuICAgIGdldE9yQ3JlYXRlV29ybGQ6IGZ1bmN0aW9uICh3b3JsZE5hbWUpIHtcbiAgICAgICAgaWYgKCF3b3JsZE5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB3b3JsZCA9IHRoaXMuZ2V0V29yZEJ5TmFtZSh3b3JsZE5hbWUpO1xuXG4gICAgICAgIGlmICghd29ybGQpIHtcbiAgICAgICAgICAgIHdvcmxkID0gdGhpcy5jcmVhdGUoeyBuYW1lOiB3b3JsZE5hbWUgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gd29ybGQ7XG4gICAgfSxcblxuICAgIGdldFdvcmRCeU5hbWU6IGZ1bmN0aW9uICh3b3JsZE5hbWUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmluZChmdW5jdGlvbiAod29ybGQpIHtcbiAgICAgICAgICAgIHJldHVybiB3b3JsZC5nZXQoJ25hbWUnKSA9PT0gd29ybGROYW1lO1xuICAgICAgICB9KTtcbiAgICB9LFxuXG4gICAgZ2V0V29ybGRCeVVzZXI6IGZ1bmN0aW9uICh1c2VyKSB7XG4gICAgICAgIGlmICghdXNlci5nZXQpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignZ2V0V29ybGRCeVVzZXIgZXhwZWN0ZXMgYSBtb2RlbCAoJyArIHVzZXIgKyAnKScpO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGlkID0gdXNlci5nZXQoJ2lkJyk7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFdvcmxkQnlVc2VySWQoaWQpO1xuICAgIH0sXG5cbiAgICBnZXRXb3JsZEJ5VXNlcklkOiBmdW5jdGlvbiAodXNlcklkKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmZpbmQoZnVuY3Rpb24gKHdvcmxkKSB7XG4gICAgICAgICAgICByZXR1cm4gXy5maW5kKHdvcmxkLmdldCgndXNlcnMnKSwgZnVuY3Rpb24gKHUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdS5nZXQoJ2lkJykgPT09IHVzZXJJZDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9LFxuXG4gICAgZ2V0V29ybGROYW1lczogZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wbHVjaygnbmFtZScpO1xuICAgIH0sXG5cbiAgICBnZXROZXh0V29ybGROYW1lOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBwYWQg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GVjdGlvbiA9IHRoaXMudXNlcnNDb2xsZWN0aW9uO1xuICAgICAgICB1c2Vyc0NvbGxlY3Rpb24uZWFjaChmdW5jdGlvbiAodSkge1xuICAgICAgICAgICAgdS5zZXQoeyBpc1dvcmxkQ29tcGxldGU6IHRydWUgfSk7XG4gICAgICAgICAgICByZXR1cm4gKHVzZXJzSGFzaFt1LmdldCgnaWQnKV0gPSB1KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGhpcy5lYWNoKGZ1bmN0aW9uICh3LCBpKSB7XG4gICAgICAgICAgICB2YXIgbmFtZSA9IHcuZ2V0KCduYW1lJyk7XG4gICAgICAgICAgICB2YXIgaXNDb21wbGV0ZSA9IHcuZ2V0KCdjb21wbGV0ZScpO1xuICAgICAgICAgICAgdy5zZXQoeyBpbmRleDogaSwgbmFtZTogbmFtZSB8fCAoaSArIDEpICsgJycgfSk7XG4gICAgICAgICAgICBfLmVhY2gody5nZXQoJ3VzZXJzJyksIGZ1bmN0aW9uICh1KSB7XG4gICAgICAgICAgICAgICAgaWYgKHVzZXJzSGFzaFt1LmdldCgndXNlcklkJyldKSB7XG4gICAgICAgICAgICAgICAgICAgIHVzZXJzSGFzaFt1LmdldCgndXNlcklkJyldLnNldCh7IHdvcmxkOiBuYW1lLCByb2xlOiB1LmdldCgncm9sZScpLCBpc1dvcmxkQ29tcGxldGU6IGlzQ29tcGxldGUgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgIHVzZXJzQ29sbGVjdGlvbi5zb3J0KCk7XG4gICAgfSxcblxuICAgIGZldGNoOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB3b3JsZEFwaS5saXN0KClcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICh3b3JsZHMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc2V0KHRoaXMucGFyc2Uod29ybGRzKSk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgIH0sXG5cbiAgICBwYXJzZTogZnVuY3Rpb24gKHdvcmxkcykge1xuICAgICAgICBpZiAod29ybGRzLmxlbmd0aCkge1xuICAgICAgICAgICAgd29ybGRzID0gXy5tYXAod29ybGRzLCBmdW5jdGlvbiAodykge1xuICAgICAgICAgICAgICAgIHZhciB1c2VycyA9IF8ubWFwKHcudXNlcnMsIGZ1bmN0aW9uICh1KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGluIHRoZSB3b3JsZCBhcGkgdXNlcnMgSWRzIGNvbWVzIGFzIHVzZXJJZFxuICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgd2UgYWRkIGl0IGFzIGlkIHNvIHdlIGNhbiB1c2UgdGhlXG4gICAgICAgICAgICAgICAgICAgIC8vIHNhbWUgY29kZSB0byBhY2Nlc3MgbW9kZWxzIHRoYXQgY29tZSBmcm9tIHRoZVxuICAgICAgICAgICAgICAgICAgICAvLyBtZW1iZXIvbG9jYWwgYXBpIGFzIHdpdGggdGhlIHdvcmxkIGFwaVxuICAgICAgICAgICAgICAgICAgICB1LmlkID0gdS51c2VySWQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgVXNlck1vZGVsKHUpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgdy51c2VycyA9IHVzZXJzO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHc7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB3b3JsZHM7XG4gICAgfVxufSk7XG4iLCIndXNlIHN0cmljdCc7XG5cbi8qKlxuKiBVdGlsaXR5IGNsYXNzIHRvIG1ha2UgYWpheCBjYWxscyBzZXF1ZW5jaWFsXG4qL1xuZnVuY3Rpb24gQWpheFF1ZXVlICgpIHtcbiAgICB0aGlzLnF1ZXVlID0gW107XG59XG5cbiQuZXh0ZW5kKEFqYXhRdWV1ZS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BmdW5jdGlvblxuICAgIGV4dGVuZChjaGlsZCwgcGFyZW50LCBzdGF0aWNQcm9wcyk7XG5cbiAgICAvLyBhc3NvY2lhdGUgcHJvdG90eXBlIGNoYWluXG4gICAgaW5oZXJpdChjaGlsZCwgcGFyZW50KTtcblxuICAgIC8vIGFkZCBpbnN0YW5jZSBwcm9wZXJ0aWVzXG4gICAgaWYgKHByb3BzKSB7XG4gICAgICAgIGV4dGVuZChjaGlsZC5wcm90b3R5cGUsIHByb3BzKTtcbiAgICB9XG5cbiAgICAvLyBkb25lXG4gICAgcmV0dXJuIGNoaWxkO1xufTtcbiJdfQ== +//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9ncnVudC1icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL2Fzc2lnbm1lbnQtcm93LmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy9hc3NpZ25tZW50LmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy9iYXNlLWNvbGxlY3Rpb24uanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL2Jhc2UtbW9kZWwuanMiLCJzcmMvY29tcG9uZW50cy9hc3NpZ25tZW50L2pzL2RlZmF1bHRzLmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy9pbmRleC5qcyIsInNyYy9jb21wb25lbnRzL2Fzc2lnbm1lbnQvanMvcHJvamVjdC1tb2RlbC5qcyIsInNyYy9jb21wb25lbnRzL2Fzc2lnbm1lbnQvanMvc2VydmljZS1sb2NhdG9yLmpzIiwic3JjL2NvbXBvbmVudHMvYXNzaWdubWVudC9qcy90ZW1wbGF0ZXMuanMiLCJzcmMv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aXMud29ybGRzLmZldGNoKClcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLndvcmxkcy5qb2luVXNlcnMoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcigpO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlQ29udHJvbHMoKTtcbiAgICAgICAgICAgIH0uYmluZCh0aGlzKSk7XG4gICAgfSxcblxuICAgIGF1dG9Bc3NpZ25BbGw6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdGhpcy5fc2hvd1VwZGF0aW5nKCk7XG4gICAgICAgIHZhciBtYXhVc2VycyA9ICt0aGlzLiQoJyNtYXgtdXNlcnMnKS52YWwoKTtcbiAgICAgICAgcmV0dXJuIHRoaXMud29ybGRzLmF1dG9Bc3NpZ25BbGwoeyBtYXhVc2VyczogbWF4VXNlcnMgfSlcbiAgICAgICAgICAgIC5kb25lKHRoaXMuX2hpZGVVcGRhdGluZylcbiAgICAgICAgICAgIC5mYWlsKHRoaXMuX2hpZGVVcGRhdGluZylcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLndvcmxkcy5qb2luVXNlcnMoKTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlbmRlcigpO1xuICAgICAgICAgICAgfS5iaW5kKHRoaXMpKTtcbiAgICB9LFxuXG4gICAgZ2V0U2VsZWN0ZWRJZHM6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuJCgndGJvZHkgOmNoZWNrYm94OmNoZWNrZWQnKS5tYXAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuICQodGhpcykuZGF0YSgnaWQnKTtcbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIGZpbmRSb3dWaWV3czogZnVuY3Rpb24gKGlkcykge1xuICAgICAgICByZXR1cm4gXy5tYXAoaWRzLCBmdW5jdGl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AgICAgICBfLmVhY2gocm93cywgZnVuY3Rpb24gKHZpZXcpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXNlciA9IHZpZXcubW9kZWw7XG4gICAgICAgICAgICAgICAgcXVldWUuYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZXcubWFrZUluYWN0aXZlKClcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZXcucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgICAgICBxdWV1ZS5leGVjdXRlKHRoaXMpLnRoZW4oZG9uZSk7XG4gICAgICAgIH0uYmluZCh0aGlzKTtcblxuICAgICAgICByZXR1cm4gdGhpcy51bmFzc2lnblVzZXJzKGlkcylcbiAgICAgICAgICAgIC50aGVuKG1ha2VVc2Vyc0luYWN0aXZlKTtcblxuXG4gICAgfSxcblxuICAgIHJlbmRlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLiQoJ3RhYmxlIHRib2R5JykuZW1wdHkoKTtcbiAgICAgICAgdGhpcy5yZW5kZXJUYWJsZSgpO1xuICAgICAgICB0aGlzLnRvZ2dsZUNvbnRyb2xscygpO1xuICAgIH0sXG5cbiAgICByZW5kZXJUYWJsZTogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLnJvd1ZpZXdzID0ge307XG4gICAgICAgIHZhciByb3dzID0gW107XG4gICAgICAgIHRoaXMudXNlcnMuZWFjaChmdW5jdGlvbiAodSkge1xuICAgICAgICAgICAgdmFyIHZpZXcgPSBuZXcgQXNzaWduZW1udFJvdyh7IG1vZGVsOiB1LCB3b3JsZHM6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ZWN0aW9uO1xuXG4gICAgICAgIHJldHVybiBtb2RlbDtcbiAgICB9LFxuXG4gICAgc2V0OiBmdW5jdGlvbiAobW9kZWxzKSB7XG4gICAgICAgIGlmICghbW9kZWxzKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBtb2RlbHMgPSBbXS5jb25jYXQobW9kZWxzKTtcblxuICAgICAgICBpZiAoIW1vZGVscy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIF8uZWFjaChtb2RlbHMsIGZ1bmN0aW9uIChtKSB7XG4gICAgICAgICAgICBpZiAoIShtIGluc3RhbmNlb2YgdGhpcy5tb2RlbCkpIHtcbiAgICAgICAgICAgICAgICBtID0gbmV3IHRoaXMubW9kZWwobSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG0uY29sbGVjdGlvbiA9IHRoaXM7XG5cbiAgICAgICAgICAgIHRoaXMuX21vZGVscy5wdXNoKG0pO1xuICAgICAgICB9LCB0aGlzKTtcblxuICAgICAgICB0aGlzLnNvcnQuY2FsbCh0aGlzKTtcblxuICAgICAgICByZXR1cm4gbW9kZWxzO1xuICAgIH0sXG5cbiAgICBzb3J0Rm46IGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICAgIHJldHVybiBiLl9kYXRhW3RoaXMuaWRBdHRyaWJ1dGVdIC0gYS5fZGF0YVt0aGlzLmlkQXR0cmlidXRlXTtcbiAgICB9LFxuXG4gICAgc29ydDogZnVuY3Rpb24gKCkge1xuICAgICAgICB0aGlzLl9tb2RlbHMgPSB0aGlzLl9tb2RlbHMuc29ydCh0aGlzLnNvcnRGbi5iaW5kKHRoaXMpKTtcblxuICAgICAgICByZXR1cm4gdGhpcy5fbW9kZWxzO1xuICAgIH0sXG5cbiAgICBnZXRCeUlkOiBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgcmV0dXJuIF8uZmluZCh0aGlzLl9tb2Rl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ICAgICAgICB2YXIgcHJldldvcmxkID0gdGhpcy5nZXRXb3JsZEJ5VXNlcih1c2VyKTtcbiAgICAgICAgdmFyIGN1cldvcmxkID0gdGhpcy5nZXRPckNyZWF0ZVdvcmxkKHdvcmxkTmFtZSk7XG4gICAgICAgIHZhciBkb25lID0gZG9uZUZuKGR0ZCwgMSk7XG5cbiAgICAgICAgLy8gY2hlY2sgaWYgdGhlcmUncyBhbnl0aGluZyB0byBkb1xuICAgICAgICBpZiAoIXByZXZXb3JsZCAmJiAhY3VyV29ybGQpIHtcbiAgICAgICAgICAgIHJldHVybiBkdGQucmVzb2x2ZSgpLnByb21pc2UoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChwcmV2V29ybGQpIHtcbiAgICAgICAgICAgIHByZXZXb3JsZC5yZW1vdmVVc2VyKHVzZXIpXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VyV29ybGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJXb3JsZC5hZGRVc2VyKHVzZXIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAudGhlbihkb25lKTtcbiAgICAgICAgfSBlbHNlIGlmIChjdXJXb3JsZCkge1xuICAgICAgICAgICAgY3VyV29ybGQuYWRkVXNlcih1c2VyKVxuICAgICAgICAgICAgICAgIC50aGVuKGRvbmUpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGR0ZC5wcm9taXNlKCk7XG4gICAgfSxcblxuICAgIGdldE9yQ3JlYXRlV29ybGQ6IGZ1bmN0aW9uICh3b3JsZE5hbWUpIHtcbiAgICAgICAgaWYgKCF3b3JsZE5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB3b3JsZCA9IHRoaXMuZ2V0V29yZEJ5TmFtZSh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ZXJzOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB1c2Vyc0hhc2ggPSB7fTtcbiAgICAgICAgdmFyIHVzZXJzQ29sbGVjdGlvbiA9IHRoaXMudXNlcnNDb2xsZWN0aW9uO1xuICAgICAgICB1c2Vyc0NvbGxlY3Rpb24uZWFjaChmdW5jdGlvbiAodSkge1xuICAgICAgICAgICAgdS5zZXQoeyBpc1dvcmxkQ29tcGxldGU6IHRydWUgfSk7XG4gICAgICAgICAgICByZXR1cm4gKHVzZXJzSGFzaFt1LmdldCgnaWQnKV0gPSB1KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGhpcy5lYWNoKGZ1bmN0aW9uICh3LCBpKSB7XG4gICAgICAgICAgICB2YXIgbmFtZSA9IHcuZ2V0KCduYW1lJyk7XG4gICAgICAgICAgICB2YXIgaXNDb21wbGV0ZSA9IHcuZ2V0KCdjb21wbGV0ZScpO1xuICAgICAgICAgICAgdy5zZXQoeyBpbmRleDogaSwgbmFtZTogbmFtZSB8fCAoaSArIDEpICsgJycgfSk7XG4gICAgICAgICAgICBfLmVhY2gody5nZXQoJ3VzZXJzJyksIGZ1bmN0aW9uICh1KSB7XG4gICAgICAgICAgICAgICAgaWYgKHVzZXJzSGFzaFt1LmdldCgndXNlcklkJyldKSB7XG4gICAgICAgICAgICAgICAgICAgIHVzZXJzSGFzaFt1LmdldCgndXNlcklkJyldLnNldCh7IHdvcmxkOiBuYW1lLCByb2xlOiB1LmdldCgncm9sZScpLCBpc1dvcmxkQ29tcGxldGU6IGlzQ29tcGxldGUgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgIHVzZXJzQ29sbGVjdGlvbi5zb3J0KCk7XG4gICAgfSxcblxuICAgIGZldGNoOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB3b3JsZEFwaS5saXN0KClcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICh3b3JsZHMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc2V0KHRoaXMucGFyc2Uod29ybGRzKSk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgIH0sXG5cbiAgICBwYXJzZTogZnVuY3Rpb24gKHdvcmxkcykge1xuICAgICAgICBpZiAod29ybGRzLmxlbmd0aCkge1xuICAgICAgICAgICAgd29ybGRzID0gXy5tYXAod29ybGRzLCBmdW5jdGlvbiAodykge1xuICAgICAgICAgICAgICAgIHZhciB1c2VycyA9IF8ubWFwKHcudXNlcnMsIGZ1bmN0aW9uICh1KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGluIHRoZSB3b3JsZCBhcGkgdXNlcnMgSWRzIGNvbWVzIGFzIHVzZXJJZFxuICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgd2UgYWRkIGl0IGFzIGlkIHNvIHdlIGNhbiB1c2UgdGhlXG4gICAgICAgICAgICAgICAgICAgIC8vIHNhbWUgY29kZSB0byBhY2Nlc3MgbW9kZWxzIHRoYXQgY29tZSBmcm9tIHRoZVxuICAgICAgICAgICAgICAgICAgICAvLyBtZW1iZXIvbG9jYWwgYXBpIGFzIHdpdGggdGhlIHdvcmxkIGFwaVxuICAgICAgICAgICAgICAgICAgICB1LmlkID0gdS51c2VySWQ7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgVXNlck1vZGVsKHUpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgdy51c2VycyA9IHVzZXJzO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHc7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB3b3JsZHM7XG4gICAgfVxufSk7XG4iLCIndXNlIHN0cmljdCc7XG5cbi8qKlxuKiBVdGlsaXR5IGNsYXNzIHRvIG1ha2UgYWpheCBjYWxscyBzZXF1ZW5jaWFsXG4qL1xuZn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bWVudHMpOyB9O1xuXG4gICAgLy8gYWRkIHN0YXRpYyBwcm9wZXJ0aWVzIHRvIHRoZSBjaGlsZCBjb25zdHJ1Y3RvciBmdW5jdGlvblxuICAgIGV4dGVuZChjaGlsZCwgcGFyZW50LCBzdGF0aWNQcm9wcyk7XG5cbiAgICAvLyBhc3NvY2lhdGUgcHJvdG90eXBlIGNoYWluXG4gICAgaW5oZXJpdChjaGlsZCwgcGFyZW50KTtcblxuICAgIC8vIGFkZCBpbnN0YW5jZSBwcm9wZXJ0aWVzXG4gICAgaWYgKHByb3BzKSB7XG4gICAgICAgIGV4dGVuZChjaGlsZC5wcm90b3R5cGUsIHByb3BzKTtcbiAgICB9XG5cbiAgICAvLyBkb25lXG4gICAgcmV0dXJuIGNoaWxkO1xufTtcbiJdfQ== diff --git a/dist/components/assignment/index.html b/dist/components/assignment/index.html index 1ca5293f..735ea404 100644 --- a/dist/components/assignment/index.html +++ b/dist/components/assignment/index.html @@ -7,7 +7,7 @@ - + @@ -73,8 +73,8 @@ - - + + - - + +