diff --git a/apps/dashboard-app/src/main/js/pom.xml b/apps/dashboard-app/src/main/js/pom.xml
index db6da127d..12b093541 100644
--- a/apps/dashboard-app/src/main/js/pom.xml
+++ b/apps/dashboard-app/src/main/js/pom.xml
@@ -1,91 +1,90 @@
shrine-base
net.shrine
- 1.23.1.0-SNAPSHOT
+ 1.23.2.1-SNAPSHOT
-
4.0.0
dashboard-app-client
pom
com.github.eirslett
frontend-maven-plugin
0.0.23
install node and npm
install-node-and-npm
v0.10.33
2.7.4
npm install
npm
generate-resources
install
bower install
bower
install
grunt default
grunt
--no-color
diff --git a/apps/steward-app/src/main/js/app/client/steward.runner.js b/apps/steward-app/src/main/js/app/client/steward.runner.js
index 2ce829557..cf67660a0 100644
--- a/apps/steward-app/src/main/js/app/client/steward.runner.js
+++ b/apps/steward-app/src/main/js/app/client/steward.runner.js
@@ -1,30 +1,38 @@
(function () {
'use strict';
angular
.module('shrine.steward')
.run(StewardRunner);
/**
* App Run Phase - Set up listener to verify user has access.
*/
StewardRunner.$inject = ['$rootScope', '$location', 'StewardService'];
function StewardRunner($rootScope, $location, StewardService) {
var defaultRoute = StewardService.constants.defaultRoute;
var path = $location.path();
$rootScope.$on('$locationChangeStart', verifyIdentity);
function verifyIdentity(event, next, current) {
if (isUserNotLoggedIn()) {
$location.path(defaultRoute);
}
+ else if(isNextRouteLogin(next)) {
+ StewardService.logoutUser();
+ }
}
function isUserNotLoggedIn() {
var currentUser = StewardService.getAppUser();
return (!currentUser || !currentUser.isLoggedIn);
}
+
+ function isNextRouteLogin(next) {
+ var nextRoute = next.split("/").reverse()[0];
+ return nextRoute === 'login';
+ }
}
})();
diff --git a/shrine-webclient/src/main/js/client/js-i2b2/cells/SHRINE/shrine.plugin.js b/shrine-webclient/src/main/js/client/js-i2b2/cells/SHRINE/shrine.plugin.js
index 7495641c6..a26c9a518 100644
--- a/shrine-webclient/src/main/js/client/js-i2b2/cells/SHRINE/shrine.plugin.js
+++ b/shrine-webclient/src/main/js/client/js-i2b2/cells/SHRINE/shrine.plugin.js
@@ -1,58 +1,65 @@
/**
* @todo: This logic could be designed to handle all views.
*/
(function () {
'use strict';
var pluginId = 'shrinePlugin';
var tabId = 'shrineTab';
var contentIds = [
'infoQueryStatusText',
'infoQueryStatusChart',
'infoQueryStatusReport',
'infoDownloadStatusData',
pluginId
];
// -- add plugin to i2b2 namespace -- //
i2b2.SHRINE.plugin = new i2b2Base_cellViewController(i2b2.SHRINE, pluginId);
i2b2.SHRINE.plugin.showDisplay = showDisplay;
i2b2.SHRINE.plugin.hideDisplay = hideDisplay;
i2b2.SHRINE.plugin.ZoomView = zoomView;
function zoomView() {
const height = jQuery('#infoQueryStatusText').css('height');
jQuery('#shrinePlugin').css('height', height);
}
function showDisplay() {
clearAllTabs();
setShrineTabActive();
hideContent();
$(pluginId).show();
}
function clearAllTabs() {
$(pluginId).parentNode.parentNode
.select('DIV.tabBox.active')
- .each(el => el.removeClassName('active'));
+ .each(function(el) {
+ el.removeClassName('active');
+ });
+ /* IE is no fun! .each(el => el.removeClassName('active'));*/
}
function setShrineTabActive() {
// set us as active
$(pluginId)
.parentNode
.parentNode
.select('DIV.tabBox.' + tabId)[0]
.addClassName('active');
}
function hideContent() {
- contentIds.each(id => $(id).hide());
+ contentIds
+ .each(function(id) {
+ $(id).hide();
+ })
+ /*@ie no fun! .each(id => $(id).hide());*/
}
function hideDisplay() {
$(pluginId).hide();
}
})();
diff --git a/shrine-webclient/src/main/js/client/js-shrine/export/jspm_packages/system-csp-production.js b/shrine-webclient/src/main/js/client/js-shrine/export/jspm_packages/system-csp-production.js
new file mode 100644
index 000000000..14565f5ce
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/export/jspm_packages/system-csp-production.js
@@ -0,0 +1,6 @@
+/*
+ * SystemJS v0.19.46
+ */
+!function(){function e(){!function(e){function t(e,n){if("string"!=typeof e)throw new TypeError("URL must be a string");var r=String(e).replace(/^\s+|\s+$/g,"").replace(/\\/g,"/").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);if(!r)throw new RangeError("Invalid URL format");var a=r[1]||"",o=r[2]||"",i=r[3]||"",s=r[4]||"",l=r[5]||"",u=r[6]||"",d=r[7]||"",c=r[8]||"",f=r[9]||"";if(void 0!==n){var m=n instanceof t?n:new t(n),p=!a&&!s&&!o;!p||d||c||(c=m.search),p&&"/"!==d[0]&&(d=d?(!m.host&&!m.username||m.pathname?"":"/")+m.pathname.slice(0,m.pathname.lastIndexOf("/")+1)+d:m.pathname);var h=[];d.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?h.pop():h.push(e)}),d=h.join("").replace(/^\//,"/"===d[0]?"/":""),p&&(u=m.port,l=m.hostname,s=m.host,i=m.password,o=m.username),a||(a=m.protocol)}d=d.replace(/\\/g,"/"),this.origin=s?a+(""!==a||""!==s?"//":"")+s:"",this.href=a+(a&&s||"file:"==a?"//":"")+(""!==o?o+(""!==i?":"+i:"")+"@":"")+s+d+c+f,this.protocol=a,this.username=o,this.password=i,this.host=s,this.hostname=l,this.port=u,this.pathname=d,this.search=c,this.hash=f}e.URLPolyfill=t}("undefined"!=typeof self?self:global),function(e){function t(e,t){if(!e.originalErr)for(var n=((e.message||e)+(e.stack?"\n"+e.stack:"")).toString().split("\n"),r=[],a=0;as.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var d=s.split("*");if(d.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=d[0].length;f>=a&&t.substr(0,d[0].length)==d[0]&&t.substr(t.length-d[1].length)==d[1]&&(a=f,r=s,n=t.substr(d[0].length,t.length-d[1].length-d[0].length))}}var m=o[r];return"string"==typeof n&&(m=m.replace("*",n)),m}function m(e){for(var t=[],n=[],r=0,a=e.length;a>r;r++){var o=$.call(t,e[r]);-1===o?(t.push(e[r]),n.push([r])):n[o].push(r)}return{names:t,indices:n}}function p(t){var n={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(Q)for(var r in t)"default"!==r&&h(n,t,r);else g(n,t);return n["default"]=t,J(n,"__useDefault",{value:!0}),n}function h(e,t,n){try{var r;(r=Object.getOwnPropertyDescriptor(t,n))&&J(e,n,r)}catch(a){return e[n]=t[n],!1}}function g(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)(!r||t.hasOwnProperty(a))&&(n&&a in e||(e[a]=t[a]));return e}function v(e,t,n){var r=t&&t.hasOwnProperty;for(var a in t)if(!r||t.hasOwnProperty(a)){var o=t[a];a in e?o instanceof Array&&e[a]instanceof Array?e[a]=[].concat(n?o:e[a]).concat(n?e[a]:o):"object"==typeof o&&null!==o&&"object"==typeof e[a]?e[a]=g(g({},e[a]),o,n):n||(e[a]=o):e[a]=o}}function y(e,t,n,r,a){for(var o in t)if(-1!=$.call(["main","format","defaultExtension","basePath"],o))e[o]=t[o];else if("map"==o)g(e.map=e.map||{},t.map);else if("meta"==o)g(e.meta=e.meta||{},t.meta);else if("depCache"==o)for(var i in t.depCache){var s;s="./"==i.substr(0,2)?n+"/"+i.substr(2):k.call(r,i),r.depCache[s]=(r.depCache[s]||[]).concat(t.depCache[i])}else!a||-1!=$.call(["browserConfig","nodeConfig","devConfig","productionConfig"],o)||t.hasOwnProperty&&!t.hasOwnProperty(o)||w.call(r,'"'+o+'" is not a valid package configuration option in package '+n)}function b(e,t,n,r){var a;if(e.packages[t]){var o=e.packages[t];a=e.packages[t]={},y(a,r?n:o,t,e,r),y(a,r?o:n,t,e,!r)}else a=e.packages[t]=n;return"object"==typeof a.main&&(a.map=a.map||{},a.map["./@main"]=a.main,a.main["default"]=a.main["default"]||"./",a.main="@main"),a}function w(e){this.warnings&&"undefined"!=typeof console&&console.warn&&console.warn(e)}function x(e,t){e.metadata.entry=R(),e.metadata.entry.execute=function(){return t},e.metadata.entry.deps=[],e.metadata.format="defined"}function S(e,t){for(var n=e.split(".");n.length;)t=t[n.shift()];return t}function E(e,t){var n,r=0;for(var a in e)if(t.substr(0,a.length)==a&&(t.length==a.length||"/"==t[a.length])){var o=a.split("/").length;if(r>=o)continue;n=a,r=o}return n}function _(e){this._loader.baseURL!==this.baseURL&&("/"!=this.baseURL[this.baseURL.length-1]&&(this.baseURL+="/"),this._loader.baseURL=this.baseURL=new G(this.baseURL,K).href)}function P(e,t){this.set("@system-env",te=this.newModule({browser:U,node:!!this._nodeRequire,production:!t&&e,dev:t||!e,build:t,"default":!0}))}function j(e,t){if(!d(e))throw new Error("Node module "+e+" can't be loaded as it is not a package require.");if(!ne){var n=this._nodeRequire("module"),r=t.substr(A?8:7);ne=new n(r),ne.paths=n._nodeModulePaths(r)}return ne.require(e)}function k(e,t){if(u(e))return c(e,t);if(l(e))return e;var n=E(this.map,e);if(n){if(e=this.map[n]+e.substr(n.length),u(e))return c(e);if(l(e))return e}if(this.has(e))return e;if("@node/"==e.substr(0,6)){if(!this._nodeRequire)throw new TypeError("Error loading "+e+". Can only load node core modules in Node.");return this.builder?this.set(e,this.newModule({})):this.set(e,this.newModule(p(j.call(this,e.substr(6),this.baseURL)))),e}return _.call(this),f(this,e)||this.baseURL+e}function O(e,t,n){te.browser&&t.browserConfig&&n(t.browserConfig),te.node&&t.nodeConfig&&n(t.nodeConfig),te.dev&&t.devConfig&&n(t.devConfig),te.build&&t.buildConfig&&n(t.buildConfig),te.production&&t.productionConfig&&n(t.productionConfig)}function M(e){var t=e.match(oe);return t&&"System.register"==e.substr(t[0].length,15)}function R(){return{name:null,deps:null,originalIndices:null,declare:null,execute:null,executingRequire:!1,declarative:!1,normalizedDeps:null,groupIndex:null,evaluated:!1,module:null,esModule:null,esmExports:!1}}function z(t){if("string"==typeof t)return S(t,e);if(!(t instanceof Array))throw new Error("Global exports must be a string or array.");for(var n={},r=!0,a=0;at;t++)if(this[t]===e)return t;return-1};!function(){try{Object.defineProperty({},"a",{})&&(J=Object.defineProperty)}catch(e){J=function(e,t,n){try{e[t]=n.value||n.get.call(e)}catch(r){}}}}();var N,F="_"==new Error(0,"_").fileName;if("undefined"!=typeof document&&document.getElementsByTagName){if(N=document.baseURI,!N){var B=document.getElementsByTagName("base");N=B[0]&&B[0].href||window.location.href}}else"undefined"!=typeof location&&(N=e.location.href);if(N)N=N.split("#")[0].split("?")[0],N=N.substr(0,N.lastIndexOf("/")+1);else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURI");N="file://"+(A?"/":"")+process.cwd()+"/",A&&(N=N.replace(/\\/g,"/"))}try{var H="test:"==new e.URL("test:///").protocol}catch(X){}var G=H?e.URL:e.URLPolyfill;J(n.prototype,"toString",{value:function(){return"Module"}}),function(){function e(e){return{status:"loading",name:e||"",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,n){return new Promise(u({step:n.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:n&&n.metadata||{},moduleSource:n.source,moduleAddress:n.address}))}function o(t,n,r,a){return new Promise(function(e,o){e(t.loaderObj.normalize(n,r,a))}).then(function(n){var r;if(t.modules[n])return r=e(n),r.status="linked",r.module=t.modules[n],r;for(var a=0,o=t.loads.length;o>a;a++)if(r=t.loads[a],r.name==n)return r;return r=e(n),t.loads.push(r),i(t,r),r})}function i(e,t){s(e,t,Promise.resolve().then(function(){return e.loaderObj.locate({name:t.name,metadata:t.metadata})}))}function s(e,t,n){l(e,t,n.then(function(n){return"loading"==t.status?(t.address=n,e.loaderObj.fetch({name:t.name,metadata:t.metadata,address:n})):void 0}))}function l(e,t,n){n.then(function(n){return"loading"==t.status?(t.address=t.address||t.name,Promise.resolve(e.loaderObj.translate({name:t.name,metadata:t.metadata,address:t.address,source:n})).then(function(n){return t.source=n,e.loaderObj.instantiate({name:t.name,metadata:t.metadata,address:t.address,source:n})}).then(function(e){if(void 0===e)throw new TypeError("Declarative modules unsupported in the polyfill.");if("object"!=typeof e)throw new TypeError("Invalid instantiate return value");t.depsList=e.deps||[],t.execute=e.execute}).then(function(){t.dependencies=[];for(var n=t.depsList,r=[],a=0,i=n.length;i>a;a++)(function(n,a){r.push(o(e,n,t.name,t.address).then(function(e){if(t.dependencies[a]={key:n,value:e.name},"linked"!=e.status)for(var r=t.linkSets.concat([]),o=0,i=r.length;i>o;o++)c(r[o],e)}))})(n[a],a);return Promise.all(r)}).then(function(){t.status="loaded";for(var e=t.linkSets.concat([]),n=0,r=e.length;r>n;n++)m(e[n],t)})):void 0})["catch"](function(e){t.status="failed",t.exception=e;for(var n=t.linkSets.concat([]),r=0,a=n.length;a>r;r++)p(n[r],t,e)})}function u(t){return function(n,r){var a=t.loader,o=t.moduleName,u=t.step;if(a.modules[o])throw new TypeError('"'+o+'" already exists in the module table');for(var c,f=0,m=a.loads.length;m>f;f++)if(a.loads[f].name==o&&(c=a.loads[f],"translate"!=u||c.source||(c.address=t.moduleAddress,l(a,c,Promise.resolve(t.moduleSource))),c.linkSets.length&&c.linkSets[0].loads[0].name==c.name))return c.linkSets[0].done.then(function(){n(c)});var p=c||e(o);p.metadata=t.moduleMetadata;var h=d(a,p);a.loads.push(p),n(h.done),"locate"==u?i(a,p):"fetch"==u?s(a,p,Promise.resolve(t.moduleAddress)):(p.address=t.moduleAddress,l(a,p,Promise.resolve(t.moduleSource)))}}function d(e,t){var n={loader:e,loads:[],startingLoad:t,loadingCount:0};return n.done=new Promise(function(e,t){n.resolve=e,n.reject=t}),c(n,t),n}function c(e,t){if("failed"!=t.status){for(var n=0,r=e.loads.length;r>n;n++)if(e.loads[n]==t)return;e.loads.push(t),t.linkSets.push(e),"loaded"!=t.status&&e.loadingCount++;for(var a=e.loader,n=0,r=t.dependencies.length;r>n;n++)if(t.dependencies[n]){var o=t.dependencies[n].value;if(!a.modules[o])for(var i=0,s=a.loads.length;s>i;i++)if(a.loads[i].name==o){c(e,a.loads[i]);break}}}}function f(e){var t=!1;try{y(e,function(n,r){p(e,n,r),t=!0})}catch(n){p(e,null,n),t=!0}return t}function m(e,t){if(e.loadingCount--,!(e.loadingCount>0)){var n=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var r=[].concat(e.loads),a=0,o=r.length;o>a;a++){var t=r[a];t.module={name:t.name,module:w({}),evaluated:!0},t.status="linked",h(e.loader,t)}return e.resolve(n)}var i=f(e);i||e.resolve(n)}}function p(e,n,r){var a=e.loader;e:if(n)if(e.loads[0].name==n.name)r=t(r,"Error loading "+n.name);else{for(var o=0;oo;o++){var n=u[o];a.loaderObj.failed=a.loaderObj.failed||[],-1==$.call(a.loaderObj.failed,n)&&a.loaderObj.failed.push(n);var c=$.call(n.linkSets,e);if(n.linkSets.splice(c,1),0==n.linkSets.length){var f=$.call(e.loader.loads,n);-1!=f&&e.loader.loads.splice(f,1)}}e.reject(r)}function h(e,t){if(e.loaderObj.trace){e.loaderObj.loads||(e.loaderObj.loads={});var n={};t.dependencies.forEach(function(e){n[e.key]=e.value}),e.loaderObj.loads[t.name]={name:t.name,deps:t.dependencies.map(function(e){return e.key}),depMap:n,address:t.address,metadata:t.metadata,source:t.source}}t.name&&(e.modules[t.name]=t.module);var r=$.call(e.loads,t);-1!=r&&e.loads.splice(r,1);for(var a=0,o=t.linkSets.length;o>a;a++)r=$.call(t.linkSets[a].loads,t),-1!=r&&t.linkSets[a].loads.splice(r,1);t.linkSets.splice(0,t.linkSets.length)}function g(e,t,r){try{var a=t.execute()}catch(o){return void r(t,o)}return a&&a instanceof n?a:void r(t,new TypeError("Execution must define a Module instance"))}function v(e,t,n){var r=e._loader.importPromises;return r[t]=n.then(function(e){return r[t]=void 0,e},function(e){throw r[t]=void 0,e})}function y(e,t){var n=e.loader;if(e.loads.length)for(var r=e.loads.concat([]),a=0;a "'+r.paths[o]+'" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.')}if(e.defaultJSExtensions&&(r.defaultJSExtensions=e.defaultJSExtensions,w.call(r,"The defaultJSExtensions configuration option is deprecated, use packages configuration instead.")),e.pluginFirst&&(r.pluginFirst=e.pluginFirst),e.map)for(var o in e.map){var i=e.map[o];if("string"!=typeof i){var s=r.defaultJSExtensions&&".js"!=o.substr(o.length-3,3),l=r.decanonicalize(o);s&&".js"==l.substr(l.length-3,3)&&(l=l.substr(0,l.length-3));var u="";for(var c in r.packages)l.substr(0,c.length)==c&&(!l[c.length]||"/"==l[c.length])&&u.split("/").lengtha&&(n=o,a=r));return n}function t(e,t,n,r,a){if(!r||"/"==r[r.length-1]||a||t.defaultExtension===!1)return r;var o=!1;if(t.meta&&p(t.meta,r,function(e,t,n){return 0==n||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),!o&&e.meta&&p(e.meta,n+"/"+r,function(e,t,n){return 0==n||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),o)return r;var i="."+(t.defaultExtension||"js");return r.substr(r.length-i.length)!=i?r+i:r}function n(e,n,r,a,i){if(!a){if(!n.main)return r+(e.defaultJSExtensions?".js":"");a="./"==n.main.substr(0,2)?n.main.substr(2):n.main}if(n.map){var s="./"+a,l=E(n.map,s);if(l||(s="./"+t(e,n,r,a,i),s!="./"+a&&(l=E(n.map,s))),l){var u=o(e,n,r,l,s,i);if(u)return u}}return r+"/"+t(e,n,r,a,i)}function r(e,t,n,r){if("."==e)throw new Error("Package "+n+' has a map entry for "." which is not permitted.');return t.substr(0,e.length)==e&&r.length>e.length?!1:!0}function o(e,n,a,o,i,s){"/"==i[i.length-1]&&(i=i.substr(0,i.length-1));var l=n.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+a);if(r(o,l,a,i)&&"string"==typeof l){if("."==l)l=a;else if("./"==l.substr(0,2))return a+"/"+t(e,n,a,l.substr(2)+i.substr(o.length),s);return e.normalizeSync(l+i.substr(o.length),a+"/")}}function l(e,n,r,a,o){if(!a){if(!n.main)return Promise.resolve(r+(e.defaultJSExtensions?".js":""));a="./"==n.main.substr(0,2)?n.main.substr(2):n.main}var i,s;return n.map&&(i="./"+a,s=E(n.map,i),s||(i="./"+t(e,n,r,a,o),i!="./"+a&&(s=E(n.map,i)))),(s?d(e,n,r,s,i,o):Promise.resolve()).then(function(i){return i?Promise.resolve(i):Promise.resolve(r+"/"+t(e,n,r,a,o))})}function u(e,n,r,a,o,i,s){if("."==o)o=r;else if("./"==o.substr(0,2))return Promise.resolve(r+"/"+t(e,n,r,o.substr(2)+i.substr(a.length),s)).then(function(t){return T.call(e,t,r+"/")});return e.normalize(o+i.substr(a.length),r+"/")}function d(e,t,n,a,o,i){"/"==o[o.length-1]&&(o=o.substr(0,o.length-1));var s=t.map[a];if("string"==typeof s)return r(a,s,n,o)?u(e,t,n,a,s,o,i):Promise.resolve();if(e.builder)return Promise.resolve(n+"/#:"+o);var l=[],d=[];for(var c in s){var f=I(c);d.push({condition:f,map:s[c]}),l.push(e["import"](f.module,n))}return Promise.all(l).then(function(e){for(var t=0;tl&&(l=n),v(s,t,n&&l>n)}),v(n.metadata,s)}o.format&&!n.metadata.loader&&(n.metadata.format=n.metadata.format||o.format)}return t})}})}(),function(){function t(){if(s&&"interactive"===s.script.readyState)return s.load;for(var e=0;ea;a++){var i=e.normalizedDeps[a],s=n.defined[i];if(s&&!s.evaluated){var l=e.groupIndex+(s.declarative!=e.declarative);if(null===s.groupIndex||s.groupIndex=0;i--){for(var s=a[i],l=0;lr;r++){var s=a.importers[r];if(!s.locked){var l=$.call(s.dependencies,a),u=s.setters[l];u&&u(o)}}return a.locked=!1,t},{id:t.name});if("function"==typeof i&&(i={setters:[],execute:i}),i=i||{setters:[],execute:function(){}},a.setters=i.setters,a.execute=i.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+t.name);for(var s=0,d=t.normalizedDeps.length;d>s;s++){var c,f=t.normalizedDeps[s],m=n.defined[f],p=r[f];p?c=p.exports:m&&!m.declarative?c=m.esModule:m?(u(m,n),p=m.module,c=p.exports):c=n.get(f),p&&p.importers?(p.importers.push(a),a.dependencies.push(p)):a.dependencies.push(null);for(var h=t.originalIndices[s],g=0,v=h.length;v>g;++g){var y=h[g];a.setters[y]&&a.setters[y](c)}}}}function d(e,t){var n,r=t.defined[e];if(r)r.declarative?f(e,r,[],t):r.evaluated||c(r,t),n=r.module.exports;else if(n=t.get(e),!n)throw new Error("Unable to load dependency "+e+".");return(!r||r.declarative)&&n&&n.__useDefault?n["default"]:n}function c(t,r){if(!t.module){var a={},o=t.module={exports:a,id:t.name};if(!t.executingRequire)for(var i=0,s=t.normalizedDeps.length;s>i;i++){var l=t.normalizedDeps[i],u=r.defined[l];u&&c(u,r)}t.evaluated=!0;var f=t.execute.call(e,function(e){for(var n=0,a=t.deps.length;a>n;n++)if(t.deps[n]==e)return d(t.normalizedDeps[n],r);var o=r.normalizeSync(e,t.name);if(-1!=$.call(t.normalizedDeps,o))return d(o,r);throw new Error("Module "+e+" not declared as a dependency of "+t.name)},a,o);void 0!==f&&(o.exports=f),a=o.exports,a&&(a.__esModule||a instanceof n)?t.esModule=r.newModule(a):t.esmExports&&a!==e?t.esModule=r.newModule(p(a)):t.esModule=r.newModule({"default":a,__useDefault:!0})}}function f(t,n,r,a){if(n&&!n.evaluated&&n.declarative){r.push(t);for(var o=0,i=n.normalizedDeps.length;i>o;o++){var s=n.normalizedDeps[o];-1==$.call(r,s)&&(a.defined[s]?f(s,a.defined[s],r,a):a.get(s))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}a.prototype.register=function(e,t,n){if("string"!=typeof e&&(n=t,t=e,e=null),"boolean"==typeof n)return this.registerDynamic.apply(this,arguments);var r=R();r.name=e&&(this.decanonicalize||this.normalize).call(this,e),r.declarative=!0,r.deps=t,r.declare=n,this.pushRegister_({amd:!1,entry:r})},a.prototype.registerDynamic=function(e,t,n,r){"string"!=typeof e&&(r=n,n=t,t=e,e=null);var a=R();a.name=e&&(this.decanonicalize||this.normalize).call(this,e),a.deps=t,a.execute=r,a.executingRequire=n,this.pushRegister_({amd:!1,entry:a})},i("reduceRegister_",function(){return function(e,t){if(t){var n=t.entry,r=e&&e.metadata;if(n.name&&(n.name in this.defined||(this.defined[n.name]=n),r&&(r.bundle=!0)),!n.name||e&&!r.entry&&n.name==e.name){if(!r)throw new TypeError("Invalid System.register call. Anonymous System.register calls can only be made by modules loaded by SystemJS.import and not via script tags.");if(r.entry)throw"register"==r.format?new Error("Multiple anonymous System.register calls in module "+e.name+". If loading a bundle, ensure all the System.register calls are named."):new Error("Module "+e.name+" interpreted as "+r.format+" module format, but called System.register.");r.format||(r.format="register"),r.entry=n}}}}),s(function(e){return function(){e.call(this),this.defined={},this._loader.moduleRecords={}}}),J(o,"toString",{value:function(){return"Module"}}),i("delete",function(e){return function(t){return delete this._loader.moduleRecords[t],delete this.defined[t],e.call(this,t)}}),i("fetch",function(e){return function(t){return this.defined[t.name]?(t.metadata.format="defined",""):(t.metadata.deps=t.metadata.deps||[],e.call(this,t))}}),i("translate",function(e){return function(t){return t.metadata.deps=t.metadata.deps||[],Promise.resolve(e.apply(this,arguments)).then(function(e){return("register"==t.metadata.format||"system"==t.metadata.format||!t.metadata.format&&M(t.source))&&(t.metadata.format="register"),e})}}),i("load",function(e){return function(t){var n=this,a=n.defined[t];return!a||a.deps.length?e.apply(this,arguments):(a.originalIndices=a.normalizedDeps=[],r(t,a,n),f(t,a,[],n),a.esModule||(a.esModule=n.newModule(a.module.exports)),n.trace||(n.defined[t]=void 0),n.set(t,a.esModule),Promise.resolve())}}),i("instantiate",function(e){return function(t){"detect"==t.metadata.format&&(t.metadata.format=void 0),e.call(this,t);var n,a=this;if(a.defined[t.name])n=a.defined[t.name],n.declarative||(n.deps=n.deps.concat(t.metadata.deps)),n.deps=n.deps.concat(t.metadata.deps);else if(t.metadata.entry)n=t.metadata.entry,n.deps=n.deps.concat(t.metadata.deps);else if(!(a.builder&&t.metadata.bundle||"register"!=t.metadata.format&&"esm"!=t.metadata.format&&"es6"!=t.metadata.format)){if("undefined"!=typeof __exec&&__exec.call(a,t),!t.metadata.entry&&!t.metadata.bundle)throw new Error(t.name+" detected as "+t.metadata.format+" but didn't execute.");n=t.metadata.entry,n&&t.metadata.deps&&(n.deps=n.deps.concat(t.metadata.deps))}n||(n=R(),n.deps=t.metadata.deps,n.execute=function(){}),a.defined[t.name]=n;var o=m(n.deps);n.deps=o.names,n.originalIndices=o.indices,n.name=t.name,n.esmExports=t.metadata.esmExports!==!1;for(var i=[],s=0,l=n.deps.length;l>s;s++)i.push(Promise.resolve(a.normalize(n.deps[s],t.name)));return Promise.all(i).then(function(e){return n.normalizedDeps=e,{deps:n.deps,execute:function(){return r(t.name,n,a),f(t.name,n,[],a),n.esModule||(n.esModule=a.newModule(n.module.exports)),a.trace||(a.defined[t.name]=void 0),n.esModule}}})}})}(),i("reduceRegister_",function(e){return function(t,n){if(n||!t.metadata.exports&&(!q||"global"!=t.metadata.format))return e.call(this,t,n);t.metadata.format="global";var r=t.metadata.entry=R();r.deps=t.metadata.deps;var a=z(t.metadata.exports);r.execute=function(){return a}}}),s(function(t){return function(){function n(t){if(Object.keys)Object.keys(e).forEach(t);else for(var n in e)i.call(e,n)&&t(n)}function r(t){n(function(n){if(-1==$.call(s,n)){try{var r=e[n]}catch(a){s.push(n)}t(n,r)}})}var a=this;t.call(a);var o,i=Object.prototype.hasOwnProperty,s=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];a.set("@@global-helpers",a.newModule({prepareGlobal:function(t,n,a,i){var s=e.define;e.define=void 0;var l;if(a){l={};for(var u in a)l[u]=e[u],e[u]=a[u]}return n||(o={},r(function(e,t){o[e]=t})),function(){var t,a=n?z(n):{},u=!!n;if((!n||i)&&r(function(r,s){o[r]!==s&&"undefined"!=typeof s&&(i&&(e[r]=void 0),n||(a[r]=s,"undefined"!=typeof t?u||t===s||(u=!0):t=s))}),a=u?a:t,l)for(var d in l)e[d]=l[d];return e.define=s,a}}}))}}),s(function(e){return function(){function t(e){return"file:///"==e.substr(0,8)?e.substr(7+!!A):r&&e.substr(0,r.length)==r?e.substr(r.length):e}var n=this;if(e.call(n),"undefined"!=typeof window&&"undefined"!=typeof document&&window.location)var r=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"");n.set("@@cjs-helpers",n.newModule({requireResolve:function(e,r){return t(n.normalizeSync(e,r))},getPathVars:function(e){var n,r=e.lastIndexOf("!");n=-1!=r?e.substr(0,r):e;var a=n.split("/");return a.pop(),a=a.join("/"),{filename:t(n),dirname:t(a)}}}))}}),i("fetch",function(t){return function(n){return n.metadata.scriptLoad&&U&&(e.define=this.amdDefine),t.call(this,n)}}),s(function(t){return function(){function n(e,t){e=e.replace(s,"");var n=e.match(d),r=(n[1].split(",")[t]||"require").replace(c,""),a=f[r]||(f[r]=new RegExp(l+r+u,"g"));a.lastIndex=0;for(var o,i=[];o=a.exec(e);)i.push(o[2]||o[3]);return i}function r(e,t,n,a){if("object"==typeof e&&!(e instanceof Array))return r.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if("string"==typeof e&&"function"==typeof t&&(e=[e]),!(e instanceof Array)){if("string"==typeof e){var i=o.defaultJSExtensions&&".js"!=e.substr(e.length-3,3),s=o.decanonicalize(e,a);i&&".js"==s.substr(s.length-3,3)&&(s=s.substr(0,s.length-3));var l=o.get(s);if(!l)throw new Error('Module not already loaded loading "'+e+'" as '+s+(a?' from "'+a+'".':"."));return l.__useDefault?l["default"]:l}throw new TypeError("Invalid require")}for(var u=[],d=0;d1;)r=a.shift(),e=e[r]=e[r]||{};r=a.shift(),r in e||(e[r]=n)}s(function(e){return function(){this.meta={},e.call(this)}}),i("locate",function(e){return function(t){var n,r=this.meta,a=t.name,o=0;for(var i in r)if(n=i.indexOf("*"),-1!==n&&i.substr(0,n)===a.substr(0,n)&&i.substr(n+1)===a.substr(a.length-i.length+n+1)){var s=i.split("/").length;s>o&&(o=s),v(t.metadata,r[i],o!=s)}return r[a]&&v(t.metadata,r[a]),e.call(this,t)}});var t=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,n=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;i("translate",function(r){return function(a){if("defined"==a.metadata.format)return a.metadata.deps=a.metadata.deps||[],Promise.resolve(a.source);var o=a.source.match(t);if(o)for(var i=o[0].match(n),s=0;s')}else e()}else if("undefined"!=typeof importScripts){var a="";try{throw new Error("_")}catch(o){o.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){$__curScript={src:t},a=t.replace(/\/[^\/]*$/,"/")})}t&&importScripts(a+"system-polyfills.js"),e()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,e()}();
+//# sourceMappingURL=system-csp-production.js.map
diff --git a/shrine-webclient/src/main/js/client/js-shrine/export/jspm_packages/system-polyfills.js b/shrine-webclient/src/main/js/client/js-shrine/export/jspm_packages/system-polyfills.js
new file mode 100644
index 000000000..bf3aaab1b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/export/jspm_packages/system-polyfills.js
@@ -0,0 +1,5 @@
+/*
+ * SystemJS Promise Polyfill
+ */
+!function(t){!function(e){"object"==typeof exports?module.exports=e():"function"==typeof t&&t.amd?t(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){var t;return function e(t,n,o){function r(u,c){if(!n[u]){if(!t[u]){var f="function"==typeof require&&require;if(!c&&f)return f(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var s=n[u]={exports:{}};t[u][0].call(s.exports,function(e){var n=t[u][1][e];return r(n?n:e)},s,s.exports,e,t,n,o)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u=0&&(l.splice(e,1),h("Handled previous rejection ["+t.id+"] "+r.formatObject(t.value)))}function c(t,e){p.push(t,e),null===d&&(d=o(f,0))}function f(){for(d=null;p.length>0;)p.shift()(p.shift())}var s,a=n,h=n;"undefined"!=typeof console&&(s=console,a="undefined"!=typeof s.error?function(t){s.error(t)}:function(t){s.log(t)},h="undefined"!=typeof s.info?function(t){s.info(t)}:function(t){s.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(e,t.value)};var p=[],l=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{"../env":5,"../format":6}],5:[function(e,n,o){!function(t){"use strict";t(function(t){function e(){return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)}function n(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function o(t){function e(){var t=n;n=void 0,t()}var n,o=document.createTextNode(""),r=new t(e);r.observe(o,{characterData:!0});var i=0;return function(t){n=t,o.data=i^=1}}var r,i="undefined"!=typeof setTimeout&&setTimeout,u=function(t,e){return setTimeout(t,e)},c=function(t){return clearTimeout(t)},f=function(t){return i(t,0)};if(e())f=function(t){return process.nextTick(t)};else if(r=n())f=o(r);else if(!i){var s=t,a=s("vertx");u=function(t,e){return a.setTimer(e,t)},c=a.cancelTimer,f=a.runOnLoop||a.runOnContext}return{setTimer:u,clearTimer:c,asap:f}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t(e)})},{}],6:[function(e,n,o){!function(t){"use strict";t(function(){function t(t){var n="object"==typeof t&&null!==t&&(t.stack||t.message)?t.stack||t.message:e(t);return t instanceof Error?n:n+" (WARNING: non-Error used)"}function e(t){var e=String(t);return"[object Object]"===e&&"undefined"!=typeof JSON&&(e=n(t,e)),e}function n(t,e){try{return JSON.stringify(t)}catch(n){return e}}return{formatError:t,formatObject:e,tryStringify:n}})}("function"==typeof t&&t.amd?t:function(t){n.exports=t()})},{}],7:[function(e,n,o){!function(t){"use strict";t(function(){return function(t){function e(t,e){this._handler=t===_?e:n(t)}function n(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}function o(t){r.notify(t)}var r=new b;try{t(e,n,o)}catch(i){n(i)}return r}function o(t){return k(t)?t:new e(_,new x(v(t)))}function r(t){return new e(_,new x(new P(t)))}function i(){return $}function u(){return new e(_,new b)}function c(t,e){var n=new b(t.receiver,t.join().context);return new e(_,n)}function f(t){return a(B,null,t)}function s(t,e){return a(M,t,e)}function a(t,n,o){function r(e,r,u){u.resolved||h(o,i,e,t(n,r,e),u)}function i(t,e,n){a[t]=e,0===--s&&n.become(new q(a))}for(var u,c="function"==typeof n?r:i,f=new b,s=o.length>>>0,a=new Array(s),p=0;p0?e(n,i.value,r):(r.become(i),p(t,n+1,i))}else e(n,o,r)}function p(t,e,n){for(var o=e;on&&t._unreport()}}function d(t){return"object"!=typeof t||null===t?r(new TypeError("non-iterable passed to race()")):0===t.length?i():1===t.length?o(t[0]):y(t)}function y(t){var n,o,r,i=new b;for(n=0;n0||"function"!=typeof e&&0>r)return new this.constructor(_,o);var i=this._beget(),u=i._handler;return o.chain(u,o.receiver,t,e,n),i},e.prototype["catch"]=function(t){return this.then(void 0,t)},e.prototype._beget=function(){return c(this._handler,this.constructor)},e.all=f,e.race=d,e._traverse=s,e._visitRemaining=p,_.prototype.when=_.prototype.become=_.prototype.notify=_.prototype.fail=_.prototype._unreport=_.prototype._report=K,_.prototype._state=0,_.prototype.state=function(){return this._state},_.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},_.prototype.chain=function(t,e,n,o,r){this.when({resolver:t,receiver:e,fulfilled:n,rejected:o,progress:r})},_.prototype.visit=function(t,e,n,o){this.chain(X,t,e,n,o)},_.prototype.fold=function(t,e,n,o){this.when(new S(t,e,n,o))},A(_,w),w.prototype.become=function(t){t.fail()};var X=new w;A(_,b),b.prototype._state=0,b.prototype.resolve=function(t){this.become(v(t))},b.prototype.reject=function(t){this.resolved||this.become(new P(t))},b.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=O();return t},b.prototype.run=function(){var t=this.consumers,e=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;ns.length?(o[s]&&"/"||"")+t.substr(s.length):"")}else{var d=s.split("*");if(d.length>2)throw new TypeError("Only one wildcard in a path is permitted");var f=d[0].length;f>=a&&t.substr(0,d[0].length)==d[0]&&t.substr(t.length-d[1].length)==d[1]&&(a=f,n=s,r=t.substr(d[0].length,t.length-d[1].length-d[0].length))}}var m=o[n];return"string"==typeof r&&(m=m.replace("*",r)),m}function m(e){for(var t=[],r=[],n=0,a=e.length;a>n;n++){var o=$.call(t,e[n]);-1===o?(t.push(e[n]),r.push([n])):r[o].push(n)}return{names:t,indices:r}}function p(t){var r={};if(("object"==typeof t||"function"==typeof t)&&t!==e)if(te)for(var n in t)"default"!==n&&h(r,t,n);else g(r,t);return r["default"]=t,U(r,"__useDefault",{value:!0}),r}function h(e,t,r){try{var n;(n=Object.getOwnPropertyDescriptor(t,r))&&U(e,r,n)}catch(a){return e[r]=t[r],!1}}function g(e,t,r){var n=t&&t.hasOwnProperty;for(var a in t)(!n||t.hasOwnProperty(a))&&(r&&a in e||(e[a]=t[a]));return e}function v(e,t,r){var n=t&&t.hasOwnProperty;for(var a in t)if(!n||t.hasOwnProperty(a)){var o=t[a];a in e?o instanceof Array&&e[a]instanceof Array?e[a]=[].concat(r?o:e[a]).concat(r?e[a]:o):"object"==typeof o&&null!==o&&"object"==typeof e[a]?e[a]=g(g({},e[a]),o,r):r||(e[a]=o):e[a]=o}}function y(e,t,r,n,a){for(var o in t)if(-1!=$.call(["main","format","defaultExtension","basePath"],o))e[o]=t[o];else if("map"==o)g(e.map=e.map||{},t.map);else if("meta"==o)g(e.meta=e.meta||{},t.meta);else if("depCache"==o)for(var i in t.depCache){var s;s="./"==i.substr(0,2)?r+"/"+i.substr(2):M.call(n,i),n.depCache[s]=(n.depCache[s]||[]).concat(t.depCache[i])}else!a||-1!=$.call(["browserConfig","nodeConfig","devConfig","productionConfig"],o)||t.hasOwnProperty&&!t.hasOwnProperty(o)||w.call(n,'"'+o+'" is not a valid package configuration option in package '+r)}function b(e,t,r,n){var a;if(e.packages[t]){var o=e.packages[t];a=e.packages[t]={},y(a,n?r:o,t,e,n),y(a,n?o:r,t,e,!n)}else a=e.packages[t]=r;return"object"==typeof a.main&&(a.map=a.map||{},a.map["./@main"]=a.main,a.main["default"]=a.main["default"]||"./",a.main="@main"),a}function w(e){this.warnings&&"undefined"!=typeof console&&console.warn&&console.warn(e)}function x(e,t){e.metadata.entry=R(),e.metadata.entry.execute=function(){return t},e.metadata.entry.deps=[],e.metadata.format="defined"}function S(e,t){for(var r=e.split(".");r.length;)t=t[r.shift()];return t}function _(e,t){var r,n=0;for(var a in e)if(t.substr(0,a.length)==a&&(t.length==a.length||"/"==t[a.length])){var o=a.split("/").length;if(n>=o)continue;r=a,n=o}return r}function E(e){this._loader.baseURL!==this.baseURL&&("/"!=this.baseURL[this.baseURL.length-1]&&(this.baseURL+="/"),this._loader.baseURL=this.baseURL=new G(this.baseURL,ee).href)}function j(e,t){this.set("@system-env",ne=this.newModule({browser:D,node:!!this._nodeRequire,production:!t&&e,dev:t||!e,build:t,"default":!0}))}function P(e,t){if(!d(e))throw new Error("Node module "+e+" can't be loaded as it is not a package require.");if(!ae){var r=this._nodeRequire("module"),n=t.substr(q?8:7);ae=new r(n),ae.paths=r._nodeModulePaths(n)}return ae.require(e)}function M(e,t){if(u(e))return c(e,t);if(l(e))return e;var r=_(this.map,e);if(r){if(e=this.map[r]+e.substr(r.length),u(e))return c(e);if(l(e))return e}if(this.has(e))return e;if("@node/"==e.substr(0,6)){if(!this._nodeRequire)throw new TypeError("Error loading "+e+". Can only load node core modules in Node.");return this.builder?this.set(e,this.newModule({})):this.set(e,this.newModule(p(P.call(this,e.substr(6),this.baseURL)))),e}return E.call(this),f(this,e)||this.baseURL+e}function O(e,t,r){ne.browser&&t.browserConfig&&r(t.browserConfig),ne.node&&t.nodeConfig&&r(t.nodeConfig),ne.dev&&t.devConfig&&r(t.devConfig),ne.build&&t.buildConfig&&r(t.buildConfig),ne.production&&t.productionConfig&&r(t.productionConfig)}function k(e){var t=e.match(se);return t&&"System.register"==e.substr(t[0].length,15)}function R(){return{name:null,deps:null,originalIndices:null,declare:null,execute:null,executingRequire:!1,declarative:!1,normalizedDeps:null,groupIndex:null,evaluated:!1,module:null,esModule:null,esmExports:!1}}function z(t){if("string"==typeof t)return S(t,e);if(!(t instanceof Array))throw new Error("Global exports must be a string or array.");for(var r={},n=!0,a=0;at;t++)if(this[t]===e)return t;return-1};!function(){try{Object.defineProperty({},"a",{})&&(U=Object.defineProperty)}catch(e){U=function(e,t,r){try{e[t]=r.value||r.get.call(e)}catch(n){}}}}();var J,N="_"==new Error(0,"_").fileName;if("undefined"!=typeof document&&document.getElementsByTagName){if(J=document.baseURI,!J){var B=document.getElementsByTagName("base");J=B[0]&&B[0].href||window.location.href}}else"undefined"!=typeof location&&(J=e.location.href);if(J)J=J.split("#")[0].split("?")[0],J=J.substr(0,J.lastIndexOf("/")+1);else{if("undefined"==typeof process||!process.cwd)throw new TypeError("No environment baseURI");J="file://"+(q?"/":"")+process.cwd()+"/",q&&(J=J.replace(/\\/g,"/"))}try{var H="test:"==new e.URL("test:///").protocol}catch(X){}var G=H?e.URL:e.URLPolyfill;U(r.prototype,"toString",{value:function(){return"Module"}}),function(){function e(e){return{status:"loading",name:e||"",linkSets:[],dependencies:[],metadata:{}}}function a(e,t,r){return new Promise(u({step:r.address?"fetch":"locate",loader:e,moduleName:t,moduleMetadata:r&&r.metadata||{},moduleSource:r.source,moduleAddress:r.address}))}function o(t,r,n,a){return new Promise(function(e,o){e(t.loaderObj.normalize(r,n,a))}).then(function(r){var n;if(t.modules[r])return n=e(r),n.status="linked",n.module=t.modules[r],n;for(var a=0,o=t.loads.length;o>a;a++)if(n=t.loads[a],n.name==r)return n;return n=e(r),t.loads.push(n),i(t,n),n})}function i(e,t){s(e,t,Promise.resolve().then(function(){return e.loaderObj.locate({name:t.name,metadata:t.metadata})}))}function s(e,t,r){l(e,t,r.then(function(r){return"loading"==t.status?(t.address=r,e.loaderObj.fetch({name:t.name,metadata:t.metadata,address:r})):void 0}))}function l(e,t,r){r.then(function(r){return"loading"==t.status?(t.address=t.address||t.name,Promise.resolve(e.loaderObj.translate({name:t.name,metadata:t.metadata,address:t.address,source:r})).then(function(r){return t.source=r,e.loaderObj.instantiate({name:t.name,metadata:t.metadata,address:t.address,source:r})}).then(function(e){if(void 0===e)throw new TypeError("Declarative modules unsupported in the polyfill.");if("object"!=typeof e)throw new TypeError("Invalid instantiate return value");t.depsList=e.deps||[],t.execute=e.execute}).then(function(){t.dependencies=[];for(var r=t.depsList,n=[],a=0,i=r.length;i>a;a++)(function(r,a){n.push(o(e,r,t.name,t.address).then(function(e){if(t.dependencies[a]={key:r,value:e.name},"linked"!=e.status)for(var n=t.linkSets.concat([]),o=0,i=n.length;i>o;o++)c(n[o],e)}))})(r[a],a);return Promise.all(n)}).then(function(){t.status="loaded";for(var e=t.linkSets.concat([]),r=0,n=e.length;n>r;r++)m(e[r],t)})):void 0})["catch"](function(e){t.status="failed",t.exception=e;for(var r=t.linkSets.concat([]),n=0,a=r.length;a>n;n++)p(r[n],t,e)})}function u(t){return function(r,n){var a=t.loader,o=t.moduleName,u=t.step;if(a.modules[o])throw new TypeError('"'+o+'" already exists in the module table');for(var c,f=0,m=a.loads.length;m>f;f++)if(a.loads[f].name==o&&(c=a.loads[f],"translate"!=u||c.source||(c.address=t.moduleAddress,l(a,c,Promise.resolve(t.moduleSource))),c.linkSets.length&&c.linkSets[0].loads[0].name==c.name))return c.linkSets[0].done.then(function(){r(c)});var p=c||e(o);p.metadata=t.moduleMetadata;var h=d(a,p);a.loads.push(p),r(h.done),"locate"==u?i(a,p):"fetch"==u?s(a,p,Promise.resolve(t.moduleAddress)):(p.address=t.moduleAddress,l(a,p,Promise.resolve(t.moduleSource)))}}function d(e,t){var r={loader:e,loads:[],startingLoad:t,loadingCount:0};return r.done=new Promise(function(e,t){r.resolve=e,r.reject=t}),c(r,t),r}function c(e,t){if("failed"!=t.status){for(var r=0,n=e.loads.length;n>r;r++)if(e.loads[r]==t)return;e.loads.push(t),t.linkSets.push(e),"loaded"!=t.status&&e.loadingCount++;for(var a=e.loader,r=0,n=t.dependencies.length;n>r;r++)if(t.dependencies[r]){var o=t.dependencies[r].value;if(!a.modules[o])for(var i=0,s=a.loads.length;s>i;i++)if(a.loads[i].name==o){c(e,a.loads[i]);break}}}}function f(e){var t=!1;try{y(e,function(r,n){p(e,r,n),t=!0})}catch(r){p(e,null,r),t=!0}return t}function m(e,t){if(e.loadingCount--,!(e.loadingCount>0)){var r=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var n=[].concat(e.loads),a=0,o=n.length;o>a;a++){var t=n[a];t.module={name:t.name,module:w({}),evaluated:!0},t.status="linked",h(e.loader,t)}return e.resolve(r)}var i=f(e);i||e.resolve(r)}}function p(e,r,n){var a=e.loader;e:if(r)if(e.loads[0].name==r.name)n=t(n,"Error loading "+r.name);else{for(var o=0;oo;o++){var r=u[o];a.loaderObj.failed=a.loaderObj.failed||[],-1==$.call(a.loaderObj.failed,r)&&a.loaderObj.failed.push(r);var c=$.call(r.linkSets,e);if(r.linkSets.splice(c,1),0==r.linkSets.length){var f=$.call(e.loader.loads,r);-1!=f&&e.loader.loads.splice(f,1)}}e.reject(n)}function h(e,t){if(e.loaderObj.trace){e.loaderObj.loads||(e.loaderObj.loads={});var r={};t.dependencies.forEach(function(e){r[e.key]=e.value}),e.loaderObj.loads[t.name]={name:t.name,deps:t.dependencies.map(function(e){return e.key}),depMap:r,address:t.address,metadata:t.metadata,source:t.source}}t.name&&(e.modules[t.name]=t.module);var n=$.call(e.loads,t);-1!=n&&e.loads.splice(n,1);for(var a=0,o=t.linkSets.length;o>a;a++)n=$.call(t.linkSets[a].loads,t),-1!=n&&t.linkSets[a].loads.splice(n,1);t.linkSets.splice(0,t.linkSets.length)}function g(e,t,n){try{var a=t.execute()}catch(o){return void n(t,o)}return a&&a instanceof r?a:void n(t,new TypeError("Execution must define a Module instance"))}function v(e,t,r){var n=e._loader.importPromises;return n[t]=r.then(function(e){return n[t]=void 0,e},function(e){throw n[t]=void 0,e})}function y(e,t){var r=e.loader;if(e.loads.length)for(var n=e.loads.concat([]),a=0;a "'+n.paths[o]+'" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.')}if(e.defaultJSExtensions&&(n.defaultJSExtensions=e.defaultJSExtensions,w.call(n,"The defaultJSExtensions configuration option is deprecated, use packages configuration instead.")),e.pluginFirst&&(n.pluginFirst=e.pluginFirst),e.map)for(var o in e.map){var i=e.map[o];if("string"!=typeof i){var s=n.defaultJSExtensions&&".js"!=o.substr(o.length-3,3),l=n.decanonicalize(o);s&&".js"==l.substr(l.length-3,3)&&(l=l.substr(0,l.length-3));var u="";for(var c in n.packages)l.substr(0,c.length)==c&&(!l[c.length]||"/"==l[c.length])&&u.split("/").lengtha&&(r=o,a=n));return r}function t(e,t,r,n,a){if(!n||"/"==n[n.length-1]||a||t.defaultExtension===!1)return n;var o=!1;if(t.meta&&p(t.meta,n,function(e,t,r){return 0==r||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),!o&&e.meta&&p(e.meta,r+"/"+n,function(e,t,r){return 0==r||e.lastIndexOf("*")!=e.length-1?o=!0:void 0}),o)return n;var i="."+(t.defaultExtension||"js");return n.substr(n.length-i.length)!=i?n+i:n}function r(e,r,n,a,i){if(!a){if(!r.main)return n+(e.defaultJSExtensions?".js":"");a="./"==r.main.substr(0,2)?r.main.substr(2):r.main}if(r.map){var s="./"+a,l=_(r.map,s);if(l||(s="./"+t(e,r,n,a,i),s!="./"+a&&(l=_(r.map,s))),l){var u=o(e,r,n,l,s,i);if(u)return u}}return n+"/"+t(e,r,n,a,i)}function n(e,t,r,n){if("."==e)throw new Error("Package "+r+' has a map entry for "." which is not permitted.');return t.substr(0,e.length)==e&&n.length>e.length?!1:!0}function o(e,r,a,o,i,s){"/"==i[i.length-1]&&(i=i.substr(0,i.length-1));var l=r.map[o];if("object"==typeof l)throw new Error("Synchronous conditional normalization not supported sync normalizing "+o+" in "+a);if(n(o,l,a,i)&&"string"==typeof l){if("."==l)l=a;else if("./"==l.substr(0,2))return a+"/"+t(e,r,a,l.substr(2)+i.substr(o.length),s);return e.normalizeSync(l+i.substr(o.length),a+"/")}}function l(e,r,n,a,o){if(!a){if(!r.main)return Promise.resolve(n+(e.defaultJSExtensions?".js":""));a="./"==r.main.substr(0,2)?r.main.substr(2):r.main}var i,s;return r.map&&(i="./"+a,s=_(r.map,i),s||(i="./"+t(e,r,n,a,o),i!="./"+a&&(s=_(r.map,i)))),(s?d(e,r,n,s,i,o):Promise.resolve()).then(function(i){return i?Promise.resolve(i):Promise.resolve(n+"/"+t(e,r,n,a,o))})}function u(e,r,n,a,o,i,s){if("."==o)o=n;else if("./"==o.substr(0,2))return Promise.resolve(n+"/"+t(e,r,n,o.substr(2)+i.substr(a.length),s)).then(function(t){return C.call(e,t,n+"/")});return e.normalize(o+i.substr(a.length),n+"/")}function d(e,t,r,a,o,i){"/"==o[o.length-1]&&(o=o.substr(0,o.length-1));var s=t.map[a];if("string"==typeof s)return n(a,s,r,o)?u(e,t,r,a,s,o,i):Promise.resolve();if(e.builder)return Promise.resolve(r+"/#:"+o);var l=[],d=[];for(var c in s){var f=I(c);d.push({condition:f,map:s[c]}),l.push(e["import"](f.module,r))}return Promise.all(l).then(function(e){for(var t=0;tl&&(l=r),v(s,t,r&&l>r)}),v(r.metadata,s)}o.format&&!r.metadata.loader&&(r.metadata.format=r.metadata.format||o.format)}return t})}})}(),function(){function t(){if(s&&"interactive"===s.script.readyState)return s.load;for(var e=0;ea;a++){var i=e.normalizedDeps[a],s=r.defined[i];if(s&&!s.evaluated){var l=e.groupIndex+(s.declarative!=e.declarative);if(null===s.groupIndex||s.groupIndex=0;i--){for(var s=a[i],l=0;ln;n++){var s=a.importers[n];if(!s.locked){var l=$.call(s.dependencies,a),u=s.setters[l];u&&u(o)}}return a.locked=!1,t},{id:t.name});if("function"==typeof i&&(i={setters:[],execute:i}),i=i||{setters:[],execute:function(){}},a.setters=i.setters,a.execute=i.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+t.name);for(var s=0,d=t.normalizedDeps.length;d>s;s++){var c,f=t.normalizedDeps[s],m=r.defined[f],p=n[f];p?c=p.exports:m&&!m.declarative?c=m.esModule:m?(u(m,r),p=m.module,c=p.exports):c=r.get(f),p&&p.importers?(p.importers.push(a),a.dependencies.push(p)):a.dependencies.push(null);for(var h=t.originalIndices[s],g=0,v=h.length;v>g;++g){var y=h[g];a.setters[y]&&a.setters[y](c)}}}}function d(e,t){var r,n=t.defined[e];if(n)n.declarative?f(e,n,[],t):n.evaluated||c(n,t),r=n.module.exports;else if(r=t.get(e),!r)throw new Error("Unable to load dependency "+e+".");return(!n||n.declarative)&&r&&r.__useDefault?r["default"]:r}function c(t,n){if(!t.module){var a={},o=t.module={exports:a,id:t.name};if(!t.executingRequire)for(var i=0,s=t.normalizedDeps.length;s>i;i++){var l=t.normalizedDeps[i],u=n.defined[l];u&&c(u,n)}t.evaluated=!0;var f=t.execute.call(e,function(e){for(var r=0,a=t.deps.length;a>r;r++)if(t.deps[r]==e)return d(t.normalizedDeps[r],n);var o=n.normalizeSync(e,t.name);if(-1!=$.call(t.normalizedDeps,o))return d(o,n);throw new Error("Module "+e+" not declared as a dependency of "+t.name)},a,o);void 0!==f&&(o.exports=f),a=o.exports,a&&(a.__esModule||a instanceof r)?t.esModule=n.newModule(a):t.esmExports&&a!==e?t.esModule=n.newModule(p(a)):t.esModule=n.newModule({"default":a,__useDefault:!0})}}function f(t,r,n,a){if(r&&!r.evaluated&&r.declarative){n.push(t);for(var o=0,i=r.normalizedDeps.length;i>o;o++){var s=r.normalizedDeps[o];-1==$.call(n,s)&&(a.defined[s]?f(s,a.defined[s],n,a):a.get(s))}r.evaluated||(r.evaluated=!0,r.module.execute.call(e))}}a.prototype.register=function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=null),"boolean"==typeof r)return this.registerDynamic.apply(this,arguments);var n=R();n.name=e&&(this.decanonicalize||this.normalize).call(this,e),n.declarative=!0,n.deps=t,n.declare=r,this.pushRegister_({amd:!1,entry:n})},a.prototype.registerDynamic=function(e,t,r,n){"string"!=typeof e&&(n=r,r=t,t=e,e=null);var a=R();a.name=e&&(this.decanonicalize||this.normalize).call(this,e),a.deps=t,a.execute=n,a.executingRequire=r,this.pushRegister_({amd:!1,entry:a})},i("reduceRegister_",function(){return function(e,t){if(t){var r=t.entry,n=e&&e.metadata;if(r.name&&(r.name in this.defined||(this.defined[r.name]=r),n&&(n.bundle=!0)),!r.name||e&&!n.entry&&r.name==e.name){if(!n)throw new TypeError("Invalid System.register call. Anonymous System.register calls can only be made by modules loaded by SystemJS.import and not via script tags.");if(n.entry)throw"register"==n.format?new Error("Multiple anonymous System.register calls in module "+e.name+". If loading a bundle, ensure all the System.register calls are named."):new Error("Module "+e.name+" interpreted as "+n.format+" module format, but called System.register.");n.format||(n.format="register"),n.entry=r}}}}),s(function(e){return function(){e.call(this),this.defined={},this._loader.moduleRecords={}}}),U(o,"toString",{value:function(){return"Module"}}),i("delete",function(e){return function(t){return delete this._loader.moduleRecords[t],delete this.defined[t],e.call(this,t)}}),i("fetch",function(e){return function(t){return this.defined[t.name]?(t.metadata.format="defined",""):(t.metadata.deps=t.metadata.deps||[],e.call(this,t))}}),i("translate",function(e){return function(t){return t.metadata.deps=t.metadata.deps||[],Promise.resolve(e.apply(this,arguments)).then(function(e){return("register"==t.metadata.format||"system"==t.metadata.format||!t.metadata.format&&k(t.source))&&(t.metadata.format="register"),e})}}),i("load",function(e){return function(t){var r=this,a=r.defined[t];return!a||a.deps.length?e.apply(this,arguments):(a.originalIndices=a.normalizedDeps=[],n(t,a,r),f(t,a,[],r),a.esModule||(a.esModule=r.newModule(a.module.exports)),r.trace||(r.defined[t]=void 0),r.set(t,a.esModule),Promise.resolve())}}),i("instantiate",function(e){return function(t){"detect"==t.metadata.format&&(t.metadata.format=void 0),e.call(this,t);var r,a=this;if(a.defined[t.name])r=a.defined[t.name],r.declarative||(r.deps=r.deps.concat(t.metadata.deps)),r.deps=r.deps.concat(t.metadata.deps);else if(t.metadata.entry)r=t.metadata.entry,r.deps=r.deps.concat(t.metadata.deps);else if(!(a.builder&&t.metadata.bundle||"register"!=t.metadata.format&&"esm"!=t.metadata.format&&"es6"!=t.metadata.format)){if("undefined"!=typeof re&&re.call(a,t),!t.metadata.entry&&!t.metadata.bundle)throw new Error(t.name+" detected as "+t.metadata.format+" but didn't execute.");r=t.metadata.entry,r&&t.metadata.deps&&(r.deps=r.deps.concat(t.metadata.deps))}r||(r=R(),r.deps=t.metadata.deps,r.execute=function(){}),a.defined[t.name]=r;var o=m(r.deps);r.deps=o.names,r.originalIndices=o.indices,r.name=t.name,r.esmExports=t.metadata.esmExports!==!1;for(var i=[],s=0,l=r.deps.length;l>s;s++)i.push(Promise.resolve(a.normalize(r.deps[s],t.name)));return Promise.all(i).then(function(e){return r.normalizedDeps=e,{deps:r.deps,execute:function(){return n(t.name,r,a),f(t.name,r,[],a),r.esModule||(r.esModule=a.newModule(r.module.exports)),a.trace||(a.defined[t.name]=void 0),r.esModule}}})}})}(),function(){var r=/(^\s*|[}\);\n]\s*)(import\s*(['"]|(\*\s+as\s+)?[^"'\(\)\n;]+\s*from\s*['"]|\{)|export\s+\*\s+from\s+["']|export\s*(\{|default|function|class|var|const|let|async\s+function))/,n=/\$traceurRuntime\s*\./,a=/babelHelpers\s*\./;i("translate",function(o){return function(i){var s=this,l=arguments;return o.apply(s,l).then(function(o){if("esm"==i.metadata.format||"es6"==i.metadata.format||!i.metadata.format&&o.match(r)){if("es6"==i.metadata.format&&w.call(s,"Module "+i.name+' has metadata setting its format to "es6", which is deprecated.\nThis should be updated to "esm".'),i.metadata.format="esm",i.metadata.deps){for(var u="",d=0;d100&&!i.metadata.format&&(i.metadata.format="global","traceur"===s.transpiler&&(i.metadata.exports="traceur"),"typescript"===s.transpiler&&(i.metadata.exports="ts")),s._loader.loadedTranspiler=!0),s._loader.loadedTranspilerRuntime===!1&&(i.name==s.normalizeSync("traceur-runtime")||i.name==s.normalizeSync("babel/external-helpers*"))&&(o.length>100&&(i.metadata.format=i.metadata.format||"global"),s._loader.loadedTranspilerRuntime=!0),("register"==i.metadata.format||i.metadata.bundle)&&s._loader.loadedTranspilerRuntime!==!0){if("traceur"==s.transpiler&&!e.$traceurRuntime&&i.source.match(n))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s["import"]("traceur-runtime").then(function(){return o});if("babel"==s.transpiler&&!e.babelHelpers&&i.source.match(a))return s._loader.loadedTranspilerRuntime=s._loader.loadedTranspilerRuntime||!1,s["import"]("babel/external-helpers").then(function(){return o})}return o})}})}();var le="undefined"!=typeof self?"self":"global";i("fetch",function(e){return function(t){return t.metadata.exports&&!t.metadata.format&&(t.metadata.format="global"),e.call(this,t)}}),i("instantiate",function(e){return function(t){var r=this;if(t.metadata.format||(t.metadata.format="global"),"global"==t.metadata.format&&!t.metadata.entry){var n=R();t.metadata.entry=n,n.deps=[];for(var a in t.metadata.globals){var o=t.metadata.globals[a];o&&n.deps.push(o)}n.execute=function(e,n,a){var o;if(t.metadata.globals){o={};for(var i in t.metadata.globals)t.metadata.globals[i]&&(o[i]=e(t.metadata.globals[i]))}var s=t.metadata.exports;s&&(t.source+="\n"+le+'["'+s+'"] = '+s+";");var l=r.get("@@global-helpers").prepareGlobal(a.id,s,o,!!t.metadata.encapsulateGlobal);return re.call(r,t),l()}}return e.call(this,t)}}),i("reduceRegister_",function(e){return function(t,r){if(r||!t.metadata.exports&&(!F||"global"!=t.metadata.format))return e.call(this,t,r);t.metadata.format="global";var n=t.metadata.entry=R();n.deps=t.metadata.deps;var a=z(t.metadata.exports);n.execute=function(){return a}}}),s(function(t){return function(){function r(t){if(Object.keys)Object.keys(e).forEach(t);else for(var r in e)i.call(e,r)&&t(r)}function n(t){r(function(r){if(-1==$.call(s,r)){try{var n=e[r]}catch(a){s.push(r)}t(r,n)}})}var a=this;t.call(a);var o,i=Object.prototype.hasOwnProperty,s=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];a.set("@@global-helpers",a.newModule({prepareGlobal:function(t,r,a,i){var s=e.define;e.define=void 0;var l;if(a){l={};for(var u in a)l[u]=e[u],e[u]=a[u]}return r||(o={},n(function(e,t){o[e]=t})),function(){var t,a=r?z(r):{},u=!!r;if((!r||i)&&n(function(n,s){o[n]!==s&&"undefined"!=typeof s&&(i&&(e[n]=void 0),r||(a[n]=s,"undefined"!=typeof t?u||t===s||(u=!0):t=s))}),a=u?a:t,l)for(var d in l)e[d]=l[d];return e.define=s,a}}}))}}),function(){function t(e){function t(e,t){for(var r=0;rt.index)return!0;return!1}n.lastIndex=a.lastIndex=o.lastIndex=0;var r,i=[],s=[],l=[];if(e.length/e.split("\n").length<200){for(;r=o.exec(e);)s.push([r.index,r.index+r[0].length]);for(;r=a.exec(e);)t(s,r)||l.push([r.index+r[1].length,r.index+r[0].length-1])}for(;r=n.exec(e);)if(!t(s,r)&&!t(l,r)){var u=r[1].substr(1,r[1].length-2);if(u.match(/"|'/))continue;"/"==u[u.length-1]&&(u=u.substr(0,u.length-1)),i.push(u)}return i}var r=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF.])(exports\s*(\[['"]|\.)|module(\.exports|\['exports'\]|\["exports"\])\s*(\[['"]|[=,\.]))/,n=/(?:^\uFEFF?|[^$_a-zA-Z\xA0-\uFFFF."'])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,a=/(^|[^\\])(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,o=/("[^"\\\n\r]*(\\.[^"\\\n\r]*)*"|'[^'\\\n\r]*(\\.[^'\\\n\r]*)*')/g,s=/^\#\!.*/;i("instantiate",function(a){return function(o){var i=this;if(o.metadata.format||(r.lastIndex=0,n.lastIndex=0,(n.exec(o.source)||r.exec(o.source))&&(o.metadata.format="cjs")),"cjs"==o.metadata.format){var l=o.metadata.deps,u=o.metadata.cjsRequireDetection===!1?[]:t(o.source);for(var d in o.metadata.globals)o.metadata.globals[d]&&u.push(o.metadata.globals[d]);var c=R();o.metadata.entry=c,c.deps=u,c.executingRequire=!0,c.execute=function(t,r,n){function a(e){return"/"==e[e.length-1]&&(e=e.substr(0,e.length-1)),t.apply(this,arguments)}if(a.resolve=function(e){return i.get("@@cjs-helpers").requireResolve(e,n.id)},n.paths=[],n.require=t,!o.metadata.cjsDeferDepsExecute)for(var u=0;u1;)n=a.shift(),e=e[n]=e[n]||{};n=a.shift(),n in e||(e[n]=r)}s(function(e){return function(){this.meta={},e.call(this)}}),i("locate",function(e){return function(t){var r,n=this.meta,a=t.name,o=0;for(var i in n)if(r=i.indexOf("*"),-1!==r&&i.substr(0,r)===a.substr(0,r)&&i.substr(r+1)===a.substr(a.length-i.length+r+1)){var s=i.split("/").length;s>o&&(o=s),v(t.metadata,n[i],o!=s)}return n[a]&&v(t.metadata,n[a]),e.call(this,t)}});var t=/^(\s*\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,r=/\/\*[^\*]*(\*(?!\/)[^\*]*)*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;i("translate",function(n){return function(a){if("defined"==a.metadata.format)return a.metadata.deps=a.metadata.deps||[],Promise.resolve(a.source);var o=a.source.match(t);if(o)for(var i=o[0].match(r),s=0;s')}else e()}else if("undefined"!=typeof importScripts){var a="";try{throw new Error("_")}catch(o){o.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){$__curScript={src:t},a=t.replace(/\/[^\/]*$/,"/")})}t&&importScripts(a+"system-polyfills.js"),e()}else $__curScript="undefined"!=typeof __filename?{src:__filename}:null,e()}();
+//# sourceMappingURL=system.js.map
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/.dependencies.json b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/.dependencies.json
new file mode 100644
index 000000000..7d01aacb1
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/.dependencies.json
@@ -0,0 +1,124 @@
+{
+ "npm:aurelia-bootstrapper@1.0.0": {
+ "aurelia-event-aggregator": "npm:aurelia-event-aggregator@^1.0.0",
+ "aurelia-framework": "npm:aurelia-framework@^1.0.0",
+ "aurelia-history": "npm:aurelia-history@^1.0.0",
+ "aurelia-history-browser": "npm:aurelia-history-browser@^1.0.0",
+ "aurelia-loader-default": "npm:aurelia-loader-default@^1.0.0",
+ "aurelia-logging-console": "npm:aurelia-logging-console@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0",
+ "aurelia-pal-browser": "npm:aurelia-pal-browser@^1.0.0",
+ "aurelia-polyfills": "npm:aurelia-polyfills@^1.0.0",
+ "aurelia-router": "npm:aurelia-router@^1.0.1",
+ "aurelia-templating": "npm:aurelia-templating@^1.0.0",
+ "aurelia-templating-binding": "npm:aurelia-templating-binding@^1.0.0",
+ "aurelia-templating-resources": "npm:aurelia-templating-resources@^1.0.0",
+ "aurelia-templating-router": "npm:aurelia-templating-router@^1.0.0"
+ },
+ "npm:aurelia-fetch-client@1.0.1": {},
+ "npm:aurelia-framework@1.0.6": {
+ "aurelia-binding": "npm:aurelia-binding@^1.0.0",
+ "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0",
+ "aurelia-loader": "npm:aurelia-loader@^1.0.0",
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0",
+ "aurelia-path": "npm:aurelia-path@^1.0.0",
+ "aurelia-task-queue": "npm:aurelia-task-queue@^1.0.0",
+ "aurelia-templating": "npm:aurelia-templating@^1.0.0"
+ },
+ "npm:aurelia-loader-default@1.0.0": {
+ "aurelia-loader": "npm:aurelia-loader@^1.0.0",
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-logging-console@1.0.0": {
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0"
+ },
+ "npm:aurelia-pal-browser@1.0.0": {
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-history-browser@1.0.0": {
+ "aurelia-history": "npm:aurelia-history@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-router@1.0.6": {
+ "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0",
+ "aurelia-event-aggregator": "npm:aurelia-event-aggregator@^1.0.0",
+ "aurelia-history": "npm:aurelia-history@^1.0.0",
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-path": "npm:aurelia-path@^1.0.0",
+ "aurelia-route-recognizer": "npm:aurelia-route-recognizer@^1.0.0"
+ },
+ "npm:aurelia-polyfills@1.1.1": {
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-templating-binding@1.0.0": {
+ "aurelia-binding": "npm:aurelia-binding@^1.0.0",
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-templating": "npm:aurelia-templating@^1.0.0"
+ },
+ "npm:aurelia-templating-resources@1.1.1": {
+ "aurelia-binding": "npm:aurelia-binding@^1.0.7",
+ "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0",
+ "aurelia-loader": "npm:aurelia-loader@^1.0.0",
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0",
+ "aurelia-path": "npm:aurelia-path@^1.0.0",
+ "aurelia-task-queue": "npm:aurelia-task-queue@^1.0.0",
+ "aurelia-templating": "npm:aurelia-templating@^1.0.0"
+ },
+ "npm:aurelia-templating-router@1.0.0": {
+ "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0",
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0",
+ "aurelia-path": "npm:aurelia-path@^1.0.0",
+ "aurelia-router": "npm:aurelia-router@^1.0.1",
+ "aurelia-templating": "npm:aurelia-templating@^1.0.0"
+ },
+ "npm:jquery@2.2.4": {},
+ "github:systemjs/plugin-text@0.0.8": {},
+ "github:github/fetch@1.0.0": {},
+ "npm:aurelia-event-aggregator@1.0.0": {
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0"
+ },
+ "npm:aurelia-loader@1.0.0": {
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-path": "npm:aurelia-path@^1.0.0"
+ },
+ "npm:aurelia-metadata@1.0.1": {
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-dependency-injection@1.1.0": {
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-task-queue@1.1.0": {
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0"
+ },
+ "npm:aurelia-binding@1.0.9": {
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0",
+ "aurelia-task-queue": "npm:aurelia-task-queue@^1.0.0"
+ },
+ "npm:aurelia-route-recognizer@1.1.0": {
+ "aurelia-path": "npm:aurelia-path@^1.0.0"
+ },
+ "npm:aurelia-logging@1.0.0": {},
+ "npm:aurelia-templating@1.1.1": {
+ "aurelia-binding": "npm:aurelia-binding@^1.0.0",
+ "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0",
+ "aurelia-loader": "npm:aurelia-loader@^1.0.0",
+ "aurelia-logging": "npm:aurelia-logging@^1.0.0",
+ "aurelia-metadata": "npm:aurelia-metadata@^1.0.0",
+ "aurelia-pal": "npm:aurelia-pal@^1.0.0",
+ "aurelia-path": "npm:aurelia-path@^1.0.0",
+ "aurelia-task-queue": "npm:aurelia-task-queue@^1.1.0"
+ },
+ "npm:aurelia-history@1.0.0": {},
+ "npm:aurelia-pal@1.0.0": {},
+ "npm:aurelia-path@1.1.1": {}
+}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/.loaderversions b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/.loaderversions
new file mode 100644
index 000000000..a606600fb
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/.loaderversions
@@ -0,0 +1 @@
+0.19.46
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0.js
new file mode 100644
index 000000000..0d7861de9
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0.js
@@ -0,0 +1 @@
+module.exports = require("github:github/fetch@1.0.0/fetch.js");
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.gitignore b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.gitignore
new file mode 100644
index 000000000..17f90c32e
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.gitignore
@@ -0,0 +1,5 @@
+.env
+bower_components/
+node_modules/
+sauce_connect/
+sauce_connect.log
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.jshintrc b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.jshintrc
new file mode 100644
index 000000000..c451b5467
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.jshintrc
@@ -0,0 +1,25 @@
+{
+ "curly": true,
+ "eqeqeq": true,
+ "es3": true,
+ "immed": true,
+ "indent": 2,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "quotmark": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+ "asi": true,
+ "boss": true,
+ "esnext": true,
+ "eqnull": true,
+ "browser": true,
+ "worker": true,
+ "globals": {
+ "JSON": false,
+ "URLSearchParams": false
+ }
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.jspm-hash
new file mode 100644
index 000000000..702c56b04
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+ad96feb721393590a1b79dd2646854f5cbb1618699914b932bd37a50b983c5e7c90ae93bjspm-github@0.13.10.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.senv b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.senv
new file mode 100644
index 000000000..659e01102
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.senv
@@ -0,0 +1,3 @@
+hqhBWY7QnNkyaM/nUOnpYMUWhjMyWw8bl6EJOPSxHlgopMEfoIOestV3mhVEwEKTpTnHtx9pv+zl62lYr6kBrVfSaDg7uF+WEMXlMo/HecmE3Qz21JLkBDZYc4JAPvjF9dObU1WSVAHI4uFsVcCrylzulR4DnV3zWum4l+TvJ0rcXBCISeNPLj/YQxyJMDm+QSSDY6Sg1LXNHWUU6ORLKrW4XrIZmL4WxEIm7IXThK7gNslojDlz7krRJ8XIS5nCx/kI7L7ZfJwd3VG+d56kW7a97U1OJcjNXVL1L3OwX+oqKAu4ojOehkTBepmnOtu62LRHd1Jgr07faT++hvL5sA==
+SWg+ILWFcdwg0rU+8fYUoZSjxd1MWmRBJGS5EpbFvrD0Lzdv2lGmrfTMfDGjV0nmpnZhSkAXcWJENw7J9XRQAMmbGq93NL8K0Tv1B49xhuIffIkJlmRP3fosIJGrpHBZWa8v/87Jtirqgg58xisjh7LZRrhrHiw3BPeZumv2t7YO1YzAGfcxthcdtxPs+jBl8iufvhO03/oE8Gd7d3FjfnOBDJwyoTcYTNvTXdh85GINJRKhYhSdq1pq+ASDNxIvfEBUhLzwvQsG4ScuDcUpC7T63dfH+BhtakT2EkC/8w5vRw9jK7DM2UevOSnLZroC05CQDawz453X6CxgLlwJJg==
+ZaPgL6eMy+Gg1ti+ZYH09tXH+pUA0oEaPMb5vTsxUye0Hqam2zRtJ5AYlZQO1lTp0IuJjFTTuxve07tfy0MPgP9Bntq9YkB06+kRMVJPRB1kSAoq/tTGv1binbe4g8bN9B7LFu1/ODPyNVPEOaisy4WjRBym8t5n59cQFl4keQqqoB+fWUf4DVXN+7Xi84wy1gSanwH3jKCVtOhBzaWIKY+pLk2qYYLUUuKlB5SVk9ywEzFOoStVlZXGemOVVlXrtOg3wW83cce5zAmdbrrQz+nAquPuZepDmVvmg1mDdQ30BQ3p6BJixwyvsBRtdVQAJEr98nRMpnkyylaQNKAlcw==
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.travis.yml b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.travis.yml
new file mode 100644
index 000000000..c8681f1c5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/.travis.yml
@@ -0,0 +1,22 @@
+sudo: false
+language: node_js
+before_script: make
+script: make test
+env:
+ global:
+ - SAUCE_USERNAME=github-fetch
+ - SAUCE_ACCESS_KEY=c3d37f93-0c2e-4834-9da5-eddc0d8c6299
+ matrix:
+ - PHANTOMJS=1
+ - SAUCE_PLATFORM="Windows 7" SAUCE_BROWSER="firefox" SAUCE_VERSION=""
+ - SAUCE_PLATFORM="Windows 7" SAUCE_BROWSER="googlechrome" SAUCE_VERSION=""
+ - SAUCE_PLATFORM="Windows 7" SAUCE_BROWSER="internet explorer" SAUCE_VERSION="11"
+ - SAUCE_PLATFORM="Windows 7" SAUCE_BROWSER="internet explorer" SAUCE_VERSION="10"
+deploy:
+ provider: npm
+ email: mislav.marohnic@gmail.com
+ api_key:
+ secure: gt9g5/bXhxSKjxfFSPCdpWGJKBrSG8zdGRYgPouUgRqNeD2Ff4Nc8HGQTxp0OLKnP/jJ5FIru5jUur6LWzJCyEd+aNUEvFf5J078m3pzHN9AP2fiWUkKXcc5lKV0PQnI+JDRxJwd/PggtjubrneGfCzyFoys9apRrd/TzTGEtGw=
+ on:
+ tags: true
+ repo: github/fetch
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/LICENSE b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/LICENSE
new file mode 100644
index 000000000..0e319d55d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2014-2016 GitHub, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/MAINTAINING.md b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/MAINTAINING.md
new file mode 100644
index 000000000..0082ab34b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/MAINTAINING.md
@@ -0,0 +1,29 @@
+# Maintaining
+
+## Releasing a new version
+
+This project follows [semver](http://semver.org/). So if you are making a bug
+fix, only increment the patch level "1.0.x". If any new files are added, a
+minor version "1.x.x" bump is in order.
+
+### Make a release commit
+
+To prepare the release commit:
+
+1. Edit the [bower.json](https://github.com/github/fetch/blob/master/bower.json)
+`version` value.
+2. Change the npm [package.json](https://github.com/github/fetch/blob/master/package.json)
+`version` value to match.
+3. Make a single commit with the description as "Fetch 1.x.x".
+4. Finally, tag the commit with `v1.x.x`.
+
+```
+$ git pull
+$ vim bower.json
+$ vim package.json
+$ git add bower.json package.json
+$ git commit -m "Fetch 1.x.x"
+$ git tag v1.x.x
+$ git push
+$ git push --tags
+```
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/Makefile b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/Makefile
new file mode 100644
index 000000000..f3964d334
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/Makefile
@@ -0,0 +1,30 @@
+build: node_modules/ bower_components/
+
+test: node_modules/ build lint
+ ./script/test
+
+lint: node_modules/
+ ./node_modules/.bin/jshint *.js test/*.js
+
+bower_components/: node_modules/
+ ./node_modules/.bin/bower install
+
+node_modules/:
+ npm install
+
+clean:
+ rm -rf ./bower_components ./node_modules
+
+ifeq ($(shell uname -s),Darwin)
+sauce_connect/bin/sc:
+ wget https://saucelabs.com/downloads/sc-4.3.11-osx.zip
+ unzip sc-4.3.11-osx.zip
+ mv sc-4.3.11-osx sauce_connect
+ rm sc-4.3.11-osx.zip
+else
+sauce_connect/bin/sc:
+ mkdir -p sauce_connect
+ curl -fsSL http://saucelabs.com/downloads/sc-4.3.11-linux.tar.gz | tar xz -C sauce_connect --strip-components 1
+endif
+
+.PHONY: build clean lint test saucelabs travis
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/README.md b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/README.md
new file mode 100644
index 000000000..437ed2408
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/README.md
@@ -0,0 +1,221 @@
+# window.fetch polyfill
+
+This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
+[code-of-conduct]: http://todogroup.org/opencodeofconduct/#fetch/opensource@github.com
+
+The global `fetch` function is an easier way to make web requests and handle
+responses than using an XMLHttpRequest. This polyfill is written as closely as
+possible to the standard Fetch specification at https://fetch.spec.whatwg.org.
+
+## Installation
+
+Available on [Bower](http://bower.io) as **fetch**.
+
+```sh
+$ bower install fetch
+```
+
+You'll also need a Promise polyfill for [older browsers](http://caniuse.com/#feat=promises).
+
+```sh
+$ bower install es6-promise
+```
+
+This can also be installed with `npm`.
+
+```sh
+$ npm install whatwg-fetch --save
+```
+
+For a node.js implementation, try [node-fetch](https://github.com/bitinn/node-fetch).
+
+For use with webpack, refer to [Using WebPack with shims and polyfills](http://mts.io/2015/04/08/webpack-shims-polyfills/).
+
+For babel and es2015+, make sure to import the file:
+
+```javascript
+import 'whatwg-fetch';
+fetch(...);
+```
+
+## Usage
+
+The `fetch` function supports any HTTP method. We'll focus on GET and POST
+example requests.
+
+### HTML
+
+```javascript
+fetch('/users.html')
+ .then(function(response) {
+ return response.text()
+ }).then(function(body) {
+ document.body.innerHTML = body
+ })
+```
+
+### JSON
+
+```javascript
+fetch('/users.json')
+ .then(function(response) {
+ return response.json()
+ }).then(function(json) {
+ console.log('parsed json', json)
+ }).catch(function(ex) {
+ console.log('parsing failed', ex)
+ })
+```
+
+### Response metadata
+
+```javascript
+fetch('/users.json').then(function(response) {
+ console.log(response.headers.get('Content-Type'))
+ console.log(response.headers.get('Date'))
+ console.log(response.status)
+ console.log(response.statusText)
+})
+```
+
+### Post form
+
+```javascript
+var form = document.querySelector('form')
+
+fetch('/users', {
+ method: 'POST',
+ body: new FormData(form)
+})
+```
+
+### Post JSON
+
+```javascript
+fetch('/users', {
+ method: 'POST',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ name: 'Hubot',
+ login: 'hubot',
+ })
+})
+```
+
+### File upload
+
+```javascript
+var input = document.querySelector('input[type="file"]')
+
+var data = new FormData()
+data.append('file', input.files[0])
+data.append('user', 'hubot')
+
+fetch('/avatars', {
+ method: 'POST',
+ body: data
+})
+```
+
+### Caveats
+
+The `fetch` specification differs from `jQuery.ajax()` in mainly two ways that
+bear keeping in mind:
+
+* The Promise returned from `fetch()` **won't reject on HTTP error status**
+ even if the response is a HTTP 404 or 500. Instead, it will resolve normally,
+ and it will only reject on network failure, or if anything prevented the
+ request from completing.
+
+* By default, `fetch` **won't send any cookies** to the server, resulting in
+ unauthenticated requests if the site relies on maintaining a user session.
+
+#### Handling HTTP error statuses
+
+To have `fetch` Promise reject on HTTP error statuses, i.e. on any non-2xx
+status, define a custom response handler:
+
+```javascript
+function checkStatus(response) {
+ if (response.status >= 200 && response.status < 300) {
+ return response
+ } else {
+ var error = new Error(response.statusText)
+ error.response = response
+ throw error
+ }
+}
+
+function parseJSON(response) {
+ return response.json()
+}
+
+fetch('/users')
+ .then(checkStatus)
+ .then(parseJSON)
+ .then(function(data) {
+ console.log('request succeeded with JSON response', data)
+ }).catch(function(error) {
+ console.log('request failed', error)
+ })
+```
+
+#### Sending cookies
+
+To automatically send cookies for the current domain, the `credentials` option
+must be provided:
+
+```javascript
+fetch('/users', {
+ credentials: 'same-origin'
+})
+```
+
+This option makes `fetch` behave similar to XMLHttpRequest with regards to
+cookies. Otherwise, cookies won't get sent, resulting in these requests not
+preserving the authentication session.
+
+Use the `include` value to send cookies in a [cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) (CORS) request.
+
+```javascript
+fetch('https://example.com:1234/users', {
+ credentials: 'include'
+})
+```
+
+
+#### Receiving cookies
+
+Like with XMLHttpRequest, the `Set-Cookie` response header returned from the
+server is a [forbidden header name][] and therefore can't be programatically
+read with `response.headers.get()`. Instead, it's the browser's responsibility
+to handle new cookies being set (if applicable to the current URL). Unless they
+are HTTP-only, new cookies will be available through `document.cookie`.
+
+ [forbidden header name]: https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name
+
+#### Obtaining the Response URL
+
+Due to limitations of XMLHttpRequest, the `response.url` value might not be
+reliable after HTTP redirects on older browsers.
+
+The solution is to configure the server to set the response HTTP header
+`X-Request-URL` to the current URL after any redirect that might have happened.
+It should be safe to set it unconditionally.
+
+``` ruby
+# Ruby on Rails controller example
+response.headers['X-Request-URL'] = request.url
+```
+
+This server workaround is necessary if you need reliable `response.url` in
+Firefox < 32, Chrome < 37, Safari, or IE.
+
+## Browser Support
+
+![Chrome](https://raw.github.com/alrra/browser-logos/master/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/firefox/firefox_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/internet-explorer/internet-explorer_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/safari/safari_48x48.png)
+--- | --- | --- | --- | --- |
+Latest ✔ | Latest ✔ | 10+ ✔ | Latest ✔ | 6.1+ ✔ |
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/bower.json b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/bower.json
new file mode 100644
index 000000000..8966a3089
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/bower.json
@@ -0,0 +1,16 @@
+{
+ "name": "fetch",
+ "main": "fetch.js",
+ "devDependencies": {
+ "es6-promise": "1.0.0"
+ },
+ "ignore": [
+ ".*",
+ "*.md",
+ "examples/",
+ "Makefile",
+ "package.json",
+ "script/",
+ "test/"
+ ]
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/examples/index.html b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/examples/index.html
new file mode 100644
index 000000000..546a695cc
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/examples/index.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/fetch.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/fetch.js
new file mode 100644
index 000000000..d0652dea6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/fetch.js
@@ -0,0 +1,433 @@
+(function(self) {
+ 'use strict';
+
+ if (self.fetch) {
+ return
+ }
+
+ var support = {
+ searchParams: 'URLSearchParams' in self,
+ iterable: 'Symbol' in self && 'iterator' in Symbol,
+ blob: 'FileReader' in self && 'Blob' in self && (function() {
+ try {
+ new Blob()
+ return true
+ } catch(e) {
+ return false
+ }
+ })(),
+ formData: 'FormData' in self,
+ arrayBuffer: 'ArrayBuffer' in self
+ }
+
+ function normalizeName(name) {
+ if (typeof name !== 'string') {
+ name = String(name)
+ }
+ if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
+ throw new TypeError('Invalid character in header field name')
+ }
+ return name.toLowerCase()
+ }
+
+ function normalizeValue(value) {
+ if (typeof value !== 'string') {
+ value = String(value)
+ }
+ return value
+ }
+
+ // Build a destructive iterator for the value list
+ function iteratorFor(items) {
+ var iterator = {
+ next: function() {
+ var value = items.shift()
+ return {done: value === undefined, value: value}
+ }
+ }
+
+ if (support.iterable) {
+ iterator[Symbol.iterator] = function() {
+ return iterator
+ }
+ }
+
+ return iterator
+ }
+
+ function Headers(headers) {
+ this.map = {}
+
+ if (headers instanceof Headers) {
+ headers.forEach(function(value, name) {
+ this.append(name, value)
+ }, this)
+
+ } else if (headers) {
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
+ this.append(name, headers[name])
+ }, this)
+ }
+ }
+
+ Headers.prototype.append = function(name, value) {
+ name = normalizeName(name)
+ value = normalizeValue(value)
+ var list = this.map[name]
+ if (!list) {
+ list = []
+ this.map[name] = list
+ }
+ list.push(value)
+ }
+
+ Headers.prototype['delete'] = function(name) {
+ delete this.map[normalizeName(name)]
+ }
+
+ Headers.prototype.get = function(name) {
+ var values = this.map[normalizeName(name)]
+ return values ? values[0] : null
+ }
+
+ Headers.prototype.getAll = function(name) {
+ return this.map[normalizeName(name)] || []
+ }
+
+ Headers.prototype.has = function(name) {
+ return this.map.hasOwnProperty(normalizeName(name))
+ }
+
+ Headers.prototype.set = function(name, value) {
+ this.map[normalizeName(name)] = [normalizeValue(value)]
+ }
+
+ Headers.prototype.forEach = function(callback, thisArg) {
+ Object.getOwnPropertyNames(this.map).forEach(function(name) {
+ this.map[name].forEach(function(value) {
+ callback.call(thisArg, value, name, this)
+ }, this)
+ }, this)
+ }
+
+ Headers.prototype.keys = function() {
+ var items = []
+ this.forEach(function(value, name) { items.push(name) })
+ return iteratorFor(items)
+ }
+
+ Headers.prototype.values = function() {
+ var items = []
+ this.forEach(function(value) { items.push(value) })
+ return iteratorFor(items)
+ }
+
+ Headers.prototype.entries = function() {
+ var items = []
+ this.forEach(function(value, name) { items.push([name, value]) })
+ return iteratorFor(items)
+ }
+
+ if (support.iterable) {
+ Headers.prototype[Symbol.iterator] = Headers.prototype.entries
+ }
+
+ function consumed(body) {
+ if (body.bodyUsed) {
+ return Promise.reject(new TypeError('Already read'))
+ }
+ body.bodyUsed = true
+ }
+
+ function fileReaderReady(reader) {
+ return new Promise(function(resolve, reject) {
+ reader.onload = function() {
+ resolve(reader.result)
+ }
+ reader.onerror = function() {
+ reject(reader.error)
+ }
+ })
+ }
+
+ function readBlobAsArrayBuffer(blob) {
+ var reader = new FileReader()
+ reader.readAsArrayBuffer(blob)
+ return fileReaderReady(reader)
+ }
+
+ function readBlobAsText(blob) {
+ var reader = new FileReader()
+ reader.readAsText(blob)
+ return fileReaderReady(reader)
+ }
+
+ function Body() {
+ this.bodyUsed = false
+
+ this._initBody = function(body) {
+ this._bodyInit = body
+ if (typeof body === 'string') {
+ this._bodyText = body
+ } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
+ this._bodyBlob = body
+ } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
+ this._bodyFormData = body
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
+ this._bodyText = body.toString()
+ } else if (!body) {
+ this._bodyText = ''
+ } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
+ // Only support ArrayBuffers for POST method.
+ // Receiving ArrayBuffers happens via Blobs, instead.
+ } else {
+ throw new Error('unsupported BodyInit type')
+ }
+
+ if (!this.headers.get('content-type')) {
+ if (typeof body === 'string') {
+ this.headers.set('content-type', 'text/plain;charset=UTF-8')
+ } else if (this._bodyBlob && this._bodyBlob.type) {
+ this.headers.set('content-type', this._bodyBlob.type)
+ } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
+ this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
+ }
+ }
+ }
+
+ if (support.blob) {
+ this.blob = function() {
+ var rejected = consumed(this)
+ if (rejected) {
+ return rejected
+ }
+
+ if (this._bodyBlob) {
+ return Promise.resolve(this._bodyBlob)
+ } else if (this._bodyFormData) {
+ throw new Error('could not read FormData body as blob')
+ } else {
+ return Promise.resolve(new Blob([this._bodyText]))
+ }
+ }
+
+ this.arrayBuffer = function() {
+ return this.blob().then(readBlobAsArrayBuffer)
+ }
+
+ this.text = function() {
+ var rejected = consumed(this)
+ if (rejected) {
+ return rejected
+ }
+
+ if (this._bodyBlob) {
+ return readBlobAsText(this._bodyBlob)
+ } else if (this._bodyFormData) {
+ throw new Error('could not read FormData body as text')
+ } else {
+ return Promise.resolve(this._bodyText)
+ }
+ }
+ } else {
+ this.text = function() {
+ var rejected = consumed(this)
+ return rejected ? rejected : Promise.resolve(this._bodyText)
+ }
+ }
+
+ if (support.formData) {
+ this.formData = function() {
+ return this.text().then(decode)
+ }
+ }
+
+ this.json = function() {
+ return this.text().then(JSON.parse)
+ }
+
+ return this
+ }
+
+ // HTTP methods whose capitalization should be normalized
+ var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
+
+ function normalizeMethod(method) {
+ var upcased = method.toUpperCase()
+ return (methods.indexOf(upcased) > -1) ? upcased : method
+ }
+
+ function Request(input, options) {
+ options = options || {}
+ var body = options.body
+ if (Request.prototype.isPrototypeOf(input)) {
+ if (input.bodyUsed) {
+ throw new TypeError('Already read')
+ }
+ this.url = input.url
+ this.credentials = input.credentials
+ if (!options.headers) {
+ this.headers = new Headers(input.headers)
+ }
+ this.method = input.method
+ this.mode = input.mode
+ if (!body) {
+ body = input._bodyInit
+ input.bodyUsed = true
+ }
+ } else {
+ this.url = input
+ }
+
+ this.credentials = options.credentials || this.credentials || 'omit'
+ if (options.headers || !this.headers) {
+ this.headers = new Headers(options.headers)
+ }
+ this.method = normalizeMethod(options.method || this.method || 'GET')
+ this.mode = options.mode || this.mode || null
+ this.referrer = null
+
+ if ((this.method === 'GET' || this.method === 'HEAD') && body) {
+ throw new TypeError('Body not allowed for GET or HEAD requests')
+ }
+ this._initBody(body)
+ }
+
+ Request.prototype.clone = function() {
+ return new Request(this)
+ }
+
+ function decode(body) {
+ var form = new FormData()
+ body.trim().split('&').forEach(function(bytes) {
+ if (bytes) {
+ var split = bytes.split('=')
+ var name = split.shift().replace(/\+/g, ' ')
+ var value = split.join('=').replace(/\+/g, ' ')
+ form.append(decodeURIComponent(name), decodeURIComponent(value))
+ }
+ })
+ return form
+ }
+
+ function headers(xhr) {
+ var head = new Headers()
+ var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n')
+ pairs.forEach(function(header) {
+ var split = header.trim().split(':')
+ var key = split.shift().trim()
+ var value = split.join(':').trim()
+ head.append(key, value)
+ })
+ return head
+ }
+
+ Body.call(Request.prototype)
+
+ function Response(bodyInit, options) {
+ if (!options) {
+ options = {}
+ }
+
+ this.type = 'default'
+ this.status = options.status
+ this.ok = this.status >= 200 && this.status < 300
+ this.statusText = options.statusText
+ this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)
+ this.url = options.url || ''
+ this._initBody(bodyInit)
+ }
+
+ Body.call(Response.prototype)
+
+ Response.prototype.clone = function() {
+ return new Response(this._bodyInit, {
+ status: this.status,
+ statusText: this.statusText,
+ headers: new Headers(this.headers),
+ url: this.url
+ })
+ }
+
+ Response.error = function() {
+ var response = new Response(null, {status: 0, statusText: ''})
+ response.type = 'error'
+ return response
+ }
+
+ var redirectStatuses = [301, 302, 303, 307, 308]
+
+ Response.redirect = function(url, status) {
+ if (redirectStatuses.indexOf(status) === -1) {
+ throw new RangeError('Invalid status code')
+ }
+
+ return new Response(null, {status: status, headers: {location: url}})
+ }
+
+ self.Headers = Headers
+ self.Request = Request
+ self.Response = Response
+
+ self.fetch = function(input, init) {
+ return new Promise(function(resolve, reject) {
+ var request
+ if (Request.prototype.isPrototypeOf(input) && !init) {
+ request = input
+ } else {
+ request = new Request(input, init)
+ }
+
+ var xhr = new XMLHttpRequest()
+
+ function responseURL() {
+ if ('responseURL' in xhr) {
+ return xhr.responseURL
+ }
+
+ // Avoid security warnings on getResponseHeader when not allowed by CORS
+ if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
+ return xhr.getResponseHeader('X-Request-URL')
+ }
+
+ return
+ }
+
+ xhr.onload = function() {
+ var options = {
+ status: xhr.status,
+ statusText: xhr.statusText,
+ headers: headers(xhr),
+ url: responseURL()
+ }
+ var body = 'response' in xhr ? xhr.response : xhr.responseText
+ resolve(new Response(body, options))
+ }
+
+ xhr.onerror = function() {
+ reject(new TypeError('Network request failed'))
+ }
+
+ xhr.ontimeout = function() {
+ reject(new TypeError('Network request failed'))
+ }
+
+ xhr.open(request.method, request.url, true)
+
+ if (request.credentials === 'include') {
+ xhr.withCredentials = true
+ }
+
+ if ('responseType' in xhr && support.blob) {
+ xhr.responseType = 'blob'
+ }
+
+ request.headers.forEach(function(value, name) {
+ xhr.setRequestHeader(name, value)
+ })
+
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
+ })
+ }
+ self.fetch.polyfill = true
+})(typeof self !== 'undefined' ? self : this);
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/package.json b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/package.json
new file mode 100644
index 000000000..1edc022e6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "whatwg-fetch",
+ "description": "A window.fetch polyfill.",
+ "version": "1.0.0",
+ "main": "fetch.js",
+ "repository": "github/fetch",
+ "license": "MIT",
+ "devDependencies": {
+ "bower": "1.3.8",
+ "chai": "1.10.0",
+ "jshint": "2.8.0",
+ "mocha": "2.1.0",
+ "mocha-phantomjs-core": "2.0.1",
+ "url-search-params": "0.5.0"
+ },
+ "files": [
+ "LICENSE",
+ "fetch.js"
+ ]
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/phantomjs b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/phantomjs
new file mode 100755
index 000000000..a006231d8
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/phantomjs
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -e
+
+port=3900
+
+# Find next available port
+while lsof -i :$((++port)) >/dev/null; do true; done
+
+# Spin a test server in the background
+node ./script/server $port &>/dev/null &
+server_pid=$!
+trap "kill $server_pid" INT EXIT
+
+STATUS=0
+
+reporter=dot
+[ -z "$CI" ] || reporter=spec
+
+run() {
+ phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js \
+ "$1" $reporter "{\"useColors\":true, \"hooks\":\"$PWD/test/mocha-phantomjs-hooks.js\"}" \
+ || STATUS=$?
+}
+
+[ -z "$CI" ] || echo "phantomjs $(phantomjs -v)"
+
+run "http://localhost:$port/"
+run "http://localhost:$port/test/test-worker.html"
+
+exit $STATUS
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/saucelabs b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/saucelabs
new file mode 100755
index 000000000..a47e36a51
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/saucelabs
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+set -e
+
+port=8080
+
+# Spin a test server in the background
+node ./script/server $port &>/dev/null &
+server_pid=$!
+trap "kill $server_pid" INT EXIT
+
+make sauce_connect/bin/sc
+sauce_ready="${TMPDIR:-/tmp}/sauce-ready.$$"
+sauce_connect/bin/sc -u "$SAUCE_USERNAME" -k "$SAUCE_ACCESS_KEY" \
+ -i "$TRAVIS_JOB_NUMBER" -l sauce_connect.log -f "$sauce_ready" &>/dev/null &
+sauce_pid=$!
+trap "kill $sauce_pid" INT EXIT
+
+while [ ! -f "$sauce_ready" ]; do sleep .01; done
+rm -f "$sauce_ready"
+
+job="$(./script/saucelabs-api --raw "js-tests" < 0 || tests != passes + pending) exit 1
+ }
+' <<<"$result"
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/saucelabs-api b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/saucelabs-api
new file mode 100755
index 000000000..f6833bdbf
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/saucelabs-api
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -e
+
+raw=""
+if [ "$1" = "--raw" ]; then
+ raw="1"
+ shift 1
+fi
+
+endpoint="$1"
+
+curl -fs -X POST "https://saucelabs.com/rest/v1/$SAUCE_USERNAME/${endpoint}" \
+ -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" \
+ -H "Content-Type: application/json" -d "@-" | \
+{
+ if [ -n "$raw" ]; then
+ cat
+ else
+ ruby -rjson -e '
+ dump = lambda do |obj, ns|
+ case obj
+ when Array then obj.each_with_index { |v, i| dump.call(v, [ns, i]) }
+ when Hash then obj.each { |k, v| dump.call(v, [ns, k]) }
+ else puts "%s: %s" % [ ns.flatten.compact.join("."), obj.to_s ]
+ end
+ end
+ dump.call JSON.parse(STDIN.read), nil
+ '
+ fi
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/server b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/server
new file mode 100755
index 000000000..00993f84f
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/server
@@ -0,0 +1,148 @@
+#!/usr/bin/env node
+
+var port = Number(process.argv[2] || 3000)
+
+var fs = require('fs')
+var http = require('http');
+var url = require('url');
+var querystring = require('querystring');
+
+var routes = {
+ '/request': function(res, req) {
+ res.writeHead(200, {'Content-Type': 'application/json'});
+ var data = ''
+ req.on('data', function(c) { data += c })
+ req.on('end', function() {
+ res.end(JSON.stringify({
+ method: req.method,
+ url: req.url,
+ headers: req.headers,
+ data: data
+ }));
+ })
+ },
+ '/hello': function(res, req) {
+ res.writeHead(200, {
+ 'Content-Type': 'text/plain',
+ 'X-Request-URL': 'http://' + req.headers.host + req.url
+ });
+ res.end('hi');
+ },
+ '/hello/utf8': function(res) {
+ res.writeHead(200, {
+ 'Content-Type': 'text/plain; charset=utf-8'
+ });
+ // "hello"
+ var buf = new Buffer([104, 101, 108, 108, 111]);
+ res.end(buf);
+ },
+ '/hello/utf16le': function(res) {
+ res.writeHead(200, {
+ 'Content-Type': 'text/plain; charset=utf-16le'
+ });
+ // "hello"
+ var buf = new Buffer([104, 0, 101, 0, 108, 0, 108, 0, 111, 0]);
+ res.end(buf);
+ },
+ '/binary': function(res) {
+ res.writeHead(200, {'Content-Type': 'application/octet-stream'});
+ var buf = new Buffer(256);
+ for (var i = 0; i < 256; i++) {
+ buf[i] = i;
+ }
+ res.end(buf);
+ },
+ '/redirect/301': function(res) {
+ res.writeHead(301, {'Location': '/hello'});
+ res.end();
+ },
+ '/redirect/302': function(res) {
+ res.writeHead(302, {'Location': '/hello'});
+ res.end();
+ },
+ '/redirect/303': function(res) {
+ res.writeHead(303, {'Location': '/hello'});
+ res.end();
+ },
+ '/redirect/307': function(res) {
+ res.writeHead(307, {'Location': '/hello'});
+ res.end();
+ },
+ '/redirect/308': function(res) {
+ res.writeHead(308, {'Location': '/hello'});
+ res.end();
+ },
+ '/boom': function(res) {
+ res.writeHead(500, {'Content-Type': 'text/plain'});
+ res.end('boom');
+ },
+ '/empty': function(res) {
+ res.writeHead(204);
+ res.end();
+ },
+ '/error': function(res) {
+ res.destroy();
+ },
+ '/form': function(res) {
+ res.writeHead(200, {'Content-Type': 'application/x-www-form-urlencoded'});
+ res.end('number=1&space=one+two&empty=&encoded=a%2Bb&');
+ },
+ '/json': function(res) {
+ res.writeHead(200, {'Content-Type': 'application/json'});
+ res.end(JSON.stringify({name: 'Hubot', login: 'hubot'}));
+ },
+ '/json-error': function(res) {
+ res.writeHead(200, {'Content-Type': 'application/json'});
+ res.end('not json {');
+ },
+ '/cookie': function(res, req) {
+ var setCookie, cookie
+ var params = querystring.parse(url.parse(req.url).query);
+ if (params.name && params.value) {
+ setCookie = [params.name, params.value].join('=');
+ }
+ if (params.name) {
+ cookie = querystring.parse(req.headers['cookie'], '; ')[params.name];
+ }
+ res.writeHead(200, {'Content-Type': 'text/plain', 'Set-Cookie': setCookie});
+ res.end(cookie);
+ },
+ '/headers': function(res) {
+ res.writeHead(200, {
+ 'Date': 'Mon, 13 Oct 2014 21:02:27 GMT',
+ 'Content-Type': 'text/html; charset=utf-8'
+ });
+ res.end();
+ }
+};
+
+var types = {
+ js: 'application/javascript',
+ css: 'text/css',
+ html: 'text/html',
+ txt: 'text/plain'
+};
+
+server = http.createServer(function(req, res) {
+ var pathname = url.parse(req.url).pathname;
+ var route = routes[pathname];
+ if (route) {
+ route(res, req);
+ } else {
+ if (pathname == '/') pathname = '/test/test.html'
+ fs.readFile(__dirname + '/..' + pathname, function(err, data) {
+ if (err) {
+ res.writeHead(404, {'Content-Type': types.txt});
+ res.end('Not Found');
+ } else {
+ var ext = (pathname.match(/\.([^\/]+)$/) || [])[1]
+ res.writeHead(200, {'Content-Type': types[ext] || types.txt});
+ res.end(data);
+ }
+ });
+ }
+});
+
+console.warn("Started test server on localhost:" + port);
+server.listen(port);
+
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/test b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/test
new file mode 100755
index 000000000..bc471d435
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/script/test
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+if [ -n "$SAUCE_BROWSER" ]; then
+ ./script/saucelabs
+else
+ ./script/phantomjs
+fi
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/.gitignore b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/.gitignore
new file mode 100644
index 000000000..e6011a561
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/.gitignore
@@ -0,0 +1 @@
+server.pid
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/.jshintrc b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/.jshintrc
new file mode 100644
index 000000000..300079e46
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/.jshintrc
@@ -0,0 +1,19 @@
+{
+ "extends": "../.jshintrc",
+ "es3": false,
+ "strict": false,
+ "sub": true,
+ "globals": {
+ "fetch": false,
+ "Headers": false,
+ "Request": false,
+ "Response": false,
+ "mocha": false,
+ "chai": false,
+ "suite": false,
+ "setup": false,
+ "suiteSetup": false,
+ "test": false,
+ "assert": false
+ }
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/mocha-phantomjs-hooks.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/mocha-phantomjs-hooks.js
new file mode 100644
index 000000000..27227f729
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/mocha-phantomjs-hooks.js
@@ -0,0 +1,9 @@
+/* globals exports */
+exports.beforeStart = function(context) {
+ var originalResourceError = context.page.onResourceError
+ context.page.onResourceError = function(resErr) {
+ if (!/\/boom$/.test(resErr.url)) {
+ originalResourceError(resErr)
+ }
+ }
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test-worker.html b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test-worker.html
new file mode 100644
index 000000000..71c259f51
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test-worker.html
@@ -0,0 +1,45 @@
+
+
+
+
+ Fetch Worker Tests
+
+
+
+
+
+
+
+
+
+
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test.html b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test.html
new file mode 100644
index 000000000..3220ce3a5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test.html
@@ -0,0 +1,54 @@
+
+
+
+
+ Fetch Tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test.js
new file mode 100644
index 000000000..60085ff25
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/test.js
@@ -0,0 +1,1101 @@
+var support = {
+ searchParams: 'URLSearchParams' in self,
+ blob: 'FileReader' in self && 'Blob' in self && (function() {
+ try {
+ new Blob()
+ return true
+ } catch(e) {
+ return false
+ }
+ })(),
+ formData: 'FormData' in self,
+ arrayBuffer: 'ArrayBuffer' in self,
+ patch: !/PhantomJS/.test(navigator.userAgent),
+ permanentRedirect: !/PhantomJS|Trident/.test(navigator.userAgent)
+}
+
+function readBlobAsText(blob) {
+ if ('FileReader' in self) {
+ return new Promise(function(resolve, reject) {
+ var reader = new FileReader()
+ reader.onload = function() {
+ resolve(reader.result)
+ }
+ reader.onerror = function() {
+ reject(reader.error)
+ }
+ reader.readAsText(blob)
+ })
+ } else if ('FileReaderSync' in self) {
+ return new FileReaderSync().readAsText(blob)
+ } else {
+ throw new ReferenceError('FileReader is not defined')
+ }
+}
+
+function readBlobAsBytes(blob) {
+ if ('FileReader' in self) {
+ return new Promise(function(resolve, reject) {
+ var reader = new FileReader()
+ reader.onload = function() {
+ var view = new Uint8Array(reader.result)
+ resolve(Array.prototype.slice.call(view))
+ }
+ reader.onerror = function() {
+ reject(reader.error)
+ }
+ reader.readAsArrayBuffer(blob)
+ })
+ } else if ('FileReaderSync' in self) {
+ return new FileReaderSync().readAsArrayBuffer(blob)
+ } else {
+ throw new ReferenceError('FileReader is not defined')
+ }
+}
+
+var native = {}
+var keepGlobals = ['fetch', 'Headers', 'Request', 'Response']
+var exercise = ['polyfill']
+
+// If native fetch implementation exists, save it and allow it to be replaced
+// by the polyfill. Native implementation will be exercised additionally.
+if (self.fetch) {
+ keepGlobals.forEach(function(name) {
+ native[name] = self[name]
+ })
+ self.fetch = undefined
+ exercise.push('native')
+}
+
+var slice = Array.prototype.slice
+
+function featureDependent(testOrSuite, condition) {
+ (condition ? testOrSuite : testOrSuite.skip).apply(this, slice.call(arguments, 2))
+}
+
+exercise.forEach(function(exerciseMode) {
+ suite(exerciseMode, function() {
+ if (exerciseMode === 'native') {
+ suiteSetup(function() {
+ keepGlobals.forEach(function(name) {
+ self[name] = native[name]
+ })
+ })
+ }
+
+ var nativeChrome = /Chrome\//.test(navigator.userAgent) && exerciseMode === 'native'
+ var nativeFirefox = /Firefox\//.test(navigator.userAgent) && exerciseMode === 'native'
+ var polyfillFirefox = /Firefox\//.test(navigator.userAgent) && exerciseMode === 'polyfill'
+
+test('resolves promise on 500 error', function() {
+ return fetch('/boom').then(function(response) {
+ assert.equal(response.status, 500)
+ assert.equal(response.ok, false)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'boom')
+ })
+})
+
+test.skip('rejects promise for network error', function() {
+ return fetch('/error').then(function(response) {
+ assert(false, 'HTTP status ' + response.status + ' was treated as success')
+ }).catch(function(error) {
+ assert(error instanceof TypeError, 'Rejected with Error')
+ })
+})
+
+test('rejects when Request constructor throws', function() {
+ return fetch('/request', { method: 'GET', body: 'invalid' }).then(function() {
+ assert(false, 'Invalid Request init was accepted')
+ }).catch(function(error) {
+ assert(error instanceof TypeError, 'Rejected with Error')
+ })
+})
+
+// https://fetch.spec.whatwg.org/#headers-class
+suite('Headers', function() {
+ test('constructor copies headers', function() {
+ var original = new Headers()
+ original.append('Accept', 'application/json')
+ original.append('Accept', 'text/plain')
+ original.append('Content-Type', 'text/html')
+
+ var headers = new Headers(original)
+ assert.deepEqual(['application/json', 'text/plain'], headers.getAll('Accept'))
+ assert.deepEqual(['text/html'], headers.getAll('Content-Type'))
+ })
+ test('headers are case insensitive', function() {
+ var headers = new Headers({'Accept': 'application/json'})
+ assert.equal(headers.get('ACCEPT'), 'application/json')
+ assert.equal(headers.get('Accept'), 'application/json')
+ assert.equal(headers.get('accept'), 'application/json')
+ })
+ test('appends to existing', function() {
+ var headers = new Headers({'Accept': 'application/json'})
+ assert.isFalse(headers.has('Content-Type'))
+ headers.append('Content-Type', 'application/json')
+ assert.isTrue(headers.has('Content-Type'))
+ assert.equal(headers.get('Content-Type'), 'application/json')
+ })
+ test('appends values to existing header name', function() {
+ var headers = new Headers({'Accept': 'application/json'})
+ headers.append('Accept', 'text/plain')
+ assert.equal(headers.getAll('Accept').length, 2)
+ assert.equal(headers.getAll('Accept')[0], 'application/json')
+ assert.equal(headers.getAll('Accept')[1], 'text/plain')
+ })
+ test('sets header name and value', function() {
+ var headers = new Headers()
+ headers.set('Content-Type', 'application/json')
+ assert.equal(headers.get('Content-Type'), 'application/json')
+ })
+ test('returns null on no header found', function() {
+ var headers = new Headers()
+ assert.isNull(headers.get('Content-Type'))
+ })
+ test('has headers that are set', function() {
+ var headers = new Headers()
+ headers.set('Content-Type', 'application/json')
+ assert.isTrue(headers.has('Content-Type'))
+ })
+ test('deletes headers', function() {
+ var headers = new Headers()
+ headers.set('Content-Type', 'application/json')
+ assert.isTrue(headers.has('Content-Type'))
+ headers.delete('Content-Type')
+ assert.isFalse(headers.has('Content-Type'))
+ assert.isNull(headers.get('Content-Type'))
+ })
+ test('returns list on getAll when header found', function() {
+ var headers = new Headers({'Content-Type': 'application/json'})
+ assert.isArray(headers.getAll('Content-Type'))
+ assert.equal(headers.getAll('Content-Type').length, 1)
+ assert.equal(headers.getAll('Content-Type')[0], 'application/json')
+ })
+ test('returns empty list on getAll when no header found', function() {
+ var headers = new Headers()
+ assert.isArray(headers.getAll('Content-Type'))
+ assert.equal(headers.getAll('Content-Type').length, 0)
+ })
+ test('converts field name to string on set and get', function() {
+ var headers = new Headers()
+ headers.set(1, 'application/json')
+ assert.equal(headers.get(1), 'application/json')
+ })
+ test('converts field value to string on set and get', function() {
+ var headers = new Headers()
+ headers.set('Content-Type', 1)
+ headers.set('X-CSRF-Token', undefined)
+ assert.equal(headers.get('Content-Type'), '1')
+ assert.equal(headers.get('X-CSRF-Token'), 'undefined')
+ })
+ test('throws TypeError on invalid character in field name', function() {
+ assert.throws(function() { new Headers({'': ['application/json']}) }, TypeError)
+ assert.throws(function() { new Headers({'Accept:': ['application/json']}) }, TypeError)
+ assert.throws(function() {
+ var headers = new Headers()
+ headers.set({field: 'value'}, 'application/json')
+ }, TypeError)
+ })
+ featureDependent(test, !nativeFirefox, 'is iterable with forEach', function() {
+ var headers = new Headers()
+ headers.append('Accept', 'application/json')
+ headers.append('Accept', 'text/plain')
+ headers.append('Content-Type', 'text/html')
+
+ var results = []
+ headers.forEach(function(value, key, object) {
+ results.push({value: value, key: key, object: object})
+ })
+
+ assert.equal(results.length, 3)
+ assert.deepEqual({key: 'accept', value: 'application/json', object: headers}, results[0])
+ assert.deepEqual({key: 'accept', value: 'text/plain', object: headers}, results[1])
+ assert.deepEqual({key: 'content-type', value: 'text/html', object: headers}, results[2])
+ })
+ featureDependent(test, !nativeFirefox, 'forEach accepts second thisArg argument', function() {
+ var headers = new Headers({'Accept': 'application/json'})
+ var thisArg = 42
+ headers.forEach(function() {
+ assert.equal(this, thisArg)
+ }, thisArg)
+ })
+ test('is iterable with keys', function() {
+ var headers = new Headers()
+ headers.append('Accept', 'application/json')
+ headers.append('Accept', 'text/plain')
+ headers.append('Content-Type', 'text/html')
+
+ var iterator = headers.keys()
+ assert.deepEqual({done: false, value: 'accept'}, iterator.next())
+ assert.deepEqual({done: false, value: 'accept'}, iterator.next())
+ assert.deepEqual({done: false, value: 'content-type'}, iterator.next())
+ assert.deepEqual({done: true, value: undefined}, iterator.next())
+ })
+ test('is iterable with values', function() {
+ var headers = new Headers()
+ headers.append('Accept', 'application/json')
+ headers.append('Accept', 'text/plain')
+ headers.append('Content-Type', 'text/html')
+
+ var iterator = headers.values()
+ assert.deepEqual({done: false, value: 'application/json'}, iterator.next())
+ assert.deepEqual({done: false, value: 'text/plain'}, iterator.next())
+ assert.deepEqual({done: false, value: 'text/html'}, iterator.next())
+ assert.deepEqual({done: true, value: undefined}, iterator.next())
+ })
+ test('is iterable with entries', function() {
+ var headers = new Headers()
+ headers.append('Accept', 'application/json')
+ headers.append('Accept', 'text/plain')
+ headers.append('Content-Type', 'text/html')
+
+ var iterator = headers.entries()
+ assert.deepEqual({done: false, value: ['accept', 'application/json']}, iterator.next())
+ assert.deepEqual({done: false, value: ['accept', 'text/plain']}, iterator.next())
+ assert.deepEqual({done: false, value: ['content-type', 'text/html']}, iterator.next())
+ assert.deepEqual({done: true, value: undefined}, iterator.next())
+ })
+ })
+
+// https://fetch.spec.whatwg.org/#request-class
+suite('Request', function() {
+ test('sends request headers', function() {
+ return fetch('/request', {
+ headers: {
+ 'Accept': 'application/json',
+ 'X-Test': '42'
+ }
+ }).then(function(response) {
+ return response.json()
+ }).then(function(json) {
+ assert.equal(json.headers['accept'], 'application/json')
+ assert.equal(json.headers['x-test'], '42')
+ })
+ })
+
+ test('fetch request', function() {
+ var request = new Request('/request', {
+ headers: {
+ 'Accept': 'application/json',
+ 'X-Test': '42'
+ }
+ })
+
+ return fetch(request).then(function(response) {
+ return response.json()
+ }).then(function(json) {
+ assert.equal(json.headers['accept'], 'application/json')
+ assert.equal(json.headers['x-test'], '42')
+ })
+ })
+
+ featureDependent(test, support.arrayBuffer, 'sends ArrayBuffer body', function() {
+ var text = 'name=Hubot'
+
+ var buf = new ArrayBuffer(text.length)
+ var view = new Uint8Array(buf)
+
+ for(var i = 0; i < text.length; i++) {
+ view[i] = text.charCodeAt(i)
+ }
+
+ return fetch('/request', {
+ method: 'post',
+ body: buf
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'POST')
+ assert.equal(request.data, 'name=Hubot')
+ })
+ })
+
+ featureDependent(test, support.searchParams, 'sends URLSearchParams body', function() {
+ return fetch('/request', {
+ method: 'post',
+ body: new URLSearchParams('a=1&b=2')
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'POST')
+ assert.equal(request.data, 'a=1&b=2')
+ })
+ })
+
+ test('construct with url', function() {
+ var request = new Request('https://fetch.spec.whatwg.org/')
+ assert.equal(request.url, 'https://fetch.spec.whatwg.org/')
+ })
+
+ test('construct with Request', function() {
+ var request1 = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: 'I work out',
+ headers: {
+ accept: 'application/json',
+ 'Content-Type': 'text/plain'
+ }
+ })
+ var request2 = new Request(request1)
+
+ return request2.text().then(function(body2) {
+ assert.equal(body2, 'I work out')
+ assert.equal(request2.method, 'POST')
+ assert.equal(request2.url, 'https://fetch.spec.whatwg.org/')
+ assert.equal(request2.headers.get('accept'), 'application/json')
+ assert.equal(request2.headers.get('content-type'), 'text/plain')
+
+ return request1.text().then(function() {
+ assert(false, 'original request body should have been consumed')
+ }, function(error) {
+ assert(error instanceof TypeError, 'expected TypeError for already read body')
+ })
+ })
+ })
+
+ test('construct with Request and override headers', function() {
+ var request1 = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: 'I work out',
+ headers: {
+ accept: 'application/json',
+ 'X-Request-ID': '123'
+ }
+ })
+ var request2 = new Request(request1, {
+ headers: { 'x-test': '42' }
+ })
+
+ assert.equal(request2.headers.get('accept'), undefined)
+ assert.equal(request2.headers.get('x-request-id'), undefined)
+ assert.equal(request2.headers.get('x-test'), '42')
+ })
+
+ test('construct with Request and override body', function() {
+ var request1 = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: 'I work out',
+ headers: {
+ 'Content-Type': 'text/plain'
+ }
+ })
+ var request2 = new Request(request1, {
+ body: '{"wiggles": 5}',
+ headers: { 'Content-Type': 'application/json' }
+ })
+
+ return request2.json().then(function(data) {
+ assert.equal(data.wiggles, 5)
+ assert.equal(request2.headers.get('content-type'), 'application/json')
+ })
+ })
+
+ featureDependent(test, !nativeChrome, 'construct with used Request body', function() {
+ var request1 = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: 'I work out'
+ })
+
+ return request1.text().then(function() {
+ assert.throws(function() {
+ new Request(request1)
+ }, TypeError)
+ })
+ })
+
+ test('GET should not have implicit Content-Type', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/')
+ assert.equal(req.headers.get('content-type'), undefined)
+ })
+
+ test('POST with blank body should not have implicit Content-Type', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post'
+ })
+ assert.equal(req.headers.get('content-type'), undefined)
+ })
+
+ test('construct with string body sets Content-Type header', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: 'I work out'
+ })
+
+ assert.equal(req.headers.get('content-type'), 'text/plain;charset=UTF-8')
+ })
+
+ featureDependent(test, support.blob, 'construct with Blob body and type sets Content-Type header', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: new Blob(['test'], { type: 'image/png' })
+ })
+
+ assert.equal(req.headers.get('content-type'), 'image/png')
+ })
+
+ test('construct with body and explicit header uses header', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ headers: { 'Content-Type': 'image/png' },
+ body: 'I work out'
+ })
+
+ assert.equal(req.headers.get('content-type'), 'image/png')
+ })
+
+ featureDependent(test, support.blob, 'construct with Blob body and explicit Content-Type header', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ headers: { 'Content-Type': 'image/png' },
+ body: new Blob(['test'], { type: 'text/plain' })
+ })
+
+ assert.equal(req.headers.get('content-type'), 'image/png')
+ })
+
+ featureDependent(test, support.searchParams, 'construct with URLSearchParams body sets Content-Type header', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: new URLSearchParams('a=1&b=2')
+ })
+
+ assert.equal(req.headers.get('content-type'), 'application/x-www-form-urlencoded;charset=UTF-8')
+ })
+
+ featureDependent(test, support.searchParams, 'construct with URLSearchParams body and explicit Content-Type header', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ headers: { 'Content-Type': 'image/png' },
+ body: new URLSearchParams('a=1&b=2')
+ })
+
+ assert.equal(req.headers.get('content-type'), 'image/png')
+ })
+
+ test('clone request', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ headers: {'content-type': 'text/plain'},
+ body: 'I work out'
+ })
+ var clone = req.clone()
+
+ assert.equal(clone.method, 'POST')
+ assert.equal(clone.headers.get('content-type'), 'text/plain')
+ assert.notEqual(clone.headers, req.headers)
+
+ return clone.text().then(function(body) {
+ assert.equal(body, 'I work out')
+ })
+ })
+
+ featureDependent(test, !nativeChrome, 'clone with used Request body', function() {
+ var req = new Request('https://fetch.spec.whatwg.org/', {
+ method: 'post',
+ body: 'I work out'
+ })
+
+ return req.text().then(function() {
+ assert.throws(function() {
+ req.clone()
+ }, TypeError)
+ })
+ })
+
+ // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
+ suite('BodyInit extract', function() {
+ featureDependent(suite, support.blob, 'type Blob', function() {
+ test('consume as blob', function() {
+ var request = new Request(null, {method: 'POST', body: new Blob(['hello'])})
+ return request.blob().then(readBlobAsText).then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+
+ test('consume as text', function() {
+ var request = new Request(null, {method: 'POST', body: new Blob(['hello'])})
+ return request.text().then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+ })
+
+ suite('type USVString', function() {
+ test('consume as text', function() {
+ var request = new Request(null, {method: 'POST', body: 'hello'})
+ return request.text().then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+
+ featureDependent(test, support.blob, 'consume as blob', function() {
+ var request = new Request(null, {method: 'POST', body: 'hello'})
+ return request.blob().then(readBlobAsText).then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+ })
+ })
+})
+
+// https://fetch.spec.whatwg.org/#response-class
+suite('Response', function() {
+ // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
+ suite('BodyInit extract', function() {
+ featureDependent(suite, support.blob, 'type Blob', function() {
+ test('consume as blob', function() {
+ var response = new Response(new Blob(['hello']))
+ return response.blob().then(readBlobAsText).then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+
+ test('consume as text', function() {
+ var response = new Response(new Blob(['hello']))
+ return response.text().then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+ })
+
+ suite('type USVString', function() {
+ test('consume as text', function() {
+ var response = new Response('hello')
+ return response.text().then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+
+ featureDependent(test, support.blob, 'consume as blob', function() {
+ var response = new Response('hello')
+ return response.blob().then(readBlobAsText).then(function(text) {
+ assert.equal(text, 'hello')
+ })
+ })
+ })
+ })
+
+ test('populates response body', function() {
+ return fetch('/hello').then(function(response) {
+ assert.equal(response.status, 200)
+ assert.equal(response.ok, true)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'hi')
+ })
+ })
+
+ test('parses response headers', function() {
+ return fetch('/headers?' + new Date().getTime()).then(function(response) {
+ assert.equal(response.headers.get('Date'), 'Mon, 13 Oct 2014 21:02:27 GMT')
+ assert.equal(response.headers.get('Content-Type'), 'text/html; charset=utf-8')
+ })
+ })
+
+ test('creates Headers object from raw headers', function() {
+ var r = new Response('{"foo":"bar"}', {headers: {'content-type': 'application/json'}})
+ assert.equal(r.headers instanceof Headers, true)
+ return r.json().then(function(json){
+ assert.equal(json.foo, 'bar')
+ return json
+ })
+ })
+
+ test('clone text response', function() {
+ var res = new Response('{"foo":"bar"}', {
+ headers: {'content-type': 'application/json'}
+ })
+ var clone = res.clone()
+
+ assert.notEqual(clone.headers, res.headers, 'headers were cloned')
+ assert.equal(clone.headers.get('content-type'), 'application/json')
+
+ return Promise.all([clone.json(), res.json()]).then(function(jsons){
+ assert.deepEqual(jsons[0], jsons[1], 'json of cloned object is the same as original')
+ })
+ })
+
+ featureDependent(test, support.blob, 'clone blob response', function() {
+ return fetch('/binary').then(function(response) {
+ return Promise.all([response.clone().arrayBuffer(), response.arrayBuffer()]).then(function(bufs){
+ bufs.forEach(function(buf){
+ assert(buf instanceof ArrayBuffer, 'buf is an ArrayBuffer instance')
+ assert.equal(buf.byteLength, 256, 'buf.byteLength is correct')
+ var view = new Uint8Array(buf)
+ for (var i = 0; i < 256; i++) {
+ assert.equal(view[i], i)
+ }
+ })
+ })
+ })
+ })
+
+ test('error creates error Response', function() {
+ var r = Response.error()
+ assert(r instanceof Response)
+ assert.equal(r.status, 0)
+ assert.equal(r.statusText, '')
+ assert.equal(r.type, 'error')
+ })
+
+ test('redirect creates redirect Response', function() {
+ var r = Response.redirect('https://fetch.spec.whatwg.org/', 301)
+ assert(r instanceof Response)
+ assert.equal(r.status, 301)
+ assert.equal(r.headers.get('Location'), 'https://fetch.spec.whatwg.org/')
+ })
+
+ test('construct with string body sets Content-Type header', function() {
+ var r = new Response('I work out')
+ assert.equal(r.headers.get('content-type'), 'text/plain;charset=UTF-8')
+ })
+
+ featureDependent(test, support.blob, 'construct with Blob body and type sets Content-Type header', function() {
+ var r = new Response(new Blob(['test'], { type: 'text/plain' }))
+ assert.equal(r.headers.get('content-type'), 'text/plain')
+ })
+
+ test('construct with body and explicit header uses header', function() {
+ var r = new Response('I work out', {
+ headers: {
+ 'Content-Type': 'text/plain'
+ },
+ })
+
+ assert.equal(r.headers.get('content-type'), 'text/plain')
+ })
+})
+
+// https://fetch.spec.whatwg.org/#body-mixin
+suite('Body mixin', function() {
+ featureDependent(suite, support.blob, 'arrayBuffer', function() {
+ test('resolves arrayBuffer promise', function() {
+ return fetch('/hello').then(function(response) {
+ return response.arrayBuffer()
+ }).then(function(buf) {
+ assert(buf instanceof ArrayBuffer, 'buf is an ArrayBuffer instance')
+ assert.equal(buf.byteLength, 2)
+ })
+ })
+
+ test('arrayBuffer handles binary data', function() {
+ return fetch('/binary').then(function(response) {
+ return response.arrayBuffer()
+ }).then(function(buf) {
+ assert(buf instanceof ArrayBuffer, 'buf is an ArrayBuffer instance')
+ assert.equal(buf.byteLength, 256, 'buf.byteLength is correct')
+ var view = new Uint8Array(buf)
+ for (var i = 0; i < 256; i++) {
+ assert.equal(view[i], i)
+ }
+ })
+ })
+
+ test('arrayBuffer handles utf-8 data', function() {
+ return fetch('/hello/utf8').then(function(response) {
+ return response.arrayBuffer()
+ }).then(function(buf) {
+ assert(buf instanceof ArrayBuffer, 'buf is an ArrayBuffer instance')
+ assert.equal(buf.byteLength, 5, 'buf.byteLength is correct')
+ var octets = Array.prototype.slice.call(new Uint8Array(buf))
+ assert.deepEqual(octets, [104, 101, 108, 108, 111])
+ })
+ })
+
+ test('arrayBuffer handles utf-16le data', function() {
+ return fetch('/hello/utf16le').then(function(response) {
+ return response.arrayBuffer()
+ }).then(function(buf) {
+ assert(buf instanceof ArrayBuffer, 'buf is an ArrayBuffer instance')
+ assert.equal(buf.byteLength, 10, 'buf.byteLength is correct')
+ var octets = Array.prototype.slice.call(new Uint8Array(buf))
+ assert.deepEqual(octets, [104, 0, 101, 0, 108, 0, 108, 0, 111, 0])
+ })
+ })
+
+ test('rejects arrayBuffer promise after body is consumed', function() {
+ return fetch('/hello').then(function(response) {
+ assert.equal(response.bodyUsed, false)
+ response.blob()
+ assert.equal(response.bodyUsed, true)
+ return response.arrayBuffer()
+ }).catch(function(error) {
+ assert(error instanceof TypeError, 'Promise rejected after body consumed')
+ })
+ })
+ })
+
+ featureDependent(suite, support.blob, 'blob', function() {
+ test('resolves blob promise', function() {
+ return fetch('/hello').then(function(response) {
+ return response.blob()
+ }).then(function(blob) {
+ assert(blob instanceof Blob, 'blob is a Blob instance')
+ assert.equal(blob.size, 2)
+ })
+ })
+
+ test('blob handles binary data', function() {
+ return fetch('/binary').then(function(response) {
+ return response.blob()
+ }).then(function(blob) {
+ assert(blob instanceof Blob, 'blob is a Blob instance')
+ assert.equal(blob.size, 256, 'blob.size is correct')
+ })
+ })
+
+ test('blob handles utf-8 data', function() {
+ return fetch('/hello/utf8').then(function(response) {
+ return response.blob()
+ }).then(readBlobAsBytes).then(function(octets) {
+ assert.equal(octets.length, 5, 'blob.size is correct')
+ assert.deepEqual(octets, [104, 101, 108, 108, 111])
+ })
+ })
+
+ test('blob handles utf-16le data', function() {
+ return fetch('/hello/utf16le').then(function(response) {
+ return response.blob()
+ }).then(readBlobAsBytes).then(function(octets) {
+ assert.equal(octets.length, 10, 'blob.size is correct')
+ assert.deepEqual(octets, [104, 0, 101, 0, 108, 0, 108, 0, 111, 0])
+ })
+ })
+
+ test('rejects blob promise after body is consumed', function() {
+ return fetch('/hello').then(function(response) {
+ assert(response.blob, 'Body does not implement blob')
+ assert.equal(response.bodyUsed, false)
+ response.text()
+ assert.equal(response.bodyUsed, true)
+ return response.blob()
+ }).catch(function(error) {
+ assert(error instanceof TypeError, 'Promise rejected after body consumed')
+ })
+ })
+ })
+
+ featureDependent(suite, support.formData, 'formData', function() {
+ test('post sets content-type header', function() {
+ return fetch('/request', {
+ method: 'post',
+ body: new FormData()
+ }).then(function(response) {
+ return response.json()
+ }).then(function(json) {
+ assert.equal(json.method, 'POST')
+ assert(/^multipart\/form-data;/.test(json.headers['content-type']))
+ })
+ })
+
+ featureDependent(test, !nativeChrome, 'rejects formData promise after body is consumed', function() {
+ return fetch('/json').then(function(response) {
+ assert(response.formData, 'Body does not implement formData')
+ response.formData()
+ return response.formData()
+ }).catch(function(error) {
+ if (error instanceof chai.AssertionError) {
+ throw error
+ } else {
+ assert(error instanceof TypeError, 'Promise rejected after body consumed')
+ }
+ })
+ })
+
+ featureDependent(test, !nativeChrome, 'parses form encoded response', function() {
+ return fetch('/form').then(function(response) {
+ return response.formData()
+ }).then(function(form) {
+ assert(form instanceof FormData, 'Parsed a FormData object')
+ })
+ })
+ })
+
+ suite('json', function() {
+ test('parses json response', function() {
+ return fetch('/json').then(function(response) {
+ return response.json()
+ }).then(function(json) {
+ assert.equal(json.name, 'Hubot')
+ assert.equal(json.login, 'hubot')
+ })
+ })
+
+ test('rejects json promise after body is consumed', function() {
+ return fetch('/json').then(function(response) {
+ assert(response.json, 'Body does not implement json')
+ assert.equal(response.bodyUsed, false)
+ response.text()
+ assert.equal(response.bodyUsed, true)
+ return response.json()
+ }).catch(function(error) {
+ assert(error instanceof TypeError, 'Promise rejected after body consumed')
+ })
+ })
+
+ featureDependent(test, !polyfillFirefox, 'handles json parse error', function() {
+ return fetch('/json-error').then(function(response) {
+ return response.json()
+ }).catch(function(error) {
+ assert(error instanceof Error, 'JSON exception is an Error instance')
+ assert(error.message, 'JSON exception has an error message')
+ })
+ })
+ })
+
+ suite('text', function() {
+ test('handles 204 No Content response', function() {
+ return fetch('/empty').then(function(response) {
+ assert.equal(response.status, 204)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, '')
+ })
+ })
+
+ test('resolves text promise', function() {
+ return fetch('/hello').then(function(response) {
+ return response.text()
+ }).then(function(text) {
+ assert.equal(text, 'hi')
+ })
+ })
+
+ test('rejects text promise after body is consumed', function() {
+ return fetch('/hello').then(function(response) {
+ assert(response.text, 'Body does not implement text')
+ assert.equal(response.bodyUsed, false)
+ response.text()
+ assert.equal(response.bodyUsed, true)
+ return response.text()
+ }).catch(function(error) {
+ assert(error instanceof TypeError, 'Promise rejected after body consumed')
+ })
+ })
+ })
+})
+
+// https://fetch.spec.whatwg.org/#methods
+suite('Methods', function() {
+ test('supports HTTP GET', function() {
+ return fetch('/request', {
+ method: 'get',
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'GET')
+ assert.equal(request.data, '')
+ })
+ })
+
+ test('GET with body throws TypeError', function() {
+ assert.throw(function() {
+ new Request('', {
+ method: 'get',
+ body: 'invalid'
+ })
+ }, TypeError)
+ })
+
+ test('HEAD with body throws TypeError', function() {
+ assert.throw(function() {
+ new Request('', {
+ method: 'head',
+ body: 'invalid'
+ })
+ }, TypeError)
+ })
+
+ test('supports HTTP POST', function() {
+ return fetch('/request', {
+ method: 'post',
+ body: 'name=Hubot'
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'POST')
+ assert.equal(request.data, 'name=Hubot')
+ })
+ })
+
+ test('supports HTTP PUT', function() {
+ return fetch('/request', {
+ method: 'put',
+ body: 'name=Hubot'
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'PUT')
+ assert.equal(request.data, 'name=Hubot')
+ })
+ })
+
+ featureDependent(test, support.patch, 'supports HTTP PATCH', function() {
+ return fetch('/request', {
+ method: 'PATCH',
+ body: 'name=Hubot'
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'PATCH')
+ assert.equal(request.data, 'name=Hubot')
+ })
+ })
+
+ test('supports HTTP DELETE', function() {
+ return fetch('/request', {
+ method: 'delete',
+ }).then(function(response) {
+ return response.json()
+ }).then(function(request) {
+ assert.equal(request.method, 'DELETE')
+ assert.equal(request.data, '')
+ })
+ })
+})
+
+// https://fetch.spec.whatwg.org/#atomic-http-redirect-handling
+suite('Atomic HTTP redirect handling', function() {
+ test('handles 301 redirect response', function() {
+ return fetch('/redirect/301').then(function(response) {
+ assert.equal(response.status, 200)
+ assert.equal(response.ok, true)
+ assert.match(response.url, /\/hello/)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'hi')
+ })
+ })
+
+ test('handles 302 redirect response', function() {
+ return fetch('/redirect/302').then(function(response) {
+ assert.equal(response.status, 200)
+ assert.equal(response.ok, true)
+ assert.match(response.url, /\/hello/)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'hi')
+ })
+ })
+
+ test('handles 303 redirect response', function() {
+ return fetch('/redirect/303').then(function(response) {
+ assert.equal(response.status, 200)
+ assert.equal(response.ok, true)
+ assert.match(response.url, /\/hello/)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'hi')
+ })
+ })
+
+ test('handles 307 redirect response', function() {
+ return fetch('/redirect/307').then(function(response) {
+ assert.equal(response.status, 200)
+ assert.equal(response.ok, true)
+ assert.match(response.url, /\/hello/)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'hi')
+ })
+ })
+
+ featureDependent(test, support.permanentRedirect, 'handles 308 redirect response', function() {
+ return fetch('/redirect/308').then(function(response) {
+ assert.equal(response.status, 200)
+ assert.equal(response.ok, true)
+ assert.match(response.url, /\/hello/)
+ return response.text()
+ }).then(function(body) {
+ assert.equal(body, 'hi')
+ })
+ })
+})
+
+// https://fetch.spec.whatwg.org/#concept-request-credentials-mode
+suite('credentials mode', function() {
+ setup(function() {
+ return fetch('/cookie?name=foo&value=reset', {credentials: 'same-origin'})
+ })
+
+ featureDependent(suite, exerciseMode === 'native', 'omit', function() {
+ test('request credentials defaults to omit', function() {
+ var request = new Request('')
+ assert.equal(request.credentials, 'omit')
+ })
+
+ test('does not accept cookies with implicit omit credentials', function() {
+ return fetch('/cookie?name=foo&value=bar').then(function() {
+ return fetch('/cookie?name=foo', {credentials: 'same-origin'})
+ }).then(function(response) {
+ return response.text()
+ }).then(function(data) {
+ assert.equal(data, 'reset')
+ })
+ })
+
+ test('does not accept cookies with omit credentials', function() {
+ return fetch('/cookie?name=foo&value=bar', {credentials: 'omit'}).then(function() {
+ return fetch('/cookie?name=foo', {credentials: 'same-origin'})
+ }).then(function(response) {
+ return response.text()
+ }).then(function(data) {
+ assert.equal(data, 'reset')
+ })
+ })
+
+ test('does not send cookies with implicit omit credentials', function() {
+ return fetch('/cookie?name=foo&value=bar', {credentials: 'same-origin'}).then(function() {
+ return fetch('/cookie?name=foo')
+ }).then(function(response) {
+ return response.text()
+ }).then(function(data) {
+ assert.equal(data, '')
+ })
+ })
+
+ test('does not send cookies with omit credentials', function() {
+ return fetch('/cookie?name=foo&value=bar').then(function() {
+ return fetch('/cookie?name=foo', {credentials: 'omit'})
+ }).then(function(response) {
+ return response.text()
+ }).then(function(data) {
+ assert.equal(data, '')
+ })
+ })
+ })
+
+ suite('same-origin', function() {
+ test('request credentials uses inits member', function() {
+ var request = new Request('', {credentials: 'same-origin'})
+ assert.equal(request.credentials, 'same-origin')
+ })
+
+ test('send cookies with same-origin credentials', function() {
+ return fetch('/cookie?name=foo&value=bar', {credentials: 'same-origin'}).then(function() {
+ return fetch('/cookie?name=foo', {credentials: 'same-origin'})
+ }).then(function(response) {
+ return response.text()
+ }).then(function(data) {
+ assert.equal(data, 'bar')
+ })
+ })
+ })
+
+ suite('include', function() {
+ test('send cookies with include credentials', function() {
+ return fetch('/cookie?name=foo&value=bar', {credentials: 'include'}).then(function() {
+ return fetch('/cookie?name=foo', {credentials: 'include'})
+ }).then(function(response) {
+ return response.text()
+ }).then(function(data) {
+ assert.equal(data, 'bar')
+ })
+ })
+ })
+})
+
+ })
+})
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/worker.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/worker.js
new file mode 100644
index 000000000..0c826fd09
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/github/fetch@1.0.0/test/worker.js
@@ -0,0 +1,38 @@
+importScripts('/node_modules/chai/chai.js')
+importScripts('/node_modules/mocha/mocha.js')
+
+mocha.setup('tdd')
+self.assert = chai.assert
+
+importScripts('/bower_components/es6-promise/promise.js')
+importScripts('/test/test.js')
+importScripts('/fetch.js')
+
+function title(test) {
+ return test.fullTitle().replace(/#/g, '');
+}
+
+function reporter(runner) {
+ runner.on('pending', function(test){
+ self.postMessage({name: 'pending', title: title(test)});
+ });
+
+ runner.on('pass', function(test){
+ self.postMessage({name: 'pass', title: title(test)});
+ });
+
+ runner.on('fail', function(test, err){
+ self.postMessage({
+ name: 'fail',
+ title: title(test),
+ message: err.message,
+ stack: err.stack
+ });
+ });
+
+ runner.on('end', function(){
+ self.postMessage({name: 'end'});
+ });
+}
+
+mocha.reporter(reporter).run()
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8.js
new file mode 100644
index 000000000..bcac0137b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8.js
@@ -0,0 +1 @@
+module.exports = require("github:systemjs/plugin-text@0.0.8/text");
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/.gitignore b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/.gitignore
new file mode 100644
index 000000000..bfa6a22a5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/.gitignore
@@ -0,0 +1 @@
+# Created by .ignore support plugin (hsz.mobi)
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/.jspm-hash
new file mode 100644
index 000000000..ac729d4c6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/.jspm-hash
@@ -0,0 +1 @@
+8ba997948dfe0b4a0fb11de4d7fc05ae8eb613b599914b932bd37a50b983c5e7c90ae93bjspm-github@0.13.10.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/LICENSE b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/LICENSE
new file mode 100644
index 000000000..7167772e3
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 jspm
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/README.md b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/README.md
new file mode 100644
index 000000000..3348fc95d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/README.md
@@ -0,0 +1,26 @@
+text
+===========
+
+SystemJS's text loading plugin. Text is loaded from the file into the variable as a string.
+
+Installing
+---
+
+For SystemJS use, locate `text.js` in the application, and then locate it with map configuration:
+
+```javascript
+System.config({
+ map: {
+ text: 'path/to/text.js'
+ }
+});
+```
+
+For installing with jspm, run `jspm install text`.
+
+Basic Use
+---
+
+```javascript
+import myText from './mytext.html!text';
+```
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/package.json b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/package.json
new file mode 100644
index 000000000..c189299ca
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "systemjs-plugin-text",
+ "version": "0.0.8",
+ "main": "text",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/systemjs/plugin-text.git"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/systemjs/plugin-text/issues"
+ },
+ "homepage": "https://github.com/systemjs/plugin-text"
+}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/test.html b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/test.html
new file mode 100644
index 000000000..e51859ced
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/test.html
@@ -0,0 +1,4 @@
+
+
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/text.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/text.js
new file mode 100644
index 000000000..3cc5f94d1
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/text.js
@@ -0,0 +1,12 @@
+/*
+ Text plugin
+*/
+exports.translate = function(load) {
+ if (this.builder && this.transpiler) {
+ load.metadata.format = 'esm';
+ return 'export default ' + JSON.stringify(load.source) + ';';
+ }
+
+ load.metadata.format = 'amd';
+ return 'def' + 'ine(function() {\nreturn ' + JSON.stringify(load.source) + ';\n});';
+}
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/text.txt b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/text.txt
new file mode 100644
index 000000000..446b259f7
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/github/systemjs/plugin-text@0.0.8/text.txt
@@ -0,0 +1,4 @@
+This is
+Some text
+
+"yay"
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9.js
new file mode 100644
index 000000000..dced11894
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-binding@1.0.9/aurelia-binding"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/.jspm-hash
new file mode 100644
index 000000000..bd8d42d98
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/.jspm-hash
@@ -0,0 +1 @@
+b4d14507dda00aef7dbc56fbcd527c5f9ebd137c99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/aurelia-binding.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/aurelia-binding.js
new file mode 100644
index 000000000..0940100d5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/aurelia-binding.js
@@ -0,0 +1,5374 @@
+/* */
+define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-task-queue', 'aurelia-metadata'], function (exports, _aureliaLogging, _aureliaPal, _aureliaTaskQueue, _aureliaMetadata) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.getSetObserver = exports.BindingEngine = exports.NameExpression = exports.Listener = exports.ListenerExpression = exports.BindingBehaviorResource = exports.ValueConverterResource = exports.Call = exports.CallExpression = exports.Binding = exports.BindingExpression = exports.ObjectObservationAdapter = exports.ObserverLocator = exports.SVGAnalyzer = exports.presentationAttributes = exports.presentationElements = exports.elements = exports.ComputedExpression = exports.ClassObserver = exports.SelectValueObserver = exports.CheckedObserver = exports.ValueAttributeObserver = exports.StyleObserver = exports.DataAttributeObserver = exports.dataAttributeAccessor = exports.XLinkAttributeObserver = exports.SetterObserver = exports.PrimitiveObserver = exports.propertyAccessor = exports.DirtyCheckProperty = exports.DirtyChecker = exports.EventManager = exports.getMapObserver = exports.ParserImplementation = exports.Parser = exports.Scanner = exports.Lexer = exports.Token = exports.bindingMode = exports.ExpressionCloner = exports.Unparser = exports.LiteralObject = exports.LiteralArray = exports.LiteralString = exports.LiteralPrimitive = exports.PrefixNot = exports.Binary = exports.CallFunction = exports.CallMember = exports.CallScope = exports.AccessKeyed = exports.AccessMember = exports.AccessScope = exports.AccessThis = exports.Conditional = exports.Assign = exports.ValueConverter = exports.BindingBehavior = exports.Chain = exports.Expression = exports.getArrayObserver = exports.CollectionLengthObserver = exports.ModifyCollectionObserver = exports.ExpressionObserver = exports.sourceContext = undefined;
+ exports.camelCase = camelCase;
+ exports.createOverrideContext = createOverrideContext;
+ exports.getContextFor = getContextFor;
+ exports.createScopeForTest = createScopeForTest;
+ exports.connectable = connectable;
+ exports.enqueueBindingConnect = enqueueBindingConnect;
+ exports.subscriberCollection = subscriberCollection;
+ exports.calcSplices = calcSplices;
+ exports.mergeSplice = mergeSplice;
+ exports.projectArraySplices = projectArraySplices;
+ exports.getChangeRecords = getChangeRecords;
+ exports.cloneExpression = cloneExpression;
+ exports.hasDeclaredDependencies = hasDeclaredDependencies;
+ exports.declarePropertyDependencies = declarePropertyDependencies;
+ exports.computedFrom = computedFrom;
+ exports.createComputedObserver = createComputedObserver;
+ exports.valueConverter = valueConverter;
+ exports.bindingBehavior = bindingBehavior;
+ exports.observable = observable;
+
+ var LogManager = _interopRequireWildcard(_aureliaLogging);
+
+ function _interopRequireWildcard(obj) {
+ if (obj && obj.__esModule) {
+ return obj;
+ } else {
+ var newObj = {};
+
+ if (obj != null) {
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
+ }
+ }
+
+ newObj.default = obj;
+ return newObj;
+ }
+ }
+
+ 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 _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;
+ };
+ }();
+
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }
+
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+
+
+ var _dec, _dec2, _class, _dec3, _class2, _dec4, _class3, _dec5, _class5, _dec6, _class7, _dec7, _class8, _dec8, _class9, _dec9, _class10, _class11, _temp, _dec10, _class12, _class13, _temp2;
+
+ var map = Object.create(null);
+
+ function camelCase(name) {
+ if (name in map) {
+ return map[name];
+ }
+ var result = name.charAt(0).toLowerCase() + name.slice(1).replace(/[_.-](\w|$)/g, function (_, x) {
+ return x.toUpperCase();
+ });
+ map[name] = result;
+ return result;
+ }
+
+ function createOverrideContext(bindingContext, parentOverrideContext) {
+ return {
+ bindingContext: bindingContext,
+ parentOverrideContext: parentOverrideContext || null
+ };
+ }
+
+ function getContextFor(name, scope, ancestor) {
+ var oc = scope.overrideContext;
+
+ if (ancestor) {
+ while (ancestor && oc) {
+ ancestor--;
+ oc = oc.parentOverrideContext;
+ }
+ if (ancestor || !oc) {
+ return undefined;
+ }
+ return name in oc ? oc : oc.bindingContext;
+ }
+
+ while (oc && !(name in oc) && !(oc.bindingContext && name in oc.bindingContext)) {
+ oc = oc.parentOverrideContext;
+ }
+ if (oc) {
+ return name in oc ? oc : oc.bindingContext;
+ }
+
+ return scope.bindingContext || scope.overrideContext;
+ }
+
+ function createScopeForTest(bindingContext, parentBindingContext) {
+ if (parentBindingContext) {
+ return {
+ bindingContext: bindingContext,
+ overrideContext: createOverrideContext(bindingContext, createOverrideContext(parentBindingContext))
+ };
+ }
+ return {
+ bindingContext: bindingContext,
+ overrideContext: createOverrideContext(bindingContext)
+ };
+ }
+
+ var sourceContext = exports.sourceContext = 'Binding:source';
+ var slotNames = [];
+ var versionSlotNames = [];
+
+ for (var i = 0; i < 100; i++) {
+ slotNames.push('_observer' + i);
+ versionSlotNames.push('_observerVersion' + i);
+ }
+
+ function addObserver(observer) {
+ var observerSlots = this._observerSlots === undefined ? 0 : this._observerSlots;
+ var i = observerSlots;
+ while (i-- && this[slotNames[i]] !== observer) {}
+
+ if (i === -1) {
+ i = 0;
+ while (this[slotNames[i]]) {
+ i++;
+ }
+ this[slotNames[i]] = observer;
+ observer.subscribe(sourceContext, this);
+
+ if (i === observerSlots) {
+ this._observerSlots = i + 1;
+ }
+ }
+
+ if (this._version === undefined) {
+ this._version = 0;
+ }
+ this[versionSlotNames[i]] = this._version;
+ }
+
+ function observeProperty(obj, propertyName) {
+ var observer = this.observerLocator.getObserver(obj, propertyName);
+ addObserver.call(this, observer);
+ }
+
+ function observeArray(array) {
+ var observer = this.observerLocator.getArrayObserver(array);
+ addObserver.call(this, observer);
+ }
+
+ function unobserve(all) {
+ var i = this._observerSlots;
+ while (i--) {
+ if (all || this[versionSlotNames[i]] !== this._version) {
+ var observer = this[slotNames[i]];
+ this[slotNames[i]] = null;
+ if (observer) {
+ observer.unsubscribe(sourceContext, this);
+ }
+ }
+ }
+ }
+
+ function connectable() {
+ return function (target) {
+ target.prototype.observeProperty = observeProperty;
+ target.prototype.observeArray = observeArray;
+ target.prototype.unobserve = unobserve;
+ target.prototype.addObserver = addObserver;
+ };
+ }
+
+ var bindings = new Map();
+ var minimumImmediate = 100;
+ var frameBudget = 15;
+
+ var isFlushRequested = false;
+ var immediate = 0;
+
+ function flush(animationFrameStart) {
+ var i = 0;
+ var keys = bindings.keys();
+ var item = void 0;
+
+ while (item = keys.next()) {
+ if (item.done) {
+ break;
+ }
+
+ var binding = item.value;
+ bindings.delete(binding);
+ binding.connect(true);
+ i++;
+
+ if (i % 100 === 0 && _aureliaPal.PLATFORM.performance.now() - animationFrameStart > frameBudget) {
+ break;
+ }
+ }
+
+ if (bindings.size) {
+ _aureliaPal.PLATFORM.requestAnimationFrame(flush);
+ } else {
+ isFlushRequested = false;
+ immediate = 0;
+ }
+ }
+
+ function enqueueBindingConnect(binding) {
+ if (immediate < minimumImmediate) {
+ immediate++;
+ binding.connect(false);
+ } else {
+ bindings.set(binding);
+ }
+ if (!isFlushRequested) {
+ isFlushRequested = true;
+ _aureliaPal.PLATFORM.requestAnimationFrame(flush);
+ }
+ }
+
+ function addSubscriber(context, callable) {
+ if (this.hasSubscriber(context, callable)) {
+ return false;
+ }
+ if (!this._context0) {
+ this._context0 = context;
+ this._callable0 = callable;
+ return true;
+ }
+ if (!this._context1) {
+ this._context1 = context;
+ this._callable1 = callable;
+ return true;
+ }
+ if (!this._context2) {
+ this._context2 = context;
+ this._callable2 = callable;
+ return true;
+ }
+ if (!this._contextsRest) {
+ this._contextsRest = [context];
+ this._callablesRest = [callable];
+ return true;
+ }
+ this._contextsRest.push(context);
+ this._callablesRest.push(callable);
+ return true;
+ }
+
+ function removeSubscriber(context, callable) {
+ if (this._context0 === context && this._callable0 === callable) {
+ this._context0 = null;
+ this._callable0 = null;
+ return true;
+ }
+ if (this._context1 === context && this._callable1 === callable) {
+ this._context1 = null;
+ this._callable1 = null;
+ return true;
+ }
+ if (this._context2 === context && this._callable2 === callable) {
+ this._context2 = null;
+ this._callable2 = null;
+ return true;
+ }
+ var rest = this._contextsRest;
+ var index = void 0;
+ if (!rest || !rest.length || (index = rest.indexOf(context)) === -1 || this._callablesRest[index] !== callable) {
+ return false;
+ }
+ rest.splice(index, 1);
+ this._callablesRest.splice(index, 1);
+ return true;
+ }
+
+ var arrayPool1 = [];
+ var arrayPool2 = [];
+ var poolUtilization = [];
+
+ function callSubscribers(newValue, oldValue) {
+ var context0 = this._context0;
+ var callable0 = this._callable0;
+ var context1 = this._context1;
+ var callable1 = this._callable1;
+ var context2 = this._context2;
+ var callable2 = this._callable2;
+ var length = this._contextsRest ? this._contextsRest.length : 0;
+ var contextsRest = void 0;
+ var callablesRest = void 0;
+ var poolIndex = void 0;
+ var i = void 0;
+ if (length) {
+ poolIndex = poolUtilization.length;
+ while (poolIndex-- && poolUtilization[poolIndex]) {}
+ if (poolIndex < 0) {
+ poolIndex = poolUtilization.length;
+ contextsRest = [];
+ callablesRest = [];
+ poolUtilization.push(true);
+ arrayPool1.push(contextsRest);
+ arrayPool2.push(callablesRest);
+ } else {
+ poolUtilization[poolIndex] = true;
+ contextsRest = arrayPool1[poolIndex];
+ callablesRest = arrayPool2[poolIndex];
+ }
+
+ i = length;
+ while (i--) {
+ contextsRest[i] = this._contextsRest[i];
+ callablesRest[i] = this._callablesRest[i];
+ }
+ }
+
+ if (context0) {
+ if (callable0) {
+ callable0.call(context0, newValue, oldValue);
+ } else {
+ context0(newValue, oldValue);
+ }
+ }
+ if (context1) {
+ if (callable1) {
+ callable1.call(context1, newValue, oldValue);
+ } else {
+ context1(newValue, oldValue);
+ }
+ }
+ if (context2) {
+ if (callable2) {
+ callable2.call(context2, newValue, oldValue);
+ } else {
+ context2(newValue, oldValue);
+ }
+ }
+ if (length) {
+ for (i = 0; i < length; i++) {
+ var callable = callablesRest[i];
+ var context = contextsRest[i];
+ if (callable) {
+ callable.call(context, newValue, oldValue);
+ } else {
+ context(newValue, oldValue);
+ }
+ contextsRest[i] = null;
+ callablesRest[i] = null;
+ }
+ poolUtilization[poolIndex] = false;
+ }
+ }
+
+ function hasSubscribers() {
+ return !!(this._context0 || this._context1 || this._context2 || this._contextsRest && this._contextsRest.length);
+ }
+
+ function hasSubscriber(context, callable) {
+ var has = this._context0 === context && this._callable0 === callable || this._context1 === context && this._callable1 === callable || this._context2 === context && this._callable2 === callable;
+ if (has) {
+ return true;
+ }
+ var index = void 0;
+ var contexts = this._contextsRest;
+ if (!contexts || (index = contexts.length) === 0) {
+ return false;
+ }
+ var callables = this._callablesRest;
+ while (index--) {
+ if (contexts[index] === context && callables[index] === callable) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function subscriberCollection() {
+ return function (target) {
+ target.prototype.addSubscriber = addSubscriber;
+ target.prototype.removeSubscriber = removeSubscriber;
+ target.prototype.callSubscribers = callSubscribers;
+ target.prototype.hasSubscribers = hasSubscribers;
+ target.prototype.hasSubscriber = hasSubscriber;
+ };
+ }
+
+ var ExpressionObserver = exports.ExpressionObserver = (_dec = connectable(), _dec2 = subscriberCollection(), _dec(_class = _dec2(_class = function () {
+ function ExpressionObserver(scope, expression, observerLocator, lookupFunctions) {
+
+
+ this.scope = scope;
+ this.expression = expression;
+ this.observerLocator = observerLocator;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ ExpressionObserver.prototype.getValue = function getValue() {
+ return this.expression.evaluate(this.scope, this.lookupFunctions);
+ };
+
+ ExpressionObserver.prototype.setValue = function setValue(newValue) {
+ this.expression.assign(this.scope, newValue);
+ };
+
+ ExpressionObserver.prototype.subscribe = function subscribe(context, callable) {
+ var _this = this;
+
+ if (!this.hasSubscribers()) {
+ this.oldValue = this.expression.evaluate(this.scope, this.lookupFunctions);
+ this.expression.connect(this, this.scope);
+ }
+ this.addSubscriber(context, callable);
+ if (arguments.length === 1 && context instanceof Function) {
+ return {
+ dispose: function dispose() {
+ _this.unsubscribe(context, callable);
+ }
+ };
+ }
+ };
+
+ ExpressionObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ if (this.removeSubscriber(context, callable) && !this.hasSubscribers()) {
+ this.unobserve(true);
+ this.oldValue = undefined;
+ }
+ };
+
+ ExpressionObserver.prototype.call = function call() {
+ var newValue = this.expression.evaluate(this.scope, this.lookupFunctions);
+ var oldValue = this.oldValue;
+ if (newValue !== oldValue) {
+ this.oldValue = newValue;
+ this.callSubscribers(newValue, oldValue);
+ }
+ this._version++;
+ this.expression.connect(this, this.scope);
+ this.unobserve(false);
+ };
+
+ return ExpressionObserver;
+ }()) || _class) || _class);
+
+
+ function isIndex(s) {
+ return +s === s >>> 0;
+ }
+
+ function toNumber(s) {
+ return +s;
+ }
+
+ function newSplice(index, removed, addedCount) {
+ return {
+ index: index,
+ removed: removed,
+ addedCount: addedCount
+ };
+ }
+
+ var EDIT_LEAVE = 0;
+ var EDIT_UPDATE = 1;
+ var EDIT_ADD = 2;
+ var EDIT_DELETE = 3;
+
+ function ArraySplice() {}
+
+ ArraySplice.prototype = {
+ calcEditDistances: function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ var rowCount = oldEnd - oldStart + 1;
+ var columnCount = currentEnd - currentStart + 1;
+ var distances = new Array(rowCount);
+ var north = void 0;
+ var west = void 0;
+
+ for (var _i = 0; _i < rowCount; ++_i) {
+ distances[_i] = new Array(columnCount);
+ distances[_i][0] = _i;
+ }
+
+ for (var j = 0; j < columnCount; ++j) {
+ distances[0][j] = j;
+ }
+
+ for (var _i2 = 1; _i2 < rowCount; ++_i2) {
+ for (var _j = 1; _j < columnCount; ++_j) {
+ if (this.equals(current[currentStart + _j - 1], old[oldStart + _i2 - 1])) {
+ distances[_i2][_j] = distances[_i2 - 1][_j - 1];
+ } else {
+ north = distances[_i2 - 1][_j] + 1;
+ west = distances[_i2][_j - 1] + 1;
+ distances[_i2][_j] = north < west ? north : west;
+ }
+ }
+ }
+
+ return distances;
+ },
+
+ spliceOperationsFromEditDistances: function spliceOperationsFromEditDistances(distances) {
+ var i = distances.length - 1;
+ var j = distances[0].length - 1;
+ var current = distances[i][j];
+ var edits = [];
+ while (i > 0 || j > 0) {
+ if (i === 0) {
+ edits.push(EDIT_ADD);
+ j--;
+ continue;
+ }
+ if (j === 0) {
+ edits.push(EDIT_DELETE);
+ i--;
+ continue;
+ }
+ var northWest = distances[i - 1][j - 1];
+ var west = distances[i - 1][j];
+ var north = distances[i][j - 1];
+
+ var min = void 0;
+ if (west < north) {
+ min = west < northWest ? west : northWest;
+ } else {
+ min = north < northWest ? north : northWest;
+ }
+
+ if (min === northWest) {
+ if (northWest === current) {
+ edits.push(EDIT_LEAVE);
+ } else {
+ edits.push(EDIT_UPDATE);
+ current = northWest;
+ }
+ i--;
+ j--;
+ } else if (min === west) {
+ edits.push(EDIT_DELETE);
+ i--;
+ current = west;
+ } else {
+ edits.push(EDIT_ADD);
+ j--;
+ current = north;
+ }
+ }
+
+ edits.reverse();
+ return edits;
+ },
+
+ calcSplices: function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ var prefixCount = 0;
+ var suffixCount = 0;
+
+ var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
+ if (currentStart === 0 && oldStart === 0) {
+ prefixCount = this.sharedPrefix(current, old, minLength);
+ }
+
+ if (currentEnd === current.length && oldEnd === old.length) {
+ suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
+ }
+
+ currentStart += prefixCount;
+ oldStart += prefixCount;
+ currentEnd -= suffixCount;
+ oldEnd -= suffixCount;
+
+ if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) {
+ return [];
+ }
+
+ if (currentStart === currentEnd) {
+ var _splice = newSplice(currentStart, [], 0);
+ while (oldStart < oldEnd) {
+ _splice.removed.push(old[oldStart++]);
+ }
+
+ return [_splice];
+ } else if (oldStart === oldEnd) {
+ return [newSplice(currentStart, [], currentEnd - currentStart)];
+ }
+
+ var ops = this.spliceOperationsFromEditDistances(this.calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
+
+ var splice = undefined;
+ var splices = [];
+ var index = currentStart;
+ var oldIndex = oldStart;
+ for (var _i3 = 0; _i3 < ops.length; ++_i3) {
+ switch (ops[_i3]) {
+ case EDIT_LEAVE:
+ if (splice) {
+ splices.push(splice);
+ splice = undefined;
+ }
+
+ index++;
+ oldIndex++;
+ break;
+ case EDIT_UPDATE:
+ if (!splice) {
+ splice = newSplice(index, [], 0);
+ }
+
+ splice.addedCount++;
+ index++;
+
+ splice.removed.push(old[oldIndex]);
+ oldIndex++;
+ break;
+ case EDIT_ADD:
+ if (!splice) {
+ splice = newSplice(index, [], 0);
+ }
+
+ splice.addedCount++;
+ index++;
+ break;
+ case EDIT_DELETE:
+ if (!splice) {
+ splice = newSplice(index, [], 0);
+ }
+
+ splice.removed.push(old[oldIndex]);
+ oldIndex++;
+ break;
+ }
+ }
+
+ if (splice) {
+ splices.push(splice);
+ }
+ return splices;
+ },
+
+ sharedPrefix: function sharedPrefix(current, old, searchLength) {
+ for (var _i4 = 0; _i4 < searchLength; ++_i4) {
+ if (!this.equals(current[_i4], old[_i4])) {
+ return _i4;
+ }
+ }
+
+ return searchLength;
+ },
+
+ sharedSuffix: function sharedSuffix(current, old, searchLength) {
+ var index1 = current.length;
+ var index2 = old.length;
+ var count = 0;
+ while (count < searchLength && this.equals(current[--index1], old[--index2])) {
+ count++;
+ }
+
+ return count;
+ },
+
+ calculateSplices: function calculateSplices(current, previous) {
+ return this.calcSplices(current, 0, current.length, previous, 0, previous.length);
+ },
+
+ equals: function equals(currentValue, previousValue) {
+ return currentValue === previousValue;
+ }
+ };
+
+ var arraySplice = new ArraySplice();
+
+ function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+ return arraySplice.calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd);
+ }
+
+ function intersect(start1, end1, start2, end2) {
+ if (end1 < start2 || end2 < start1) {
+ return -1;
+ }
+
+ if (end1 === start2 || end2 === start1) {
+ return 0;
+ }
+
+ if (start1 < start2) {
+ if (end1 < end2) {
+ return end1 - start2;
+ }
+
+ return end2 - start2;
+ }
+
+ if (end2 < end1) {
+ return end2 - start1;
+ }
+
+ return end1 - start1;
+ }
+
+ function mergeSplice(splices, index, removed, addedCount) {
+ var splice = newSplice(index, removed, addedCount);
+
+ var inserted = false;
+ var insertionOffset = 0;
+
+ for (var _i5 = 0; _i5 < splices.length; _i5++) {
+ var current = splices[_i5];
+ current.index += insertionOffset;
+
+ if (inserted) {
+ continue;
+ }
+
+ var intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount);
+
+ if (intersectCount >= 0) {
+
+ splices.splice(_i5, 1);
+ _i5--;
+
+ insertionOffset -= current.addedCount - current.removed.length;
+
+ splice.addedCount += current.addedCount - intersectCount;
+ var deleteCount = splice.removed.length + current.removed.length - intersectCount;
+
+ if (!splice.addedCount && !deleteCount) {
+ inserted = true;
+ } else {
+ var currentRemoved = current.removed;
+
+ if (splice.index < current.index) {
+ var prepend = splice.removed.slice(0, current.index - splice.index);
+ Array.prototype.push.apply(prepend, currentRemoved);
+ currentRemoved = prepend;
+ }
+
+ if (splice.index + splice.removed.length > current.index + current.addedCount) {
+ var append = splice.removed.slice(current.index + current.addedCount - splice.index);
+ Array.prototype.push.apply(currentRemoved, append);
+ }
+
+ splice.removed = currentRemoved;
+ if (current.index < splice.index) {
+ splice.index = current.index;
+ }
+ }
+ } else if (splice.index < current.index) {
+
+ inserted = true;
+
+ splices.splice(_i5, 0, splice);
+ _i5++;
+
+ var offset = splice.addedCount - splice.removed.length;
+ current.index += offset;
+ insertionOffset += offset;
+ }
+ }
+
+ if (!inserted) {
+ splices.push(splice);
+ }
+ }
+
+ function createInitialSplices(array, changeRecords) {
+ var splices = [];
+
+ for (var _i6 = 0; _i6 < changeRecords.length; _i6++) {
+ var record = changeRecords[_i6];
+ switch (record.type) {
+ case 'splice':
+ mergeSplice(splices, record.index, record.removed.slice(), record.addedCount);
+ break;
+ case 'add':
+ case 'update':
+ case 'delete':
+ if (!isIndex(record.name)) {
+ continue;
+ }
+
+ var index = toNumber(record.name);
+ if (index < 0) {
+ continue;
+ }
+
+ mergeSplice(splices, index, [record.oldValue], record.type === 'delete' ? 0 : 1);
+ break;
+ default:
+ console.error('Unexpected record type: ' + JSON.stringify(record));
+ break;
+ }
+ }
+
+ return splices;
+ }
+
+ function projectArraySplices(array, changeRecords) {
+ var splices = [];
+
+ createInitialSplices(array, changeRecords).forEach(function (splice) {
+ if (splice.addedCount === 1 && splice.removed.length === 1) {
+ if (splice.removed[0] !== array[splice.index]) {
+ splices.push(splice);
+ }
+
+ return;
+ }
+
+ splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length));
+ });
+
+ return splices;
+ }
+
+ function newRecord(type, object, key, oldValue) {
+ return {
+ type: type,
+ object: object,
+ key: key,
+ oldValue: oldValue
+ };
+ }
+
+ function getChangeRecords(map) {
+ var entries = new Array(map.size);
+ var keys = map.keys();
+ var i = 0;
+ var item = void 0;
+
+ while (item = keys.next()) {
+ if (item.done) {
+ break;
+ }
+
+ entries[i] = newRecord('added', map, item.value);
+ i++;
+ }
+
+ return entries;
+ }
+
+ var ModifyCollectionObserver = exports.ModifyCollectionObserver = (_dec3 = subscriberCollection(), _dec3(_class2 = function () {
+ function ModifyCollectionObserver(taskQueue, collection) {
+
+
+ this.taskQueue = taskQueue;
+ this.queued = false;
+ this.changeRecords = null;
+ this.oldCollection = null;
+ this.collection = collection;
+ this.lengthPropertyName = collection instanceof Map || collection instanceof Set ? 'size' : 'length';
+ }
+
+ ModifyCollectionObserver.prototype.subscribe = function subscribe(context, callable) {
+ this.addSubscriber(context, callable);
+ };
+
+ ModifyCollectionObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ this.removeSubscriber(context, callable);
+ };
+
+ ModifyCollectionObserver.prototype.addChangeRecord = function addChangeRecord(changeRecord) {
+ if (!this.hasSubscribers() && !this.lengthObserver) {
+ return;
+ }
+
+ if (changeRecord.type === 'splice') {
+ var index = changeRecord.index;
+ var arrayLength = changeRecord.object.length;
+ if (index > arrayLength) {
+ index = arrayLength - changeRecord.addedCount;
+ } else if (index < 0) {
+ index = arrayLength + changeRecord.removed.length + index - changeRecord.addedCount;
+ }
+ if (index < 0) {
+ index = 0;
+ }
+ changeRecord.index = index;
+ }
+
+ if (this.changeRecords === null) {
+ this.changeRecords = [changeRecord];
+ } else {
+ this.changeRecords.push(changeRecord);
+ }
+
+ if (!this.queued) {
+ this.queued = true;
+ this.taskQueue.queueMicroTask(this);
+ }
+ };
+
+ ModifyCollectionObserver.prototype.flushChangeRecords = function flushChangeRecords() {
+ if (this.changeRecords && this.changeRecords.length || this.oldCollection) {
+ this.call();
+ }
+ };
+
+ ModifyCollectionObserver.prototype.reset = function reset(oldCollection) {
+ this.oldCollection = oldCollection;
+
+ if (this.hasSubscribers() && !this.queued) {
+ this.queued = true;
+ this.taskQueue.queueMicroTask(this);
+ }
+ };
+
+ ModifyCollectionObserver.prototype.getLengthObserver = function getLengthObserver() {
+ return this.lengthObserver || (this.lengthObserver = new CollectionLengthObserver(this.collection));
+ };
+
+ ModifyCollectionObserver.prototype.call = function call() {
+ var changeRecords = this.changeRecords;
+ var oldCollection = this.oldCollection;
+ var records = void 0;
+
+ this.queued = false;
+ this.changeRecords = [];
+ this.oldCollection = null;
+
+ if (this.hasSubscribers()) {
+ if (oldCollection) {
+ if (this.collection instanceof Map || this.collection instanceof Set) {
+ records = getChangeRecords(oldCollection);
+ } else {
+ records = calcSplices(this.collection, 0, this.collection.length, oldCollection, 0, oldCollection.length);
+ }
+ } else {
+ if (this.collection instanceof Map || this.collection instanceof Set) {
+ records = changeRecords;
+ } else {
+ records = projectArraySplices(this.collection, changeRecords);
+ }
+ }
+
+ this.callSubscribers(records);
+ }
+
+ if (this.lengthObserver) {
+ this.lengthObserver.call(this.collection[this.lengthPropertyName]);
+ }
+ };
+
+ return ModifyCollectionObserver;
+ }()) || _class2);
+ var CollectionLengthObserver = exports.CollectionLengthObserver = (_dec4 = subscriberCollection(), _dec4(_class3 = function () {
+ function CollectionLengthObserver(collection) {
+
+
+ this.collection = collection;
+ this.lengthPropertyName = collection instanceof Map || collection instanceof Set ? 'size' : 'length';
+ this.currentValue = collection[this.lengthPropertyName];
+ }
+
+ CollectionLengthObserver.prototype.getValue = function getValue() {
+ return this.collection[this.lengthPropertyName];
+ };
+
+ CollectionLengthObserver.prototype.setValue = function setValue(newValue) {
+ this.collection[this.lengthPropertyName] = newValue;
+ };
+
+ CollectionLengthObserver.prototype.subscribe = function subscribe(context, callable) {
+ this.addSubscriber(context, callable);
+ };
+
+ CollectionLengthObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ this.removeSubscriber(context, callable);
+ };
+
+ CollectionLengthObserver.prototype.call = function call(newValue) {
+ var oldValue = this.currentValue;
+ this.callSubscribers(newValue, oldValue);
+ this.currentValue = newValue;
+ };
+
+ return CollectionLengthObserver;
+ }()) || _class3);
+
+ var pop = Array.prototype.pop;
+ var push = Array.prototype.push;
+ var reverse = Array.prototype.reverse;
+ var shift = Array.prototype.shift;
+ var sort = Array.prototype.sort;
+ var splice = Array.prototype.splice;
+ var unshift = Array.prototype.unshift;
+
+ Array.prototype.pop = function () {
+ var notEmpty = this.length > 0;
+ var methodCallResult = pop.apply(this, arguments);
+ if (notEmpty && this.__array_observer__ !== undefined) {
+ this.__array_observer__.addChangeRecord({
+ type: 'delete',
+ object: this,
+ name: this.length,
+ oldValue: methodCallResult
+ });
+ }
+ return methodCallResult;
+ };
+
+ Array.prototype.push = function () {
+ var methodCallResult = push.apply(this, arguments);
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.addChangeRecord({
+ type: 'splice',
+ object: this,
+ index: this.length - arguments.length,
+ removed: [],
+ addedCount: arguments.length
+ });
+ }
+ return methodCallResult;
+ };
+
+ Array.prototype.reverse = function () {
+ var oldArray = void 0;
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.flushChangeRecords();
+ oldArray = this.slice();
+ }
+ var methodCallResult = reverse.apply(this, arguments);
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.reset(oldArray);
+ }
+ return methodCallResult;
+ };
+
+ Array.prototype.shift = function () {
+ var notEmpty = this.length > 0;
+ var methodCallResult = shift.apply(this, arguments);
+ if (notEmpty && this.__array_observer__ !== undefined) {
+ this.__array_observer__.addChangeRecord({
+ type: 'delete',
+ object: this,
+ name: 0,
+ oldValue: methodCallResult
+ });
+ }
+ return methodCallResult;
+ };
+
+ Array.prototype.sort = function () {
+ var oldArray = void 0;
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.flushChangeRecords();
+ oldArray = this.slice();
+ }
+ var methodCallResult = sort.apply(this, arguments);
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.reset(oldArray);
+ }
+ return methodCallResult;
+ };
+
+ Array.prototype.splice = function () {
+ var methodCallResult = splice.apply(this, arguments);
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.addChangeRecord({
+ type: 'splice',
+ object: this,
+ index: arguments[0],
+ removed: methodCallResult,
+ addedCount: arguments.length > 2 ? arguments.length - 2 : 0
+ });
+ }
+ return methodCallResult;
+ };
+
+ Array.prototype.unshift = function () {
+ var methodCallResult = unshift.apply(this, arguments);
+ if (this.__array_observer__ !== undefined) {
+ this.__array_observer__.addChangeRecord({
+ type: 'splice',
+ object: this,
+ index: 0,
+ removed: [],
+ addedCount: arguments.length
+ });
+ }
+ return methodCallResult;
+ };
+
+ function _getArrayObserver(taskQueue, array) {
+ return ModifyArrayObserver.for(taskQueue, array);
+ }
+
+ exports.getArrayObserver = _getArrayObserver;
+
+ var ModifyArrayObserver = function (_ModifyCollectionObse) {
+ _inherits(ModifyArrayObserver, _ModifyCollectionObse);
+
+ function ModifyArrayObserver(taskQueue, array) {
+
+
+ return _possibleConstructorReturn(this, _ModifyCollectionObse.call(this, taskQueue, array));
+ }
+
+ ModifyArrayObserver.for = function _for(taskQueue, array) {
+ if (!('__array_observer__' in array)) {
+ Reflect.defineProperty(array, '__array_observer__', {
+ value: ModifyArrayObserver.create(taskQueue, array),
+ enumerable: false, configurable: false
+ });
+ }
+ return array.__array_observer__;
+ };
+
+ ModifyArrayObserver.create = function create(taskQueue, array) {
+ return new ModifyArrayObserver(taskQueue, array);
+ };
+
+ return ModifyArrayObserver;
+ }(ModifyCollectionObserver);
+
+ var Expression = exports.Expression = function () {
+ function Expression() {
+
+
+ this.isChain = false;
+ this.isAssignable = false;
+ }
+
+ Expression.prototype.evaluate = function evaluate(scope, lookupFunctions, args) {
+ throw new Error('Binding expression "' + this + '" cannot be evaluated.');
+ };
+
+ Expression.prototype.assign = function assign(scope, value, lookupFunctions) {
+ throw new Error('Binding expression "' + this + '" cannot be assigned to.');
+ };
+
+ Expression.prototype.toString = function toString() {
+ return Unparser.unparse(this);
+ };
+
+ return Expression;
+ }();
+
+ var Chain = exports.Chain = function (_Expression) {
+ _inherits(Chain, _Expression);
+
+ function Chain(expressions) {
+
+
+ var _this3 = _possibleConstructorReturn(this, _Expression.call(this));
+
+ _this3.expressions = expressions;
+ _this3.isChain = true;
+ return _this3;
+ }
+
+ Chain.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var result = void 0;
+ var expressions = this.expressions;
+ var last = void 0;
+
+ for (var _i7 = 0, length = expressions.length; _i7 < length; ++_i7) {
+ last = expressions[_i7].evaluate(scope, lookupFunctions);
+
+ if (last !== null) {
+ result = last;
+ }
+ }
+
+ return result;
+ };
+
+ Chain.prototype.accept = function accept(visitor) {
+ return visitor.visitChain(this);
+ };
+
+ return Chain;
+ }(Expression);
+
+ var BindingBehavior = exports.BindingBehavior = function (_Expression2) {
+ _inherits(BindingBehavior, _Expression2);
+
+ function BindingBehavior(expression, name, args) {
+
+
+ var _this4 = _possibleConstructorReturn(this, _Expression2.call(this));
+
+ _this4.expression = expression;
+ _this4.name = name;
+ _this4.args = args;
+ return _this4;
+ }
+
+ BindingBehavior.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return this.expression.evaluate(scope, lookupFunctions);
+ };
+
+ BindingBehavior.prototype.assign = function assign(scope, value, lookupFunctions) {
+ return this.expression.assign(scope, value, lookupFunctions);
+ };
+
+ BindingBehavior.prototype.accept = function accept(visitor) {
+ return visitor.visitBindingBehavior(this);
+ };
+
+ BindingBehavior.prototype.connect = function connect(binding, scope) {
+ this.expression.connect(binding, scope);
+ };
+
+ BindingBehavior.prototype.bind = function bind(binding, scope, lookupFunctions) {
+ if (this.expression.expression && this.expression.bind) {
+ this.expression.bind(binding, scope, lookupFunctions);
+ }
+ var behavior = lookupFunctions.bindingBehaviors(this.name);
+ if (!behavior) {
+ throw new Error('No BindingBehavior named "' + this.name + '" was found!');
+ }
+ var behaviorKey = 'behavior-' + this.name;
+ if (binding[behaviorKey]) {
+ throw new Error('A binding behavior named "' + this.name + '" has already been applied to "' + this.expression + '"');
+ }
+ binding[behaviorKey] = behavior;
+ behavior.bind.apply(behavior, [binding, scope].concat(evalList(scope, this.args, binding.lookupFunctions)));
+ };
+
+ BindingBehavior.prototype.unbind = function unbind(binding, scope) {
+ var behaviorKey = 'behavior-' + this.name;
+ binding[behaviorKey].unbind(binding, scope);
+ binding[behaviorKey] = null;
+ if (this.expression.expression && this.expression.unbind) {
+ this.expression.unbind(binding, scope);
+ }
+ };
+
+ return BindingBehavior;
+ }(Expression);
+
+ var ValueConverter = exports.ValueConverter = function (_Expression3) {
+ _inherits(ValueConverter, _Expression3);
+
+ function ValueConverter(expression, name, args, allArgs) {
+
+
+ var _this5 = _possibleConstructorReturn(this, _Expression3.call(this));
+
+ _this5.expression = expression;
+ _this5.name = name;
+ _this5.args = args;
+ _this5.allArgs = allArgs;
+ return _this5;
+ }
+
+ ValueConverter.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var converter = lookupFunctions.valueConverters(this.name);
+ if (!converter) {
+ throw new Error('No ValueConverter named "' + this.name + '" was found!');
+ }
+
+ if ('toView' in converter) {
+ return converter.toView.apply(converter, evalList(scope, this.allArgs, lookupFunctions));
+ }
+
+ return this.allArgs[0].evaluate(scope, lookupFunctions);
+ };
+
+ ValueConverter.prototype.assign = function assign(scope, value, lookupFunctions) {
+ var converter = lookupFunctions.valueConverters(this.name);
+ if (!converter) {
+ throw new Error('No ValueConverter named "' + this.name + '" was found!');
+ }
+
+ if ('fromView' in converter) {
+ value = converter.fromView.apply(converter, [value].concat(evalList(scope, this.args, lookupFunctions)));
+ }
+
+ return this.allArgs[0].assign(scope, value, lookupFunctions);
+ };
+
+ ValueConverter.prototype.accept = function accept(visitor) {
+ return visitor.visitValueConverter(this);
+ };
+
+ ValueConverter.prototype.connect = function connect(binding, scope) {
+ var expressions = this.allArgs;
+ var i = expressions.length;
+ while (i--) {
+ expressions[i].connect(binding, scope);
+ }
+ };
+
+ return ValueConverter;
+ }(Expression);
+
+ var Assign = exports.Assign = function (_Expression4) {
+ _inherits(Assign, _Expression4);
+
+ function Assign(target, value) {
+
+
+ var _this6 = _possibleConstructorReturn(this, _Expression4.call(this));
+
+ _this6.target = target;
+ _this6.value = value;
+ return _this6;
+ }
+
+ Assign.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return this.target.assign(scope, this.value.evaluate(scope, lookupFunctions));
+ };
+
+ Assign.prototype.accept = function accept(vistor) {
+ vistor.visitAssign(this);
+ };
+
+ Assign.prototype.connect = function connect(binding, scope) {};
+
+ return Assign;
+ }(Expression);
+
+ var Conditional = exports.Conditional = function (_Expression5) {
+ _inherits(Conditional, _Expression5);
+
+ function Conditional(condition, yes, no) {
+
+
+ var _this7 = _possibleConstructorReturn(this, _Expression5.call(this));
+
+ _this7.condition = condition;
+ _this7.yes = yes;
+ _this7.no = no;
+ return _this7;
+ }
+
+ Conditional.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return !!this.condition.evaluate(scope) ? this.yes.evaluate(scope) : this.no.evaluate(scope);
+ };
+
+ Conditional.prototype.accept = function accept(visitor) {
+ return visitor.visitConditional(this);
+ };
+
+ Conditional.prototype.connect = function connect(binding, scope) {
+ this.condition.connect(binding, scope);
+ if (this.condition.evaluate(scope)) {
+ this.yes.connect(binding, scope);
+ } else {
+ this.no.connect(binding, scope);
+ }
+ };
+
+ return Conditional;
+ }(Expression);
+
+ var AccessThis = exports.AccessThis = function (_Expression6) {
+ _inherits(AccessThis, _Expression6);
+
+ function AccessThis(ancestor) {
+
+
+ var _this8 = _possibleConstructorReturn(this, _Expression6.call(this));
+
+ _this8.ancestor = ancestor;
+ return _this8;
+ }
+
+ AccessThis.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var oc = scope.overrideContext;
+ var i = this.ancestor;
+ while (i-- && oc) {
+ oc = oc.parentOverrideContext;
+ }
+ return i < 1 && oc ? oc.bindingContext : undefined;
+ };
+
+ AccessThis.prototype.accept = function accept(visitor) {
+ return visitor.visitAccessThis(this);
+ };
+
+ AccessThis.prototype.connect = function connect(binding, scope) {};
+
+ return AccessThis;
+ }(Expression);
+
+ var AccessScope = exports.AccessScope = function (_Expression7) {
+ _inherits(AccessScope, _Expression7);
+
+ function AccessScope(name, ancestor) {
+
+
+ var _this9 = _possibleConstructorReturn(this, _Expression7.call(this));
+
+ _this9.name = name;
+ _this9.ancestor = ancestor;
+ _this9.isAssignable = true;
+ return _this9;
+ }
+
+ AccessScope.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var context = getContextFor(this.name, scope, this.ancestor);
+ return context[this.name];
+ };
+
+ AccessScope.prototype.assign = function assign(scope, value) {
+ var context = getContextFor(this.name, scope, this.ancestor);
+ return context ? context[this.name] = value : undefined;
+ };
+
+ AccessScope.prototype.accept = function accept(visitor) {
+ return visitor.visitAccessScope(this);
+ };
+
+ AccessScope.prototype.connect = function connect(binding, scope) {
+ var context = getContextFor(this.name, scope, this.ancestor);
+ binding.observeProperty(context, this.name);
+ };
+
+ return AccessScope;
+ }(Expression);
+
+ var AccessMember = exports.AccessMember = function (_Expression8) {
+ _inherits(AccessMember, _Expression8);
+
+ function AccessMember(object, name) {
+
+
+ var _this10 = _possibleConstructorReturn(this, _Expression8.call(this));
+
+ _this10.object = object;
+ _this10.name = name;
+ _this10.isAssignable = true;
+ return _this10;
+ }
+
+ AccessMember.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var instance = this.object.evaluate(scope, lookupFunctions);
+ return instance === null || instance === undefined ? instance : instance[this.name];
+ };
+
+ AccessMember.prototype.assign = function assign(scope, value) {
+ var instance = this.object.evaluate(scope);
+
+ if (instance === null || instance === undefined) {
+ instance = {};
+ this.object.assign(scope, instance);
+ }
+
+ instance[this.name] = value;
+ return value;
+ };
+
+ AccessMember.prototype.accept = function accept(visitor) {
+ return visitor.visitAccessMember(this);
+ };
+
+ AccessMember.prototype.connect = function connect(binding, scope) {
+ this.object.connect(binding, scope);
+ var obj = this.object.evaluate(scope);
+ if (obj) {
+ binding.observeProperty(obj, this.name);
+ }
+ };
+
+ return AccessMember;
+ }(Expression);
+
+ var AccessKeyed = exports.AccessKeyed = function (_Expression9) {
+ _inherits(AccessKeyed, _Expression9);
+
+ function AccessKeyed(object, key) {
+
+
+ var _this11 = _possibleConstructorReturn(this, _Expression9.call(this));
+
+ _this11.object = object;
+ _this11.key = key;
+ _this11.isAssignable = true;
+ return _this11;
+ }
+
+ AccessKeyed.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var instance = this.object.evaluate(scope, lookupFunctions);
+ var lookup = this.key.evaluate(scope, lookupFunctions);
+ return getKeyed(instance, lookup);
+ };
+
+ AccessKeyed.prototype.assign = function assign(scope, value) {
+ var instance = this.object.evaluate(scope);
+ var lookup = this.key.evaluate(scope);
+ return setKeyed(instance, lookup, value);
+ };
+
+ AccessKeyed.prototype.accept = function accept(visitor) {
+ return visitor.visitAccessKeyed(this);
+ };
+
+ AccessKeyed.prototype.connect = function connect(binding, scope) {
+ this.object.connect(binding, scope);
+ var obj = this.object.evaluate(scope);
+ if (obj instanceof Object) {
+ this.key.connect(binding, scope);
+ var key = this.key.evaluate(scope);
+
+ if (key !== null && key !== undefined && !(Array.isArray(obj) && typeof key === 'number')) {
+ binding.observeProperty(obj, key);
+ }
+ }
+ };
+
+ return AccessKeyed;
+ }(Expression);
+
+ var CallScope = exports.CallScope = function (_Expression10) {
+ _inherits(CallScope, _Expression10);
+
+ function CallScope(name, args, ancestor) {
+
+
+ var _this12 = _possibleConstructorReturn(this, _Expression10.call(this));
+
+ _this12.name = name;
+ _this12.args = args;
+ _this12.ancestor = ancestor;
+ return _this12;
+ }
+
+ CallScope.prototype.evaluate = function evaluate(scope, lookupFunctions, mustEvaluate) {
+ var args = evalList(scope, this.args, lookupFunctions);
+ var context = getContextFor(this.name, scope, this.ancestor);
+ var func = getFunction(context, this.name, mustEvaluate);
+ if (func) {
+ return func.apply(context, args);
+ }
+ return undefined;
+ };
+
+ CallScope.prototype.accept = function accept(visitor) {
+ return visitor.visitCallScope(this);
+ };
+
+ CallScope.prototype.connect = function connect(binding, scope) {
+ var args = this.args;
+ var i = args.length;
+ while (i--) {
+ args[i].connect(binding, scope);
+ }
+ };
+
+ return CallScope;
+ }(Expression);
+
+ var CallMember = exports.CallMember = function (_Expression11) {
+ _inherits(CallMember, _Expression11);
+
+ function CallMember(object, name, args) {
+
+
+ var _this13 = _possibleConstructorReturn(this, _Expression11.call(this));
+
+ _this13.object = object;
+ _this13.name = name;
+ _this13.args = args;
+ return _this13;
+ }
+
+ CallMember.prototype.evaluate = function evaluate(scope, lookupFunctions, mustEvaluate) {
+ var instance = this.object.evaluate(scope, lookupFunctions);
+ var args = evalList(scope, this.args, lookupFunctions);
+ var func = getFunction(instance, this.name, mustEvaluate);
+ if (func) {
+ return func.apply(instance, args);
+ }
+ return undefined;
+ };
+
+ CallMember.prototype.accept = function accept(visitor) {
+ return visitor.visitCallMember(this);
+ };
+
+ CallMember.prototype.connect = function connect(binding, scope) {
+ this.object.connect(binding, scope);
+ var obj = this.object.evaluate(scope);
+ if (getFunction(obj, this.name, false)) {
+ var args = this.args;
+ var _i8 = args.length;
+ while (_i8--) {
+ args[_i8].connect(binding, scope);
+ }
+ }
+ };
+
+ return CallMember;
+ }(Expression);
+
+ var CallFunction = exports.CallFunction = function (_Expression12) {
+ _inherits(CallFunction, _Expression12);
+
+ function CallFunction(func, args) {
+
+
+ var _this14 = _possibleConstructorReturn(this, _Expression12.call(this));
+
+ _this14.func = func;
+ _this14.args = args;
+ return _this14;
+ }
+
+ CallFunction.prototype.evaluate = function evaluate(scope, lookupFunctions, mustEvaluate) {
+ var func = this.func.evaluate(scope, lookupFunctions);
+ if (typeof func === 'function') {
+ return func.apply(null, evalList(scope, this.args, lookupFunctions));
+ }
+ if (!mustEvaluate && (func === null || func === undefined)) {
+ return undefined;
+ }
+ throw new Error(this.func + ' is not a function');
+ };
+
+ CallFunction.prototype.accept = function accept(visitor) {
+ return visitor.visitCallFunction(this);
+ };
+
+ CallFunction.prototype.connect = function connect(binding, scope) {
+ this.func.connect(binding, scope);
+ var func = this.func.evaluate(scope);
+ if (typeof func === 'function') {
+ var args = this.args;
+ var _i9 = args.length;
+ while (_i9--) {
+ args[_i9].connect(binding, scope);
+ }
+ }
+ };
+
+ return CallFunction;
+ }(Expression);
+
+ var Binary = exports.Binary = function (_Expression13) {
+ _inherits(Binary, _Expression13);
+
+ function Binary(operation, left, right) {
+
+
+ var _this15 = _possibleConstructorReturn(this, _Expression13.call(this));
+
+ _this15.operation = operation;
+ _this15.left = left;
+ _this15.right = right;
+ return _this15;
+ }
+
+ Binary.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var left = this.left.evaluate(scope);
+
+ switch (this.operation) {
+ case '&&':
+ return left && this.right.evaluate(scope);
+ case '||':
+ return left || this.right.evaluate(scope);
+ }
+
+ var right = this.right.evaluate(scope);
+
+ switch (this.operation) {
+ case '==':
+ return left == right;
+ case '===':
+ return left === right;
+ case '!=':
+ return left != right;
+ case '!==':
+ return left !== right;
+ }
+
+ if (left === null || right === null || left === undefined || right === undefined) {
+ switch (this.operation) {
+ case '+':
+ if (left !== null && left !== undefined) return left;
+ if (right !== null && right !== undefined) return right;
+ return 0;
+ case '-':
+ if (left !== null && left !== undefined) return left;
+ if (right !== null && right !== undefined) return 0 - right;
+ return 0;
+ }
+
+ return null;
+ }
+
+ switch (this.operation) {
+ case '+':
+ return autoConvertAdd(left, right);
+ case '-':
+ return left - right;
+ case '*':
+ return left * right;
+ case '/':
+ return left / right;
+ case '%':
+ return left % right;
+ case '<':
+ return left < right;
+ case '>':
+ return left > right;
+ case '<=':
+ return left <= right;
+ case '>=':
+ return left >= right;
+ case '^':
+ return left ^ right;
+ }
+
+ throw new Error('Internal error [' + this.operation + '] not handled');
+ };
+
+ Binary.prototype.accept = function accept(visitor) {
+ return visitor.visitBinary(this);
+ };
+
+ Binary.prototype.connect = function connect(binding, scope) {
+ this.left.connect(binding, scope);
+ var left = this.left.evaluate(scope);
+ if (this.operation === '&&' && !left || this.operation === '||' && left) {
+ return;
+ }
+ this.right.connect(binding, scope);
+ };
+
+ return Binary;
+ }(Expression);
+
+ var PrefixNot = exports.PrefixNot = function (_Expression14) {
+ _inherits(PrefixNot, _Expression14);
+
+ function PrefixNot(operation, expression) {
+
+
+ var _this16 = _possibleConstructorReturn(this, _Expression14.call(this));
+
+ _this16.operation = operation;
+ _this16.expression = expression;
+ return _this16;
+ }
+
+ PrefixNot.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return !this.expression.evaluate(scope);
+ };
+
+ PrefixNot.prototype.accept = function accept(visitor) {
+ return visitor.visitPrefix(this);
+ };
+
+ PrefixNot.prototype.connect = function connect(binding, scope) {
+ this.expression.connect(binding, scope);
+ };
+
+ return PrefixNot;
+ }(Expression);
+
+ var LiteralPrimitive = exports.LiteralPrimitive = function (_Expression15) {
+ _inherits(LiteralPrimitive, _Expression15);
+
+ function LiteralPrimitive(value) {
+
+
+ var _this17 = _possibleConstructorReturn(this, _Expression15.call(this));
+
+ _this17.value = value;
+ return _this17;
+ }
+
+ LiteralPrimitive.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return this.value;
+ };
+
+ LiteralPrimitive.prototype.accept = function accept(visitor) {
+ return visitor.visitLiteralPrimitive(this);
+ };
+
+ LiteralPrimitive.prototype.connect = function connect(binding, scope) {};
+
+ return LiteralPrimitive;
+ }(Expression);
+
+ var LiteralString = exports.LiteralString = function (_Expression16) {
+ _inherits(LiteralString, _Expression16);
+
+ function LiteralString(value) {
+
+
+ var _this18 = _possibleConstructorReturn(this, _Expression16.call(this));
+
+ _this18.value = value;
+ return _this18;
+ }
+
+ LiteralString.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return this.value;
+ };
+
+ LiteralString.prototype.accept = function accept(visitor) {
+ return visitor.visitLiteralString(this);
+ };
+
+ LiteralString.prototype.connect = function connect(binding, scope) {};
+
+ return LiteralString;
+ }(Expression);
+
+ var LiteralArray = exports.LiteralArray = function (_Expression17) {
+ _inherits(LiteralArray, _Expression17);
+
+ function LiteralArray(elements) {
+
+
+ var _this19 = _possibleConstructorReturn(this, _Expression17.call(this));
+
+ _this19.elements = elements;
+ return _this19;
+ }
+
+ LiteralArray.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var elements = this.elements;
+ var result = [];
+
+ for (var _i10 = 0, length = elements.length; _i10 < length; ++_i10) {
+ result[_i10] = elements[_i10].evaluate(scope, lookupFunctions);
+ }
+
+ return result;
+ };
+
+ LiteralArray.prototype.accept = function accept(visitor) {
+ return visitor.visitLiteralArray(this);
+ };
+
+ LiteralArray.prototype.connect = function connect(binding, scope) {
+ var length = this.elements.length;
+ for (var _i11 = 0; _i11 < length; _i11++) {
+ this.elements[_i11].connect(binding, scope);
+ }
+ };
+
+ return LiteralArray;
+ }(Expression);
+
+ var LiteralObject = exports.LiteralObject = function (_Expression18) {
+ _inherits(LiteralObject, _Expression18);
+
+ function LiteralObject(keys, values) {
+
+
+ var _this20 = _possibleConstructorReturn(this, _Expression18.call(this));
+
+ _this20.keys = keys;
+ _this20.values = values;
+ return _this20;
+ }
+
+ LiteralObject.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ var instance = {};
+ var keys = this.keys;
+ var values = this.values;
+
+ for (var _i12 = 0, length = keys.length; _i12 < length; ++_i12) {
+ instance[keys[_i12]] = values[_i12].evaluate(scope, lookupFunctions);
+ }
+
+ return instance;
+ };
+
+ LiteralObject.prototype.accept = function accept(visitor) {
+ return visitor.visitLiteralObject(this);
+ };
+
+ LiteralObject.prototype.connect = function connect(binding, scope) {
+ var length = this.keys.length;
+ for (var _i13 = 0; _i13 < length; _i13++) {
+ this.values[_i13].connect(binding, scope);
+ }
+ };
+
+ return LiteralObject;
+ }(Expression);
+
+ function evalList(scope, list, lookupFunctions) {
+ var length = list.length;
+ var result = [];
+ for (var _i14 = 0; _i14 < length; _i14++) {
+ result[_i14] = list[_i14].evaluate(scope, lookupFunctions);
+ }
+ return result;
+ }
+
+ function autoConvertAdd(a, b) {
+ if (a !== null && b !== null) {
+ if (typeof a === 'string' && typeof b !== 'string') {
+ return a + b.toString();
+ }
+
+ if (typeof a !== 'string' && typeof b === 'string') {
+ return a.toString() + b;
+ }
+
+ return a + b;
+ }
+
+ if (a !== null) {
+ return a;
+ }
+
+ if (b !== null) {
+ return b;
+ }
+
+ return 0;
+ }
+
+ function getFunction(obj, name, mustExist) {
+ var func = obj === null || obj === undefined ? null : obj[name];
+ if (typeof func === 'function') {
+ return func;
+ }
+ if (!mustExist && (func === null || func === undefined)) {
+ return null;
+ }
+ throw new Error(name + ' is not a function');
+ }
+
+ function getKeyed(obj, key) {
+ if (Array.isArray(obj)) {
+ return obj[parseInt(key, 10)];
+ } else if (obj) {
+ return obj[key];
+ } else if (obj === null || obj === undefined) {
+ return undefined;
+ }
+
+ return obj[key];
+ }
+
+ function setKeyed(obj, key, value) {
+ if (Array.isArray(obj)) {
+ var index = parseInt(key, 10);
+
+ if (obj.length <= index) {
+ obj.length = index + 1;
+ }
+
+ obj[index] = value;
+ } else {
+ obj[key] = value;
+ }
+
+ return value;
+ }
+
+ var Unparser = exports.Unparser = function () {
+ function Unparser(buffer) {
+
+
+ this.buffer = buffer;
+ }
+
+ Unparser.unparse = function unparse(expression) {
+ var buffer = [];
+ var visitor = new Unparser(buffer);
+
+ expression.accept(visitor);
+
+ return buffer.join('');
+ };
+
+ Unparser.prototype.write = function write(text) {
+ this.buffer.push(text);
+ };
+
+ Unparser.prototype.writeArgs = function writeArgs(args) {
+ this.write('(');
+
+ for (var _i15 = 0, length = args.length; _i15 < length; ++_i15) {
+ if (_i15 !== 0) {
+ this.write(',');
+ }
+
+ args[_i15].accept(this);
+ }
+
+ this.write(')');
+ };
+
+ Unparser.prototype.visitChain = function visitChain(chain) {
+ var expressions = chain.expressions;
+
+ for (var _i16 = 0, length = expression.length; _i16 < length; ++_i16) {
+ if (_i16 !== 0) {
+ this.write(';');
+ }
+
+ expressions[_i16].accept(this);
+ }
+ };
+
+ Unparser.prototype.visitBindingBehavior = function visitBindingBehavior(behavior) {
+ var args = behavior.args;
+
+ behavior.expression.accept(this);
+ this.write('&' + behavior.name);
+
+ for (var _i17 = 0, length = args.length; _i17 < length; ++_i17) {
+ this.write(':');
+ args[_i17].accept(this);
+ }
+ };
+
+ Unparser.prototype.visitValueConverter = function visitValueConverter(converter) {
+ var args = converter.args;
+
+ converter.expression.accept(this);
+ this.write('|' + converter.name);
+
+ for (var _i18 = 0, length = args.length; _i18 < length; ++_i18) {
+ this.write(':');
+ args[_i18].accept(this);
+ }
+ };
+
+ Unparser.prototype.visitAssign = function visitAssign(assign) {
+ assign.target.accept(this);
+ this.write('=');
+ assign.value.accept(this);
+ };
+
+ Unparser.prototype.visitConditional = function visitConditional(conditional) {
+ conditional.condition.accept(this);
+ this.write('?');
+ conditional.yes.accept(this);
+ this.write(':');
+ conditional.no.accept(this);
+ };
+
+ Unparser.prototype.visitAccessThis = function visitAccessThis(access) {
+ if (access.ancestor === 0) {
+ this.write('$this');
+ return;
+ }
+ this.write('$parent');
+ var i = access.ancestor - 1;
+ while (i--) {
+ this.write('.$parent');
+ }
+ };
+
+ Unparser.prototype.visitAccessScope = function visitAccessScope(access) {
+ var i = access.ancestor;
+ while (i--) {
+ this.write('$parent.');
+ }
+ this.write(access.name);
+ };
+
+ Unparser.prototype.visitAccessMember = function visitAccessMember(access) {
+ access.object.accept(this);
+ this.write('.' + access.name);
+ };
+
+ Unparser.prototype.visitAccessKeyed = function visitAccessKeyed(access) {
+ access.object.accept(this);
+ this.write('[');
+ access.key.accept(this);
+ this.write(']');
+ };
+
+ Unparser.prototype.visitCallScope = function visitCallScope(call) {
+ var i = call.ancestor;
+ while (i--) {
+ this.write('$parent.');
+ }
+ this.write(call.name);
+ this.writeArgs(call.args);
+ };
+
+ Unparser.prototype.visitCallFunction = function visitCallFunction(call) {
+ call.func.accept(this);
+ this.writeArgs(call.args);
+ };
+
+ Unparser.prototype.visitCallMember = function visitCallMember(call) {
+ call.object.accept(this);
+ this.write('.' + call.name);
+ this.writeArgs(call.args);
+ };
+
+ Unparser.prototype.visitPrefix = function visitPrefix(prefix) {
+ this.write('(' + prefix.operation);
+ prefix.expression.accept(this);
+ this.write(')');
+ };
+
+ Unparser.prototype.visitBinary = function visitBinary(binary) {
+ binary.left.accept(this);
+ this.write(binary.operation);
+ binary.right.accept(this);
+ };
+
+ Unparser.prototype.visitLiteralPrimitive = function visitLiteralPrimitive(literal) {
+ this.write('' + literal.value);
+ };
+
+ Unparser.prototype.visitLiteralArray = function visitLiteralArray(literal) {
+ var elements = literal.elements;
+
+ this.write('[');
+
+ for (var _i19 = 0, length = elements.length; _i19 < length; ++_i19) {
+ if (_i19 !== 0) {
+ this.write(',');
+ }
+
+ elements[_i19].accept(this);
+ }
+
+ this.write(']');
+ };
+
+ Unparser.prototype.visitLiteralObject = function visitLiteralObject(literal) {
+ var keys = literal.keys;
+ var values = literal.values;
+
+ this.write('{');
+
+ for (var _i20 = 0, length = keys.length; _i20 < length; ++_i20) {
+ if (_i20 !== 0) {
+ this.write(',');
+ }
+
+ this.write('\'' + keys[_i20] + '\':');
+ values[_i20].accept(this);
+ }
+
+ this.write('}');
+ };
+
+ Unparser.prototype.visitLiteralString = function visitLiteralString(literal) {
+ var escaped = literal.value.replace(/'/g, "\'");
+ this.write('\'' + escaped + '\'');
+ };
+
+ return Unparser;
+ }();
+
+ var ExpressionCloner = exports.ExpressionCloner = function () {
+ function ExpressionCloner() {
+
+ }
+
+ ExpressionCloner.prototype.cloneExpressionArray = function cloneExpressionArray(array) {
+ var clonedArray = [];
+ var i = array.length;
+ while (i--) {
+ clonedArray[i] = array[i].accept(this);
+ }
+ return clonedArray;
+ };
+
+ ExpressionCloner.prototype.visitChain = function visitChain(chain) {
+ return new Chain(this.cloneExpressionArray(chain.expressions));
+ };
+
+ ExpressionCloner.prototype.visitBindingBehavior = function visitBindingBehavior(behavior) {
+ return new BindingBehavior(behavior.expression.accept(this), behavior.name, this.cloneExpressionArray(behavior.args));
+ };
+
+ ExpressionCloner.prototype.visitValueConverter = function visitValueConverter(converter) {
+ return new ValueConverter(converter.expression.accept(this), converter.name, this.cloneExpressionArray(converter.args));
+ };
+
+ ExpressionCloner.prototype.visitAssign = function visitAssign(assign) {
+ return new Assign(assign.target.accept(this), assign.value.accept(this));
+ };
+
+ ExpressionCloner.prototype.visitConditional = function visitConditional(conditional) {
+ return new Conditional(conditional.condition.accept(this), conditional.yes.accept(this), conditional.no.accept(this));
+ };
+
+ ExpressionCloner.prototype.visitAccessThis = function visitAccessThis(access) {
+ return new AccessThis(access.ancestor);
+ };
+
+ ExpressionCloner.prototype.visitAccessScope = function visitAccessScope(access) {
+ return new AccessScope(access.name, access.ancestor);
+ };
+
+ ExpressionCloner.prototype.visitAccessMember = function visitAccessMember(access) {
+ return new AccessMember(access.object.accept(this), access.name);
+ };
+
+ ExpressionCloner.prototype.visitAccessKeyed = function visitAccessKeyed(access) {
+ return new AccessKeyed(access.object.accept(this), access.key.accept(this));
+ };
+
+ ExpressionCloner.prototype.visitCallScope = function visitCallScope(call) {
+ return new CallScope(call.name, this.cloneExpressionArray(call.args), call.ancestor);
+ };
+
+ ExpressionCloner.prototype.visitCallFunction = function visitCallFunction(call) {
+ return new CallFunction(call.func.accept(this), this.cloneExpressionArray(call.args));
+ };
+
+ ExpressionCloner.prototype.visitCallMember = function visitCallMember(call) {
+ return new CallMember(call.object.accept(this), call.name, this.cloneExpressionArray(call.args));
+ };
+
+ ExpressionCloner.prototype.visitPrefix = function visitPrefix(prefix) {
+ return new PrefixNot(prefix.operation, prefix.expression.accept(this));
+ };
+
+ ExpressionCloner.prototype.visitBinary = function visitBinary(binary) {
+ return new Binary(binary.operation, binary.left.accept(this), binary.right.accept(this));
+ };
+
+ ExpressionCloner.prototype.visitLiteralPrimitive = function visitLiteralPrimitive(literal) {
+ return new LiteralPrimitive(literal);
+ };
+
+ ExpressionCloner.prototype.visitLiteralArray = function visitLiteralArray(literal) {
+ return new LiteralArray(this.cloneExpressionArray(literal.elements));
+ };
+
+ ExpressionCloner.prototype.visitLiteralObject = function visitLiteralObject(literal) {
+ return new LiteralObject(literal.keys, this.cloneExpressionArray(literal.values));
+ };
+
+ ExpressionCloner.prototype.visitLiteralString = function visitLiteralString(literal) {
+ return new LiteralString(literal.value);
+ };
+
+ return ExpressionCloner;
+ }();
+
+ function cloneExpression(expression) {
+ var visitor = new ExpressionCloner();
+ return expression.accept(visitor);
+ }
+
+ var bindingMode = exports.bindingMode = {
+ oneTime: 0,
+ oneWay: 1,
+ twoWay: 2
+ };
+
+ var Token = exports.Token = function () {
+ function Token(index, text) {
+
+
+ this.index = index;
+ this.text = text;
+ }
+
+ Token.prototype.withOp = function withOp(op) {
+ this.opKey = op;
+ return this;
+ };
+
+ Token.prototype.withGetterSetter = function withGetterSetter(key) {
+ this.key = key;
+ return this;
+ };
+
+ Token.prototype.withValue = function withValue(value) {
+ this.value = value;
+ return this;
+ };
+
+ Token.prototype.toString = function toString() {
+ return 'Token(' + this.text + ')';
+ };
+
+ return Token;
+ }();
+
+ var Lexer = exports.Lexer = function () {
+ function Lexer() {
+
+ }
+
+ Lexer.prototype.lex = function lex(text) {
+ var scanner = new Scanner(text);
+ var tokens = [];
+ var token = scanner.scanToken();
+
+ while (token) {
+ tokens.push(token);
+ token = scanner.scanToken();
+ }
+
+ return tokens;
+ };
+
+ return Lexer;
+ }();
+
+ var Scanner = exports.Scanner = function () {
+ function Scanner(input) {
+
+
+ this.input = input;
+ this.length = input.length;
+ this.peek = 0;
+ this.index = -1;
+
+ this.advance();
+ }
+
+ Scanner.prototype.scanToken = function scanToken() {
+ while (this.peek <= $SPACE) {
+ if (++this.index >= this.length) {
+ this.peek = $EOF;
+ return null;
+ }
+
+ this.peek = this.input.charCodeAt(this.index);
+ }
+
+ if (isIdentifierStart(this.peek)) {
+ return this.scanIdentifier();
+ }
+
+ if (isDigit(this.peek)) {
+ return this.scanNumber(this.index);
+ }
+
+ var start = this.index;
+
+ switch (this.peek) {
+ case $PERIOD:
+ this.advance();
+ return isDigit(this.peek) ? this.scanNumber(start) : new Token(start, '.');
+ case $LPAREN:
+ case $RPAREN:
+ case $LBRACE:
+ case $RBRACE:
+ case $LBRACKET:
+ case $RBRACKET:
+ case $COMMA:
+ case $COLON:
+ case $SEMICOLON:
+ return this.scanCharacter(start, String.fromCharCode(this.peek));
+ case $SQ:
+ case $DQ:
+ return this.scanString();
+ case $PLUS:
+ case $MINUS:
+ case $STAR:
+ case $SLASH:
+ case $PERCENT:
+ case $CARET:
+ case $QUESTION:
+ return this.scanOperator(start, String.fromCharCode(this.peek));
+ case $LT:
+ case $GT:
+ case $BANG:
+ case $EQ:
+ return this.scanComplexOperator(start, $EQ, String.fromCharCode(this.peek), '=');
+ case $AMPERSAND:
+ return this.scanComplexOperator(start, $AMPERSAND, '&', '&');
+ case $BAR:
+ return this.scanComplexOperator(start, $BAR, '|', '|');
+ case $NBSP:
+ while (isWhitespace(this.peek)) {
+ this.advance();
+ }
+
+ return this.scanToken();
+ }
+
+ var character = String.fromCharCode(this.peek);
+ this.error('Unexpected character [' + character + ']');
+ return null;
+ };
+
+ Scanner.prototype.scanCharacter = function scanCharacter(start, text) {
+ assert(this.peek === text.charCodeAt(0));
+ this.advance();
+ return new Token(start, text);
+ };
+
+ Scanner.prototype.scanOperator = function scanOperator(start, text) {
+ assert(this.peek === text.charCodeAt(0));
+ assert(OPERATORS.indexOf(text) !== -1);
+ this.advance();
+ return new Token(start, text).withOp(text);
+ };
+
+ Scanner.prototype.scanComplexOperator = function scanComplexOperator(start, code, one, two) {
+ assert(this.peek === one.charCodeAt(0));
+ this.advance();
+
+ var text = one;
+
+ if (this.peek === code) {
+ this.advance();
+ text += two;
+ }
+
+ if (this.peek === code) {
+ this.advance();
+ text += two;
+ }
+
+ assert(OPERATORS.indexOf(text) !== -1);
+
+ return new Token(start, text).withOp(text);
+ };
+
+ Scanner.prototype.scanIdentifier = function scanIdentifier() {
+ assert(isIdentifierStart(this.peek));
+ var start = this.index;
+
+ this.advance();
+
+ while (isIdentifierPart(this.peek)) {
+ this.advance();
+ }
+
+ var text = this.input.substring(start, this.index);
+ var result = new Token(start, text);
+
+ if (OPERATORS.indexOf(text) !== -1) {
+ result.withOp(text);
+ } else {
+ result.withGetterSetter(text);
+ }
+
+ return result;
+ };
+
+ Scanner.prototype.scanNumber = function scanNumber(start) {
+ assert(isDigit(this.peek));
+ var simple = this.index === start;
+ this.advance();
+
+ while (true) {
+ if (!isDigit(this.peek)) {
+ if (this.peek === $PERIOD) {
+ simple = false;
+ } else if (isExponentStart(this.peek)) {
+ this.advance();
+
+ if (isExponentSign(this.peek)) {
+ this.advance();
+ }
+
+ if (!isDigit(this.peek)) {
+ this.error('Invalid exponent', -1);
+ }
+
+ simple = false;
+ } else {
+ break;
+ }
+ }
+
+ this.advance();
+ }
+
+ var text = this.input.substring(start, this.index);
+ var value = simple ? parseInt(text, 10) : parseFloat(text);
+ return new Token(start, text).withValue(value);
+ };
+
+ Scanner.prototype.scanString = function scanString() {
+ assert(this.peek === $SQ || this.peek === $DQ);
+
+ var start = this.index;
+ var quote = this.peek;
+
+ this.advance();
+
+ var buffer = void 0;
+ var marker = this.index;
+
+ while (this.peek !== quote) {
+ if (this.peek === $BACKSLASH) {
+ if (!buffer) {
+ buffer = [];
+ }
+
+ buffer.push(this.input.substring(marker, this.index));
+ this.advance();
+
+ var _unescaped = void 0;
+
+ if (this.peek === $u) {
+ var hex = this.input.substring(this.index + 1, this.index + 5);
+
+ if (!/[A-Z0-9]{4}/.test(hex)) {
+ this.error('Invalid unicode escape [\\u' + hex + ']');
+ }
+
+ _unescaped = parseInt(hex, 16);
+
+ for (var _i21 = 0; _i21 < 5; ++_i21) {
+ this.advance();
+ }
+ } else {
+ _unescaped = unescape(this.peek);
+ this.advance();
+ }
+
+ buffer.push(String.fromCharCode(_unescaped));
+ marker = this.index;
+ } else if (this.peek === $EOF) {
+ this.error('Unterminated quote');
+ } else {
+ this.advance();
+ }
+ }
+
+ var last = this.input.substring(marker, this.index);
+ this.advance();
+ var text = this.input.substring(start, this.index);
+
+ var unescaped = last;
+
+ if (buffer !== null && buffer !== undefined) {
+ buffer.push(last);
+ unescaped = buffer.join('');
+ }
+
+ return new Token(start, text).withValue(unescaped);
+ };
+
+ Scanner.prototype.advance = function advance() {
+ if (++this.index >= this.length) {
+ this.peek = $EOF;
+ } else {
+ this.peek = this.input.charCodeAt(this.index);
+ }
+ };
+
+ Scanner.prototype.error = function error(message) {
+ var offset = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
+
+ var position = this.index + offset;
+ throw new Error('Lexer Error: ' + message + ' at column ' + position + ' in expression [' + this.input + ']');
+ };
+
+ return Scanner;
+ }();
+
+ var OPERATORS = ['undefined', 'null', 'true', 'false', '+', '-', '*', '/', '%', '^', '=', '==', '===', '!=', '!==', '<', '>', '<=', '>=', '&&', '||', '&', '|', '!', '?'];
+
+ var $EOF = 0;
+ var $TAB = 9;
+ var $LF = 10;
+ var $VTAB = 11;
+ var $FF = 12;
+ var $CR = 13;
+ var $SPACE = 32;
+ var $BANG = 33;
+ var $DQ = 34;
+ var $$ = 36;
+ var $PERCENT = 37;
+ var $AMPERSAND = 38;
+ var $SQ = 39;
+ var $LPAREN = 40;
+ var $RPAREN = 41;
+ var $STAR = 42;
+ var $PLUS = 43;
+ var $COMMA = 44;
+ var $MINUS = 45;
+ var $PERIOD = 46;
+ var $SLASH = 47;
+ var $COLON = 58;
+ var $SEMICOLON = 59;
+ var $LT = 60;
+ var $EQ = 61;
+ var $GT = 62;
+ var $QUESTION = 63;
+
+ var $0 = 48;
+ var $9 = 57;
+
+ var $A = 65;
+ var $E = 69;
+ var $Z = 90;
+
+ var $LBRACKET = 91;
+ var $BACKSLASH = 92;
+ var $RBRACKET = 93;
+ var $CARET = 94;
+ var $_ = 95;
+
+ var $a = 97;
+ var $e = 101;
+ var $f = 102;
+ var $n = 110;
+ var $r = 114;
+ var $t = 116;
+ var $u = 117;
+ var $v = 118;
+ var $z = 122;
+
+ var $LBRACE = 123;
+ var $BAR = 124;
+ var $RBRACE = 125;
+ var $NBSP = 160;
+
+ function isWhitespace(code) {
+ return code >= $TAB && code <= $SPACE || code === $NBSP;
+ }
+
+ function isIdentifierStart(code) {
+ return $a <= code && code <= $z || $A <= code && code <= $Z || code === $_ || code === $$;
+ }
+
+ function isIdentifierPart(code) {
+ return $a <= code && code <= $z || $A <= code && code <= $Z || $0 <= code && code <= $9 || code === $_ || code === $$;
+ }
+
+ function isDigit(code) {
+ return $0 <= code && code <= $9;
+ }
+
+ function isExponentStart(code) {
+ return code === $e || code === $E;
+ }
+
+ function isExponentSign(code) {
+ return code === $MINUS || code === $PLUS;
+ }
+
+ function unescape(code) {
+ switch (code) {
+ case $n:
+ return $LF;
+ case $f:
+ return $FF;
+ case $r:
+ return $CR;
+ case $t:
+ return $TAB;
+ case $v:
+ return $VTAB;
+ default:
+ return code;
+ }
+ }
+
+ function assert(condition, message) {
+ if (!condition) {
+ throw message || 'Assertion failed';
+ }
+ }
+
+ var EOF = new Token(-1, null);
+
+ var Parser = exports.Parser = function () {
+ function Parser() {
+
+
+ this.cache = {};
+ this.lexer = new Lexer();
+ }
+
+ Parser.prototype.parse = function parse(input) {
+ input = input || '';
+
+ return this.cache[input] || (this.cache[input] = new ParserImplementation(this.lexer, input).parseChain());
+ };
+
+ return Parser;
+ }();
+
+ var ParserImplementation = exports.ParserImplementation = function () {
+ function ParserImplementation(lexer, input) {
+
+
+ this.index = 0;
+ this.input = input;
+ this.tokens = lexer.lex(input);
+ }
+
+ ParserImplementation.prototype.parseChain = function parseChain() {
+ var isChain = false;
+ var expressions = [];
+
+ while (this.optional(';')) {
+ isChain = true;
+ }
+
+ while (this.index < this.tokens.length) {
+ if (this.peek.text === ')' || this.peek.text === '}' || this.peek.text === ']') {
+ this.error('Unconsumed token ' + this.peek.text);
+ }
+
+ var expr = this.parseBindingBehavior();
+ expressions.push(expr);
+
+ while (this.optional(';')) {
+ isChain = true;
+ }
+
+ if (isChain) {
+ this.error('Multiple expressions are not allowed.');
+ }
+ }
+
+ return expressions.length === 1 ? expressions[0] : new Chain(expressions);
+ };
+
+ ParserImplementation.prototype.parseBindingBehavior = function parseBindingBehavior() {
+ var result = this.parseValueConverter();
+
+ while (this.optional('&')) {
+ var name = this.peek.text;
+ var args = [];
+
+ this.advance();
+
+ while (this.optional(':')) {
+ args.push(this.parseExpression());
+ }
+
+ result = new BindingBehavior(result, name, args);
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.parseValueConverter = function parseValueConverter() {
+ var result = this.parseExpression();
+
+ while (this.optional('|')) {
+ var name = this.peek.text;
+ var args = [];
+
+ this.advance();
+
+ while (this.optional(':')) {
+ args.push(this.parseExpression());
+ }
+
+ result = new ValueConverter(result, name, args, [result].concat(args));
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.parseExpression = function parseExpression() {
+ var start = this.peek.index;
+ var result = this.parseConditional();
+
+ while (this.peek.text === '=') {
+ if (!result.isAssignable) {
+ var end = this.index < this.tokens.length ? this.peek.index : this.input.length;
+ var _expression = this.input.substring(start, end);
+
+ this.error('Expression ' + _expression + ' is not assignable');
+ }
+
+ this.expect('=');
+ result = new Assign(result, this.parseConditional());
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.parseConditional = function parseConditional() {
+ var start = this.peek.index;
+ var result = this.parseLogicalOr();
+
+ if (this.optional('?')) {
+ var yes = this.parseExpression();
+
+ if (!this.optional(':')) {
+ var end = this.index < this.tokens.length ? this.peek.index : this.input.length;
+ var _expression2 = this.input.substring(start, end);
+
+ this.error('Conditional expression ' + _expression2 + ' requires all 3 expressions');
+ }
+
+ var no = this.parseExpression();
+ result = new Conditional(result, yes, no);
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.parseLogicalOr = function parseLogicalOr() {
+ var result = this.parseLogicalAnd();
+
+ while (this.optional('||')) {
+ result = new Binary('||', result, this.parseLogicalAnd());
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.parseLogicalAnd = function parseLogicalAnd() {
+ var result = this.parseEquality();
+
+ while (this.optional('&&')) {
+ result = new Binary('&&', result, this.parseEquality());
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.parseEquality = function parseEquality() {
+ var result = this.parseRelational();
+
+ while (true) {
+ if (this.optional('==')) {
+ result = new Binary('==', result, this.parseRelational());
+ } else if (this.optional('!=')) {
+ result = new Binary('!=', result, this.parseRelational());
+ } else if (this.optional('===')) {
+ result = new Binary('===', result, this.parseRelational());
+ } else if (this.optional('!==')) {
+ result = new Binary('!==', result, this.parseRelational());
+ } else {
+ return result;
+ }
+ }
+ };
+
+ ParserImplementation.prototype.parseRelational = function parseRelational() {
+ var result = this.parseAdditive();
+
+ while (true) {
+ if (this.optional('<')) {
+ result = new Binary('<', result, this.parseAdditive());
+ } else if (this.optional('>')) {
+ result = new Binary('>', result, this.parseAdditive());
+ } else if (this.optional('<=')) {
+ result = new Binary('<=', result, this.parseAdditive());
+ } else if (this.optional('>=')) {
+ result = new Binary('>=', result, this.parseAdditive());
+ } else {
+ return result;
+ }
+ }
+ };
+
+ ParserImplementation.prototype.parseAdditive = function parseAdditive() {
+ var result = this.parseMultiplicative();
+
+ while (true) {
+ if (this.optional('+')) {
+ result = new Binary('+', result, this.parseMultiplicative());
+ } else if (this.optional('-')) {
+ result = new Binary('-', result, this.parseMultiplicative());
+ } else {
+ return result;
+ }
+ }
+ };
+
+ ParserImplementation.prototype.parseMultiplicative = function parseMultiplicative() {
+ var result = this.parsePrefix();
+
+ while (true) {
+ if (this.optional('*')) {
+ result = new Binary('*', result, this.parsePrefix());
+ } else if (this.optional('%')) {
+ result = new Binary('%', result, this.parsePrefix());
+ } else if (this.optional('/')) {
+ result = new Binary('/', result, this.parsePrefix());
+ } else {
+ return result;
+ }
+ }
+ };
+
+ ParserImplementation.prototype.parsePrefix = function parsePrefix() {
+ if (this.optional('+')) {
+ return this.parsePrefix();
+ } else if (this.optional('-')) {
+ return new Binary('-', new LiteralPrimitive(0), this.parsePrefix());
+ } else if (this.optional('!')) {
+ return new PrefixNot('!', this.parsePrefix());
+ }
+
+ return this.parseAccessOrCallMember();
+ };
+
+ ParserImplementation.prototype.parseAccessOrCallMember = function parseAccessOrCallMember() {
+ var result = this.parsePrimary();
+
+ while (true) {
+ if (this.optional('.')) {
+ var name = this.peek.text;
+
+ this.advance();
+
+ if (this.optional('(')) {
+ var args = this.parseExpressionList(')');
+ this.expect(')');
+ if (result instanceof AccessThis) {
+ result = new CallScope(name, args, result.ancestor);
+ } else {
+ result = new CallMember(result, name, args);
+ }
+ } else {
+ if (result instanceof AccessThis) {
+ result = new AccessScope(name, result.ancestor);
+ } else {
+ result = new AccessMember(result, name);
+ }
+ }
+ } else if (this.optional('[')) {
+ var key = this.parseExpression();
+ this.expect(']');
+ result = new AccessKeyed(result, key);
+ } else if (this.optional('(')) {
+ var _args = this.parseExpressionList(')');
+ this.expect(')');
+ result = new CallFunction(result, _args);
+ } else {
+ return result;
+ }
+ }
+ };
+
+ ParserImplementation.prototype.parsePrimary = function parsePrimary() {
+ if (this.optional('(')) {
+ var result = this.parseExpression();
+ this.expect(')');
+ return result;
+ } else if (this.optional('null')) {
+ return new LiteralPrimitive(null);
+ } else if (this.optional('undefined')) {
+ return new LiteralPrimitive(undefined);
+ } else if (this.optional('true')) {
+ return new LiteralPrimitive(true);
+ } else if (this.optional('false')) {
+ return new LiteralPrimitive(false);
+ } else if (this.optional('[')) {
+ var elements = this.parseExpressionList(']');
+ this.expect(']');
+ return new LiteralArray(elements);
+ } else if (this.peek.text === '{') {
+ return this.parseObject();
+ } else if (this.peek.key !== null && this.peek.key !== undefined) {
+ return this.parseAccessOrCallScope();
+ } else if (this.peek.value !== null && this.peek.value !== undefined) {
+ var value = this.peek.value;
+ this.advance();
+ return value instanceof String || typeof value === 'string' ? new LiteralString(value) : new LiteralPrimitive(value);
+ } else if (this.index >= this.tokens.length) {
+ throw new Error('Unexpected end of expression: ' + this.input);
+ } else {
+ this.error('Unexpected token ' + this.peek.text);
+ }
+ };
+
+ ParserImplementation.prototype.parseAccessOrCallScope = function parseAccessOrCallScope() {
+ var name = this.peek.key;
+
+ this.advance();
+
+ if (name === '$this') {
+ return new AccessThis(0);
+ }
+
+ var ancestor = 0;
+ while (name === '$parent') {
+ ancestor++;
+ if (this.optional('.')) {
+ name = this.peek.key;
+ this.advance();
+ } else if (this.peek === EOF || this.peek.text === '(' || this.peek.text === '[' || this.peek.text === '}' || this.peek.text === ',') {
+ return new AccessThis(ancestor);
+ } else {
+ this.error('Unexpected token ' + this.peek.text);
+ }
+ }
+
+ if (this.optional('(')) {
+ var args = this.parseExpressionList(')');
+ this.expect(')');
+ return new CallScope(name, args, ancestor);
+ }
+
+ return new AccessScope(name, ancestor);
+ };
+
+ ParserImplementation.prototype.parseObject = function parseObject() {
+ var keys = [];
+ var values = [];
+
+ this.expect('{');
+
+ if (this.peek.text !== '}') {
+ do {
+ var peek = this.peek;
+ var value = peek.value;
+ keys.push(typeof value === 'string' ? value : peek.text);
+
+ this.advance();
+ if (peek.key && (this.peek.text === ',' || this.peek.text === '}')) {
+ --this.index;
+ values.push(this.parseAccessOrCallScope());
+ } else {
+ this.expect(':');
+ values.push(this.parseExpression());
+ }
+ } while (this.optional(','));
+ }
+
+ this.expect('}');
+
+ return new LiteralObject(keys, values);
+ };
+
+ ParserImplementation.prototype.parseExpressionList = function parseExpressionList(terminator) {
+ var result = [];
+
+ if (this.peek.text !== terminator) {
+ do {
+ result.push(this.parseExpression());
+ } while (this.optional(','));
+ }
+
+ return result;
+ };
+
+ ParserImplementation.prototype.optional = function optional(text) {
+ if (this.peek.text === text) {
+ this.advance();
+ return true;
+ }
+
+ return false;
+ };
+
+ ParserImplementation.prototype.expect = function expect(text) {
+ if (this.peek.text === text) {
+ this.advance();
+ } else {
+ this.error('Missing expected ' + text);
+ }
+ };
+
+ ParserImplementation.prototype.advance = function advance() {
+ this.index++;
+ };
+
+ ParserImplementation.prototype.error = function error(message) {
+ var location = this.index < this.tokens.length ? 'at column ' + (this.tokens[this.index].index + 1) + ' in' : 'at the end of the expression';
+
+ throw new Error('Parser Error: ' + message + ' ' + location + ' [' + this.input + ']');
+ };
+
+ _createClass(ParserImplementation, [{
+ key: 'peek',
+ get: function get() {
+ return this.index < this.tokens.length ? this.tokens[this.index] : EOF;
+ }
+ }]);
+
+ return ParserImplementation;
+ }();
+
+ var mapProto = Map.prototype;
+
+ function _getMapObserver(taskQueue, map) {
+ return ModifyMapObserver.for(taskQueue, map);
+ }
+
+ exports.getMapObserver = _getMapObserver;
+
+ var ModifyMapObserver = function (_ModifyCollectionObse2) {
+ _inherits(ModifyMapObserver, _ModifyCollectionObse2);
+
+ function ModifyMapObserver(taskQueue, map) {
+
+
+ return _possibleConstructorReturn(this, _ModifyCollectionObse2.call(this, taskQueue, map));
+ }
+
+ ModifyMapObserver.for = function _for(taskQueue, map) {
+ if (!('__map_observer__' in map)) {
+ Reflect.defineProperty(map, '__map_observer__', {
+ value: ModifyMapObserver.create(taskQueue, map),
+ enumerable: false, configurable: false
+ });
+ }
+ return map.__map_observer__;
+ };
+
+ ModifyMapObserver.create = function create(taskQueue, map) {
+ var observer = new ModifyMapObserver(taskQueue, map);
+
+ var proto = mapProto;
+ if (proto.add !== map.add || proto.delete !== map.delete || proto.clear !== map.clear) {
+ proto = {
+ add: map.add,
+ delete: map.delete,
+ clear: map.clear
+ };
+ }
+
+ map.set = function () {
+ var hasValue = map.has(arguments[0]);
+ var type = hasValue ? 'update' : 'add';
+ var oldValue = map.get(arguments[0]);
+ var methodCallResult = proto.set.apply(map, arguments);
+ if (!hasValue || oldValue !== map.get(arguments[0])) {
+ observer.addChangeRecord({
+ type: type,
+ object: map,
+ key: arguments[0],
+ oldValue: oldValue
+ });
+ }
+ return methodCallResult;
+ };
+
+ map.delete = function () {
+ var hasValue = map.has(arguments[0]);
+ var oldValue = map.get(arguments[0]);
+ var methodCallResult = proto.delete.apply(map, arguments);
+ if (hasValue) {
+ observer.addChangeRecord({
+ type: 'delete',
+ object: map,
+ key: arguments[0],
+ oldValue: oldValue
+ });
+ }
+ return methodCallResult;
+ };
+
+ map.clear = function () {
+ var methodCallResult = proto.clear.apply(map, arguments);
+ observer.addChangeRecord({
+ type: 'clear',
+ object: map
+ });
+ return methodCallResult;
+ };
+
+ return observer;
+ };
+
+ return ModifyMapObserver;
+ }(ModifyCollectionObserver);
+
+ function findOriginalEventTarget(event) {
+ return event.path && event.path[0] || event.deepPath && event.deepPath[0] || event.target;
+ }
+
+ function interceptStopPropagation(event) {
+ event.standardStopPropagation = event.stopPropagation;
+ event.stopPropagation = function () {
+ this.propagationStopped = true;
+ this.standardStopPropagation();
+ };
+ }
+
+ function handleDelegatedEvent(event) {
+ var interceptInstalled = false;
+ event.propagationStopped = false;
+ var target = findOriginalEventTarget(event);
+
+ while (target && !event.propagationStopped) {
+ if (target.delegatedCallbacks) {
+ var callback = target.delegatedCallbacks[event.type];
+ if (callback) {
+ if (!interceptInstalled) {
+ interceptStopPropagation(event);
+ interceptInstalled = true;
+ }
+ callback(event);
+ }
+ }
+
+ target = target.parentNode;
+ }
+ }
+
+ var DelegateHandlerEntry = function () {
+ function DelegateHandlerEntry(eventName) {
+
+
+ this.eventName = eventName;
+ this.count = 0;
+ }
+
+ DelegateHandlerEntry.prototype.increment = function increment() {
+ this.count++;
+
+ if (this.count === 1) {
+ _aureliaPal.DOM.addEventListener(this.eventName, handleDelegatedEvent, false);
+ }
+ };
+
+ DelegateHandlerEntry.prototype.decrement = function decrement() {
+ this.count--;
+
+ if (this.count === 0) {
+ _aureliaPal.DOM.removeEventListener(this.eventName, handleDelegatedEvent);
+ }
+ };
+
+ return DelegateHandlerEntry;
+ }();
+
+ var DefaultEventStrategy = function () {
+ function DefaultEventStrategy() {
+
+
+ this.delegatedHandlers = {};
+ }
+
+ DefaultEventStrategy.prototype.subscribe = function subscribe(target, targetEvent, callback, delegate) {
+ var _this22 = this;
+
+ if (delegate) {
+ var _ret = function () {
+ var delegatedHandlers = _this22.delegatedHandlers;
+ var handlerEntry = delegatedHandlers[targetEvent] || (delegatedHandlers[targetEvent] = new DelegateHandlerEntry(targetEvent));
+ var delegatedCallbacks = target.delegatedCallbacks || (target.delegatedCallbacks = {});
+
+ handlerEntry.increment();
+ delegatedCallbacks[targetEvent] = callback;
+
+ return {
+ v: function v() {
+ handlerEntry.decrement();
+ delegatedCallbacks[targetEvent] = null;
+ }
+ };
+ }();
+
+ if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
+ }
+
+ target.addEventListener(targetEvent, callback, false);
+
+ return function () {
+ target.removeEventListener(targetEvent, callback);
+ };
+ };
+
+ return DefaultEventStrategy;
+ }();
+
+ var EventManager = exports.EventManager = function () {
+ function EventManager() {
+
+
+ this.elementHandlerLookup = {};
+ this.eventStrategyLookup = {};
+
+ this.registerElementConfig({
+ tagName: 'input',
+ properties: {
+ value: ['change', 'input'],
+ checked: ['change', 'input'],
+ files: ['change', 'input']
+ }
+ });
+
+ this.registerElementConfig({
+ tagName: 'textarea',
+ properties: {
+ value: ['change', 'input']
+ }
+ });
+
+ this.registerElementConfig({
+ tagName: 'select',
+ properties: {
+ value: ['change']
+ }
+ });
+
+ this.registerElementConfig({
+ tagName: 'content editable',
+ properties: {
+ value: ['change', 'input', 'blur', 'keyup', 'paste']
+ }
+ });
+
+ this.registerElementConfig({
+ tagName: 'scrollable element',
+ properties: {
+ scrollTop: ['scroll'],
+ scrollLeft: ['scroll']
+ }
+ });
+
+ this.defaultEventStrategy = new DefaultEventStrategy();
+ }
+
+ EventManager.prototype.registerElementConfig = function registerElementConfig(config) {
+ var tagName = config.tagName.toLowerCase();
+ var properties = config.properties;
+ var propertyName = void 0;
+
+ this.elementHandlerLookup[tagName] = {};
+
+ for (propertyName in properties) {
+ if (properties.hasOwnProperty(propertyName)) {
+ this.registerElementPropertyConfig(tagName, propertyName, properties[propertyName]);
+ }
+ }
+ };
+
+ EventManager.prototype.registerElementPropertyConfig = function registerElementPropertyConfig(tagName, propertyName, events) {
+ this.elementHandlerLookup[tagName][propertyName] = this.createElementHandler(events);
+ };
+
+ EventManager.prototype.createElementHandler = function createElementHandler(events) {
+ return {
+ subscribe: function subscribe(target, callback) {
+ events.forEach(function (changeEvent) {
+ target.addEventListener(changeEvent, callback, false);
+ });
+
+ return function () {
+ events.forEach(function (changeEvent) {
+ target.removeEventListener(changeEvent, callback);
+ });
+ };
+ }
+ };
+ };
+
+ EventManager.prototype.registerElementHandler = function registerElementHandler(tagName, handler) {
+ this.elementHandlerLookup[tagName.toLowerCase()] = handler;
+ };
+
+ EventManager.prototype.registerEventStrategy = function registerEventStrategy(eventName, strategy) {
+ this.eventStrategyLookup[eventName] = strategy;
+ };
+
+ EventManager.prototype.getElementHandler = function getElementHandler(target, propertyName) {
+ var tagName = void 0;
+ var lookup = this.elementHandlerLookup;
+
+ if (target.tagName) {
+ tagName = target.tagName.toLowerCase();
+
+ if (lookup[tagName] && lookup[tagName][propertyName]) {
+ return lookup[tagName][propertyName];
+ }
+
+ if (propertyName === 'textContent' || propertyName === 'innerHTML') {
+ return lookup['content editable'].value;
+ }
+
+ if (propertyName === 'scrollTop' || propertyName === 'scrollLeft') {
+ return lookup['scrollable element'][propertyName];
+ }
+ }
+
+ return null;
+ };
+
+ EventManager.prototype.addEventListener = function addEventListener(target, targetEvent, callback, delegate) {
+ return (this.eventStrategyLookup[targetEvent] || this.defaultEventStrategy).subscribe(target, targetEvent, callback, delegate);
+ };
+
+ return EventManager;
+ }();
+
+ var DirtyChecker = exports.DirtyChecker = function () {
+ function DirtyChecker() {
+
+
+ this.tracked = [];
+ this.checkDelay = 120;
+ }
+
+ DirtyChecker.prototype.addProperty = function addProperty(property) {
+ var tracked = this.tracked;
+
+ tracked.push(property);
+
+ if (tracked.length === 1) {
+ this.scheduleDirtyCheck();
+ }
+ };
+
+ DirtyChecker.prototype.removeProperty = function removeProperty(property) {
+ var tracked = this.tracked;
+ tracked.splice(tracked.indexOf(property), 1);
+ };
+
+ DirtyChecker.prototype.scheduleDirtyCheck = function scheduleDirtyCheck() {
+ var _this23 = this;
+
+ setTimeout(function () {
+ return _this23.check();
+ }, this.checkDelay);
+ };
+
+ DirtyChecker.prototype.check = function check() {
+ var tracked = this.tracked;
+ var i = tracked.length;
+
+ while (i--) {
+ var current = tracked[i];
+
+ if (current.isDirty()) {
+ current.call();
+ }
+ }
+
+ if (tracked.length) {
+ this.scheduleDirtyCheck();
+ }
+ };
+
+ return DirtyChecker;
+ }();
+
+ var DirtyCheckProperty = exports.DirtyCheckProperty = (_dec5 = subscriberCollection(), _dec5(_class5 = function () {
+ function DirtyCheckProperty(dirtyChecker, obj, propertyName) {
+
+
+ this.dirtyChecker = dirtyChecker;
+ this.obj = obj;
+ this.propertyName = propertyName;
+ }
+
+ DirtyCheckProperty.prototype.getValue = function getValue() {
+ return this.obj[this.propertyName];
+ };
+
+ DirtyCheckProperty.prototype.setValue = function setValue(newValue) {
+ this.obj[this.propertyName] = newValue;
+ };
+
+ DirtyCheckProperty.prototype.call = function call() {
+ var oldValue = this.oldValue;
+ var newValue = this.getValue();
+
+ this.callSubscribers(newValue, oldValue);
+
+ this.oldValue = newValue;
+ };
+
+ DirtyCheckProperty.prototype.isDirty = function isDirty() {
+ return this.oldValue !== this.obj[this.propertyName];
+ };
+
+ DirtyCheckProperty.prototype.subscribe = function subscribe(context, callable) {
+ if (!this.hasSubscribers()) {
+ this.oldValue = this.getValue();
+ this.dirtyChecker.addProperty(this);
+ }
+ this.addSubscriber(context, callable);
+ };
+
+ DirtyCheckProperty.prototype.unsubscribe = function unsubscribe(context, callable) {
+ if (this.removeSubscriber(context, callable) && !this.hasSubscribers()) {
+ this.dirtyChecker.removeProperty(this);
+ }
+ };
+
+ return DirtyCheckProperty;
+ }()) || _class5);
+
+
+ var logger = LogManager.getLogger('property-observation');
+
+ var propertyAccessor = exports.propertyAccessor = {
+ getValue: function getValue(obj, propertyName) {
+ return obj[propertyName];
+ },
+ setValue: function setValue(value, obj, propertyName) {
+ obj[propertyName] = value;
+ }
+ };
+
+ var PrimitiveObserver = exports.PrimitiveObserver = function () {
+ function PrimitiveObserver(primitive, propertyName) {
+
+
+ this.doNotCache = true;
+
+ this.primitive = primitive;
+ this.propertyName = propertyName;
+ }
+
+ PrimitiveObserver.prototype.getValue = function getValue() {
+ return this.primitive[this.propertyName];
+ };
+
+ PrimitiveObserver.prototype.setValue = function setValue() {
+ var type = _typeof(this.primitive);
+ throw new Error('The ' + this.propertyName + ' property of a ' + type + ' (' + this.primitive + ') cannot be assigned.');
+ };
+
+ PrimitiveObserver.prototype.subscribe = function subscribe() {};
+
+ PrimitiveObserver.prototype.unsubscribe = function unsubscribe() {};
+
+ return PrimitiveObserver;
+ }();
+
+ var SetterObserver = exports.SetterObserver = (_dec6 = subscriberCollection(), _dec6(_class7 = function () {
+ function SetterObserver(taskQueue, obj, propertyName) {
+
+
+ this.taskQueue = taskQueue;
+ this.obj = obj;
+ this.propertyName = propertyName;
+ this.queued = false;
+ this.observing = false;
+ }
+
+ SetterObserver.prototype.getValue = function getValue() {
+ return this.obj[this.propertyName];
+ };
+
+ SetterObserver.prototype.setValue = function setValue(newValue) {
+ this.obj[this.propertyName] = newValue;
+ };
+
+ SetterObserver.prototype.getterValue = function getterValue() {
+ return this.currentValue;
+ };
+
+ SetterObserver.prototype.setterValue = function setterValue(newValue) {
+ var oldValue = this.currentValue;
+
+ if (oldValue !== newValue) {
+ if (!this.queued) {
+ this.oldValue = oldValue;
+ this.queued = true;
+ this.taskQueue.queueMicroTask(this);
+ }
+
+ this.currentValue = newValue;
+ }
+ };
+
+ SetterObserver.prototype.call = function call() {
+ var oldValue = this.oldValue;
+ var newValue = this.currentValue;
+
+ this.queued = false;
+
+ this.callSubscribers(newValue, oldValue);
+ };
+
+ SetterObserver.prototype.subscribe = function subscribe(context, callable) {
+ if (!this.observing) {
+ this.convertProperty();
+ }
+ this.addSubscriber(context, callable);
+ };
+
+ SetterObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ this.removeSubscriber(context, callable);
+ };
+
+ SetterObserver.prototype.convertProperty = function convertProperty() {
+ this.observing = true;
+ this.currentValue = this.obj[this.propertyName];
+ this.setValue = this.setterValue;
+ this.getValue = this.getterValue;
+
+ if (!Reflect.defineProperty(this.obj, this.propertyName, {
+ configurable: true,
+ enumerable: this.propertyName in this.obj ? this.obj.propertyIsEnumerable(this.propertyName) : true,
+ get: this.getValue.bind(this),
+ set: this.setValue.bind(this)
+ })) {
+ logger.warn('Cannot observe property \'' + this.propertyName + '\' of object', this.obj);
+ }
+ };
+
+ return SetterObserver;
+ }()) || _class7);
+
+ var XLinkAttributeObserver = exports.XLinkAttributeObserver = function () {
+ function XLinkAttributeObserver(element, propertyName, attributeName) {
+
+
+ this.element = element;
+ this.propertyName = propertyName;
+ this.attributeName = attributeName;
+ }
+
+ XLinkAttributeObserver.prototype.getValue = function getValue() {
+ return this.element.getAttributeNS('http://www.w3.org/1999/xlink', this.attributeName);
+ };
+
+ XLinkAttributeObserver.prototype.setValue = function setValue(newValue) {
+ return this.element.setAttributeNS('http://www.w3.org/1999/xlink', this.attributeName, newValue);
+ };
+
+ XLinkAttributeObserver.prototype.subscribe = function subscribe() {
+ throw new Error('Observation of a "' + this.element.nodeName + '" element\'s "' + this.propertyName + '" property is not supported.');
+ };
+
+ return XLinkAttributeObserver;
+ }();
+
+ var dataAttributeAccessor = exports.dataAttributeAccessor = {
+ getValue: function getValue(obj, propertyName) {
+ return obj.getAttribute(propertyName);
+ },
+ setValue: function setValue(value, obj, propertyName) {
+ return obj.setAttribute(propertyName, value);
+ }
+ };
+
+ var DataAttributeObserver = exports.DataAttributeObserver = function () {
+ function DataAttributeObserver(element, propertyName) {
+
+
+ this.element = element;
+ this.propertyName = propertyName;
+ }
+
+ DataAttributeObserver.prototype.getValue = function getValue() {
+ return this.element.getAttribute(this.propertyName);
+ };
+
+ DataAttributeObserver.prototype.setValue = function setValue(newValue) {
+ return this.element.setAttribute(this.propertyName, newValue);
+ };
+
+ DataAttributeObserver.prototype.subscribe = function subscribe() {
+ throw new Error('Observation of a "' + this.element.nodeName + '" element\'s "' + this.propertyName + '" property is not supported.');
+ };
+
+ return DataAttributeObserver;
+ }();
+
+ var StyleObserver = exports.StyleObserver = function () {
+ function StyleObserver(element, propertyName) {
+
+
+ this.element = element;
+ this.propertyName = propertyName;
+
+ this.styles = null;
+ this.version = 0;
+ }
+
+ StyleObserver.prototype.getValue = function getValue() {
+ return this.element.style.cssText;
+ };
+
+ StyleObserver.prototype._setProperty = function _setProperty(style, value) {
+ var priority = '';
+
+ if (value !== null && value !== undefined && typeof value.indexOf === 'function' && value.indexOf('!important') !== -1) {
+ priority = 'important';
+ value = value.replace('!important', '');
+ }
+ this.element.style.setProperty(style, value, priority);
+ };
+
+ StyleObserver.prototype.setValue = function setValue(newValue) {
+ var styles = this.styles || {};
+ var style = void 0;
+ var version = this.version;
+
+ if (newValue !== null && newValue !== undefined) {
+ if (newValue instanceof Object) {
+ for (style in newValue) {
+ if (newValue.hasOwnProperty(style)) {
+ styles[style] = version;
+ this._setProperty(style, newValue[style]);
+ }
+ }
+ } else if (newValue.length) {
+ var rx = /\s*([\w\-]+)\s*:\s*((?:(?:[\w\-]+\(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[\w\-]+\(\s*(?:^"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^\)]*)\),?|[^\)]*)\),?|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^;]*),?\s*)+);?/g;
+ var pair = void 0;
+ while ((pair = rx.exec(newValue)) !== null) {
+ style = pair[1];
+ if (!style) {
+ continue;
+ }
+
+ styles[style] = version;
+ this._setProperty(style, pair[2]);
+ }
+ }
+ }
+
+ this.styles = styles;
+ this.version += 1;
+
+ if (version === 0) {
+ return;
+ }
+
+ version -= 1;
+ for (style in styles) {
+ if (!styles.hasOwnProperty(style) || styles[style] !== version) {
+ continue;
+ }
+
+ this.element.style.removeProperty(style);
+ }
+ };
+
+ StyleObserver.prototype.subscribe = function subscribe() {
+ throw new Error('Observation of a "' + this.element.nodeName + '" element\'s "' + this.propertyName + '" property is not supported.');
+ };
+
+ return StyleObserver;
+ }();
+
+ var ValueAttributeObserver = exports.ValueAttributeObserver = (_dec7 = subscriberCollection(), _dec7(_class8 = function () {
+ function ValueAttributeObserver(element, propertyName, handler) {
+
+
+ this.element = element;
+ this.propertyName = propertyName;
+ this.handler = handler;
+ if (propertyName === 'files') {
+ this.setValue = function () {};
+ }
+ }
+
+ ValueAttributeObserver.prototype.getValue = function getValue() {
+ return this.element[this.propertyName];
+ };
+
+ ValueAttributeObserver.prototype.setValue = function setValue(newValue) {
+ newValue = newValue === undefined || newValue === null ? '' : newValue;
+ if (this.element[this.propertyName] !== newValue) {
+ this.element[this.propertyName] = newValue;
+ this.notify();
+ }
+ };
+
+ ValueAttributeObserver.prototype.notify = function notify() {
+ var oldValue = this.oldValue;
+ var newValue = this.getValue();
+
+ this.callSubscribers(newValue, oldValue);
+
+ this.oldValue = newValue;
+ };
+
+ ValueAttributeObserver.prototype.subscribe = function subscribe(context, callable) {
+ if (!this.hasSubscribers()) {
+ this.oldValue = this.getValue();
+ this.disposeHandler = this.handler.subscribe(this.element, this.notify.bind(this));
+ }
+
+ this.addSubscriber(context, callable);
+ };
+
+ ValueAttributeObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ if (this.removeSubscriber(context, callable) && !this.hasSubscribers()) {
+ this.disposeHandler();
+ this.disposeHandler = null;
+ }
+ };
+
+ return ValueAttributeObserver;
+ }()) || _class8);
+
+
+ var checkedArrayContext = 'CheckedObserver:array';
+ var checkedValueContext = 'CheckedObserver:value';
+
+ var CheckedObserver = exports.CheckedObserver = (_dec8 = subscriberCollection(), _dec8(_class9 = function () {
+ function CheckedObserver(element, handler, observerLocator) {
+
+
+ this.element = element;
+ this.handler = handler;
+ this.observerLocator = observerLocator;
+ }
+
+ CheckedObserver.prototype.getValue = function getValue() {
+ return this.value;
+ };
+
+ CheckedObserver.prototype.setValue = function setValue(newValue) {
+ if (this.value === newValue) {
+ return;
+ }
+
+ if (this.arrayObserver) {
+ this.arrayObserver.unsubscribe(checkedArrayContext, this);
+ this.arrayObserver = null;
+ }
+
+ if (this.element.type === 'checkbox' && Array.isArray(newValue)) {
+ this.arrayObserver = this.observerLocator.getArrayObserver(newValue);
+ this.arrayObserver.subscribe(checkedArrayContext, this);
+ }
+
+ this.oldValue = this.value;
+ this.value = newValue;
+ this.synchronizeElement();
+ this.notify();
+
+ if (!this.initialSync) {
+ this.initialSync = true;
+ this.observerLocator.taskQueue.queueMicroTask(this);
+ }
+ };
+
+ CheckedObserver.prototype.call = function call(context, splices) {
+ this.synchronizeElement();
+
+ if (!this.valueObserver) {
+ this.valueObserver = this.element.__observers__.model || this.element.__observers__.value;
+ if (this.valueObserver) {
+ this.valueObserver.subscribe(checkedValueContext, this);
+ }
+ }
+ };
+
+ CheckedObserver.prototype.synchronizeElement = function synchronizeElement() {
+ var value = this.value;
+ var element = this.element;
+ var elementValue = element.hasOwnProperty('model') ? element.model : element.value;
+ var isRadio = element.type === 'radio';
+ var matcher = element.matcher || function (a, b) {
+ return a === b;
+ };
+
+ element.checked = isRadio && !!matcher(value, elementValue) || !isRadio && value === true || !isRadio && Array.isArray(value) && value.findIndex(function (item) {
+ return !!matcher(item, elementValue);
+ }) !== -1;
+ };
+
+ CheckedObserver.prototype.synchronizeValue = function synchronizeValue() {
+ var value = this.value;
+ var element = this.element;
+ var elementValue = element.hasOwnProperty('model') ? element.model : element.value;
+ var index = void 0;
+ var matcher = element.matcher || function (a, b) {
+ return a === b;
+ };
+
+ if (element.type === 'checkbox') {
+ if (Array.isArray(value)) {
+ index = value.findIndex(function (item) {
+ return !!matcher(item, elementValue);
+ });
+ if (element.checked && index === -1) {
+ value.push(elementValue);
+ } else if (!element.checked && index !== -1) {
+ value.splice(index, 1);
+ }
+
+ return;
+ }
+
+ value = element.checked;
+ } else if (element.checked) {
+ value = elementValue;
+ } else {
+ return;
+ }
+
+ this.oldValue = this.value;
+ this.value = value;
+ this.notify();
+ };
+
+ CheckedObserver.prototype.notify = function notify() {
+ var oldValue = this.oldValue;
+ var newValue = this.value;
+
+ this.callSubscribers(newValue, oldValue);
+ };
+
+ CheckedObserver.prototype.subscribe = function subscribe(context, callable) {
+ if (!this.hasSubscribers()) {
+ this.disposeHandler = this.handler.subscribe(this.element, this.synchronizeValue.bind(this, false));
+ }
+ this.addSubscriber(context, callable);
+ };
+
+ CheckedObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ if (this.removeSubscriber(context, callable) && !this.hasSubscribers()) {
+ this.disposeHandler();
+ this.disposeHandler = null;
+ }
+ };
+
+ CheckedObserver.prototype.unbind = function unbind() {
+ if (this.arrayObserver) {
+ this.arrayObserver.unsubscribe(checkedArrayContext, this);
+ this.arrayObserver = null;
+ }
+ if (this.valueObserver) {
+ this.valueObserver.unsubscribe(checkedValueContext, this);
+ }
+ };
+
+ return CheckedObserver;
+ }()) || _class9);
+
+
+ var selectArrayContext = 'SelectValueObserver:array';
+
+ var SelectValueObserver = exports.SelectValueObserver = (_dec9 = subscriberCollection(), _dec9(_class10 = function () {
+ function SelectValueObserver(element, handler, observerLocator) {
+
+
+ this.element = element;
+ this.handler = handler;
+ this.observerLocator = observerLocator;
+ }
+
+ SelectValueObserver.prototype.getValue = function getValue() {
+ return this.value;
+ };
+
+ SelectValueObserver.prototype.setValue = function setValue(newValue) {
+ if (newValue !== null && newValue !== undefined && this.element.multiple && !Array.isArray(newValue)) {
+ throw new Error('Only null or Array instances can be bound to a multi-select.');
+ }
+ if (this.value === newValue) {
+ return;
+ }
+
+ if (this.arrayObserver) {
+ this.arrayObserver.unsubscribe(selectArrayContext, this);
+ this.arrayObserver = null;
+ }
+
+ if (Array.isArray(newValue)) {
+ this.arrayObserver = this.observerLocator.getArrayObserver(newValue);
+ this.arrayObserver.subscribe(selectArrayContext, this);
+ }
+
+ this.oldValue = this.value;
+ this.value = newValue;
+ this.synchronizeOptions();
+ this.notify();
+
+ if (!this.initialSync) {
+ this.initialSync = true;
+ this.observerLocator.taskQueue.queueMicroTask(this);
+ }
+ };
+
+ SelectValueObserver.prototype.call = function call(context, splices) {
+ this.synchronizeOptions();
+ };
+
+ SelectValueObserver.prototype.synchronizeOptions = function synchronizeOptions() {
+ var value = this.value;
+ var clear = void 0;
+ var isArray = void 0;
+
+ if (value === null || value === undefined) {
+ clear = true;
+ } else if (Array.isArray(value)) {
+ isArray = true;
+ }
+
+ var options = this.element.options;
+ var i = options.length;
+ var matcher = this.element.matcher || function (a, b) {
+ return a === b;
+ };
+
+ var _loop = function _loop() {
+ var option = options.item(i);
+ if (clear) {
+ option.selected = false;
+ return 'continue';
+ }
+ var optionValue = option.hasOwnProperty('model') ? option.model : option.value;
+ if (isArray) {
+ option.selected = value.findIndex(function (item) {
+ return !!matcher(optionValue, item);
+ }) !== -1;
+ return 'continue';
+ }
+ option.selected = !!matcher(optionValue, value);
+ };
+
+ while (i--) {
+ var _ret2 = _loop();
+
+ if (_ret2 === 'continue') continue;
+ }
+ };
+
+ SelectValueObserver.prototype.synchronizeValue = function synchronizeValue() {
+ var _this24 = this;
+
+ var options = this.element.options;
+ var count = 0;
+ var value = [];
+
+ for (var _i22 = 0, ii = options.length; _i22 < ii; _i22++) {
+ var _option = options.item(_i22);
+ if (!_option.selected) {
+ continue;
+ }
+ value.push(_option.hasOwnProperty('model') ? _option.model : _option.value);
+ count++;
+ }
+
+ if (this.element.multiple) {
+ if (Array.isArray(this.value)) {
+ var _ret3 = function () {
+ var matcher = _this24.element.matcher || function (a, b) {
+ return a === b;
+ };
+
+ var i = 0;
+
+ var _loop2 = function _loop2() {
+ var a = _this24.value[i];
+ if (value.findIndex(function (b) {
+ return matcher(a, b);
+ }) === -1) {
+ _this24.value.splice(i, 1);
+ } else {
+ i++;
+ }
+ };
+
+ while (i < _this24.value.length) {
+ _loop2();
+ }
+
+ i = 0;
+
+ var _loop3 = function _loop3() {
+ var a = value[i];
+ if (_this24.value.findIndex(function (b) {
+ return matcher(a, b);
+ }) === -1) {
+ _this24.value.push(a);
+ }
+ i++;
+ };
+
+ while (i < value.length) {
+ _loop3();
+ }
+ return {
+ v: void 0
+ };
+ }();
+
+ if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v;
+ }
+ } else {
+ if (count === 0) {
+ value = null;
+ } else {
+ value = value[0];
+ }
+ }
+
+ if (value !== this.value) {
+ this.oldValue = this.value;
+ this.value = value;
+ this.notify();
+ }
+ };
+
+ SelectValueObserver.prototype.notify = function notify() {
+ var oldValue = this.oldValue;
+ var newValue = this.value;
+
+ this.callSubscribers(newValue, oldValue);
+ };
+
+ SelectValueObserver.prototype.subscribe = function subscribe(context, callable) {
+ if (!this.hasSubscribers()) {
+ this.disposeHandler = this.handler.subscribe(this.element, this.synchronizeValue.bind(this, false));
+ }
+ this.addSubscriber(context, callable);
+ };
+
+ SelectValueObserver.prototype.unsubscribe = function unsubscribe(context, callable) {
+ if (this.removeSubscriber(context, callable) && !this.hasSubscribers()) {
+ this.disposeHandler();
+ this.disposeHandler = null;
+ }
+ };
+
+ SelectValueObserver.prototype.bind = function bind() {
+ var _this25 = this;
+
+ this.domObserver = _aureliaPal.DOM.createMutationObserver(function () {
+ _this25.synchronizeOptions();
+ _this25.synchronizeValue();
+ });
+ this.domObserver.observe(this.element, { childList: true, subtree: true });
+ };
+
+ SelectValueObserver.prototype.unbind = function unbind() {
+ this.domObserver.disconnect();
+ this.domObserver = null;
+
+ if (this.arrayObserver) {
+ this.arrayObserver.unsubscribe(selectArrayContext, this);
+ this.arrayObserver = null;
+ }
+ };
+
+ return SelectValueObserver;
+ }()) || _class10);
+
+ var ClassObserver = exports.ClassObserver = function () {
+ function ClassObserver(element) {
+
+
+ this.element = element;
+ this.doNotCache = true;
+ this.value = '';
+ this.version = 0;
+ }
+
+ ClassObserver.prototype.getValue = function getValue() {
+ return this.value;
+ };
+
+ ClassObserver.prototype.setValue = function setValue(newValue) {
+ var nameIndex = this.nameIndex || {};
+ var version = this.version;
+ var names = void 0;
+ var name = void 0;
+
+ if (newValue !== null && newValue !== undefined && newValue.length) {
+ names = newValue.split(/\s+/);
+ for (var _i23 = 0, length = names.length; _i23 < length; _i23++) {
+ name = names[_i23];
+ if (name === '') {
+ continue;
+ }
+ nameIndex[name] = version;
+ this.element.classList.add(name);
+ }
+ }
+
+ this.value = newValue;
+ this.nameIndex = nameIndex;
+ this.version += 1;
+
+ if (version === 0) {
+ return;
+ }
+
+ version -= 1;
+ for (name in nameIndex) {
+ if (!nameIndex.hasOwnProperty(name) || nameIndex[name] !== version) {
+ continue;
+ }
+ this.element.classList.remove(name);
+ }
+ };
+
+ ClassObserver.prototype.subscribe = function subscribe() {
+ throw new Error('Observation of a "' + this.element.nodeName + '" element\'s "class" property is not supported.');
+ };
+
+ return ClassObserver;
+ }();
+
+ function hasDeclaredDependencies(descriptor) {
+ return !!(descriptor && descriptor.get && descriptor.get.dependencies);
+ }
+
+ function declarePropertyDependencies(ctor, propertyName, dependencies) {
+ var descriptor = Object.getOwnPropertyDescriptor(ctor.prototype, propertyName);
+ descriptor.get.dependencies = dependencies;
+ }
+
+ function computedFrom() {
+ for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
+ rest[_key] = arguments[_key];
+ }
+
+ return function (target, key, descriptor) {
+ descriptor.get.dependencies = rest;
+ return descriptor;
+ };
+ }
+
+ var ComputedExpression = exports.ComputedExpression = function (_Expression19) {
+ _inherits(ComputedExpression, _Expression19);
+
+ function ComputedExpression(name, dependencies) {
+
+
+ var _this26 = _possibleConstructorReturn(this, _Expression19.call(this));
+
+ _this26.name = name;
+ _this26.dependencies = dependencies;
+ _this26.isAssignable = true;
+ return _this26;
+ }
+
+ ComputedExpression.prototype.evaluate = function evaluate(scope, lookupFunctions) {
+ return scope.bindingContext[this.name];
+ };
+
+ ComputedExpression.prototype.assign = function assign(scope, value) {
+ scope.bindingContext[this.name] = value;
+ };
+
+ ComputedExpression.prototype.accept = function accept(visitor) {
+ throw new Error('not implemented');
+ };
+
+ ComputedExpression.prototype.connect = function connect(binding, scope) {
+ var dependencies = this.dependencies;
+ var i = dependencies.length;
+ while (i--) {
+ dependencies[i].connect(binding, scope);
+ }
+ };
+
+ return ComputedExpression;
+ }(Expression);
+
+ function createComputedObserver(obj, propertyName, descriptor, observerLocator) {
+ var dependencies = descriptor.get.dependencies;
+ if (!(dependencies instanceof ComputedExpression)) {
+ var _i24 = dependencies.length;
+ while (_i24--) {
+ dependencies[_i24] = observerLocator.parser.parse(dependencies[_i24]);
+ }
+ dependencies = descriptor.get.dependencies = new ComputedExpression(propertyName, dependencies);
+ }
+
+ var scope = { bindingContext: obj, overrideContext: createOverrideContext(obj) };
+ return new ExpressionObserver(scope, dependencies, observerLocator);
+ }
+
+ var elements = exports.elements = {
+ a: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'target', 'transform', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ altGlyph: ['class', 'dx', 'dy', 'externalResourcesRequired', 'format', 'glyphRef', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'rotate', 'style', 'systemLanguage', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ altGlyphDef: ['id', 'xml:base', 'xml:lang', 'xml:space'],
+ altGlyphItem: ['id', 'xml:base', 'xml:lang', 'xml:space'],
+ animate: ['accumulate', 'additive', 'attributeName', 'attributeType', 'begin', 'by', 'calcMode', 'dur', 'end', 'externalResourcesRequired', 'fill', 'from', 'id', 'keySplines', 'keyTimes', 'max', 'min', 'onbegin', 'onend', 'onload', 'onrepeat', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart', 'systemLanguage', 'to', 'values', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ animateColor: ['accumulate', 'additive', 'attributeName', 'attributeType', 'begin', 'by', 'calcMode', 'dur', 'end', 'externalResourcesRequired', 'fill', 'from', 'id', 'keySplines', 'keyTimes', 'max', 'min', 'onbegin', 'onend', 'onload', 'onrepeat', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart', 'systemLanguage', 'to', 'values', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ animateMotion: ['accumulate', 'additive', 'begin', 'by', 'calcMode', 'dur', 'end', 'externalResourcesRequired', 'fill', 'from', 'id', 'keyPoints', 'keySplines', 'keyTimes', 'max', 'min', 'onbegin', 'onend', 'onload', 'onrepeat', 'origin', 'path', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart', 'rotate', 'systemLanguage', 'to', 'values', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ animateTransform: ['accumulate', 'additive', 'attributeName', 'attributeType', 'begin', 'by', 'calcMode', 'dur', 'end', 'externalResourcesRequired', 'fill', 'from', 'id', 'keySplines', 'keyTimes', 'max', 'min', 'onbegin', 'onend', 'onload', 'onrepeat', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart', 'systemLanguage', 'to', 'type', 'values', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ circle: ['class', 'cx', 'cy', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'r', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ clipPath: ['class', 'clipPathUnits', 'externalResourcesRequired', 'id', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ 'color-profile': ['id', 'local', 'name', 'rendering-intent', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ cursor: ['externalResourcesRequired', 'id', 'requiredExtensions', 'requiredFeatures', 'systemLanguage', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ defs: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ desc: ['class', 'id', 'style', 'xml:base', 'xml:lang', 'xml:space'],
+ ellipse: ['class', 'cx', 'cy', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'rx', 'ry', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ feBlend: ['class', 'height', 'id', 'in', 'in2', 'mode', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feColorMatrix: ['class', 'height', 'id', 'in', 'result', 'style', 'type', 'values', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feComponentTransfer: ['class', 'height', 'id', 'in', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feComposite: ['class', 'height', 'id', 'in', 'in2', 'k1', 'k2', 'k3', 'k4', 'operator', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feConvolveMatrix: ['bias', 'class', 'divisor', 'edgeMode', 'height', 'id', 'in', 'kernelMatrix', 'kernelUnitLength', 'order', 'preserveAlpha', 'result', 'style', 'targetX', 'targetY', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feDiffuseLighting: ['class', 'diffuseConstant', 'height', 'id', 'in', 'kernelUnitLength', 'result', 'style', 'surfaceScale', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feDisplacementMap: ['class', 'height', 'id', 'in', 'in2', 'result', 'scale', 'style', 'width', 'x', 'xChannelSelector', 'xml:base', 'xml:lang', 'xml:space', 'y', 'yChannelSelector'],
+ feDistantLight: ['azimuth', 'elevation', 'id', 'xml:base', 'xml:lang', 'xml:space'],
+ feFlood: ['class', 'height', 'id', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feFuncA: ['amplitude', 'exponent', 'id', 'intercept', 'offset', 'slope', 'tableValues', 'type', 'xml:base', 'xml:lang', 'xml:space'],
+ feFuncB: ['amplitude', 'exponent', 'id', 'intercept', 'offset', 'slope', 'tableValues', 'type', 'xml:base', 'xml:lang', 'xml:space'],
+ feFuncG: ['amplitude', 'exponent', 'id', 'intercept', 'offset', 'slope', 'tableValues', 'type', 'xml:base', 'xml:lang', 'xml:space'],
+ feFuncR: ['amplitude', 'exponent', 'id', 'intercept', 'offset', 'slope', 'tableValues', 'type', 'xml:base', 'xml:lang', 'xml:space'],
+ feGaussianBlur: ['class', 'height', 'id', 'in', 'result', 'stdDeviation', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feImage: ['class', 'externalResourcesRequired', 'height', 'id', 'preserveAspectRatio', 'result', 'style', 'width', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feMerge: ['class', 'height', 'id', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feMergeNode: ['id', 'xml:base', 'xml:lang', 'xml:space'],
+ feMorphology: ['class', 'height', 'id', 'in', 'operator', 'radius', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feOffset: ['class', 'dx', 'dy', 'height', 'id', 'in', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ fePointLight: ['id', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y', 'z'],
+ feSpecularLighting: ['class', 'height', 'id', 'in', 'kernelUnitLength', 'result', 'specularConstant', 'specularExponent', 'style', 'surfaceScale', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feSpotLight: ['id', 'limitingConeAngle', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'specularExponent', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y', 'z'],
+ feTile: ['class', 'height', 'id', 'in', 'result', 'style', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ feTurbulence: ['baseFrequency', 'class', 'height', 'id', 'numOctaves', 'result', 'seed', 'stitchTiles', 'style', 'type', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ filter: ['class', 'externalResourcesRequired', 'filterRes', 'filterUnits', 'height', 'id', 'primitiveUnits', 'style', 'width', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ font: ['class', 'externalResourcesRequired', 'horiz-adv-x', 'horiz-origin-x', 'horiz-origin-y', 'id', 'style', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'xml:base', 'xml:lang', 'xml:space'],
+ 'font-face': ['accent-height', 'alphabetic', 'ascent', 'bbox', 'cap-height', 'descent', 'font-family', 'font-size', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'hanging', 'id', 'ideographic', 'mathematical', 'overline-position', 'overline-thickness', 'panose-1', 'slope', 'stemh', 'stemv', 'strikethrough-position', 'strikethrough-thickness', 'underline-position', 'underline-thickness', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'widths', 'x-height', 'xml:base', 'xml:lang', 'xml:space'],
+ 'font-face-format': ['id', 'string', 'xml:base', 'xml:lang', 'xml:space'],
+ 'font-face-name': ['id', 'name', 'xml:base', 'xml:lang', 'xml:space'],
+ 'font-face-src': ['id', 'xml:base', 'xml:lang', 'xml:space'],
+ 'font-face-uri': ['id', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ foreignObject: ['class', 'externalResourcesRequired', 'height', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ g: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ glyph: ['arabic-form', 'class', 'd', 'glyph-name', 'horiz-adv-x', 'id', 'lang', 'orientation', 'style', 'unicode', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'xml:base', 'xml:lang', 'xml:space'],
+ glyphRef: ['class', 'dx', 'dy', 'format', 'glyphRef', 'id', 'style', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ hkern: ['g1', 'g2', 'id', 'k', 'u1', 'u2', 'xml:base', 'xml:lang', 'xml:space'],
+ image: ['class', 'externalResourcesRequired', 'height', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'preserveAspectRatio', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ line: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'x1', 'x2', 'xml:base', 'xml:lang', 'xml:space', 'y1', 'y2'],
+ linearGradient: ['class', 'externalResourcesRequired', 'gradientTransform', 'gradientUnits', 'id', 'spreadMethod', 'style', 'x1', 'x2', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y1', 'y2'],
+ marker: ['class', 'externalResourcesRequired', 'id', 'markerHeight', 'markerUnits', 'markerWidth', 'orient', 'preserveAspectRatio', 'refX', 'refY', 'style', 'viewBox', 'xml:base', 'xml:lang', 'xml:space'],
+ mask: ['class', 'externalResourcesRequired', 'height', 'id', 'maskContentUnits', 'maskUnits', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ metadata: ['id', 'xml:base', 'xml:lang', 'xml:space'],
+ 'missing-glyph': ['class', 'd', 'horiz-adv-x', 'id', 'style', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'xml:base', 'xml:lang', 'xml:space'],
+ mpath: ['externalResourcesRequired', 'id', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ path: ['class', 'd', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'pathLength', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ pattern: ['class', 'externalResourcesRequired', 'height', 'id', 'patternContentUnits', 'patternTransform', 'patternUnits', 'preserveAspectRatio', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ polygon: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'points', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ polyline: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'points', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ radialGradient: ['class', 'cx', 'cy', 'externalResourcesRequired', 'fx', 'fy', 'gradientTransform', 'gradientUnits', 'id', 'r', 'spreadMethod', 'style', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ rect: ['class', 'externalResourcesRequired', 'height', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'rx', 'ry', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ script: ['externalResourcesRequired', 'id', 'type', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ set: ['attributeName', 'attributeType', 'begin', 'dur', 'end', 'externalResourcesRequired', 'fill', 'id', 'max', 'min', 'onbegin', 'onend', 'onload', 'onrepeat', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart', 'systemLanguage', 'to', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ stop: ['class', 'id', 'offset', 'style', 'xml:base', 'xml:lang', 'xml:space'],
+ style: ['id', 'media', 'title', 'type', 'xml:base', 'xml:lang', 'xml:space'],
+ svg: ['baseProfile', 'class', 'contentScriptType', 'contentStyleType', 'externalResourcesRequired', 'height', 'id', 'onabort', 'onactivate', 'onclick', 'onerror', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onresize', 'onscroll', 'onunload', 'onzoom', 'preserveAspectRatio', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'version', 'viewBox', 'width', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y', 'zoomAndPan'],
+ switch: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'xml:base', 'xml:lang', 'xml:space'],
+ symbol: ['class', 'externalResourcesRequired', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'preserveAspectRatio', 'style', 'viewBox', 'xml:base', 'xml:lang', 'xml:space'],
+ text: ['class', 'dx', 'dy', 'externalResourcesRequired', 'id', 'lengthAdjust', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'rotate', 'style', 'systemLanguage', 'textLength', 'transform', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ textPath: ['class', 'externalResourcesRequired', 'id', 'lengthAdjust', 'method', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'textLength', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space'],
+ title: ['class', 'id', 'style', 'xml:base', 'xml:lang', 'xml:space'],
+ tref: ['class', 'dx', 'dy', 'externalResourcesRequired', 'id', 'lengthAdjust', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'rotate', 'style', 'systemLanguage', 'textLength', 'x', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ tspan: ['class', 'dx', 'dy', 'externalResourcesRequired', 'id', 'lengthAdjust', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'rotate', 'style', 'systemLanguage', 'textLength', 'x', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ use: ['class', 'externalResourcesRequired', 'height', 'id', 'onactivate', 'onclick', 'onfocusin', 'onfocusout', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'requiredExtensions', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'y'],
+ view: ['externalResourcesRequired', 'id', 'preserveAspectRatio', 'viewBox', 'viewTarget', 'xml:base', 'xml:lang', 'xml:space', 'zoomAndPan'],
+ vkern: ['g1', 'g2', 'id', 'k', 'u1', 'u2', 'xml:base', 'xml:lang', 'xml:space']
+ };
+ var presentationElements = exports.presentationElements = {
+ 'a': true,
+ 'altGlyph': true,
+ 'animate': true,
+ 'animateColor': true,
+ 'circle': true,
+ 'clipPath': true,
+ 'defs': true,
+ 'ellipse': true,
+ 'feBlend': true,
+ 'feColorMatrix': true,
+ 'feComponentTransfer': true,
+ 'feComposite': true,
+ 'feConvolveMatrix': true,
+ 'feDiffuseLighting': true,
+ 'feDisplacementMap': true,
+ 'feFlood': true,
+ 'feGaussianBlur': true,
+ 'feImage': true,
+ 'feMerge': true,
+ 'feMorphology': true,
+ 'feOffset': true,
+ 'feSpecularLighting': true,
+ 'feTile': true,
+ 'feTurbulence': true,
+ 'filter': true,
+ 'font': true,
+ 'foreignObject': true,
+ 'g': true,
+ 'glyph': true,
+ 'glyphRef': true,
+ 'image': true,
+ 'line': true,
+ 'linearGradient': true,
+ 'marker': true,
+ 'mask': true,
+ 'missing-glyph': true,
+ 'path': true,
+ 'pattern': true,
+ 'polygon': true,
+ 'polyline': true,
+ 'radialGradient': true,
+ 'rect': true,
+ 'stop': true,
+ 'svg': true,
+ 'switch': true,
+ 'symbol': true,
+ 'text': true,
+ 'textPath': true,
+ 'tref': true,
+ 'tspan': true,
+ 'use': true
+ };
+
+ var presentationAttributes = exports.presentationAttributes = {
+ 'alignment-baseline': true,
+ 'baseline-shift': true,
+ 'clip-path': true,
+ 'clip-rule': true,
+ 'clip': true,
+ 'color-interpolation-filters': true,
+ 'color-interpolation': true,
+ 'color-profile': true,
+ 'color-rendering': true,
+ 'color': true,
+ 'cursor': true,
+ 'direction': true,
+ 'display': true,
+ 'dominant-baseline': true,
+ 'enable-background': true,
+ 'fill-opacity': true,
+ 'fill-rule': true,
+ 'fill': true,
+ 'filter': true,
+ 'flood-color': true,
+ 'flood-opacity': true,
+ 'font-family': true,
+ 'font-size-adjust': true,
+ 'font-size': true,
+ 'font-stretch': true,
+ 'font-style': true,
+ 'font-variant': true,
+ 'font-weight': true,
+ 'glyph-orientation-horizontal': true,
+ 'glyph-orientation-vertical': true,
+ 'image-rendering': true,
+ 'kerning': true,
+ 'letter-spacing': true,
+ 'lighting-color': true,
+ 'marker-end': true,
+ 'marker-mid': true,
+ 'marker-start': true,
+ 'mask': true,
+ 'opacity': true,
+ 'overflow': true,
+ 'pointer-events': true,
+ 'shape-rendering': true,
+ 'stop-color': true,
+ 'stop-opacity': true,
+ 'stroke-dasharray': true,
+ 'stroke-dashoffset': true,
+ 'stroke-linecap': true,
+ 'stroke-linejoin': true,
+ 'stroke-miterlimit': true,
+ 'stroke-opacity': true,
+ 'stroke-width': true,
+ 'stroke': true,
+ 'text-anchor': true,
+ 'text-decoration': true,
+ 'text-rendering': true,
+ 'unicode-bidi': true,
+ 'visibility': true,
+ 'word-spacing': true,
+ 'writing-mode': true
+ };
+
+ function createElement(html) {
+ var div = _aureliaPal.DOM.createElement('div');
+ div.innerHTML = html;
+ return div.firstChild;
+ }
+
+ var SVGAnalyzer = exports.SVGAnalyzer = function () {
+ function SVGAnalyzer() {
+
+
+ if (createElement('').firstElementChild.nodeName === 'altglyph' && elements.altGlyph) {
+ elements.altglyph = elements.altGlyph;
+ delete elements.altGlyph;
+ elements.altglyphdef = elements.altGlyphDef;
+ delete elements.altGlyphDef;
+ elements.altglyphitem = elements.altGlyphItem;
+ delete elements.altGlyphItem;
+ elements.glyphref = elements.glyphRef;
+ delete elements.glyphRef;
+ }
+ }
+
+ SVGAnalyzer.prototype.isStandardSvgAttribute = function isStandardSvgAttribute(nodeName, attributeName) {
+ return presentationElements[nodeName] && presentationAttributes[attributeName] || elements[nodeName] && elements[nodeName].indexOf(attributeName) !== -1;
+ };
+
+ return SVGAnalyzer;
+ }();
+
+ var ObserverLocator = exports.ObserverLocator = (_temp = _class11 = function () {
+ function ObserverLocator(taskQueue, eventManager, dirtyChecker, svgAnalyzer, parser) {
+
+
+ this.taskQueue = taskQueue;
+ this.eventManager = eventManager;
+ this.dirtyChecker = dirtyChecker;
+ this.svgAnalyzer = svgAnalyzer;
+ this.parser = parser;
+ this.adapters = [];
+ this.logger = LogManager.getLogger('observer-locator');
+ }
+
+ ObserverLocator.prototype.getObserver = function getObserver(obj, propertyName) {
+ var observersLookup = obj.__observers__;
+ var observer = void 0;
+
+ if (observersLookup && propertyName in observersLookup) {
+ return observersLookup[propertyName];
+ }
+
+ observer = this.createPropertyObserver(obj, propertyName);
+
+ if (!observer.doNotCache) {
+ if (observersLookup === undefined) {
+ observersLookup = this.getOrCreateObserversLookup(obj);
+ }
+
+ observersLookup[propertyName] = observer;
+ }
+
+ return observer;
+ };
+
+ ObserverLocator.prototype.getOrCreateObserversLookup = function getOrCreateObserversLookup(obj) {
+ return obj.__observers__ || this.createObserversLookup(obj);
+ };
+
+ ObserverLocator.prototype.createObserversLookup = function createObserversLookup(obj) {
+ var value = {};
+
+ if (!Reflect.defineProperty(obj, '__observers__', {
+ enumerable: false,
+ configurable: false,
+ writable: false,
+ value: value
+ })) {
+ this.logger.warn('Cannot add observers to object', obj);
+ }
+
+ return value;
+ };
+
+ ObserverLocator.prototype.addAdapter = function addAdapter(adapter) {
+ this.adapters.push(adapter);
+ };
+
+ ObserverLocator.prototype.getAdapterObserver = function getAdapterObserver(obj, propertyName, descriptor) {
+ for (var _i25 = 0, ii = this.adapters.length; _i25 < ii; _i25++) {
+ var adapter = this.adapters[_i25];
+ var observer = adapter.getObserver(obj, propertyName, descriptor);
+ if (observer) {
+ return observer;
+ }
+ }
+ return null;
+ };
+
+ ObserverLocator.prototype.createPropertyObserver = function createPropertyObserver(obj, propertyName) {
+ var descriptor = void 0;
+ var handler = void 0;
+ var xlinkResult = void 0;
+
+ if (!(obj instanceof Object)) {
+ return new PrimitiveObserver(obj, propertyName);
+ }
+
+ if (obj instanceof _aureliaPal.DOM.Element) {
+ if (propertyName === 'class') {
+ return new ClassObserver(obj);
+ }
+ if (propertyName === 'style' || propertyName === 'css') {
+ return new StyleObserver(obj, propertyName);
+ }
+ handler = this.eventManager.getElementHandler(obj, propertyName);
+ if (propertyName === 'value' && obj.tagName.toLowerCase() === 'select') {
+ return new SelectValueObserver(obj, handler, this);
+ }
+ if (propertyName === 'checked' && obj.tagName.toLowerCase() === 'input') {
+ return new CheckedObserver(obj, handler, this);
+ }
+ if (handler) {
+ return new ValueAttributeObserver(obj, propertyName, handler);
+ }
+ xlinkResult = /^xlink:(.+)$/.exec(propertyName);
+ if (xlinkResult) {
+ return new XLinkAttributeObserver(obj, propertyName, xlinkResult[1]);
+ }
+ if (propertyName === 'role' && (obj instanceof _aureliaPal.DOM.Element || obj instanceof _aureliaPal.DOM.SVGElement) || /^\w+:|^data-|^aria-/.test(propertyName) || obj instanceof _aureliaPal.DOM.SVGElement && this.svgAnalyzer.isStandardSvgAttribute(obj.nodeName, propertyName)) {
+ return new DataAttributeObserver(obj, propertyName);
+ }
+ }
+
+ descriptor = Object.getPropertyDescriptor(obj, propertyName);
+
+ if (hasDeclaredDependencies(descriptor)) {
+ return createComputedObserver(obj, propertyName, descriptor, this);
+ }
+
+ if (descriptor) {
+ var existingGetterOrSetter = descriptor.get || descriptor.set;
+ if (existingGetterOrSetter) {
+ if (existingGetterOrSetter.getObserver) {
+ return existingGetterOrSetter.getObserver(obj);
+ }
+
+ var adapterObserver = this.getAdapterObserver(obj, propertyName, descriptor);
+ if (adapterObserver) {
+ return adapterObserver;
+ }
+ return new DirtyCheckProperty(this.dirtyChecker, obj, propertyName);
+ }
+ }
+
+ if (obj instanceof Array) {
+ if (propertyName === 'length') {
+ return this.getArrayObserver(obj).getLengthObserver();
+ }
+
+ return new DirtyCheckProperty(this.dirtyChecker, obj, propertyName);
+ } else if (obj instanceof Map) {
+ if (propertyName === 'size') {
+ return this.getMapObserver(obj).getLengthObserver();
+ }
+
+ return new DirtyCheckProperty(this.dirtyChecker, obj, propertyName);
+ } else if (obj instanceof Set) {
+ if (propertyName === 'size') {
+ return this.getSetObserver(obj).getLengthObserver();
+ }
+
+ return new DirtyCheckProperty(this.dirtyChecker, obj, propertyName);
+ }
+
+ return new SetterObserver(this.taskQueue, obj, propertyName);
+ };
+
+ ObserverLocator.prototype.getAccessor = function getAccessor(obj, propertyName) {
+ if (obj instanceof _aureliaPal.DOM.Element) {
+ if (propertyName === 'class' || propertyName === 'style' || propertyName === 'css' || propertyName === 'value' && (obj.tagName.toLowerCase() === 'input' || obj.tagName.toLowerCase() === 'select') || propertyName === 'checked' && obj.tagName.toLowerCase() === 'input' || propertyName === 'model' && obj.tagName.toLowerCase() === 'input' || /^xlink:.+$/.exec(propertyName)) {
+ return this.getObserver(obj, propertyName);
+ }
+ if (/^\w+:|^data-|^aria-/.test(propertyName) || obj instanceof _aureliaPal.DOM.SVGElement && this.svgAnalyzer.isStandardSvgAttribute(obj.nodeName, propertyName)) {
+ return dataAttributeAccessor;
+ }
+ }
+ return propertyAccessor;
+ };
+
+ ObserverLocator.prototype.getArrayObserver = function getArrayObserver(array) {
+ return _getArrayObserver(this.taskQueue, array);
+ };
+
+ ObserverLocator.prototype.getMapObserver = function getMapObserver(map) {
+ return _getMapObserver(this.taskQueue, map);
+ };
+
+ ObserverLocator.prototype.getSetObserver = function getSetObserver(set) {
+ return _getSetObserver(this.taskQueue, set);
+ };
+
+ return ObserverLocator;
+ }(), _class11.inject = [_aureliaTaskQueue.TaskQueue, EventManager, DirtyChecker, SVGAnalyzer, Parser], _temp);
+
+ var ObjectObservationAdapter = exports.ObjectObservationAdapter = function () {
+ function ObjectObservationAdapter() {
+
+ }
+
+ ObjectObservationAdapter.prototype.getObserver = function getObserver(object, propertyName, descriptor) {
+ throw new Error('BindingAdapters must implement getObserver(object, propertyName).');
+ };
+
+ return ObjectObservationAdapter;
+ }();
+
+ var BindingExpression = exports.BindingExpression = function () {
+ function BindingExpression(observerLocator, targetProperty, sourceExpression, mode, lookupFunctions, attribute) {
+
+
+ this.observerLocator = observerLocator;
+ this.targetProperty = targetProperty;
+ this.sourceExpression = sourceExpression;
+ this.mode = mode;
+ this.lookupFunctions = lookupFunctions;
+ this.attribute = attribute;
+ this.discrete = false;
+ }
+
+ BindingExpression.prototype.createBinding = function createBinding(target) {
+ return new Binding(this.observerLocator, this.sourceExpression, target, this.targetProperty, this.mode, this.lookupFunctions);
+ };
+
+ return BindingExpression;
+ }();
+
+ var targetContext = 'Binding:target';
+
+ var Binding = exports.Binding = (_dec10 = connectable(), _dec10(_class12 = function () {
+ function Binding(observerLocator, sourceExpression, target, targetProperty, mode, lookupFunctions) {
+
+
+ this.observerLocator = observerLocator;
+ this.sourceExpression = sourceExpression;
+ this.target = target;
+ this.targetProperty = targetProperty;
+ this.mode = mode;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ Binding.prototype.updateTarget = function updateTarget(value) {
+ this.targetObserver.setValue(value, this.target, this.targetProperty);
+ };
+
+ Binding.prototype.updateSource = function updateSource(value) {
+ this.sourceExpression.assign(this.source, value, this.lookupFunctions);
+ };
+
+ Binding.prototype.call = function call(context, newValue, oldValue) {
+ if (!this.isBound) {
+ return;
+ }
+ if (context === sourceContext) {
+ oldValue = this.targetObserver.getValue(this.target, this.targetProperty);
+ newValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);
+ if (newValue !== oldValue) {
+ this.updateTarget(newValue);
+ }
+ if (this.mode !== bindingMode.oneTime) {
+ this._version++;
+ this.sourceExpression.connect(this, this.source);
+ this.unobserve(false);
+ }
+ return;
+ }
+ if (context === targetContext) {
+ if (newValue !== this.sourceExpression.evaluate(this.source, this.lookupFunctions)) {
+ this.updateSource(newValue);
+ }
+ return;
+ }
+ throw new Error('Unexpected call context ' + context);
+ };
+
+ Binding.prototype.bind = function bind(source) {
+ if (this.isBound) {
+ if (this.source === source) {
+ return;
+ }
+ this.unbind();
+ }
+ this.isBound = true;
+ this.source = source;
+
+ if (this.sourceExpression.bind) {
+ this.sourceExpression.bind(this, source, this.lookupFunctions);
+ }
+
+ var mode = this.mode;
+ if (!this.targetObserver) {
+ var method = mode === bindingMode.twoWay ? 'getObserver' : 'getAccessor';
+ this.targetObserver = this.observerLocator[method](this.target, this.targetProperty);
+ }
+
+ if ('bind' in this.targetObserver) {
+ this.targetObserver.bind();
+ }
+ var value = this.sourceExpression.evaluate(source, this.lookupFunctions);
+ this.updateTarget(value);
+
+ if (mode === bindingMode.oneWay) {
+ enqueueBindingConnect(this);
+ } else if (mode === bindingMode.twoWay) {
+ this.sourceExpression.connect(this, source);
+ this.targetObserver.subscribe(targetContext, this);
+ }
+ };
+
+ Binding.prototype.unbind = function unbind() {
+ if (!this.isBound) {
+ return;
+ }
+ this.isBound = false;
+ if (this.sourceExpression.unbind) {
+ this.sourceExpression.unbind(this, this.source);
+ }
+ this.source = null;
+ if ('unbind' in this.targetObserver) {
+ this.targetObserver.unbind();
+ }
+ if (this.targetObserver.unsubscribe) {
+ this.targetObserver.unsubscribe(targetContext, this);
+ }
+ this.unobserve(true);
+ };
+
+ Binding.prototype.connect = function connect(evaluate) {
+ if (!this.isBound) {
+ return;
+ }
+ if (evaluate) {
+ var value = this.sourceExpression.evaluate(this.source, this.lookupFunctions);
+ this.updateTarget(value);
+ }
+ this.sourceExpression.connect(this, this.source);
+ };
+
+ return Binding;
+ }()) || _class12);
+
+ var CallExpression = exports.CallExpression = function () {
+ function CallExpression(observerLocator, targetProperty, sourceExpression, lookupFunctions) {
+
+
+ this.observerLocator = observerLocator;
+ this.targetProperty = targetProperty;
+ this.sourceExpression = sourceExpression;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ CallExpression.prototype.createBinding = function createBinding(target) {
+ return new Call(this.observerLocator, this.sourceExpression, target, this.targetProperty, this.lookupFunctions);
+ };
+
+ return CallExpression;
+ }();
+
+ var Call = exports.Call = function () {
+ function Call(observerLocator, sourceExpression, target, targetProperty, lookupFunctions) {
+
+
+ this.sourceExpression = sourceExpression;
+ this.target = target;
+ this.targetProperty = observerLocator.getObserver(target, targetProperty);
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ Call.prototype.callSource = function callSource($event) {
+ var overrideContext = this.source.overrideContext;
+ Object.assign(overrideContext, $event);
+ overrideContext.$event = $event;
+ var mustEvaluate = true;
+ var result = this.sourceExpression.evaluate(this.source, this.lookupFunctions, mustEvaluate);
+ delete overrideContext.$event;
+ for (var prop in $event) {
+ delete overrideContext[prop];
+ }
+ return result;
+ };
+
+ Call.prototype.bind = function bind(source) {
+ var _this27 = this;
+
+ if (this.isBound) {
+ if (this.source === source) {
+ return;
+ }
+ this.unbind();
+ }
+ this.isBound = true;
+ this.source = source;
+
+ if (this.sourceExpression.bind) {
+ this.sourceExpression.bind(this, source, this.lookupFunctions);
+ }
+ this.targetProperty.setValue(function ($event) {
+ return _this27.callSource($event);
+ });
+ };
+
+ Call.prototype.unbind = function unbind() {
+ if (!this.isBound) {
+ return;
+ }
+ this.isBound = false;
+ if (this.sourceExpression.unbind) {
+ this.sourceExpression.unbind(this, this.source);
+ }
+ this.source = null;
+ this.targetProperty.setValue(null);
+ };
+
+ return Call;
+ }();
+
+ var ValueConverterResource = exports.ValueConverterResource = function () {
+ function ValueConverterResource(name) {
+
+
+ this.name = name;
+ }
+
+ ValueConverterResource.convention = function convention(name) {
+ if (name.endsWith('ValueConverter')) {
+ return new ValueConverterResource(camelCase(name.substring(0, name.length - 14)));
+ }
+ };
+
+ ValueConverterResource.prototype.initialize = function initialize(container, target) {
+ this.instance = container.get(target);
+ };
+
+ ValueConverterResource.prototype.register = function register(registry, name) {
+ registry.registerValueConverter(name || this.name, this.instance);
+ };
+
+ ValueConverterResource.prototype.load = function load(container, target) {};
+
+ return ValueConverterResource;
+ }();
+
+ function valueConverter(nameOrTarget) {
+ if (nameOrTarget === undefined || typeof nameOrTarget === 'string') {
+ return function (target) {
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.resource, new ValueConverterResource(nameOrTarget), target);
+ };
+ }
+
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.resource, new ValueConverterResource(), nameOrTarget);
+ }
+
+ var BindingBehaviorResource = exports.BindingBehaviorResource = function () {
+ function BindingBehaviorResource(name) {
+
+
+ this.name = name;
+ }
+
+ BindingBehaviorResource.convention = function convention(name) {
+ if (name.endsWith('BindingBehavior')) {
+ return new BindingBehaviorResource(camelCase(name.substring(0, name.length - 15)));
+ }
+ };
+
+ BindingBehaviorResource.prototype.initialize = function initialize(container, target) {
+ this.instance = container.get(target);
+ };
+
+ BindingBehaviorResource.prototype.register = function register(registry, name) {
+ registry.registerBindingBehavior(name || this.name, this.instance);
+ };
+
+ BindingBehaviorResource.prototype.load = function load(container, target) {};
+
+ return BindingBehaviorResource;
+ }();
+
+ function bindingBehavior(nameOrTarget) {
+ if (nameOrTarget === undefined || typeof nameOrTarget === 'string') {
+ return function (target) {
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.resource, new BindingBehaviorResource(nameOrTarget), target);
+ };
+ }
+
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.resource, new BindingBehaviorResource(), nameOrTarget);
+ }
+
+ var ListenerExpression = exports.ListenerExpression = function () {
+ function ListenerExpression(eventManager, targetEvent, sourceExpression, delegate, preventDefault, lookupFunctions) {
+
+
+ this.eventManager = eventManager;
+ this.targetEvent = targetEvent;
+ this.sourceExpression = sourceExpression;
+ this.delegate = delegate;
+ this.discrete = true;
+ this.preventDefault = preventDefault;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ ListenerExpression.prototype.createBinding = function createBinding(target) {
+ return new Listener(this.eventManager, this.targetEvent, this.delegate, this.sourceExpression, target, this.preventDefault, this.lookupFunctions);
+ };
+
+ return ListenerExpression;
+ }();
+
+ var Listener = exports.Listener = function () {
+ function Listener(eventManager, targetEvent, delegate, sourceExpression, target, preventDefault, lookupFunctions) {
+
+
+ this.eventManager = eventManager;
+ this.targetEvent = targetEvent;
+ this.delegate = delegate;
+ this.sourceExpression = sourceExpression;
+ this.target = target;
+ this.preventDefault = preventDefault;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ Listener.prototype.callSource = function callSource(event) {
+ var overrideContext = this.source.overrideContext;
+ overrideContext.$event = event;
+ var mustEvaluate = true;
+ var result = this.sourceExpression.evaluate(this.source, this.lookupFunctions, mustEvaluate);
+ delete overrideContext.$event;
+ if (result !== true && this.preventDefault) {
+ event.preventDefault();
+ }
+ return result;
+ };
+
+ Listener.prototype.bind = function bind(source) {
+ var _this28 = this;
+
+ if (this.isBound) {
+ if (this.source === source) {
+ return;
+ }
+ this.unbind();
+ }
+ this.isBound = true;
+ this.source = source;
+
+ if (this.sourceExpression.bind) {
+ this.sourceExpression.bind(this, source, this.lookupFunctions);
+ }
+ this._disposeListener = this.eventManager.addEventListener(this.target, this.targetEvent, function (event) {
+ return _this28.callSource(event);
+ }, this.delegate);
+ };
+
+ Listener.prototype.unbind = function unbind() {
+ if (!this.isBound) {
+ return;
+ }
+ this.isBound = false;
+ if (this.sourceExpression.unbind) {
+ this.sourceExpression.unbind(this, this.source);
+ }
+ this.source = null;
+ this._disposeListener();
+ this._disposeListener = null;
+ };
+
+ return Listener;
+ }();
+
+ function getAU(element) {
+ var au = element.au;
+
+ if (au === undefined) {
+ throw new Error('No Aurelia APIs are defined for the element: "' + element.tagName + '".');
+ }
+
+ return au;
+ }
+
+ var NameExpression = exports.NameExpression = function () {
+ function NameExpression(sourceExpression, apiName, lookupFunctions) {
+
+
+ this.sourceExpression = sourceExpression;
+ this.apiName = apiName;
+ this.lookupFunctions = lookupFunctions;
+ this.discrete = true;
+ }
+
+ NameExpression.prototype.createBinding = function createBinding(target) {
+ return new NameBinder(this.sourceExpression, NameExpression.locateAPI(target, this.apiName), this.lookupFunctions);
+ };
+
+ NameExpression.locateAPI = function locateAPI(element, apiName) {
+ switch (apiName) {
+ case 'element':
+ return element;
+ case 'controller':
+ return getAU(element).controller;
+ case 'view-model':
+ return getAU(element).controller.viewModel;
+ case 'view':
+ return getAU(element).controller.view;
+ default:
+ var target = getAU(element)[apiName];
+
+ if (target === undefined) {
+ throw new Error('Attempted to reference "' + apiName + '", but it was not found amongst the target\'s API.');
+ }
+
+ return target.viewModel;
+ }
+ };
+
+ return NameExpression;
+ }();
+
+ var NameBinder = function () {
+ function NameBinder(sourceExpression, target, lookupFunctions) {
+
+
+ this.sourceExpression = sourceExpression;
+ this.target = target;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ NameBinder.prototype.bind = function bind(source) {
+ if (this.isBound) {
+ if (this.source === source) {
+ return;
+ }
+ this.unbind();
+ }
+ this.isBound = true;
+ this.source = source;
+ if (this.sourceExpression.bind) {
+ this.sourceExpression.bind(this, source, this.lookupFunctions);
+ }
+ this.sourceExpression.assign(this.source, this.target, this.lookupFunctions);
+ };
+
+ NameBinder.prototype.unbind = function unbind() {
+ if (!this.isBound) {
+ return;
+ }
+ this.isBound = false;
+ if (this.sourceExpression.evaluate(this.source, this.lookupFunctions) === this.target) {
+ this.sourceExpression.assign(this.source, null, this.lookupFunctions);
+ }
+ if (this.sourceExpression.unbind) {
+ this.sourceExpression.unbind(this, this.source);
+ }
+ this.source = null;
+ };
+
+ return NameBinder;
+ }();
+
+ var LookupFunctions = {
+ bindingBehaviors: function bindingBehaviors(name) {
+ return null;
+ },
+ valueConverters: function valueConverters(name) {
+ return null;
+ }
+ };
+
+ var BindingEngine = exports.BindingEngine = (_temp2 = _class13 = function () {
+ function BindingEngine(observerLocator, parser) {
+
+
+ this.observerLocator = observerLocator;
+ this.parser = parser;
+ }
+
+ BindingEngine.prototype.createBindingExpression = function createBindingExpression(targetProperty, sourceExpression) {
+ var mode = arguments.length <= 2 || arguments[2] === undefined ? bindingMode.oneWay : arguments[2];
+ var lookupFunctions = arguments.length <= 3 || arguments[3] === undefined ? LookupFunctions : arguments[3];
+
+ return new BindingExpression(this.observerLocator, targetProperty, this.parser.parse(sourceExpression), mode, lookupFunctions);
+ };
+
+ BindingEngine.prototype.propertyObserver = function propertyObserver(obj, propertyName) {
+ var _this29 = this;
+
+ return {
+ subscribe: function subscribe(callback) {
+ var observer = _this29.observerLocator.getObserver(obj, propertyName);
+ observer.subscribe(callback);
+ return {
+ dispose: function dispose() {
+ return observer.unsubscribe(callback);
+ }
+ };
+ }
+ };
+ };
+
+ BindingEngine.prototype.collectionObserver = function collectionObserver(collection) {
+ var _this30 = this;
+
+ return {
+ subscribe: function subscribe(callback) {
+ var observer = void 0;
+ if (collection instanceof Array) {
+ observer = _this30.observerLocator.getArrayObserver(collection);
+ } else if (collection instanceof Map) {
+ observer = _this30.observerLocator.getMapObserver(collection);
+ } else if (collection instanceof Set) {
+ observer = _this30.observerLocator.getSetObserver(collection);
+ } else {
+ throw new Error('collection must be an instance of Array, Map or Set.');
+ }
+ observer.subscribe(callback);
+ return {
+ dispose: function dispose() {
+ return observer.unsubscribe(callback);
+ }
+ };
+ }
+ };
+ };
+
+ BindingEngine.prototype.expressionObserver = function expressionObserver(bindingContext, expression) {
+ var scope = { bindingContext: bindingContext, overrideContext: createOverrideContext(bindingContext) };
+ return new ExpressionObserver(scope, this.parser.parse(expression), this.observerLocator, LookupFunctions);
+ };
+
+ BindingEngine.prototype.parseExpression = function parseExpression(expression) {
+ return this.parser.parse(expression);
+ };
+
+ BindingEngine.prototype.registerAdapter = function registerAdapter(adapter) {
+ this.observerLocator.addAdapter(adapter);
+ };
+
+ return BindingEngine;
+ }(), _class13.inject = [ObserverLocator, Parser], _temp2);
+
+
+ var setProto = Set.prototype;
+
+ function _getSetObserver(taskQueue, set) {
+ return ModifySetObserver.for(taskQueue, set);
+ }
+
+ exports.getSetObserver = _getSetObserver;
+
+ var ModifySetObserver = function (_ModifyCollectionObse3) {
+ _inherits(ModifySetObserver, _ModifyCollectionObse3);
+
+ function ModifySetObserver(taskQueue, set) {
+
+
+ return _possibleConstructorReturn(this, _ModifyCollectionObse3.call(this, taskQueue, set));
+ }
+
+ ModifySetObserver.for = function _for(taskQueue, set) {
+ if (!('__set_observer__' in set)) {
+ Reflect.defineProperty(set, '__set_observer__', {
+ value: ModifySetObserver.create(taskQueue, set),
+ enumerable: false, configurable: false
+ });
+ }
+ return set.__set_observer__;
+ };
+
+ ModifySetObserver.create = function create(taskQueue, set) {
+ var observer = new ModifySetObserver(taskQueue, set);
+
+ var proto = setProto;
+ if (proto.add !== set.add || proto.delete !== set.delete || proto.clear !== set.clear) {
+ proto = {
+ add: set.add,
+ delete: set.delete,
+ clear: set.clear
+ };
+ }
+
+ set.add = function () {
+ var type = 'add';
+ var oldSize = set.size;
+ var methodCallResult = proto.add.apply(set, arguments);
+ var hasValue = set.size === oldSize;
+ if (!hasValue) {
+ observer.addChangeRecord({
+ type: type,
+ object: set,
+ value: Array.from(set).pop()
+ });
+ }
+ return methodCallResult;
+ };
+
+ set.delete = function () {
+ var hasValue = set.has(arguments[0]);
+ var methodCallResult = proto.delete.apply(set, arguments);
+ if (hasValue) {
+ observer.addChangeRecord({
+ type: 'delete',
+ object: set,
+ value: arguments[0]
+ });
+ }
+ return methodCallResult;
+ };
+
+ set.clear = function () {
+ var methodCallResult = proto.clear.apply(set, arguments);
+ observer.addChangeRecord({
+ type: 'clear',
+ object: set
+ });
+ return methodCallResult;
+ };
+
+ return observer;
+ };
+
+ return ModifySetObserver;
+ }(ModifyCollectionObserver);
+
+ function observable(targetOrConfig, key, descriptor) {
+ function deco(target, key, descriptor, config) {
+ var isClassDecorator = key === undefined;
+ if (isClassDecorator) {
+ target = target.prototype;
+ key = typeof config === 'string' ? config : config.name;
+ }
+
+ var innerPropertyName = '_' + key;
+ var innerPropertyDescriptor = {
+ configurable: true,
+ enumerable: false,
+ writable: true
+ };
+
+ var callbackName = config && config.changeHandler || key + 'Changed';
+
+ if (descriptor) {
+ if (typeof descriptor.initializer === 'function') {
+ innerPropertyDescriptor.value = descriptor.initializer();
+ }
+ } else {
+ descriptor = {};
+ }
+
+ if (!('enumerable' in descriptor)) {
+ descriptor.enumerable = true;
+ }
+
+ delete descriptor.value;
+ delete descriptor.writable;
+ delete descriptor.initializer;
+
+ Reflect.defineProperty(target, innerPropertyName, innerPropertyDescriptor);
+
+ descriptor.get = function () {
+ return this[innerPropertyName];
+ };
+ descriptor.set = function (newValue) {
+ var oldValue = this[innerPropertyName];
+
+ this[innerPropertyName] = newValue;
+ Reflect.defineProperty(this, innerPropertyName, { enumerable: false });
+
+ if (this[callbackName]) {
+ this[callbackName](newValue, oldValue, key);
+ }
+ };
+
+ descriptor.get.dependencies = [innerPropertyName];
+
+ if (isClassDecorator) {
+ Reflect.defineProperty(target, key, descriptor);
+ } else {
+ return descriptor;
+ }
+ }
+
+ if (key === undefined) {
+ return function (t, k, d) {
+ return deco(t, k, d, targetOrConfig);
+ };
+ }
+ return deco(targetOrConfig, key, descriptor);
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/index.js
new file mode 100644
index 000000000..6b9aa29c9
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-binding@1.0.9/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-binding'], function (exports, _aureliaBinding) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaBinding).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaBinding[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0.js
new file mode 100644
index 000000000..6d23346b6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-bootstrapper@1.0.0/aurelia-bootstrapper"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/.jspm-hash
new file mode 100644
index 000000000..730785a4c
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+2c138c248f4c2e273bc2552e2efd7a0290341e3f99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/aurelia-bootstrapper.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/aurelia-bootstrapper.js
new file mode 100644
index 000000000..f8a7feabf
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/aurelia-bootstrapper.js
@@ -0,0 +1,146 @@
+/* */
+define(['exports', 'aurelia-pal', 'aurelia-pal-browser', 'aurelia-polyfills'], function (exports, _aureliaPal, _aureliaPalBrowser) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.bootstrap = bootstrap;
+
+
+ var bootstrapQueue = [];
+ var sharedLoader = null;
+ var Aurelia = null;
+
+ function onBootstrap(callback) {
+ return new Promise(function (resolve, reject) {
+ if (sharedLoader) {
+ resolve(callback(sharedLoader));
+ } else {
+ bootstrapQueue.push(function () {
+ try {
+ resolve(callback(sharedLoader));
+ } catch (e) {
+ reject(e);
+ }
+ });
+ }
+ });
+ }
+
+ function ready(global) {
+ return new Promise(function (resolve, reject) {
+ if (global.document.readyState === 'complete') {
+ resolve(global.document);
+ } else {
+ global.document.addEventListener('DOMContentLoaded', completed);
+ global.addEventListener('load', completed);
+ }
+
+ function completed() {
+ global.document.removeEventListener('DOMContentLoaded', completed);
+ global.removeEventListener('load', completed);
+ resolve(global.document);
+ }
+ });
+ }
+
+ function createLoader() {
+ if (_aureliaPal.PLATFORM.Loader) {
+ return Promise.resolve(new _aureliaPal.PLATFORM.Loader());
+ }
+
+ if (window.System && typeof window.System.import === 'function') {
+ return System.normalize('aurelia-bootstrapper').then(function (bootstrapperName) {
+ return System.normalize('aurelia-loader-default', bootstrapperName);
+ }).then(function (loaderName) {
+ return System.import(loaderName).then(function (m) {
+ return new m.DefaultLoader();
+ });
+ });
+ }
+
+ if (typeof window.require === 'function') {
+ return new Promise(function (resolve, reject) {
+ return require(['aurelia-loader-default'], function (m) {
+ return resolve(new m.DefaultLoader());
+ }, reject);
+ });
+ }
+
+ return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');
+ }
+
+ function preparePlatform(loader) {
+ return loader.normalize('aurelia-bootstrapper').then(function (bootstrapperName) {
+ return loader.normalize('aurelia-framework', bootstrapperName).then(function (frameworkName) {
+ loader.map('aurelia-framework', frameworkName);
+
+ return Promise.all([loader.normalize('aurelia-dependency-injection', frameworkName).then(function (diName) {
+ return loader.map('aurelia-dependency-injection', diName);
+ }), loader.normalize('aurelia-router', bootstrapperName).then(function (routerName) {
+ return loader.map('aurelia-router', routerName);
+ }), loader.normalize('aurelia-logging-console', bootstrapperName).then(function (loggingConsoleName) {
+ return loader.map('aurelia-logging-console', loggingConsoleName);
+ })]).then(function () {
+ return loader.loadModule(frameworkName).then(function (m) {
+ return Aurelia = m.Aurelia;
+ });
+ });
+ });
+ });
+ }
+
+ function handleApp(loader, appHost) {
+ var moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app');
+ return config(loader, appHost, moduleId);
+ }
+
+ function config(loader, appHost, configModuleId) {
+ var aurelia = new Aurelia(loader);
+ aurelia.host = appHost;
+ aurelia.configModuleId = configModuleId || null;
+
+ if (configModuleId) {
+ return loader.loadModule(configModuleId).then(function (customConfig) {
+ return customConfig.configure(aurelia);
+ });
+ }
+
+ aurelia.use.standardConfiguration().developmentLogging();
+
+ return aurelia.start().then(function () {
+ return aurelia.setRoot();
+ });
+ }
+
+ function run() {
+ return ready(window).then(function (doc) {
+ (0, _aureliaPalBrowser.initialize)();
+
+ var appHost = doc.querySelectorAll('[aurelia-app],[data-aurelia-app]');
+ return createLoader().then(function (loader) {
+ return preparePlatform(loader).then(function () {
+ for (var i = 0, ii = appHost.length; i < ii; ++i) {
+ handleApp(loader, appHost[i]).catch(console.error.bind(console));
+ }
+
+ sharedLoader = loader;
+ for (var _i = 0, _ii = bootstrapQueue.length; _i < _ii; ++_i) {
+ bootstrapQueue[_i]();
+ }
+ bootstrapQueue = null;
+ });
+ });
+ });
+ }
+
+ function bootstrap(configure) {
+ return onBootstrap(function (loader) {
+ var aurelia = new Aurelia(loader);
+ return configure(aurelia);
+ });
+ }
+
+ run();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/index.js
new file mode 100644
index 000000000..368b42029
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-bootstrapper@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-bootstrapper'], function (exports, _aureliaBootstrapper) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaBootstrapper).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaBootstrapper[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0.js
new file mode 100644
index 000000000..e9b84129a
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-dependency-injection@1.1.0/aurelia-dependency-injection"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/.jspm-hash
new file mode 100644
index 000000000..567812c0b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/.jspm-hash
@@ -0,0 +1 @@
+1bbcfa24df34acd87e77f63edd108a592e8878cc99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/aurelia-dependency-injection.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/aurelia-dependency-injection.js
new file mode 100644
index 000000000..05bc89016
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/aurelia-dependency-injection.js
@@ -0,0 +1,746 @@
+/* */
+define(['exports', 'aurelia-metadata', 'aurelia-pal'], function (exports, _aureliaMetadata, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.Container = exports.InvocationHandler = exports._emptyParameters = exports.SingletonRegistration = exports.TransientRegistration = exports.FactoryInvoker = exports.NewInstance = exports.Factory = exports.StrategyResolver = exports.Parent = exports.Optional = exports.All = exports.Lazy = exports.resolver = undefined;
+ exports.getDecoratorDependencies = getDecoratorDependencies;
+ exports.lazy = lazy;
+ exports.all = all;
+ exports.optional = optional;
+ exports.parent = parent;
+ exports.factory = factory;
+ exports.newInstance = newInstance;
+ exports.invoker = invoker;
+ exports.factory = factory;
+ exports.registration = registration;
+ exports.transient = transient;
+ exports.singleton = singleton;
+ exports.autoinject = autoinject;
+ exports.inject = inject;
+
+
+
+ var _dec, _class, _dec2, _class3, _dec3, _class5, _dec4, _class7, _dec5, _class9, _dec6, _class11, _dec7, _class13, _classInvokers;
+
+ var resolver = exports.resolver = _aureliaMetadata.protocol.create('aurelia:resolver', function (target) {
+ if (!(typeof target.get === 'function')) {
+ return 'Resolvers must implement: get(container: Container, key: any): any';
+ }
+
+ return true;
+ });
+
+ var Lazy = exports.Lazy = (_dec = resolver(), _dec(_class = function () {
+ function Lazy(key) {
+
+
+ this._key = key;
+ }
+
+ Lazy.prototype.get = function get(container) {
+ var _this = this;
+
+ return function () {
+ return container.get(_this._key);
+ };
+ };
+
+ Lazy.of = function of(key) {
+ return new Lazy(key);
+ };
+
+ return Lazy;
+ }()) || _class);
+ var All = exports.All = (_dec2 = resolver(), _dec2(_class3 = function () {
+ function All(key) {
+
+
+ this._key = key;
+ }
+
+ All.prototype.get = function get(container) {
+ return container.getAll(this._key);
+ };
+
+ All.of = function of(key) {
+ return new All(key);
+ };
+
+ return All;
+ }()) || _class3);
+ var Optional = exports.Optional = (_dec3 = resolver(), _dec3(_class5 = function () {
+ function Optional(key) {
+ var checkParent = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+
+
+ this._key = key;
+ this._checkParent = checkParent;
+ }
+
+ Optional.prototype.get = function get(container) {
+ if (container.hasResolver(this._key, this._checkParent)) {
+ return container.get(this._key);
+ }
+
+ return null;
+ };
+
+ Optional.of = function of(key) {
+ var checkParent = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
+
+ return new Optional(key, checkParent);
+ };
+
+ return Optional;
+ }()) || _class5);
+ var Parent = exports.Parent = (_dec4 = resolver(), _dec4(_class7 = function () {
+ function Parent(key) {
+
+
+ this._key = key;
+ }
+
+ Parent.prototype.get = function get(container) {
+ return container.parent ? container.parent.get(this._key) : null;
+ };
+
+ Parent.of = function of(key) {
+ return new Parent(key);
+ };
+
+ return Parent;
+ }()) || _class7);
+ var StrategyResolver = exports.StrategyResolver = (_dec5 = resolver(), _dec5(_class9 = function () {
+ function StrategyResolver(strategy, state) {
+
+
+ this.strategy = strategy;
+ this.state = state;
+ }
+
+ StrategyResolver.prototype.get = function get(container, key) {
+ switch (this.strategy) {
+ case 0:
+ return this.state;
+ case 1:
+ var singleton = container.invoke(this.state);
+ this.state = singleton;
+ this.strategy = 0;
+ return singleton;
+ case 2:
+ return container.invoke(this.state);
+ case 3:
+ return this.state(container, key, this);
+ case 4:
+ return this.state[0].get(container, key);
+ case 5:
+ return container.get(this.state);
+ default:
+ throw new Error('Invalid strategy: ' + this.strategy);
+ }
+ };
+
+ return StrategyResolver;
+ }()) || _class9);
+ var Factory = exports.Factory = (_dec6 = resolver(), _dec6(_class11 = function () {
+ function Factory(key) {
+
+
+ this._key = key;
+ }
+
+ Factory.prototype.get = function get(container) {
+ var _this2 = this;
+
+ return function () {
+ for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
+ rest[_key] = arguments[_key];
+ }
+
+ return container.invoke(_this2._key, rest);
+ };
+ };
+
+ Factory.of = function of(key) {
+ return new Factory(key);
+ };
+
+ return Factory;
+ }()) || _class11);
+ var NewInstance = exports.NewInstance = (_dec7 = resolver(), _dec7(_class13 = function () {
+ function NewInstance(key) {
+
+
+ this.key = key;
+ this.asKey = key;
+
+ for (var _len2 = arguments.length, dynamicDependencies = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ dynamicDependencies[_key2 - 1] = arguments[_key2];
+ }
+
+ this.dynamicDependencies = dynamicDependencies;
+ }
+
+ NewInstance.prototype.get = function get(container) {
+ var dynamicDependencies = this.dynamicDependencies.length > 0 ? this.dynamicDependencies.map(function (dependency) {
+ return dependency['protocol:aurelia:resolver'] ? dependency.get(container) : container.get(dependency);
+ }) : undefined;
+ var instance = container.invoke(this.key, dynamicDependencies);
+ container.registerInstance(this.asKey, instance);
+ return instance;
+ };
+
+ NewInstance.prototype.as = function as(key) {
+ this.asKey = key;
+ return this;
+ };
+
+ NewInstance.of = function of(key) {
+ for (var _len3 = arguments.length, dynamicDependencies = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+ dynamicDependencies[_key3 - 1] = arguments[_key3];
+ }
+
+ return new (Function.prototype.bind.apply(NewInstance, [null].concat([key], dynamicDependencies)))();
+ };
+
+ return NewInstance;
+ }()) || _class13);
+ function getDecoratorDependencies(target, name) {
+ var dependencies = target.inject;
+ if (typeof dependencies === 'function') {
+ throw new Error('Decorator ' + name + ' cannot be used with "inject()". Please use an array instead.');
+ }
+ if (!dependencies) {
+ dependencies = _aureliaMetadata.metadata.getOwn(_aureliaMetadata.metadata.paramTypes, target).slice();
+ target.inject = dependencies;
+ }
+
+ return dependencies;
+ }
+
+ function lazy(keyValue) {
+ return function (target, key, index) {
+ var params = getDecoratorDependencies(target, 'lazy');
+ params[index] = Lazy.of(keyValue);
+ };
+ }
+
+ function all(keyValue) {
+ return function (target, key, index) {
+ var params = getDecoratorDependencies(target, 'all');
+ params[index] = All.of(keyValue);
+ };
+ }
+
+ function optional() {
+ var checkParentOrTarget = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
+
+ var deco = function deco(checkParent) {
+ return function (target, key, index) {
+ var params = getDecoratorDependencies(target, 'optional');
+ params[index] = Optional.of(params[index], checkParent);
+ };
+ };
+ if (typeof checkParentOrTarget === 'boolean') {
+ return deco(checkParentOrTarget);
+ }
+ return deco(true);
+ }
+
+ function parent(target, key, index) {
+ var params = getDecoratorDependencies(target, 'parent');
+ params[index] = Parent.of(params[index]);
+ }
+
+ function factory(keyValue, asValue) {
+ return function (target, key, index) {
+ var params = getDecoratorDependencies(target, 'factory');
+ var factory = Factory.of(keyValue);
+ params[index] = asValue ? factory.as(asValue) : factory;
+ };
+ }
+
+ function newInstance(asKeyOrTarget) {
+ for (var _len4 = arguments.length, dynamicDependencies = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
+ dynamicDependencies[_key4 - 1] = arguments[_key4];
+ }
+
+ var deco = function deco(asKey) {
+ return function (target, key, index) {
+ var params = getDecoratorDependencies(target, 'newInstance');
+ params[index] = NewInstance.of.apply(NewInstance, [params[index]].concat(dynamicDependencies));
+ if (!!asKey) {
+ params[index].as(asKey);
+ }
+ };
+ };
+ if (arguments.length >= 1) {
+ return deco(asKeyOrTarget);
+ }
+ return deco();
+ }
+
+ function invoker(value) {
+ return function (target) {
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.invoker, value, target);
+ };
+ }
+
+ function factory(potentialTarget) {
+ var deco = function deco(target) {
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.invoker, FactoryInvoker.instance, target);
+ };
+
+ return potentialTarget ? deco(potentialTarget) : deco;
+ }
+
+ var FactoryInvoker = exports.FactoryInvoker = function () {
+ function FactoryInvoker() {
+
+ }
+
+ FactoryInvoker.prototype.invoke = function invoke(container, fn, dependencies) {
+ var i = dependencies.length;
+ var args = new Array(i);
+
+ while (i--) {
+ args[i] = container.get(dependencies[i]);
+ }
+
+ return fn.apply(undefined, args);
+ };
+
+ FactoryInvoker.prototype.invokeWithDynamicDependencies = function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) {
+ var i = staticDependencies.length;
+ var args = new Array(i);
+
+ while (i--) {
+ args[i] = container.get(staticDependencies[i]);
+ }
+
+ if (dynamicDependencies !== undefined) {
+ args = args.concat(dynamicDependencies);
+ }
+
+ return fn.apply(undefined, args);
+ };
+
+ return FactoryInvoker;
+ }();
+
+ FactoryInvoker.instance = new FactoryInvoker();
+
+ function registration(value) {
+ return function (target) {
+ _aureliaMetadata.metadata.define(_aureliaMetadata.metadata.registration, value, target);
+ };
+ }
+
+ function transient(key) {
+ return registration(new TransientRegistration(key));
+ }
+
+ function singleton(keyOrRegisterInChild) {
+ var registerInChild = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild));
+ }
+
+ var TransientRegistration = exports.TransientRegistration = function () {
+ function TransientRegistration(key) {
+
+
+ this._key = key;
+ }
+
+ TransientRegistration.prototype.registerResolver = function registerResolver(container, key, fn) {
+ return container.registerTransient(this._key || key, fn);
+ };
+
+ return TransientRegistration;
+ }();
+
+ var SingletonRegistration = exports.SingletonRegistration = function () {
+ function SingletonRegistration(keyOrRegisterInChild) {
+ var registerInChild = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+
+
+ if (typeof keyOrRegisterInChild === 'boolean') {
+ this._registerInChild = keyOrRegisterInChild;
+ } else {
+ this._key = keyOrRegisterInChild;
+ this._registerInChild = registerInChild;
+ }
+ }
+
+ SingletonRegistration.prototype.registerResolver = function registerResolver(container, key, fn) {
+ return this._registerInChild ? container.registerSingleton(this._key || key, fn) : container.root.registerSingleton(this._key || key, fn);
+ };
+
+ return SingletonRegistration;
+ }();
+
+ function validateKey(key) {
+ if (key === null || key === undefined) {
+ throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\'t exist with DI?');
+ }
+ }
+ var _emptyParameters = exports._emptyParameters = Object.freeze([]);
+
+ _aureliaMetadata.metadata.registration = 'aurelia:registration';
+ _aureliaMetadata.metadata.invoker = 'aurelia:invoker';
+
+ var resolverDecorates = resolver.decorates;
+
+ var InvocationHandler = exports.InvocationHandler = function () {
+ function InvocationHandler(fn, invoker, dependencies) {
+
+
+ this.fn = fn;
+ this.invoker = invoker;
+ this.dependencies = dependencies;
+ }
+
+ InvocationHandler.prototype.invoke = function invoke(container, dynamicDependencies) {
+ return dynamicDependencies !== undefined ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies) : this.invoker.invoke(container, this.fn, this.dependencies);
+ };
+
+ return InvocationHandler;
+ }();
+
+ function invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) {
+ var i = staticDependencies.length;
+ var args = new Array(i);
+
+ while (i--) {
+ args[i] = container.get(staticDependencies[i]);
+ }
+
+ if (dynamicDependencies !== undefined) {
+ args = args.concat(dynamicDependencies);
+ }
+
+ return Reflect.construct(fn, args);
+ }
+
+ var classInvokers = (_classInvokers = {}, _classInvokers[0] = {
+ invoke: function invoke(container, Type) {
+ return new Type();
+ },
+
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers[1] = {
+ invoke: function invoke(container, Type, deps) {
+ return new Type(container.get(deps[0]));
+ },
+
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers[2] = {
+ invoke: function invoke(container, Type, deps) {
+ return new Type(container.get(deps[0]), container.get(deps[1]));
+ },
+
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers[3] = {
+ invoke: function invoke(container, Type, deps) {
+ return new Type(container.get(deps[0]), container.get(deps[1]), container.get(deps[2]));
+ },
+
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers[4] = {
+ invoke: function invoke(container, Type, deps) {
+ return new Type(container.get(deps[0]), container.get(deps[1]), container.get(deps[2]), container.get(deps[3]));
+ },
+
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers[5] = {
+ invoke: function invoke(container, Type, deps) {
+ return new Type(container.get(deps[0]), container.get(deps[1]), container.get(deps[2]), container.get(deps[3]), container.get(deps[4]));
+ },
+
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers.fallback = {
+ invoke: invokeWithDynamicDependencies,
+ invokeWithDynamicDependencies: invokeWithDynamicDependencies
+ }, _classInvokers);
+
+ function getDependencies(f) {
+ if (!f.hasOwnProperty('inject')) {
+ return [];
+ }
+
+ if (typeof f.inject === 'function') {
+ return f.inject();
+ }
+
+ return f.inject;
+ }
+
+ var Container = exports.Container = function () {
+ function Container(configuration) {
+
+
+ if (configuration === undefined) {
+ configuration = {};
+ }
+
+ this._configuration = configuration;
+ this._onHandlerCreated = configuration.onHandlerCreated;
+ this._handlers = configuration.handlers || (configuration.handlers = new Map());
+ this._resolvers = new Map();
+ this.root = this;
+ this.parent = null;
+ }
+
+ Container.prototype.makeGlobal = function makeGlobal() {
+ Container.instance = this;
+ return this;
+ };
+
+ Container.prototype.setHandlerCreatedCallback = function setHandlerCreatedCallback(onHandlerCreated) {
+ this._onHandlerCreated = onHandlerCreated;
+ this._configuration.onHandlerCreated = onHandlerCreated;
+ };
+
+ Container.prototype.registerInstance = function registerInstance(key, instance) {
+ return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance));
+ };
+
+ Container.prototype.registerSingleton = function registerSingleton(key, fn) {
+ return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn));
+ };
+
+ Container.prototype.registerTransient = function registerTransient(key, fn) {
+ return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn));
+ };
+
+ Container.prototype.registerHandler = function registerHandler(key, handler) {
+ return this.registerResolver(key, new StrategyResolver(3, handler));
+ };
+
+ Container.prototype.registerAlias = function registerAlias(originalKey, aliasKey) {
+ return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey));
+ };
+
+ Container.prototype.registerResolver = function registerResolver(key, resolver) {
+ validateKey(key);
+
+ var allResolvers = this._resolvers;
+ var result = allResolvers.get(key);
+
+ if (result === undefined) {
+ allResolvers.set(key, resolver);
+ } else if (result.strategy === 4) {
+ result.state.push(resolver);
+ } else {
+ allResolvers.set(key, new StrategyResolver(4, [result, resolver]));
+ }
+
+ return resolver;
+ };
+
+ Container.prototype.autoRegister = function autoRegister(key, fn) {
+ fn = fn === undefined ? key : fn;
+
+ if (typeof fn === 'function') {
+ var _registration = _aureliaMetadata.metadata.get(_aureliaMetadata.metadata.registration, fn);
+
+ if (_registration === undefined) {
+ return this.registerResolver(key, new StrategyResolver(1, fn));
+ }
+
+ return _registration.registerResolver(this, key, fn);
+ }
+
+ return this.registerResolver(key, new StrategyResolver(0, fn));
+ };
+
+ Container.prototype.autoRegisterAll = function autoRegisterAll(fns) {
+ var i = fns.length;
+ while (i--) {
+ this.autoRegister(fns[i]);
+ }
+ };
+
+ Container.prototype.unregister = function unregister(key) {
+ this._resolvers.delete(key);
+ };
+
+ Container.prototype.hasResolver = function hasResolver(key) {
+ var checkParent = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
+
+ validateKey(key);
+
+ return this._resolvers.has(key) || checkParent && this.parent !== null && this.parent.hasResolver(key, checkParent);
+ };
+
+ Container.prototype.get = function get(key) {
+ validateKey(key);
+
+ if (key === Container) {
+ return this;
+ }
+
+ if (resolverDecorates(key)) {
+ return key.get(this, key);
+ }
+
+ var resolver = this._resolvers.get(key);
+
+ if (resolver === undefined) {
+ if (this.parent === null) {
+ return this.autoRegister(key).get(this, key);
+ }
+
+ return this.parent._get(key);
+ }
+
+ return resolver.get(this, key);
+ };
+
+ Container.prototype._get = function _get(key) {
+ var resolver = this._resolvers.get(key);
+
+ if (resolver === undefined) {
+ if (this.parent === null) {
+ return this.autoRegister(key).get(this, key);
+ }
+
+ return this.parent._get(key);
+ }
+
+ return resolver.get(this, key);
+ };
+
+ Container.prototype.getAll = function getAll(key) {
+ validateKey(key);
+
+ var resolver = this._resolvers.get(key);
+
+ if (resolver === undefined) {
+ if (this.parent === null) {
+ return _emptyParameters;
+ }
+
+ return this.parent.getAll(key);
+ }
+
+ if (resolver.strategy === 4) {
+ var state = resolver.state;
+ var i = state.length;
+ var results = new Array(i);
+
+ while (i--) {
+ results[i] = state[i].get(this, key);
+ }
+
+ return results;
+ }
+
+ return [resolver.get(this, key)];
+ };
+
+ Container.prototype.createChild = function createChild() {
+ var child = new Container(this._configuration);
+ child.root = this.root;
+ child.parent = this;
+ return child;
+ };
+
+ Container.prototype.invoke = function invoke(fn, dynamicDependencies) {
+ try {
+ var _handler = this._handlers.get(fn);
+
+ if (_handler === undefined) {
+ _handler = this._createInvocationHandler(fn);
+ this._handlers.set(fn, _handler);
+ }
+
+ return _handler.invoke(this, dynamicDependencies);
+ } catch (e) {
+ throw new _aureliaPal.AggregateError('Error invoking ' + fn.name + '. Check the inner error for details.', e, true);
+ }
+ };
+
+ Container.prototype._createInvocationHandler = function _createInvocationHandler(fn) {
+ var dependencies = void 0;
+
+ if (fn.inject === undefined) {
+ dependencies = _aureliaMetadata.metadata.getOwn(_aureliaMetadata.metadata.paramTypes, fn) || _emptyParameters;
+ } else {
+ dependencies = [];
+ var ctor = fn;
+ while (typeof ctor === 'function') {
+ var _dependencies;
+
+ (_dependencies = dependencies).push.apply(_dependencies, getDependencies(ctor));
+ ctor = Object.getPrototypeOf(ctor);
+ }
+ }
+
+ var invoker = _aureliaMetadata.metadata.getOwn(_aureliaMetadata.metadata.invoker, fn) || classInvokers[dependencies.length] || classInvokers.fallback;
+
+ var handler = new InvocationHandler(fn, invoker, dependencies);
+ return this._onHandlerCreated !== undefined ? this._onHandlerCreated(handler) : handler;
+ };
+
+ return Container;
+ }();
+
+ function autoinject(potentialTarget) {
+ var deco = function deco(target) {
+ var previousInject = target.inject;
+ var autoInject = _aureliaMetadata.metadata.getOwn(_aureliaMetadata.metadata.paramTypes, target) || _emptyParameters;
+ if (!previousInject) {
+ target.inject = autoInject;
+ } else {
+ for (var i = 0; i < autoInject.length; i++) {
+ if (previousInject[i] && previousInject[i] !== autoInject[i]) {
+ var prevIndex = previousInject.indexOf(autoInject[i]);
+ if (prevIndex > -1) {
+ previousInject.splice(prevIndex, 1);
+ previousInject.splice(prevIndex > -1 && prevIndex < i ? i - 1 : i, 0, autoInject[i]);
+ } else if (!previousInject[i]) {
+ previousInject[i] = autoInject[i];
+ }
+ }
+ }
+ }
+ };
+
+ return potentialTarget ? deco(potentialTarget) : deco;
+ }
+
+ function inject() {
+ for (var _len5 = arguments.length, rest = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
+ rest[_key5] = arguments[_key5];
+ }
+
+ return function (target, key, descriptor) {
+ if (typeof descriptor === 'number' && rest.length === 1) {
+ var params = target.inject;
+ if (typeof params === 'function') {
+ throw new Error('Decorator inject cannot be used with "inject()". Please use an array instead.');
+ }
+ if (!params) {
+ params = _aureliaMetadata.metadata.getOwn(_aureliaMetadata.metadata.paramTypes, target).slice();
+ target.inject = params;
+ }
+ params[descriptor] = rest[0];
+ return;
+ }
+
+ if (descriptor) {
+ var _fn = descriptor.value;
+ _fn.inject = rest;
+ } else {
+ target.inject = rest;
+ }
+ };
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/index.js
new file mode 100644
index 000000000..ca66d5fa2
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-dependency-injection@1.1.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-dependency-injection'], function (exports, _aureliaDependencyInjection) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaDependencyInjection).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaDependencyInjection[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0.js
new file mode 100644
index 000000000..6911edc10
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-event-aggregator@1.0.0/aurelia-event-aggregator"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/.jspm-hash
new file mode 100644
index 000000000..c5a59f172
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+762cf9e3420d8c98a8c5dc1e7b12376f281acc9c99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/aurelia-event-aggregator.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/aurelia-event-aggregator.js
new file mode 100644
index 000000000..d6b1a847b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/aurelia-event-aggregator.js
@@ -0,0 +1,157 @@
+/* */
+define(['exports', 'aurelia-logging'], function (exports, _aureliaLogging) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.EventAggregator = undefined;
+ exports.includeEventsIn = includeEventsIn;
+ exports.configure = configure;
+
+ var LogManager = _interopRequireWildcard(_aureliaLogging);
+
+ function _interopRequireWildcard(obj) {
+ if (obj && obj.__esModule) {
+ return obj;
+ } else {
+ var newObj = {};
+
+ if (obj != null) {
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
+ }
+ }
+
+ newObj.default = obj;
+ return newObj;
+ }
+ }
+
+
+
+ var logger = LogManager.getLogger('event-aggregator');
+
+ var Handler = function () {
+ function Handler(messageType, callback) {
+
+
+ this.messageType = messageType;
+ this.callback = callback;
+ }
+
+ Handler.prototype.handle = function handle(message) {
+ if (message instanceof this.messageType) {
+ this.callback.call(null, message);
+ }
+ };
+
+ return Handler;
+ }();
+
+ var EventAggregator = exports.EventAggregator = function () {
+ function EventAggregator() {
+
+
+ this.eventLookup = {};
+ this.messageHandlers = [];
+ }
+
+ EventAggregator.prototype.publish = function publish(event, data) {
+ var subscribers = void 0;
+ var i = void 0;
+
+ if (!event) {
+ throw new Error('Event was invalid.');
+ }
+
+ if (typeof event === 'string') {
+ subscribers = this.eventLookup[event];
+ if (subscribers) {
+ subscribers = subscribers.slice();
+ i = subscribers.length;
+
+ try {
+ while (i--) {
+ subscribers[i](data, event);
+ }
+ } catch (e) {
+ logger.error(e);
+ }
+ }
+ } else {
+ subscribers = this.messageHandlers.slice();
+ i = subscribers.length;
+
+ try {
+ while (i--) {
+ subscribers[i].handle(event);
+ }
+ } catch (e) {
+ logger.error(e);
+ }
+ }
+ };
+
+ EventAggregator.prototype.subscribe = function subscribe(event, callback) {
+ var handler = void 0;
+ var subscribers = void 0;
+
+ if (!event) {
+ throw new Error('Event channel/type was invalid.');
+ }
+
+ if (typeof event === 'string') {
+ handler = callback;
+ subscribers = this.eventLookup[event] || (this.eventLookup[event] = []);
+ } else {
+ handler = new Handler(event, callback);
+ subscribers = this.messageHandlers;
+ }
+
+ subscribers.push(handler);
+
+ return {
+ dispose: function dispose() {
+ var idx = subscribers.indexOf(handler);
+ if (idx !== -1) {
+ subscribers.splice(idx, 1);
+ }
+ }
+ };
+ };
+
+ EventAggregator.prototype.subscribeOnce = function subscribeOnce(event, callback) {
+ var sub = this.subscribe(event, function (a, b) {
+ sub.dispose();
+ return callback(a, b);
+ });
+
+ return sub;
+ };
+
+ return EventAggregator;
+ }();
+
+ function includeEventsIn(obj) {
+ var ea = new EventAggregator();
+
+ obj.subscribeOnce = function (event, callback) {
+ return ea.subscribeOnce(event, callback);
+ };
+
+ obj.subscribe = function (event, callback) {
+ return ea.subscribe(event, callback);
+ };
+
+ obj.publish = function (event, data) {
+ ea.publish(event, data);
+ };
+
+ return ea;
+ }
+
+ function configure(config) {
+ config.instance(EventAggregator, includeEventsIn(config.aurelia));
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/index.js
new file mode 100644
index 000000000..8cf413832
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-event-aggregator@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-event-aggregator'], function (exports, _aureliaEventAggregator) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaEventAggregator).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaEventAggregator[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1.js
new file mode 100644
index 000000000..9818addad
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-fetch-client@1.0.1/aurelia-fetch-client"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/.jspm-hash
new file mode 100644
index 000000000..ce8c78c1a
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/.jspm-hash
@@ -0,0 +1 @@
+ae61c42a6aa9567e8c64e6e7c4c22237a47b077299914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/aurelia-fetch-client.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/aurelia-fetch-client.js
new file mode 100644
index 000000000..6aeabde8f
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/aurelia-fetch-client.js
@@ -0,0 +1,256 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.json = json;
+
+ 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;
+ };
+
+
+
+ function json(body) {
+ return new Blob([JSON.stringify(body)], { type: 'application/json' });
+ }
+
+ var HttpClientConfiguration = exports.HttpClientConfiguration = function () {
+ function HttpClientConfiguration() {
+
+
+ this.baseUrl = '';
+ this.defaults = {};
+ this.interceptors = [];
+ }
+
+ HttpClientConfiguration.prototype.withBaseUrl = function withBaseUrl(baseUrl) {
+ this.baseUrl = baseUrl;
+ return this;
+ };
+
+ HttpClientConfiguration.prototype.withDefaults = function withDefaults(defaults) {
+ this.defaults = defaults;
+ return this;
+ };
+
+ HttpClientConfiguration.prototype.withInterceptor = function withInterceptor(interceptor) {
+ this.interceptors.push(interceptor);
+ return this;
+ };
+
+ HttpClientConfiguration.prototype.useStandardConfiguration = function useStandardConfiguration() {
+ var standardConfig = { credentials: 'same-origin' };
+ Object.assign(this.defaults, standardConfig, this.defaults);
+ return this.rejectErrorResponses();
+ };
+
+ HttpClientConfiguration.prototype.rejectErrorResponses = function rejectErrorResponses() {
+ return this.withInterceptor({ response: rejectOnError });
+ };
+
+ return HttpClientConfiguration;
+ }();
+
+ function rejectOnError(response) {
+ if (!response.ok) {
+ throw response;
+ }
+
+ return response;
+ }
+
+ var HttpClient = exports.HttpClient = function () {
+ function HttpClient() {
+
+
+ this.activeRequestCount = 0;
+ this.isRequesting = false;
+ this.isConfigured = false;
+ this.baseUrl = '';
+ this.defaults = null;
+ this.interceptors = [];
+
+ if (typeof fetch === 'undefined') {
+ throw new Error('HttpClient requires a Fetch API implementation, but the current environment doesn\'t support it. You may need to load a polyfill such as https://github.com/github/fetch.');
+ }
+ }
+
+ HttpClient.prototype.configure = function configure(config) {
+ var _interceptors;
+
+ var normalizedConfig = void 0;
+
+ if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') {
+ normalizedConfig = { defaults: config };
+ } else if (typeof config === 'function') {
+ normalizedConfig = new HttpClientConfiguration();
+ var c = config(normalizedConfig);
+ if (HttpClientConfiguration.prototype.isPrototypeOf(c)) {
+ normalizedConfig = c;
+ }
+ } else {
+ throw new Error('invalid config');
+ }
+
+ var defaults = normalizedConfig.defaults;
+ if (defaults && Headers.prototype.isPrototypeOf(defaults.headers)) {
+ throw new Error('Default headers must be a plain object.');
+ }
+
+ this.baseUrl = normalizedConfig.baseUrl;
+ this.defaults = defaults;
+ (_interceptors = this.interceptors).push.apply(_interceptors, normalizedConfig.interceptors || []);
+ this.isConfigured = true;
+
+ return this;
+ };
+
+ HttpClient.prototype.fetch = function (_fetch) {
+ function fetch(_x, _x2) {
+ return _fetch.apply(this, arguments);
+ }
+
+ fetch.toString = function () {
+ return _fetch.toString();
+ };
+
+ return fetch;
+ }(function (input, init) {
+ var _this = this;
+
+ trackRequestStart.call(this);
+
+ var request = Promise.resolve().then(function () {
+ return buildRequest.call(_this, input, init, _this.defaults);
+ });
+ var promise = processRequest(request, this.interceptors).then(function (result) {
+ var response = null;
+
+ if (Response.prototype.isPrototypeOf(result)) {
+ response = result;
+ } else if (Request.prototype.isPrototypeOf(result)) {
+ request = Promise.resolve(result);
+ response = fetch(result);
+ } else {
+ throw new Error('An invalid result was returned by the interceptor chain. Expected a Request or Response instance, but got [' + result + ']');
+ }
+
+ return request.then(function (_request) {
+ return processResponse(response, _this.interceptors, _request);
+ });
+ });
+
+ return trackRequestEndWith.call(this, promise);
+ });
+
+ return HttpClient;
+ }();
+
+ var absoluteUrlRegexp = /^([a-z][a-z0-9+\-.]*:)?\/\//i;
+
+ function trackRequestStart() {
+ this.isRequesting = !! ++this.activeRequestCount;
+ }
+
+ function trackRequestEnd() {
+ this.isRequesting = !! --this.activeRequestCount;
+ }
+
+ function trackRequestEndWith(promise) {
+ var handle = trackRequestEnd.bind(this);
+ promise.then(handle, handle);
+ return promise;
+ }
+
+ function parseHeaderValues(headers) {
+ var parsedHeaders = {};
+ for (var name in headers || {}) {
+ if (headers.hasOwnProperty(name)) {
+ parsedHeaders[name] = typeof headers[name] === 'function' ? headers[name]() : headers[name];
+ }
+ }
+ return parsedHeaders;
+ }
+
+ function buildRequest(input, init) {
+ var defaults = this.defaults || {};
+ var request = void 0;
+ var body = void 0;
+ var requestContentType = void 0;
+
+ var parsedDefaultHeaders = parseHeaderValues(defaults.headers);
+ if (Request.prototype.isPrototypeOf(input)) {
+ request = input;
+ requestContentType = new Headers(request.headers).get('Content-Type');
+ } else {
+ init || (init = {});
+ body = init.body;
+ var bodyObj = body ? { body: body } : null;
+ var requestInit = Object.assign({}, defaults, { headers: {} }, init, bodyObj);
+ requestContentType = new Headers(requestInit.headers).get('Content-Type');
+ request = new Request(getRequestUrl(this.baseUrl, input), requestInit);
+ }
+ if (!requestContentType && new Headers(parsedDefaultHeaders).has('content-type')) {
+ request.headers.set('Content-Type', new Headers(parsedDefaultHeaders).get('content-type'));
+ }
+ setDefaultHeaders(request.headers, parsedDefaultHeaders);
+ if (body && Blob.prototype.isPrototypeOf(body) && body.type) {
+ request.headers.set('Content-Type', body.type);
+ }
+ return request;
+ }
+
+ function getRequestUrl(baseUrl, url) {
+ if (absoluteUrlRegexp.test(url)) {
+ return url;
+ }
+
+ return (baseUrl || '') + url;
+ }
+
+ function setDefaultHeaders(headers, defaultHeaders) {
+ for (var name in defaultHeaders || {}) {
+ if (defaultHeaders.hasOwnProperty(name) && !headers.has(name)) {
+ headers.set(name, defaultHeaders[name]);
+ }
+ }
+ }
+
+ function processRequest(request, interceptors) {
+ return applyInterceptors(request, interceptors, 'request', 'requestError');
+ }
+
+ function processResponse(response, interceptors, request) {
+ return applyInterceptors(response, interceptors, 'response', 'responseError', request);
+ }
+
+ function applyInterceptors(input, interceptors, successName, errorName) {
+ for (var _len = arguments.length, interceptorArgs = Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
+ interceptorArgs[_key - 4] = arguments[_key];
+ }
+
+ return (interceptors || []).reduce(function (chain, interceptor) {
+ var successHandler = interceptor[successName];
+ var errorHandler = interceptor[errorName];
+
+ return chain.then(successHandler && function (value) {
+ return successHandler.call.apply(successHandler, [interceptor, value].concat(interceptorArgs));
+ } || identity, errorHandler && function (reason) {
+ return errorHandler.call.apply(errorHandler, [interceptor, reason].concat(interceptorArgs));
+ } || thrower);
+ }, Promise.resolve(input));
+ }
+
+ function identity(x) {
+ return x;
+ }
+
+ function thrower(x) {
+ throw x;
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/index.js
new file mode 100644
index 000000000..4c389af89
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-fetch-client@1.0.1/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-fetch-client'], function (exports, _aureliaFetchClient) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaFetchClient).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaFetchClient[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6.js
new file mode 100644
index 000000000..dbf8adbb2
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-framework@1.0.6/aurelia-framework"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/.jspm-hash
new file mode 100644
index 000000000..c95264ce6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/.jspm-hash
@@ -0,0 +1 @@
+3c64b8cb8f00b78871ed335baedc641041e1fb6599914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/aurelia-framework.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/aurelia-framework.js
new file mode 100644
index 000000000..2f93ee4e7
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/aurelia-framework.js
@@ -0,0 +1,550 @@
+/* */
+define(['exports', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-metadata', 'aurelia-templating', 'aurelia-loader', 'aurelia-task-queue', 'aurelia-path', 'aurelia-pal', 'aurelia-logging'], function (exports, _aureliaDependencyInjection, _aureliaBinding, _aureliaMetadata, _aureliaTemplating, _aureliaLoader, _aureliaTaskQueue, _aureliaPath, _aureliaPal, _aureliaLogging) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.LogManager = exports.FrameworkConfiguration = exports.Aurelia = undefined;
+ Object.keys(_aureliaDependencyInjection).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaDependencyInjection[key];
+ }
+ });
+ });
+ Object.keys(_aureliaBinding).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaBinding[key];
+ }
+ });
+ });
+ Object.keys(_aureliaMetadata).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaMetadata[key];
+ }
+ });
+ });
+ Object.keys(_aureliaTemplating).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaTemplating[key];
+ }
+ });
+ });
+ Object.keys(_aureliaLoader).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaLoader[key];
+ }
+ });
+ });
+ Object.keys(_aureliaTaskQueue).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaTaskQueue[key];
+ }
+ });
+ });
+ Object.keys(_aureliaPath).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaPath[key];
+ }
+ });
+ });
+ Object.keys(_aureliaPal).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaPal[key];
+ }
+ });
+ });
+
+ var TheLogManager = _interopRequireWildcard(_aureliaLogging);
+
+ function _interopRequireWildcard(obj) {
+ if (obj && obj.__esModule) {
+ return obj;
+ } else {
+ var newObj = {};
+
+ if (obj != null) {
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
+ }
+ }
+
+ newObj.default = obj;
+ return newObj;
+ }
+ }
+
+
+
+ function preventActionlessFormSubmit() {
+ _aureliaPal.DOM.addEventListener('submit', function (evt) {
+ var target = evt.target;
+ var action = target.action;
+
+ if (target.tagName.toLowerCase() === 'form' && !action) {
+ evt.preventDefault();
+ }
+ });
+ }
+
+ var Aurelia = exports.Aurelia = function () {
+ function Aurelia(loader, container, resources) {
+
+
+ this.loader = loader || new _aureliaPal.PLATFORM.Loader();
+ this.container = container || new _aureliaDependencyInjection.Container().makeGlobal();
+ this.resources = resources || new _aureliaTemplating.ViewResources();
+ this.use = new FrameworkConfiguration(this);
+ this.logger = TheLogManager.getLogger('aurelia');
+ this.hostConfigured = false;
+ this.host = null;
+
+ this.use.instance(Aurelia, this);
+ this.use.instance(_aureliaLoader.Loader, this.loader);
+ this.use.instance(_aureliaTemplating.ViewResources, this.resources);
+ }
+
+ Aurelia.prototype.start = function start() {
+ var _this = this;
+
+ if (this.started) {
+ return Promise.resolve(this);
+ }
+
+ this.started = true;
+ this.logger.info('Aurelia Starting');
+
+ return this.use.apply().then(function () {
+ preventActionlessFormSubmit();
+
+ if (!_this.container.hasResolver(_aureliaTemplating.BindingLanguage)) {
+ var message = 'You must configure Aurelia with a BindingLanguage implementation.';
+ _this.logger.error(message);
+ throw new Error(message);
+ }
+
+ _this.logger.info('Aurelia Started');
+ var evt = _aureliaPal.DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true });
+ _aureliaPal.DOM.dispatchEvent(evt);
+ return _this;
+ });
+ };
+
+ Aurelia.prototype.enhance = function enhance() {
+ var _this2 = this;
+
+ var bindingContext = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+ var applicationHost = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
+
+ this._configureHost(applicationHost || _aureliaPal.DOM.querySelectorAll('body')[0]);
+
+ return new Promise(function (resolve) {
+ var engine = _this2.container.get(_aureliaTemplating.TemplatingEngine);
+ _this2.root = engine.enhance({ container: _this2.container, element: _this2.host, resources: _this2.resources, bindingContext: bindingContext });
+ _this2.root.attached();
+ _this2._onAureliaComposed();
+ resolve(_this2);
+ });
+ };
+
+ Aurelia.prototype.setRoot = function setRoot() {
+ var _this3 = this;
+
+ var root = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
+ var applicationHost = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
+
+ var instruction = {};
+
+ if (this.root && this.root.viewModel && this.root.viewModel.router) {
+ this.root.viewModel.router.deactivate();
+ this.root.viewModel.router.reset();
+ }
+
+ this._configureHost(applicationHost);
+
+ var engine = this.container.get(_aureliaTemplating.TemplatingEngine);
+ var transaction = this.container.get(_aureliaTemplating.CompositionTransaction);
+ delete transaction.initialComposition;
+
+ if (!root) {
+ if (this.configModuleId) {
+ root = (0, _aureliaPath.relativeToFile)('./app', this.configModuleId);
+ } else {
+ root = 'app';
+ }
+ }
+
+ instruction.viewModel = root;
+ instruction.container = instruction.childContainer = this.container;
+ instruction.viewSlot = this.hostSlot;
+ instruction.host = this.host;
+
+ return engine.compose(instruction).then(function (r) {
+ _this3.root = r;
+ instruction.viewSlot.attached();
+ _this3._onAureliaComposed();
+ return _this3;
+ });
+ };
+
+ Aurelia.prototype._configureHost = function _configureHost(applicationHost) {
+ if (this.hostConfigured) {
+ return;
+ }
+ applicationHost = applicationHost || this.host;
+
+ if (!applicationHost || typeof applicationHost === 'string') {
+ this.host = _aureliaPal.DOM.getElementById(applicationHost || 'applicationHost');
+ } else {
+ this.host = applicationHost;
+ }
+
+ if (!this.host) {
+ throw new Error('No applicationHost was specified.');
+ }
+
+ this.hostConfigured = true;
+ this.host.aurelia = this;
+ this.hostSlot = new _aureliaTemplating.ViewSlot(this.host, true);
+ this.hostSlot.transformChildNodesIntoView();
+ this.container.registerInstance(_aureliaPal.DOM.boundary, this.host);
+ };
+
+ Aurelia.prototype._onAureliaComposed = function _onAureliaComposed() {
+ var evt = _aureliaPal.DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true });
+ setTimeout(function () {
+ return _aureliaPal.DOM.dispatchEvent(evt);
+ }, 1);
+ };
+
+ return Aurelia;
+ }();
+
+ var logger = TheLogManager.getLogger('aurelia');
+ var extPattern = /\.[^/.]+$/;
+
+ function runTasks(config, tasks) {
+ var current = void 0;
+ var next = function next() {
+ current = tasks.shift();
+ if (current) {
+ return Promise.resolve(current(config)).then(next);
+ }
+
+ return Promise.resolve();
+ };
+
+ return next();
+ }
+
+ function loadPlugin(config, loader, info) {
+ logger.debug('Loading plugin ' + info.moduleId + '.');
+ config.resourcesRelativeTo = info.resourcesRelativeTo;
+
+ var id = info.moduleId;
+
+ if (info.resourcesRelativeTo.length > 1) {
+ return loader.normalize(info.moduleId, info.resourcesRelativeTo[1]).then(function (normalizedId) {
+ return _loadPlugin(normalizedId);
+ });
+ }
+
+ return _loadPlugin(id);
+
+ function _loadPlugin(moduleId) {
+ return loader.loadModule(moduleId).then(function (m) {
+ if ('configure' in m) {
+ return Promise.resolve(m.configure(config, info.config || {})).then(function () {
+ config.resourcesRelativeTo = null;
+ logger.debug('Configured plugin ' + info.moduleId + '.');
+ });
+ }
+
+ config.resourcesRelativeTo = null;
+ logger.debug('Loaded plugin ' + info.moduleId + '.');
+ });
+ }
+ }
+
+ function loadResources(aurelia, resourcesToLoad, appResources) {
+ var viewEngine = aurelia.container.get(_aureliaTemplating.ViewEngine);
+
+ return Promise.all(Object.keys(resourcesToLoad).map(function (n) {
+ return _normalize(resourcesToLoad[n]);
+ })).then(function (loads) {
+ var names = [];
+ var importIds = [];
+
+ loads.forEach(function (l) {
+ names.push(undefined);
+ importIds.push(l.importId);
+ });
+
+ return viewEngine.importViewResources(importIds, names, appResources);
+ });
+
+ function _normalize(load) {
+ var moduleId = load.moduleId;
+ var ext = getExt(moduleId);
+
+ if (isOtherResource(moduleId)) {
+ moduleId = removeExt(moduleId);
+ }
+
+ return aurelia.loader.normalize(moduleId, load.relativeTo).then(function (normalized) {
+ return {
+ name: load.moduleId,
+ importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized
+ };
+ });
+ }
+
+ function isOtherResource(name) {
+ var ext = getExt(name);
+ if (!ext) return false;
+ if (ext === '') return false;
+ if (ext === '.js' || ext === '.ts') return false;
+ return true;
+ }
+
+ function removeExt(name) {
+ return name.replace(extPattern, '');
+ }
+
+ function addOriginalExt(normalized, ext) {
+ return removeExt(normalized) + '.' + ext;
+ }
+ }
+
+ function getExt(name) {
+ var match = name.match(extPattern);
+ if (match && match.length > 0) {
+ return match[0].split('.')[1];
+ }
+ }
+
+ function assertProcessed(plugins) {
+ if (plugins.processed) {
+ throw new Error('This config instance has already been applied. To load more plugins or global resources, create a new FrameworkConfiguration instance.');
+ }
+ }
+
+ var FrameworkConfiguration = function () {
+ function FrameworkConfiguration(aurelia) {
+ var _this4 = this;
+
+
+
+ this.aurelia = aurelia;
+ this.container = aurelia.container;
+ this.info = [];
+ this.processed = false;
+ this.preTasks = [];
+ this.postTasks = [];
+ this.resourcesToLoad = {};
+ this.preTask(function () {
+ return aurelia.loader.normalize('aurelia-bootstrapper').then(function (name) {
+ return _this4.bootstrapperName = name;
+ });
+ });
+ this.postTask(function () {
+ return loadResources(aurelia, _this4.resourcesToLoad, aurelia.resources);
+ });
+ }
+
+ FrameworkConfiguration.prototype.instance = function instance(type, _instance) {
+ this.container.registerInstance(type, _instance);
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.singleton = function singleton(type, implementation) {
+ this.container.registerSingleton(type, implementation);
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.transient = function transient(type, implementation) {
+ this.container.registerTransient(type, implementation);
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.preTask = function preTask(task) {
+ assertProcessed(this);
+ this.preTasks.push(task);
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.postTask = function postTask(task) {
+ assertProcessed(this);
+ this.postTasks.push(task);
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.feature = function feature(plugin, config) {
+ if (getExt(plugin)) {
+ return this.plugin({ moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: config || {} });
+ }
+
+ return this.plugin({ moduleId: plugin + '/index', resourcesRelativeTo: [plugin, ''], config: config || {} });
+ };
+
+ FrameworkConfiguration.prototype.globalResources = function globalResources(resources) {
+ assertProcessed(this);
+
+ var toAdd = Array.isArray(resources) ? resources : arguments;
+ var resource = void 0;
+ var resourcesRelativeTo = this.resourcesRelativeTo || ['', ''];
+
+ for (var i = 0, ii = toAdd.length; i < ii; ++i) {
+ resource = toAdd[i];
+ if (typeof resource !== 'string') {
+ throw new Error('Invalid resource path [' + resource + ']. Resources must be specified as relative module IDs.');
+ }
+
+ var parent = resourcesRelativeTo[0];
+ var grandParent = resourcesRelativeTo[1];
+ var name = resource;
+
+ if ((resource.startsWith('./') || resource.startsWith('../')) && parent !== '') {
+ name = (0, _aureliaPath.join)(parent, resource);
+ }
+
+ this.resourcesToLoad[name] = { moduleId: name, relativeTo: grandParent };
+ }
+
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.globalName = function globalName(resourcePath, newName) {
+ assertProcessed(this);
+ this.resourcesToLoad[resourcePath] = { moduleId: newName, relativeTo: '' };
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.plugin = function plugin(_plugin, config) {
+ assertProcessed(this);
+
+ if (typeof _plugin === 'string') {
+ return this.plugin({ moduleId: _plugin, resourcesRelativeTo: [_plugin, ''], config: config || {} });
+ }
+
+ this.info.push(_plugin);
+ return this;
+ };
+
+ FrameworkConfiguration.prototype._addNormalizedPlugin = function _addNormalizedPlugin(name, config) {
+ var _this5 = this;
+
+ var plugin = { moduleId: name, resourcesRelativeTo: [name, ''], config: config || {} };
+ this.plugin(plugin);
+
+ this.preTask(function () {
+ var relativeTo = [name, _this5.bootstrapperName];
+ plugin.moduleId = name;
+ plugin.resourcesRelativeTo = relativeTo;
+ return Promise.resolve();
+ });
+
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.defaultBindingLanguage = function defaultBindingLanguage() {
+ return this._addNormalizedPlugin('aurelia-templating-binding');
+ };
+
+ FrameworkConfiguration.prototype.router = function router() {
+ return this._addNormalizedPlugin('aurelia-templating-router');
+ };
+
+ FrameworkConfiguration.prototype.history = function history() {
+ return this._addNormalizedPlugin('aurelia-history-browser');
+ };
+
+ FrameworkConfiguration.prototype.defaultResources = function defaultResources() {
+ return this._addNormalizedPlugin('aurelia-templating-resources');
+ };
+
+ FrameworkConfiguration.prototype.eventAggregator = function eventAggregator() {
+ return this._addNormalizedPlugin('aurelia-event-aggregator');
+ };
+
+ FrameworkConfiguration.prototype.basicConfiguration = function basicConfiguration() {
+ return this.defaultBindingLanguage().defaultResources().eventAggregator();
+ };
+
+ FrameworkConfiguration.prototype.standardConfiguration = function standardConfiguration() {
+ return this.basicConfiguration().history().router();
+ };
+
+ FrameworkConfiguration.prototype.developmentLogging = function developmentLogging() {
+ var _this6 = this;
+
+ this.preTask(function () {
+ return _this6.aurelia.loader.normalize('aurelia-logging-console', _this6.bootstrapperName).then(function (name) {
+ return _this6.aurelia.loader.loadModule(name).then(function (m) {
+ TheLogManager.addAppender(new m.ConsoleAppender());
+ TheLogManager.setLevel(TheLogManager.logLevel.debug);
+ });
+ });
+ });
+
+ return this;
+ };
+
+ FrameworkConfiguration.prototype.apply = function apply() {
+ var _this7 = this;
+
+ if (this.processed) {
+ return Promise.resolve();
+ }
+
+ return runTasks(this, this.preTasks).then(function () {
+ var loader = _this7.aurelia.loader;
+ var info = _this7.info;
+ var current = void 0;
+
+ var next = function next() {
+ current = info.shift();
+ if (current) {
+ return loadPlugin(_this7, loader, current).then(next);
+ }
+
+ _this7.processed = true;
+ return Promise.resolve();
+ };
+
+ return next().then(function () {
+ return runTasks(_this7, _this7.postTasks);
+ });
+ });
+ };
+
+ return FrameworkConfiguration;
+ }();
+
+ exports.FrameworkConfiguration = FrameworkConfiguration;
+ var LogManager = exports.LogManager = TheLogManager;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/index.js
new file mode 100644
index 000000000..d5294ce33
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-framework@1.0.6/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-framework'], function (exports, _aureliaFramework) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaFramework).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaFramework[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0.js
new file mode 100644
index 000000000..ec0d790d5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-history-browser@1.0.0/aurelia-history-browser"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/.jspm-hash
new file mode 100644
index 000000000..a8aff0ec5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+954e31cb5d9a18914502e02e544e83c0c152d07c99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/aurelia-history-browser.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/aurelia-history-browser.js
new file mode 100644
index 000000000..4c6d10e3a
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/aurelia-history-browser.js
@@ -0,0 +1,327 @@
+/* */
+define(['exports', 'aurelia-pal', 'aurelia-history'], function (exports, _aureliaPal, _aureliaHistory) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.BrowserHistory = exports.DefaultLinkHandler = exports.LinkHandler = undefined;
+ exports.configure = configure;
+
+ var _class, _temp;
+
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }
+
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+
+
+ var LinkHandler = exports.LinkHandler = function () {
+ function LinkHandler() {
+
+ }
+
+ LinkHandler.prototype.activate = function activate(history) {};
+
+ LinkHandler.prototype.deactivate = function deactivate() {};
+
+ return LinkHandler;
+ }();
+
+ var DefaultLinkHandler = exports.DefaultLinkHandler = function (_LinkHandler) {
+ _inherits(DefaultLinkHandler, _LinkHandler);
+
+ function DefaultLinkHandler() {
+
+
+ var _this = _possibleConstructorReturn(this, _LinkHandler.call(this));
+
+ _this.handler = function (e) {
+ var _DefaultLinkHandler$g = DefaultLinkHandler.getEventInfo(e);
+
+ var shouldHandleEvent = _DefaultLinkHandler$g.shouldHandleEvent;
+ var href = _DefaultLinkHandler$g.href;
+
+
+ if (shouldHandleEvent) {
+ e.preventDefault();
+ _this.history.navigate(href);
+ }
+ };
+ return _this;
+ }
+
+ DefaultLinkHandler.prototype.activate = function activate(history) {
+ if (history._hasPushState) {
+ this.history = history;
+ _aureliaPal.DOM.addEventListener('click', this.handler, true);
+ }
+ };
+
+ DefaultLinkHandler.prototype.deactivate = function deactivate() {
+ _aureliaPal.DOM.removeEventListener('click', this.handler);
+ };
+
+ DefaultLinkHandler.getEventInfo = function getEventInfo(event) {
+ var info = {
+ shouldHandleEvent: false,
+ href: null,
+ anchor: null
+ };
+
+ var target = DefaultLinkHandler.findClosestAnchor(event.target);
+ if (!target || !DefaultLinkHandler.targetIsThisWindow(target)) {
+ return info;
+ }
+
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
+ return info;
+ }
+
+ var href = target.getAttribute('href');
+ info.anchor = target;
+ info.href = href;
+
+ var leftButtonClicked = event.which === 1;
+ var isRelative = href && !(href.charAt(0) === '#' || /^[a-z]+:/i.test(href));
+
+ info.shouldHandleEvent = leftButtonClicked && isRelative;
+ return info;
+ };
+
+ DefaultLinkHandler.findClosestAnchor = function findClosestAnchor(el) {
+ while (el) {
+ if (el.tagName === 'A') {
+ return el;
+ }
+
+ el = el.parentNode;
+ }
+ };
+
+ DefaultLinkHandler.targetIsThisWindow = function targetIsThisWindow(target) {
+ var targetWindow = target.getAttribute('target');
+ var win = _aureliaPal.PLATFORM.global;
+
+ return !targetWindow || targetWindow === win.name || targetWindow === '_self' || targetWindow === 'top' && win === win.top;
+ };
+
+ return DefaultLinkHandler;
+ }(LinkHandler);
+
+ function configure(config) {
+ config.singleton(_aureliaHistory.History, BrowserHistory);
+ config.transient(LinkHandler, DefaultLinkHandler);
+ }
+
+ var BrowserHistory = exports.BrowserHistory = (_temp = _class = function (_History) {
+ _inherits(BrowserHistory, _History);
+
+ function BrowserHistory(linkHandler) {
+
+
+ var _this2 = _possibleConstructorReturn(this, _History.call(this));
+
+ _this2._isActive = false;
+ _this2._checkUrlCallback = _this2._checkUrl.bind(_this2);
+
+ _this2.location = _aureliaPal.PLATFORM.location;
+ _this2.history = _aureliaPal.PLATFORM.history;
+ _this2.linkHandler = linkHandler;
+ return _this2;
+ }
+
+ BrowserHistory.prototype.activate = function activate(options) {
+ if (this._isActive) {
+ throw new Error('History has already been activated.');
+ }
+
+ var wantsPushState = !!options.pushState;
+
+ this._isActive = true;
+ this.options = Object.assign({}, { root: '/' }, this.options, options);
+
+ this.root = ('/' + this.options.root + '/').replace(rootStripper, '/');
+
+ this._wantsHashChange = this.options.hashChange !== false;
+ this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
+
+ var eventName = void 0;
+ if (this._hasPushState) {
+ eventName = 'popstate';
+ } else if (this._wantsHashChange) {
+ eventName = 'hashchange';
+ }
+
+ _aureliaPal.PLATFORM.addEventListener(eventName, this._checkUrlCallback);
+
+ if (this._wantsHashChange && wantsPushState) {
+ var loc = this.location;
+ var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;
+
+ if (!this._hasPushState && !atRoot) {
+ this.fragment = this._getFragment(null, true);
+ this.location.replace(this.root + this.location.search + '#' + this.fragment);
+
+ return true;
+ } else if (this._hasPushState && atRoot && loc.hash) {
+ this.fragment = this._getHash().replace(routeStripper, '');
+ this.history.replaceState({}, _aureliaPal.DOM.title, this.root + this.fragment + loc.search);
+ }
+ }
+
+ if (!this.fragment) {
+ this.fragment = this._getFragment();
+ }
+
+ this.linkHandler.activate(this);
+
+ if (!this.options.silent) {
+ return this._loadUrl();
+ }
+ };
+
+ BrowserHistory.prototype.deactivate = function deactivate() {
+ _aureliaPal.PLATFORM.removeEventListener('popstate', this._checkUrlCallback);
+ _aureliaPal.PLATFORM.removeEventListener('hashchange', this._checkUrlCallback);
+ this._isActive = false;
+ this.linkHandler.deactivate();
+ };
+
+ BrowserHistory.prototype.getAbsoluteRoot = function getAbsoluteRoot() {
+ var origin = createOrigin(this.location.protocol, this.location.hostname, this.location.port);
+ return '' + origin + this.root;
+ };
+
+ BrowserHistory.prototype.navigate = function navigate(fragment) {
+ var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ var _ref$trigger = _ref.trigger;
+ var trigger = _ref$trigger === undefined ? true : _ref$trigger;
+ var _ref$replace = _ref.replace;
+ var replace = _ref$replace === undefined ? false : _ref$replace;
+
+ if (fragment && absoluteUrl.test(fragment)) {
+ this.location.href = fragment;
+ return true;
+ }
+
+ if (!this._isActive) {
+ return false;
+ }
+
+ fragment = this._getFragment(fragment || '');
+
+ if (this.fragment === fragment && !replace) {
+ return false;
+ }
+
+ this.fragment = fragment;
+
+ var url = this.root + fragment;
+
+ if (fragment === '' && url !== '/') {
+ url = url.slice(0, -1);
+ }
+
+ if (this._hasPushState) {
+ url = url.replace('//', '/');
+ this.history[replace ? 'replaceState' : 'pushState']({}, _aureliaPal.DOM.title, url);
+ } else if (this._wantsHashChange) {
+ updateHash(this.location, fragment, replace);
+ } else {
+ return this.location.assign(url);
+ }
+
+ if (trigger) {
+ return this._loadUrl(fragment);
+ }
+ };
+
+ BrowserHistory.prototype.navigateBack = function navigateBack() {
+ this.history.back();
+ };
+
+ BrowserHistory.prototype.setTitle = function setTitle(title) {
+ _aureliaPal.DOM.title = title;
+ };
+
+ BrowserHistory.prototype._getHash = function _getHash() {
+ return this.location.hash.substr(1);
+ };
+
+ BrowserHistory.prototype._getFragment = function _getFragment(fragment, forcePushState) {
+ var root = void 0;
+
+ if (!fragment) {
+ if (this._hasPushState || !this._wantsHashChange || forcePushState) {
+ fragment = this.location.pathname + this.location.search;
+ root = this.root.replace(trailingSlash, '');
+ if (!fragment.indexOf(root)) {
+ fragment = fragment.substr(root.length);
+ }
+ } else {
+ fragment = this._getHash();
+ }
+ }
+
+ return '/' + fragment.replace(routeStripper, '');
+ };
+
+ BrowserHistory.prototype._checkUrl = function _checkUrl() {
+ var current = this._getFragment();
+ if (current !== this.fragment) {
+ this._loadUrl();
+ }
+ };
+
+ BrowserHistory.prototype._loadUrl = function _loadUrl(fragmentOverride) {
+ var fragment = this.fragment = this._getFragment(fragmentOverride);
+
+ return this.options.routeHandler ? this.options.routeHandler(fragment) : false;
+ };
+
+ return BrowserHistory;
+ }(_aureliaHistory.History), _class.inject = [LinkHandler], _temp);
+
+ var routeStripper = /^#?\/*|\s+$/g;
+
+ var rootStripper = /^\/+|\/+$/g;
+
+ var trailingSlash = /\/$/;
+
+ var absoluteUrl = /^([a-z][a-z0-9+\-.]*:)?\/\//i;
+
+ function updateHash(location, fragment, replace) {
+ if (replace) {
+ var _href = location.href.replace(/(javascript:|#).*$/, '');
+ location.replace(_href + '#' + fragment);
+ } else {
+ location.hash = '#' + fragment;
+ }
+ }
+
+ function createOrigin(protocol, hostname, port) {
+ return protocol + '//' + hostname + (port ? ':' + port : '');
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/index.js
new file mode 100644
index 000000000..e2604e6d7
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history-browser@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-history-browser'], function (exports, _aureliaHistoryBrowser) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaHistoryBrowser).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaHistoryBrowser[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0.js
new file mode 100644
index 000000000..9ee5df5ee
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-history@1.0.0/aurelia-history"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/.jspm-hash
new file mode 100644
index 000000000..3ce06e590
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+3b3a47eea34a2c2cb17e46d4fbe3565fa746114999914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/aurelia-history.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/aurelia-history.js
new file mode 100644
index 000000000..325083d99
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/aurelia-history.js
@@ -0,0 +1,46 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+
+
+ function mi(name) {
+ throw new Error('History must implement ' + name + '().');
+ }
+
+ var History = exports.History = function () {
+ function History() {
+
+ }
+
+ History.prototype.activate = function activate(options) {
+ mi('activate');
+ };
+
+ History.prototype.deactivate = function deactivate() {
+ mi('deactivate');
+ };
+
+ History.prototype.getAbsoluteRoot = function getAbsoluteRoot() {
+ mi('getAbsoluteRoot');
+ };
+
+ History.prototype.navigate = function navigate(fragment, options) {
+ mi('navigate');
+ };
+
+ History.prototype.navigateBack = function navigateBack() {
+ mi('navigateBack');
+ };
+
+ History.prototype.setTitle = function setTitle(title) {
+ mi('setTitle');
+ };
+
+ return History;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/index.js
new file mode 100644
index 000000000..d03cfb7da
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-history@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-history'], function (exports, _aureliaHistory) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaHistory).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaHistory[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0.js
new file mode 100644
index 000000000..2db0ef4bb
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-loader-default@1.0.0/aurelia-loader-default"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/.jspm-hash
new file mode 100644
index 000000000..414b33ae8
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+b5edfb71f61734427fd1b131aeee2ede6f4e6c1f99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/aurelia-loader-default.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/aurelia-loader-default.js
new file mode 100644
index 000000000..598e2249c
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/aurelia-loader-default.js
@@ -0,0 +1,259 @@
+/* */
+define(['exports', 'aurelia-loader', 'aurelia-pal', 'aurelia-metadata'], function (exports, _aureliaLoader, _aureliaPal, _aureliaMetadata) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.DefaultLoader = exports.TextTemplateLoader = undefined;
+
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }
+
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+
+
+ var TextTemplateLoader = exports.TextTemplateLoader = function () {
+ function TextTemplateLoader() {
+
+ }
+
+ TextTemplateLoader.prototype.loadTemplate = function loadTemplate(loader, entry) {
+ return loader.loadText(entry.address).then(function (text) {
+ entry.template = _aureliaPal.DOM.createTemplateFromMarkup(text);
+ });
+ };
+
+ return TextTemplateLoader;
+ }();
+
+ function ensureOriginOnExports(executed, name) {
+ var target = executed;
+ var key = void 0;
+ var exportedValue = void 0;
+
+ if (target.__useDefault) {
+ target = target['default'];
+ }
+
+ _aureliaMetadata.Origin.set(target, new _aureliaMetadata.Origin(name, 'default'));
+
+ for (key in target) {
+ exportedValue = target[key];
+
+ if (typeof exportedValue === 'function') {
+ _aureliaMetadata.Origin.set(exportedValue, new _aureliaMetadata.Origin(name, key));
+ }
+ }
+
+ return executed;
+ }
+
+ var DefaultLoader = exports.DefaultLoader = function (_Loader) {
+ _inherits(DefaultLoader, _Loader);
+
+ function DefaultLoader() {
+
+
+ var _this = _possibleConstructorReturn(this, _Loader.call(this));
+
+ _this.textPluginName = 'text';
+
+
+ _this.moduleRegistry = Object.create(null);
+ _this.useTemplateLoader(new TextTemplateLoader());
+
+ var that = _this;
+
+ _this.addPlugin('template-registry-entry', {
+ 'fetch': function fetch(address) {
+ var entry = that.getOrCreateTemplateRegistryEntry(address);
+ return entry.templateIsLoaded ? entry : that.templateLoader.loadTemplate(that, entry).then(function (x) {
+ return entry;
+ });
+ }
+ });
+ return _this;
+ }
+
+ DefaultLoader.prototype.useTemplateLoader = function useTemplateLoader(templateLoader) {
+ this.templateLoader = templateLoader;
+ };
+
+ DefaultLoader.prototype.loadAllModules = function loadAllModules(ids) {
+ var loads = [];
+
+ for (var i = 0, ii = ids.length; i < ii; ++i) {
+ loads.push(this.loadModule(ids[i]));
+ }
+
+ return Promise.all(loads);
+ };
+
+ DefaultLoader.prototype.loadTemplate = function loadTemplate(url) {
+ return this._import(this.applyPluginToUrl(url, 'template-registry-entry'));
+ };
+
+ DefaultLoader.prototype.loadText = function loadText(url) {
+ return this._import(this.applyPluginToUrl(url, this.textPluginName)).then(function (textOrModule) {
+ if (typeof textOrModule === 'string') {
+ return textOrModule;
+ }
+
+ return textOrModule['default'];
+ });
+ };
+
+ return DefaultLoader;
+ }(_aureliaLoader.Loader);
+
+ _aureliaPal.PLATFORM.Loader = DefaultLoader;
+
+ if (!_aureliaPal.PLATFORM.global.System || !_aureliaPal.PLATFORM.global.System.import) {
+ if (_aureliaPal.PLATFORM.global.requirejs && requirejs.s && requirejs.s.contexts && requirejs.s.contexts._ && requirejs.s.contexts._.defined) {
+ _aureliaPal.PLATFORM.eachModule = function (callback) {
+ var defined = requirejs.s.contexts._.defined;
+ for (var key in defined) {
+ try {
+ if (callback(key, defined[key])) return;
+ } catch (e) {}
+ }
+ };
+ } else {
+ _aureliaPal.PLATFORM.eachModule = function (callback) {};
+ }
+
+ DefaultLoader.prototype._import = function (moduleId) {
+ return new Promise(function (resolve, reject) {
+ require([moduleId], resolve, reject);
+ });
+ };
+
+ DefaultLoader.prototype.loadModule = function (id) {
+ var _this2 = this;
+
+ var existing = this.moduleRegistry[id];
+ if (existing !== undefined) {
+ return Promise.resolve(existing);
+ }
+
+ return new Promise(function (resolve, reject) {
+ require([id], function (m) {
+ _this2.moduleRegistry[id] = m;
+ resolve(ensureOriginOnExports(m, id));
+ }, reject);
+ });
+ };
+
+ DefaultLoader.prototype.map = function (id, source) {};
+
+ DefaultLoader.prototype.normalize = function (moduleId, relativeTo) {
+ return Promise.resolve(moduleId);
+ };
+
+ DefaultLoader.prototype.normalizeSync = function (moduleId, relativeTo) {
+ return moduleId;
+ };
+
+ DefaultLoader.prototype.applyPluginToUrl = function (url, pluginName) {
+ return pluginName + '!' + url;
+ };
+
+ DefaultLoader.prototype.addPlugin = function (pluginName, implementation) {
+ var nonAnonDefine = define;
+ nonAnonDefine(pluginName, [], {
+ 'load': function load(name, req, onload) {
+ var result = implementation.fetch(name);
+ Promise.resolve(result).then(onload);
+ }
+ });
+ };
+ } else {
+ _aureliaPal.PLATFORM.eachModule = function (callback) {
+ var modules = System._loader.modules;
+
+ for (var key in modules) {
+ try {
+ if (callback(key, modules[key].module)) return;
+ } catch (e) {}
+ }
+ };
+
+ System.set('text', System.newModule({
+ 'translate': function translate(load) {
+ return 'module.exports = "' + load.source.replace(/(["\\])/g, '\\$1').replace(/[\f]/g, '\\f').replace(/[\b]/g, '\\b').replace(/[\n]/g, '\\n').replace(/[\t]/g, '\\t').replace(/[\r]/g, '\\r').replace(/[\u2028]/g, '\\u2028').replace(/[\u2029]/g, '\\u2029') + '";';
+ }
+ }));
+
+ DefaultLoader.prototype._import = function (moduleId) {
+ return System.import(moduleId);
+ };
+
+ DefaultLoader.prototype.loadModule = function (id) {
+ var _this3 = this;
+
+ return System.normalize(id).then(function (newId) {
+ var existing = _this3.moduleRegistry[newId];
+ if (existing !== undefined) {
+ return Promise.resolve(existing);
+ }
+
+ return System.import(newId).then(function (m) {
+ _this3.moduleRegistry[newId] = m;
+ return ensureOriginOnExports(m, newId);
+ });
+ });
+ };
+
+ DefaultLoader.prototype.map = function (id, source) {
+ System.map[id] = source;
+ };
+
+ DefaultLoader.prototype.normalizeSync = function (moduleId, relativeTo) {
+ return System.normalizeSync(moduleId, relativeTo);
+ };
+
+ DefaultLoader.prototype.normalize = function (moduleId, relativeTo) {
+ return System.normalize(moduleId, relativeTo);
+ };
+
+ DefaultLoader.prototype.applyPluginToUrl = function (url, pluginName) {
+ return url + '!' + pluginName;
+ };
+
+ DefaultLoader.prototype.addPlugin = function (pluginName, implementation) {
+ System.set(pluginName, System.newModule({
+ 'fetch': function fetch(load, _fetch) {
+ var result = implementation.fetch(load.address);
+ return Promise.resolve(result).then(function (x) {
+ load.metadata.result = x;
+ return '';
+ });
+ },
+ 'instantiate': function instantiate(load) {
+ return load.metadata.result;
+ }
+ }));
+ };
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/index.js
new file mode 100644
index 000000000..5f690f1a2
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader-default@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-loader-default'], function (exports, _aureliaLoaderDefault) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaLoaderDefault).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaLoaderDefault[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0.js
new file mode 100644
index 000000000..d1db13b8b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-loader@1.0.0/aurelia-loader"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/.jspm-hash
new file mode 100644
index 000000000..6fc9ab8c7
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+b78c2a2813aa8e441247237dd66fd62e5d4e19ea99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/aurelia-loader.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/aurelia-loader.js
new file mode 100644
index 000000000..4b291a802
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/aurelia-loader.js
@@ -0,0 +1,154 @@
+/* */
+define(['exports', 'aurelia-path', 'aurelia-metadata'], function (exports, _aureliaPath, _aureliaMetadata) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.Loader = exports.TemplateRegistryEntry = exports.TemplateDependency = undefined;
+
+ 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 TemplateDependency = exports.TemplateDependency = function TemplateDependency(src, name) {
+
+
+ this.src = src;
+ this.name = name;
+ };
+
+ var TemplateRegistryEntry = exports.TemplateRegistryEntry = function () {
+ function TemplateRegistryEntry(address) {
+
+
+ this.templateIsLoaded = false;
+ this.factoryIsReady = false;
+ this.resources = null;
+ this.dependencies = null;
+
+ this.address = address;
+ this.onReady = null;
+ this._template = null;
+ this._factory = null;
+ }
+
+ TemplateRegistryEntry.prototype.addDependency = function addDependency(src, name) {
+ var finalSrc = typeof src === 'string' ? (0, _aureliaPath.relativeToFile)(src, this.address) : _aureliaMetadata.Origin.get(src).moduleId;
+
+ this.dependencies.push(new TemplateDependency(finalSrc, name));
+ };
+
+ _createClass(TemplateRegistryEntry, [{
+ key: 'template',
+ get: function get() {
+ return this._template;
+ },
+ set: function set(value) {
+ var address = this.address;
+ var requires = void 0;
+ var current = void 0;
+ var src = void 0;
+ var dependencies = void 0;
+
+ this._template = value;
+ this.templateIsLoaded = true;
+
+ requires = value.content.querySelectorAll('require');
+ dependencies = this.dependencies = new Array(requires.length);
+
+ for (var i = 0, ii = requires.length; i < ii; ++i) {
+ current = requires[i];
+ src = current.getAttribute('from');
+
+ if (!src) {
+ throw new Error(' element in ' + address + ' has no "from" attribute.');
+ }
+
+ dependencies[i] = new TemplateDependency((0, _aureliaPath.relativeToFile)(src, address), current.getAttribute('as'));
+
+ if (current.parentNode) {
+ current.parentNode.removeChild(current);
+ }
+ }
+ }
+ }, {
+ key: 'factory',
+ get: function get() {
+ return this._factory;
+ },
+ set: function set(value) {
+ this._factory = value;
+ this.factoryIsReady = true;
+ }
+ }]);
+
+ return TemplateRegistryEntry;
+ }();
+
+ var Loader = exports.Loader = function () {
+ function Loader() {
+
+
+ this.templateRegistry = {};
+ }
+
+ Loader.prototype.map = function map(id, source) {
+ throw new Error('Loaders must implement map(id, source).');
+ };
+
+ Loader.prototype.normalizeSync = function normalizeSync(moduleId, relativeTo) {
+ throw new Error('Loaders must implement normalizeSync(moduleId, relativeTo).');
+ };
+
+ Loader.prototype.normalize = function normalize(moduleId, relativeTo) {
+ throw new Error('Loaders must implement normalize(moduleId: string, relativeTo: string): Promise.');
+ };
+
+ Loader.prototype.loadModule = function loadModule(id) {
+ throw new Error('Loaders must implement loadModule(id).');
+ };
+
+ Loader.prototype.loadAllModules = function loadAllModules(ids) {
+ throw new Error('Loader must implement loadAllModules(ids).');
+ };
+
+ Loader.prototype.loadTemplate = function loadTemplate(url) {
+ throw new Error('Loader must implement loadTemplate(url).');
+ };
+
+ Loader.prototype.loadText = function loadText(url) {
+ throw new Error('Loader must implement loadText(url).');
+ };
+
+ Loader.prototype.applyPluginToUrl = function applyPluginToUrl(url, pluginName) {
+ throw new Error('Loader must implement applyPluginToUrl(url, pluginName).');
+ };
+
+ Loader.prototype.addPlugin = function addPlugin(pluginName, implementation) {
+ throw new Error('Loader must implement addPlugin(pluginName, implementation).');
+ };
+
+ Loader.prototype.getOrCreateTemplateRegistryEntry = function getOrCreateTemplateRegistryEntry(address) {
+ return this.templateRegistry[address] || (this.templateRegistry[address] = new TemplateRegistryEntry(address));
+ };
+
+ return Loader;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/index.js
new file mode 100644
index 000000000..99593b43f
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-loader@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-loader'], function (exports, _aureliaLoader) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaLoader).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaLoader[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0.js
new file mode 100644
index 000000000..411fa45ea
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-logging-console@1.0.0/aurelia-logging-console"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/.jspm-hash
new file mode 100644
index 000000000..3034a219d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+edf7507a97fc68b40513a17c677d70414101adb499914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/aurelia-logging-console.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/aurelia-logging-console.js
new file mode 100644
index 000000000..f06e30098
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/aurelia-logging-console.js
@@ -0,0 +1,59 @@
+/* */
+define(['exports', 'aurelia-logging'], function (exports, _aureliaLogging) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.ConsoleAppender = undefined;
+
+
+
+ var ConsoleAppender = exports.ConsoleAppender = function () {
+ function ConsoleAppender() {
+
+ }
+
+ ConsoleAppender.prototype.debug = function debug(logger) {
+ var _console;
+
+ for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ rest[_key - 1] = arguments[_key];
+ }
+
+ (_console = console).debug.apply(_console, ['DEBUG [' + logger.id + ']'].concat(rest));
+ };
+
+ ConsoleAppender.prototype.info = function info(logger) {
+ var _console2;
+
+ for (var _len2 = arguments.length, rest = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ rest[_key2 - 1] = arguments[_key2];
+ }
+
+ (_console2 = console).info.apply(_console2, ['INFO [' + logger.id + ']'].concat(rest));
+ };
+
+ ConsoleAppender.prototype.warn = function warn(logger) {
+ var _console3;
+
+ for (var _len3 = arguments.length, rest = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+ rest[_key3 - 1] = arguments[_key3];
+ }
+
+ (_console3 = console).warn.apply(_console3, ['WARN [' + logger.id + ']'].concat(rest));
+ };
+
+ ConsoleAppender.prototype.error = function error(logger) {
+ var _console4;
+
+ for (var _len4 = arguments.length, rest = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
+ rest[_key4 - 1] = arguments[_key4];
+ }
+
+ (_console4 = console).error.apply(_console4, ['ERROR [' + logger.id + ']'].concat(rest));
+ };
+
+ return ConsoleAppender;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/index.js
new file mode 100644
index 000000000..eb98eceec
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging-console@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-logging-console'], function (exports, _aureliaLoggingConsole) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaLoggingConsole).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaLoggingConsole[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0.js
new file mode 100644
index 000000000..6f109e1b6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-logging@1.0.0/aurelia-logging"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/.jspm-hash
new file mode 100644
index 000000000..685540fdd
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+5a791a3b2be98df96cdd3b1736ed8178879c0f0099914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/aurelia-logging.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/aurelia-logging.js
new file mode 100644
index 000000000..a44589e3d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/aurelia-logging.js
@@ -0,0 +1,129 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.getLogger = getLogger;
+ exports.addAppender = addAppender;
+ exports.setLevel = setLevel;
+
+
+
+ var logLevel = exports.logLevel = {
+ none: 0,
+ error: 1,
+ warn: 2,
+ info: 3,
+ debug: 4
+ };
+
+ var loggers = {};
+ var currentLevel = logLevel.none;
+ var appenders = [];
+ var slice = Array.prototype.slice;
+ var loggerConstructionKey = {};
+
+ function log(logger, level, args) {
+ var i = appenders.length;
+ var current = void 0;
+
+ args = slice.call(args);
+ args.unshift(logger);
+
+ while (i--) {
+ current = appenders[i];
+ current[level].apply(current, args);
+ }
+ }
+
+ function debug() {
+ if (currentLevel < 4) {
+ return;
+ }
+
+ log(this, 'debug', arguments);
+ }
+
+ function info() {
+ if (currentLevel < 3) {
+ return;
+ }
+
+ log(this, 'info', arguments);
+ }
+
+ function warn() {
+ if (currentLevel < 2) {
+ return;
+ }
+
+ log(this, 'warn', arguments);
+ }
+
+ function error() {
+ if (currentLevel < 1) {
+ return;
+ }
+
+ log(this, 'error', arguments);
+ }
+
+ function connectLogger(logger) {
+ logger.debug = debug;
+ logger.info = info;
+ logger.warn = warn;
+ logger.error = error;
+ }
+
+ function createLogger(id) {
+ var logger = new Logger(id, loggerConstructionKey);
+
+ if (appenders.length) {
+ connectLogger(logger);
+ }
+
+ return logger;
+ }
+
+ function getLogger(id) {
+ return loggers[id] || (loggers[id] = createLogger(id));
+ }
+
+ function addAppender(appender) {
+ appenders.push(appender);
+
+ if (appenders.length === 1) {
+ for (var key in loggers) {
+ connectLogger(loggers[key]);
+ }
+ }
+ }
+
+ function setLevel(level) {
+ currentLevel = level;
+ }
+
+ var Logger = exports.Logger = function () {
+ function Logger(id, key) {
+
+
+ if (key !== loggerConstructionKey) {
+ throw new Error('Cannot instantiate "Logger". Use "getLogger" instead.');
+ }
+
+ this.id = id;
+ }
+
+ Logger.prototype.debug = function debug(message) {};
+
+ Logger.prototype.info = function info(message) {};
+
+ Logger.prototype.warn = function warn(message) {};
+
+ Logger.prototype.error = function error(message) {};
+
+ return Logger;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/index.js
new file mode 100644
index 000000000..ac51b59da
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-logging@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-logging'], function (exports, _aureliaLogging) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaLogging).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaLogging[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1.js
new file mode 100644
index 000000000..9b9abe72d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-metadata@1.0.1/aurelia-metadata"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/.jspm-hash
new file mode 100644
index 000000000..a76780736
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/.jspm-hash
@@ -0,0 +1 @@
+6baaaa460d1fe0489027e52332255bb9be2839ee99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/aurelia-metadata.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/aurelia-metadata.js
new file mode 100644
index 000000000..9d748c311
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/aurelia-metadata.js
@@ -0,0 +1,281 @@
+/* */
+define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.Origin = exports.metadata = undefined;
+ exports.decorators = decorators;
+ exports.deprecated = deprecated;
+ exports.mixin = mixin;
+ exports.protocol = protocol;
+
+ var _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ 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 metadata = exports.metadata = {
+ resource: 'aurelia:resource',
+ paramTypes: 'design:paramtypes',
+ propertyType: 'design:type',
+ properties: 'design:properties',
+ get: function get(metadataKey, target, targetKey) {
+ if (!target) {
+ return undefined;
+ }
+ var result = metadata.getOwn(metadataKey, target, targetKey);
+ return result === undefined ? metadata.get(metadataKey, Object.getPrototypeOf(target), targetKey) : result;
+ },
+ getOwn: function getOwn(metadataKey, target, targetKey) {
+ if (!target) {
+ return undefined;
+ }
+ return Reflect.getOwnMetadata(metadataKey, target, targetKey);
+ },
+ define: function define(metadataKey, metadataValue, target, targetKey) {
+ Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey);
+ },
+ getOrCreateOwn: function getOrCreateOwn(metadataKey, Type, target, targetKey) {
+ var result = metadata.getOwn(metadataKey, target, targetKey);
+
+ if (result === undefined) {
+ result = new Type();
+ Reflect.defineMetadata(metadataKey, result, target, targetKey);
+ }
+
+ return result;
+ }
+ };
+
+ var originStorage = new Map();
+ var unknownOrigin = Object.freeze({ moduleId: undefined, moduleMember: undefined });
+
+ var Origin = exports.Origin = function () {
+ function Origin(moduleId, moduleMember) {
+
+
+ this.moduleId = moduleId;
+ this.moduleMember = moduleMember;
+ }
+
+ Origin.get = function get(fn) {
+ var origin = originStorage.get(fn);
+
+ if (origin === undefined) {
+ _aureliaPal.PLATFORM.eachModule(function (key, value) {
+ if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
+ for (var name in value) {
+ var exp = value[name];
+ if (exp === fn) {
+ originStorage.set(fn, origin = new Origin(key, name));
+ return true;
+ }
+ }
+ }
+
+ if (value === fn) {
+ originStorage.set(fn, origin = new Origin(key, 'default'));
+ return true;
+ }
+
+ return false;
+ });
+ }
+
+ return origin || unknownOrigin;
+ };
+
+ Origin.set = function set(fn, origin) {
+ originStorage.set(fn, origin);
+ };
+
+ return Origin;
+ }();
+
+ function decorators() {
+ for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
+ rest[_key] = arguments[_key];
+ }
+
+ var applicator = function applicator(target, key, descriptor) {
+ var i = rest.length;
+
+ if (key) {
+ descriptor = descriptor || {
+ value: target[key],
+ writable: true,
+ configurable: true,
+ enumerable: true
+ };
+
+ while (i--) {
+ descriptor = rest[i](target, key, descriptor) || descriptor;
+ }
+
+ Object.defineProperty(target, key, descriptor);
+ } else {
+ while (i--) {
+ target = rest[i](target) || target;
+ }
+ }
+
+ return target;
+ };
+
+ applicator.on = applicator;
+ return applicator;
+ }
+
+ function deprecated(optionsOrTarget, maybeKey, maybeDescriptor) {
+ function decorator(target, key, descriptor) {
+ var methodSignature = target.constructor.name + '#' + key;
+ var options = maybeKey ? {} : optionsOrTarget || {};
+ var message = 'DEPRECATION - ' + methodSignature;
+
+ if (typeof descriptor.value !== 'function') {
+ throw new SyntaxError('Only methods can be marked as deprecated.');
+ }
+
+ if (options.message) {
+ message += ' - ' + options.message;
+ }
+
+ return _extends({}, descriptor, {
+ value: function deprecationWrapper() {
+ if (options.error) {
+ throw new Error(message);
+ } else {
+ console.warn(message);
+ }
+
+ return descriptor.value.apply(this, arguments);
+ }
+ });
+ }
+
+ return maybeKey ? decorator(optionsOrTarget, maybeKey, maybeDescriptor) : decorator;
+ }
+
+ function mixin(behavior) {
+ var instanceKeys = Object.keys(behavior);
+
+ function _mixin(possible) {
+ var decorator = function decorator(target) {
+ var resolvedTarget = typeof target === 'function' ? target.prototype : target;
+
+ var i = instanceKeys.length;
+ while (i--) {
+ var property = instanceKeys[i];
+ Object.defineProperty(resolvedTarget, property, {
+ value: behavior[property],
+ writable: true
+ });
+ }
+ };
+
+ return possible ? decorator(possible) : decorator;
+ }
+
+ return _mixin;
+ }
+
+ function alwaysValid() {
+ return true;
+ }
+ function noCompose() {}
+
+ function ensureProtocolOptions(options) {
+ if (options === undefined) {
+ options = {};
+ } else if (typeof options === 'function') {
+ options = {
+ validate: options
+ };
+ }
+
+ if (!options.validate) {
+ options.validate = alwaysValid;
+ }
+
+ if (!options.compose) {
+ options.compose = noCompose;
+ }
+
+ return options;
+ }
+
+ function createProtocolValidator(validate) {
+ return function (target) {
+ var result = validate(target);
+ return result === true;
+ };
+ }
+
+ function createProtocolAsserter(name, validate) {
+ return function (target) {
+ var result = validate(target);
+ if (result !== true) {
+ throw new Error(result || name + ' was not correctly implemented.');
+ }
+ };
+ }
+
+ function protocol(name, options) {
+ options = ensureProtocolOptions(options);
+
+ var result = function result(target) {
+ var resolvedTarget = typeof target === 'function' ? target.prototype : target;
+
+ options.compose(resolvedTarget);
+ result.assert(resolvedTarget);
+
+ Object.defineProperty(resolvedTarget, 'protocol:' + name, {
+ enumerable: false,
+ configurable: false,
+ writable: false,
+ value: true
+ });
+ };
+
+ result.validate = createProtocolValidator(options.validate);
+ result.assert = createProtocolAsserter(name, options.validate);
+
+ return result;
+ }
+
+ protocol.create = function (name, options) {
+ options = ensureProtocolOptions(options);
+ var hidden = 'protocol:' + name;
+ var result = function result(target) {
+ var decorator = protocol(name, options);
+ return target ? decorator(target) : decorator;
+ };
+
+ result.decorates = function (obj) {
+ return obj[hidden] === true;
+ };
+ result.validate = createProtocolValidator(options.validate);
+ result.assert = createProtocolAsserter(name, options.validate);
+
+ return result;
+ };
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/index.js
new file mode 100644
index 000000000..8dd6ae807
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-metadata@1.0.1/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-metadata'], function (exports, _aureliaMetadata) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaMetadata).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaMetadata[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0.js
new file mode 100644
index 000000000..e0c0af8db
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-pal-browser@1.0.0/aurelia-pal-browser"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/.jspm-hash
new file mode 100644
index 000000000..dc99e049d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+54a04f4c612c179aff5961d281b1022f7a4c440199914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/aurelia-pal-browser.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/aurelia-pal-browser.js
new file mode 100644
index 000000000..aac8ed876
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/aurelia-pal-browser.js
@@ -0,0 +1,518 @@
+/* */
+define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports._DOM = exports._FEATURE = exports._PLATFORM = undefined;
+ exports._ensureFunctionName = _ensureFunctionName;
+ exports._ensureClassList = _ensureClassList;
+ exports._ensurePerformance = _ensurePerformance;
+ exports._ensureCustomEvent = _ensureCustomEvent;
+ exports._ensureElementMatches = _ensureElementMatches;
+ exports._ensureHTMLTemplateElement = _ensureHTMLTemplateElement;
+ exports.initialize = initialize;
+
+ 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 _PLATFORM = exports._PLATFORM = {
+ location: window.location,
+ history: window.history,
+ addEventListener: function addEventListener(eventName, callback, capture) {
+ this.global.addEventListener(eventName, callback, capture);
+ },
+ removeEventListener: function removeEventListener(eventName, callback, capture) {
+ this.global.removeEventListener(eventName, callback, capture);
+ },
+
+ performance: window.performance,
+ requestAnimationFrame: function requestAnimationFrame(callback) {
+ return this.global.requestAnimationFrame(callback);
+ }
+ };
+
+ function _ensureFunctionName() {
+ function test() {}
+
+ if (!test.name) {
+ Object.defineProperty(Function.prototype, 'name', {
+ get: function get() {
+ var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
+
+ Object.defineProperty(this, 'name', { value: name });
+ return name;
+ }
+ });
+ }
+ }
+
+ function _ensureClassList() {
+ if (!('classList' in document.createElement('_')) || document.createElementNS && !('classList' in document.createElementNS('http://www.w3.org/2000/svg', 'g'))) {
+ (function () {
+ var protoProp = 'prototype';
+ var strTrim = String.prototype.trim;
+ var arrIndexOf = Array.prototype.indexOf;
+ var emptyArray = [];
+
+ var DOMEx = function DOMEx(type, message) {
+ this.name = type;
+ this.code = DOMException[type];
+ this.message = message;
+ };
+
+ var checkTokenAndGetIndex = function checkTokenAndGetIndex(classList, token) {
+ if (token === '') {
+ throw new DOMEx('SYNTAX_ERR', 'An invalid or illegal string was specified');
+ }
+
+ if (/\s/.test(token)) {
+ throw new DOMEx('INVALID_CHARACTER_ERR', 'String contains an invalid character');
+ }
+
+ return arrIndexOf.call(classList, token);
+ };
+
+ var ClassList = function ClassList(elem) {
+ var trimmedClasses = strTrim.call(elem.getAttribute('class') || '');
+ var classes = trimmedClasses ? trimmedClasses.split(/\s+/) : emptyArray;
+
+ for (var i = 0, ii = classes.length; i < ii; ++i) {
+ this.push(classes[i]);
+ }
+
+ this._updateClassName = function () {
+ elem.setAttribute('class', this.toString());
+ };
+ };
+
+ var classListProto = ClassList[protoProp] = [];
+
+ DOMEx[protoProp] = Error[protoProp];
+
+ classListProto.item = function (i) {
+ return this[i] || null;
+ };
+
+ classListProto.contains = function (token) {
+ token += '';
+ return checkTokenAndGetIndex(this, token) !== -1;
+ };
+
+ classListProto.add = function () {
+ var tokens = arguments;
+ var i = 0;
+ var ii = tokens.length;
+ var token = void 0;
+ var updated = false;
+
+ do {
+ token = tokens[i] + '';
+ if (checkTokenAndGetIndex(this, token) === -1) {
+ this.push(token);
+ updated = true;
+ }
+ } while (++i < ii);
+
+ if (updated) {
+ this._updateClassName();
+ }
+ };
+
+ classListProto.remove = function () {
+ var tokens = arguments;
+ var i = 0;
+ var ii = tokens.length;
+ var token = void 0;
+ var updated = false;
+ var index = void 0;
+
+ do {
+ token = tokens[i] + '';
+ index = checkTokenAndGetIndex(this, token);
+ while (index !== -1) {
+ this.splice(index, 1);
+ updated = true;
+ index = checkTokenAndGetIndex(this, token);
+ }
+ } while (++i < ii);
+
+ if (updated) {
+ this._updateClassName();
+ }
+ };
+
+ classListProto.toggle = function (token, force) {
+ token += '';
+
+ var result = this.contains(token);
+ var method = result ? force !== true && 'remove' : force !== false && 'add';
+
+ if (method) {
+ this[method](token);
+ }
+
+ if (force === true || force === false) {
+ return force;
+ }
+
+ return !result;
+ };
+
+ classListProto.toString = function () {
+ return this.join(' ');
+ };
+
+ Object.defineProperty(Element.prototype, 'classList', {
+ get: function get() {
+ return new ClassList(this);
+ },
+ enumerable: true,
+ configurable: true
+ });
+ })();
+ } else {
+ var testElement = document.createElement('_');
+ testElement.classList.add('c1', 'c2');
+
+ if (!testElement.classList.contains('c2')) {
+ var createMethod = function createMethod(method) {
+ var original = DOMTokenList.prototype[method];
+
+ DOMTokenList.prototype[method] = function (token) {
+ for (var i = 0, ii = arguments.length; i < ii; ++i) {
+ token = arguments[i];
+ original.call(this, token);
+ }
+ };
+ };
+
+ createMethod('add');
+ createMethod('remove');
+ }
+
+ testElement.classList.toggle('c3', false);
+
+ if (testElement.classList.contains('c3')) {
+ (function () {
+ var _toggle = DOMTokenList.prototype.toggle;
+
+ DOMTokenList.prototype.toggle = function (token, force) {
+ if (1 in arguments && !this.contains(token) === !force) {
+ return force;
+ }
+
+ return _toggle.call(this, token);
+ };
+ })();
+ }
+
+ testElement = null;
+ }
+ }
+
+ function _ensurePerformance() {
+ // @license http://opensource.org/licenses/MIT
+
+
+ if ('performance' in window === false) {
+ window.performance = {};
+ }
+
+ if ('now' in window.performance === false) {
+ (function () {
+ var nowOffset = Date.now();
+
+ if (performance.timing && performance.timing.navigationStart) {
+ nowOffset = performance.timing.navigationStart;
+ }
+
+ window.performance.now = function now() {
+ return Date.now() - nowOffset;
+ };
+ })();
+ }
+
+ _PLATFORM.performance = window.performance;
+ }
+
+ function _ensureCustomEvent() {
+ if (!window.CustomEvent || typeof window.CustomEvent !== 'function') {
+ var _CustomEvent = function _CustomEvent(event, params) {
+ params = params || {
+ bubbles: false,
+ cancelable: false,
+ detail: undefined
+ };
+
+ var evt = document.createEvent('CustomEvent');
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+ return evt;
+ };
+
+ _CustomEvent.prototype = window.Event.prototype;
+ window.CustomEvent = _CustomEvent;
+ }
+ }
+
+ function _ensureElementMatches() {
+ if (Element && !Element.prototype.matches) {
+ var proto = Element.prototype;
+ proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
+ }
+ }
+
+ var _FEATURE = exports._FEATURE = {};
+
+ _FEATURE.shadowDOM = function () {
+ return !!HTMLElement.prototype.attachShadow;
+ }();
+
+ _FEATURE.scopedCSS = function () {
+ return 'scoped' in document.createElement('style');
+ }();
+
+ _FEATURE.htmlTemplateElement = function () {
+ return 'content' in document.createElement('template');
+ }();
+
+ _FEATURE.mutationObserver = function () {
+ return !!(window.MutationObserver || window.WebKitMutationObserver);
+ }();
+
+ function _ensureHTMLTemplateElement() {
+ function isSVGTemplate(el) {
+ return el.tagName === 'template' && el.namespaceURI === 'http://www.w3.org/2000/svg';
+ }
+
+ function fixSVGTemplateElement(el) {
+ var template = el.ownerDocument.createElement('template');
+ var attrs = el.attributes;
+ var length = attrs.length;
+ var attr = void 0;
+
+ el.parentNode.insertBefore(template, el);
+
+ while (length-- > 0) {
+ attr = attrs[length];
+ template.setAttribute(attr.name, attr.value);
+ el.removeAttribute(attr.name);
+ }
+
+ el.parentNode.removeChild(el);
+
+ return fixHTMLTemplateElement(template);
+ }
+
+ function fixHTMLTemplateElement(template) {
+ var content = template.content = document.createDocumentFragment();
+ var child = void 0;
+
+ while (child = template.firstChild) {
+ content.appendChild(child);
+ }
+
+ return template;
+ }
+
+ function fixHTMLTemplateElementRoot(template) {
+ var content = fixHTMLTemplateElement(template).content;
+ var childTemplates = content.querySelectorAll('template');
+
+ for (var i = 0, ii = childTemplates.length; i < ii; ++i) {
+ var child = childTemplates[i];
+
+ if (isSVGTemplate(child)) {
+ fixSVGTemplateElement(child);
+ } else {
+ fixHTMLTemplateElement(child);
+ }
+ }
+
+ return template;
+ }
+
+ if (_FEATURE.htmlTemplateElement) {
+ _FEATURE.ensureHTMLTemplateElement = function (template) {
+ return template;
+ };
+ } else {
+ _FEATURE.ensureHTMLTemplateElement = fixHTMLTemplateElementRoot;
+ }
+ }
+
+ var shadowPoly = window.ShadowDOMPolyfill || null;
+
+ var _DOM = exports._DOM = {
+ Element: Element,
+ SVGElement: SVGElement,
+ boundary: 'aurelia-dom-boundary',
+ addEventListener: function addEventListener(eventName, callback, capture) {
+ document.addEventListener(eventName, callback, capture);
+ },
+ removeEventListener: function removeEventListener(eventName, callback, capture) {
+ document.removeEventListener(eventName, callback, capture);
+ },
+ adoptNode: function adoptNode(node) {
+ return document.adoptNode(node, true);
+ },
+ createElement: function createElement(tagName) {
+ return document.createElement(tagName);
+ },
+ createTextNode: function createTextNode(text) {
+ return document.createTextNode(text);
+ },
+ createComment: function createComment(text) {
+ return document.createComment(text);
+ },
+ createDocumentFragment: function createDocumentFragment() {
+ return document.createDocumentFragment();
+ },
+ createMutationObserver: function createMutationObserver(callback) {
+ return new (window.MutationObserver || window.WebKitMutationObserver)(callback);
+ },
+ createCustomEvent: function createCustomEvent(eventType, options) {
+ return new window.CustomEvent(eventType, options);
+ },
+ dispatchEvent: function dispatchEvent(evt) {
+ document.dispatchEvent(evt);
+ },
+ getComputedStyle: function getComputedStyle(element) {
+ return window.getComputedStyle(element);
+ },
+ getElementById: function getElementById(id) {
+ return document.getElementById(id);
+ },
+ querySelectorAll: function querySelectorAll(query) {
+ return document.querySelectorAll(query);
+ },
+ nextElementSibling: function nextElementSibling(element) {
+ if (element.nextElementSibling) {
+ return element.nextElementSibling;
+ }
+ do {
+ element = element.nextSibling;
+ } while (element && element.nodeType !== 1);
+ return element;
+ },
+ createTemplateFromMarkup: function createTemplateFromMarkup(markup) {
+ var parser = document.createElement('div');
+ parser.innerHTML = markup;
+
+ var temp = parser.firstElementChild;
+ if (!temp || temp.nodeName !== 'TEMPLATE') {
+ throw new Error('Template markup must be wrapped in a element e.g. ');
+ }
+
+ return _FEATURE.ensureHTMLTemplateElement(temp);
+ },
+ appendNode: function appendNode(newNode, parentNode) {
+ (parentNode || document.body).appendChild(newNode);
+ },
+ replaceNode: function replaceNode(newNode, node, parentNode) {
+ if (node.parentNode) {
+ node.parentNode.replaceChild(newNode, node);
+ } else if (shadowPoly !== null) {
+ shadowPoly.unwrap(parentNode).replaceChild(shadowPoly.unwrap(newNode), shadowPoly.unwrap(node));
+ } else {
+ parentNode.replaceChild(newNode, node);
+ }
+ },
+ removeNode: function removeNode(node, parentNode) {
+ if (node.parentNode) {
+ node.parentNode.removeChild(node);
+ } else if (parentNode) {
+ if (shadowPoly !== null) {
+ shadowPoly.unwrap(parentNode).removeChild(shadowPoly.unwrap(node));
+ } else {
+ parentNode.removeChild(node);
+ }
+ }
+ },
+ injectStyles: function injectStyles(styles, destination, prepend) {
+ var node = document.createElement('style');
+ node.innerHTML = styles;
+ node.type = 'text/css';
+
+ destination = destination || document.head;
+
+ if (prepend && destination.childNodes.length > 0) {
+ destination.insertBefore(node, destination.childNodes[0]);
+ } else {
+ destination.appendChild(node);
+ }
+
+ return node;
+ }
+ };
+
+ var isInitialized = false;
+
+ function initialize() {
+ if (isInitialized) {
+ return;
+ }
+
+ isInitialized = true;
+
+ _ensureCustomEvent();
+ _ensureFunctionName();
+ _ensureHTMLTemplateElement();
+ _ensureElementMatches();
+ _ensureClassList();
+ _ensurePerformance();
+
+ (0, _aureliaPal.initializePAL)(function (platform, feature, dom) {
+ Object.assign(platform, _PLATFORM);
+ Object.assign(feature, _FEATURE);
+ Object.assign(dom, _DOM);
+
+ (function (global) {
+ global.console = global.console || {};
+ var con = global.console;
+ var prop = void 0;
+ var method = void 0;
+ var empty = {};
+ var dummy = function dummy() {};
+ var properties = 'memory'.split(',');
+ var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');
+ while (prop = properties.pop()) {
+ if (!con[prop]) con[prop] = empty;
+ }while (method = methods.pop()) {
+ if (!con[method]) con[method] = dummy;
+ }
+ })(platform.global);
+
+ if (platform.global.console && _typeof(console.log) === 'object') {
+ ['log', 'info', 'warn', 'error', 'assert', 'dir', 'clear', 'profile', 'profileEnd'].forEach(function (method) {
+ console[method] = this.bind(console[method], console);
+ }, Function.prototype.call);
+ }
+
+ Object.defineProperty(dom, 'title', {
+ get: function get() {
+ return document.title;
+ },
+ set: function set(value) {
+ document.title = value;
+ }
+ });
+
+ Object.defineProperty(dom, 'activeElement', {
+ get: function get() {
+ return document.activeElement;
+ }
+ });
+
+ Object.defineProperty(platform, 'XMLHttpRequest', {
+ get: function get() {
+ return platform.global.XMLHttpRequest;
+ }
+ });
+ });
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/index.js
new file mode 100644
index 000000000..69deb122a
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal-browser@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-pal-browser'], function (exports, _aureliaPalBrowser) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaPalBrowser).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaPalBrowser[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0.js
new file mode 100644
index 000000000..816c0784d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-pal@1.0.0/aurelia-pal"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/.jspm-hash
new file mode 100644
index 000000000..adbf47621
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+f195eda935cca29d22e885a0144b2a2953ffd9d399914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/aurelia-pal.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/aurelia-pal.js
new file mode 100644
index 000000000..0a5544d0a
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/aurelia-pal.js
@@ -0,0 +1,82 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.AggregateError = AggregateError;
+ exports.initializePAL = initializePAL;
+ function AggregateError(message, innerError, skipIfAlreadyAggregate) {
+ if (innerError) {
+ if (innerError.innerError && skipIfAlreadyAggregate) {
+ return innerError;
+ }
+
+ var separator = '\n------------------------------------------------\n';
+
+ message += separator + 'Inner Error:\n';
+
+ if (typeof innerError === 'string') {
+ message += 'Message: ' + innerError;
+ } else {
+ if (innerError.message) {
+ message += 'Message: ' + innerError.message;
+ } else {
+ message += 'Unknown Inner Error Type. Displaying Inner Error as JSON:\n ' + JSON.stringify(innerError, null, ' ');
+ }
+
+ if (innerError.stack) {
+ message += '\nInner Error Stack:\n' + innerError.stack;
+ message += '\nEnd Inner Error Stack';
+ }
+ }
+
+ message += separator;
+ }
+
+ var e = new Error(message);
+ if (innerError) {
+ e.innerError = innerError;
+ }
+
+ return e;
+ }
+
+ var FEATURE = exports.FEATURE = {};
+
+ var PLATFORM = exports.PLATFORM = {
+ noop: function noop() {},
+ eachModule: function eachModule() {}
+ };
+
+ PLATFORM.global = function () {
+ if (typeof self !== 'undefined') {
+ return self;
+ }
+
+ if (typeof global !== 'undefined') {
+ return global;
+ }
+
+ return new Function('return this')();
+ }();
+
+ var DOM = exports.DOM = {};
+
+ function initializePAL(callback) {
+ if (typeof Object.getPropertyDescriptor !== 'function') {
+ Object.getPropertyDescriptor = function (subject, name) {
+ var pd = Object.getOwnPropertyDescriptor(subject, name);
+ var proto = Object.getPrototypeOf(subject);
+ while (typeof pd === 'undefined' && proto !== null) {
+ pd = Object.getOwnPropertyDescriptor(proto, name);
+ proto = Object.getPrototypeOf(proto);
+ }
+ return pd;
+ };
+ }
+
+ callback(PLATFORM, FEATURE, DOM);
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/index.js
new file mode 100644
index 000000000..3385cf07b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-pal@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-pal'], function (exports, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaPal).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaPal[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1.js
new file mode 100644
index 000000000..331dabf60
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-path@1.1.1/aurelia-path"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/.jspm-hash
new file mode 100644
index 000000000..051f6bcc3
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/.jspm-hash
@@ -0,0 +1 @@
+caa9d20bc8515a5f9f286d9a3b18d81b2c85b0dd99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/aurelia-path.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/aurelia-path.js
new file mode 100644
index 000000000..369c434be
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/aurelia-path.js
@@ -0,0 +1,216 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.relativeToFile = relativeToFile;
+ exports.join = join;
+ exports.buildQueryString = buildQueryString;
+ exports.parseQueryString = parseQueryString;
+
+ 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;
+ };
+
+ function trimDots(ary) {
+ for (var i = 0; i < ary.length; ++i) {
+ var part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ if (i === 0 || i === 1 && ary[2] === '..' || ary[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ function relativeToFile(name, file) {
+ var fileParts = file && file.split('/');
+ var nameParts = name.trim().split('/');
+
+ if (nameParts[0].charAt(0) === '.' && fileParts) {
+ var normalizedBaseParts = fileParts.slice(0, fileParts.length - 1);
+ nameParts.unshift.apply(nameParts, normalizedBaseParts);
+ }
+
+ trimDots(nameParts);
+
+ return nameParts.join('/');
+ }
+
+ function join(path1, path2) {
+ if (!path1) {
+ return path2;
+ }
+
+ if (!path2) {
+ return path1;
+ }
+
+ var schemeMatch = path1.match(/^([^/]*?:)\//);
+ var scheme = schemeMatch && schemeMatch.length > 0 ? schemeMatch[1] : '';
+ path1 = path1.substr(scheme.length);
+
+ var urlPrefix = void 0;
+ if (path1.indexOf('///') === 0 && scheme === 'file:') {
+ urlPrefix = '///';
+ } else if (path1.indexOf('//') === 0) {
+ urlPrefix = '//';
+ } else if (path1.indexOf('/') === 0) {
+ urlPrefix = '/';
+ } else {
+ urlPrefix = '';
+ }
+
+ var trailingSlash = path2.slice(-1) === '/' ? '/' : '';
+
+ var url1 = path1.split('/');
+ var url2 = path2.split('/');
+ var url3 = [];
+
+ for (var i = 0, ii = url1.length; i < ii; ++i) {
+ if (url1[i] === '..') {
+ url3.pop();
+ } else if (url1[i] === '.' || url1[i] === '') {
+ continue;
+ } else {
+ url3.push(url1[i]);
+ }
+ }
+
+ for (var _i = 0, _ii = url2.length; _i < _ii; ++_i) {
+ if (url2[_i] === '..') {
+ url3.pop();
+ } else if (url2[_i] === '.' || url2[_i] === '') {
+ continue;
+ } else {
+ url3.push(url2[_i]);
+ }
+ }
+
+ return scheme + urlPrefix + url3.join('/') + trailingSlash;
+ }
+
+ var encode = encodeURIComponent;
+ var encodeKey = function encodeKey(k) {
+ return encode(k).replace('%24', '$');
+ };
+
+ function buildParam(key, value, traditional) {
+ var result = [];
+ if (value === null || value === undefined) {
+ return result;
+ }
+ if (Array.isArray(value)) {
+ for (var i = 0, l = value.length; i < l; i++) {
+ if (traditional) {
+ result.push(encodeKey(key) + '=' + encode(value[i]));
+ } else {
+ var arrayKey = key + '[' + (_typeof(value[i]) === 'object' && value[i] !== null ? i : '') + ']';
+ result = result.concat(buildParam(arrayKey, value[i]));
+ }
+ }
+ } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !traditional) {
+ for (var propertyName in value) {
+ result = result.concat(buildParam(key + '[' + propertyName + ']', value[propertyName]));
+ }
+ } else {
+ result.push(encodeKey(key) + '=' + encode(value));
+ }
+ return result;
+ }
+
+ function buildQueryString(params, traditional) {
+ var pairs = [];
+ var keys = Object.keys(params || {}).sort();
+ for (var i = 0, len = keys.length; i < len; i++) {
+ var key = keys[i];
+ pairs = pairs.concat(buildParam(key, params[key], traditional));
+ }
+
+ if (pairs.length === 0) {
+ return '';
+ }
+
+ return pairs.join('&');
+ }
+
+ function processScalarParam(existedParam, value) {
+ if (Array.isArray(existedParam)) {
+ existedParam.push(value);
+ return existedParam;
+ }
+ if (existedParam !== undefined) {
+ return [existedParam, value];
+ }
+
+ return value;
+ }
+
+ function parseComplexParam(queryParams, keys, value) {
+ var currentParams = queryParams;
+ var keysLastIndex = keys.length - 1;
+ for (var j = 0; j <= keysLastIndex; j++) {
+ var key = keys[j] === '' ? currentParams.length : keys[j];
+ if (j < keysLastIndex) {
+ var prevValue = !currentParams[key] || _typeof(currentParams[key]) === 'object' ? currentParams[key] : [currentParams[key]];
+ currentParams = currentParams[key] = prevValue || (isNaN(keys[j + 1]) ? {} : []);
+ } else {
+ currentParams = currentParams[key] = value;
+ }
+ }
+ }
+
+ function parseQueryString(queryString) {
+ var queryParams = {};
+ if (!queryString || typeof queryString !== 'string') {
+ return queryParams;
+ }
+
+ var query = queryString;
+ if (query.charAt(0) === '?') {
+ query = query.substr(1);
+ }
+
+ var pairs = query.replace(/\+/g, ' ').split('&');
+ for (var i = 0; i < pairs.length; i++) {
+ var pair = pairs[i].split('=');
+ var key = decodeURIComponent(pair[0]);
+ if (!key) {
+ continue;
+ }
+
+ var keys = key.split('][');
+ var keysLastIndex = keys.length - 1;
+
+ if (/\[/.test(keys[0]) && /\]$/.test(keys[keysLastIndex])) {
+ keys[keysLastIndex] = keys[keysLastIndex].replace(/\]$/, '');
+ keys = keys.shift().split('[').concat(keys);
+ keysLastIndex = keys.length - 1;
+ } else {
+ keysLastIndex = 0;
+ }
+
+ if (pair.length >= 2) {
+ var value = pair[1] ? decodeURIComponent(pair[1]) : '';
+ if (keysLastIndex) {
+ parseComplexParam(queryParams, keys, value);
+ } else {
+ queryParams[key] = processScalarParam(queryParams[key], value);
+ }
+ } else {
+ queryParams[key] = true;
+ }
+ }
+ return queryParams;
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/index.js
new file mode 100644
index 000000000..db387fccd
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-path@1.1.1/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-path'], function (exports, _aureliaPath) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaPath).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaPath[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1.js
new file mode 100644
index 000000000..55dc51b5b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-polyfills@1.1.1/aurelia-polyfills"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/.jspm-hash
new file mode 100644
index 000000000..aaf9d153c
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/.jspm-hash
@@ -0,0 +1 @@
+c4f58b7758635182520e19c5a692e7bd0f2ea85999914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/aurelia-polyfills.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/aurelia-polyfills.js
new file mode 100644
index 000000000..816acf276
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/aurelia-polyfills.js
@@ -0,0 +1,810 @@
+/* */
+define(['aurelia-pal'], function (_aureliaPal) {
+ '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;
+ };
+
+ (function (Object, GOPS) {
+ 'use strict';
+
+ if (GOPS in Object) return;
+
+ var setDescriptor,
+ G = _aureliaPal.PLATFORM.global,
+ id = 0,
+ random = '' + Math.random(),
+ prefix = '__\x01symbol:',
+ prefixLength = prefix.length,
+ internalSymbol = '__\x01symbol@@' + random,
+ DP = 'defineProperty',
+ DPies = 'defineProperties',
+ GOPN = 'getOwnPropertyNames',
+ GOPD = 'getOwnPropertyDescriptor',
+ PIE = 'propertyIsEnumerable',
+ gOPN = Object[GOPN],
+ gOPD = Object[GOPD],
+ create = Object.create,
+ keys = Object.keys,
+ defineProperty = Object[DP],
+ $defineProperties = Object[DPies],
+ descriptor = gOPD(Object, GOPN),
+ ObjectProto = Object.prototype,
+ hOP = ObjectProto.hasOwnProperty,
+ pIE = ObjectProto[PIE],
+ toString = ObjectProto.toString,
+ indexOf = Array.prototype.indexOf || function (v) {
+ for (var i = this.length; i-- && this[i] !== v;) {}
+ return i;
+ },
+ addInternalIfNeeded = function addInternalIfNeeded(o, uid, enumerable) {
+ if (!hOP.call(o, internalSymbol)) {
+ defineProperty(o, internalSymbol, {
+ enumerable: false,
+ configurable: false,
+ writable: false,
+ value: {}
+ });
+ }
+ o[internalSymbol]['@@' + uid] = enumerable;
+ },
+ createWithSymbols = function createWithSymbols(proto, descriptors) {
+ var self = create(proto);
+ gOPN(descriptors).forEach(function (key) {
+ if (propertyIsEnumerable.call(descriptors, key)) {
+ $defineProperty(self, key, descriptors[key]);
+ }
+ });
+ return self;
+ },
+ copyAsNonEnumerable = function copyAsNonEnumerable(descriptor) {
+ var newDescriptor = create(descriptor);
+ newDescriptor.enumerable = false;
+ return newDescriptor;
+ },
+ get = function get() {},
+ onlyNonSymbols = function onlyNonSymbols(name) {
+ return name != internalSymbol && !hOP.call(source, name);
+ },
+ onlySymbols = function onlySymbols(name) {
+ return name != internalSymbol && hOP.call(source, name);
+ },
+ propertyIsEnumerable = function propertyIsEnumerable(key) {
+ var uid = '' + key;
+ return onlySymbols(uid) ? hOP.call(this, uid) && this[internalSymbol]['@@' + uid] : pIE.call(this, key);
+ },
+ setAndGetSymbol = function setAndGetSymbol(uid) {
+ var descriptor = {
+ enumerable: false,
+ configurable: true,
+ get: get,
+ set: function set(value) {
+ setDescriptor(this, uid, {
+ enumerable: false,
+ configurable: true,
+ writable: true,
+ value: value
+ });
+ addInternalIfNeeded(this, uid, true);
+ }
+ };
+ defineProperty(ObjectProto, uid, descriptor);
+ return source[uid] = defineProperty(Object(uid), 'constructor', sourceConstructor);
+ },
+ _Symbol = function _Symbol2(description) {
+ if (this && this !== G) {
+ throw new TypeError('Symbol is not a constructor');
+ }
+ return setAndGetSymbol(prefix.concat(description || '', random, ++id));
+ },
+ source = create(null),
+ sourceConstructor = { value: _Symbol },
+ sourceMap = function sourceMap(uid) {
+ return source[uid];
+ },
+ $defineProperty = function defineProp(o, key, descriptor) {
+ var uid = '' + key;
+ if (onlySymbols(uid)) {
+ setDescriptor(o, uid, descriptor.enumerable ? copyAsNonEnumerable(descriptor) : descriptor);
+ addInternalIfNeeded(o, uid, !!descriptor.enumerable);
+ } else {
+ defineProperty(o, key, descriptor);
+ }
+ return o;
+ },
+ $getOwnPropertySymbols = function getOwnPropertySymbols(o) {
+ var cof = toString.call(o);
+ o = cof === '[object String]' ? o.split('') : Object(o);
+ return gOPN(o).filter(onlySymbols).map(sourceMap);
+ };
+
+ descriptor.value = $defineProperty;
+ defineProperty(Object, DP, descriptor);
+
+ descriptor.value = $getOwnPropertySymbols;
+ defineProperty(Object, GOPS, descriptor);
+
+ descriptor.value = function getOwnPropertyNames(o) {
+ return gOPN(o).filter(onlyNonSymbols);
+ };
+ defineProperty(Object, GOPN, descriptor);
+
+ descriptor.value = function defineProperties(o, descriptors) {
+ var symbols = $getOwnPropertySymbols(descriptors);
+ if (symbols.length) {
+ keys(descriptors).concat(symbols).forEach(function (uid) {
+ if (propertyIsEnumerable.call(descriptors, uid)) {
+ $defineProperty(o, uid, descriptors[uid]);
+ }
+ });
+ } else {
+ $defineProperties(o, descriptors);
+ }
+ return o;
+ };
+ defineProperty(Object, DPies, descriptor);
+
+ descriptor.value = propertyIsEnumerable;
+ defineProperty(ObjectProto, PIE, descriptor);
+
+ descriptor.value = _Symbol;
+ defineProperty(G, 'Symbol', descriptor);
+
+ descriptor.value = function (key) {
+ var uid = prefix.concat(prefix, key, random);
+ return uid in ObjectProto ? source[uid] : setAndGetSymbol(uid);
+ };
+ defineProperty(_Symbol, 'for', descriptor);
+
+ descriptor.value = function (symbol) {
+ return hOP.call(source, symbol) ? symbol.slice(prefixLength * 2, -random.length) : void 0;
+ };
+ defineProperty(_Symbol, 'keyFor', descriptor);
+
+ descriptor.value = function getOwnPropertyDescriptor(o, key) {
+ var descriptor = gOPD(o, key);
+ if (descriptor && onlySymbols(key)) {
+ descriptor.enumerable = propertyIsEnumerable.call(o, key);
+ }
+ return descriptor;
+ };
+ defineProperty(Object, GOPD, descriptor);
+
+ descriptor.value = function (proto, descriptors) {
+ return arguments.length === 1 ? create(proto) : createWithSymbols(proto, descriptors);
+ };
+ defineProperty(Object, 'create', descriptor);
+
+ descriptor.value = function () {
+ var str = toString.call(this);
+ return str === '[object String]' && onlySymbols(this) ? '[object Symbol]' : str;
+ };
+ defineProperty(ObjectProto, 'toString', descriptor);
+
+ try {
+ setDescriptor = create(defineProperty({}, prefix, {
+ get: function get() {
+ return defineProperty(this, prefix, { value: false })[prefix];
+ }
+ }))[prefix] || defineProperty;
+ } catch (o_O) {
+ setDescriptor = function setDescriptor(o, key, descriptor) {
+ var protoDescriptor = gOPD(ObjectProto, key);
+ delete ObjectProto[key];
+ defineProperty(o, key, descriptor);
+ defineProperty(ObjectProto, key, protoDescriptor);
+ };
+ }
+ })(Object, 'getOwnPropertySymbols');
+
+ (function (O, S) {
+ var dP = O.defineProperty,
+ ObjectProto = O.prototype,
+ toString = ObjectProto.toString,
+ toStringTag = 'toStringTag',
+ descriptor;
+ ['iterator', 'match', 'replace', 'search', 'split', 'hasInstance', 'isConcatSpreadable', 'unscopables', 'species', 'toPrimitive', toStringTag].forEach(function (name) {
+ if (!(name in Symbol)) {
+ dP(Symbol, name, { value: Symbol(name) });
+ switch (name) {
+ case toStringTag:
+ descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString');
+ descriptor.value = function () {
+ var str = toString.call(this),
+ tst = typeof this === 'undefined' || this === null ? undefined : this[Symbol.toStringTag];
+ return typeof tst === 'undefined' ? str : '[object ' + tst + ']';
+ };
+ dP(ObjectProto, 'toString', descriptor);
+ break;
+ }
+ }
+ });
+ })(Object, Symbol);
+
+ (function (Si, AP, SP) {
+
+ function returnThis() {
+ return this;
+ }
+
+ if (!AP[Si]) AP[Si] = function () {
+ var i = 0,
+ self = this,
+ iterator = {
+ next: function next() {
+ var done = self.length <= i;
+ return done ? { done: done } : { done: done, value: self[i++] };
+ }
+ };
+ iterator[Si] = returnThis;
+ return iterator;
+ };
+
+ if (!SP[Si]) SP[Si] = function () {
+ var fromCodePoint = String.fromCodePoint,
+ self = this,
+ i = 0,
+ length = self.length,
+ iterator = {
+ next: function next() {
+ var done = length <= i,
+ c = done ? '' : fromCodePoint(self.codePointAt(i));
+ i += c.length;
+ return done ? { done: done } : { done: done, value: c };
+ }
+ };
+ iterator[Si] = returnThis;
+ return iterator;
+ };
+ })(Symbol.iterator, Array.prototype, String.prototype);
+
+ Number.isNaN = Number.isNaN || function (value) {
+ return value !== value;
+ };
+
+ Number.isFinite = Number.isFinite || function (value) {
+ return typeof value === "number" && isFinite(value);
+ };
+ if (!String.prototype.endsWith || function () {
+ try {
+ return !"ab".endsWith("a", 1);
+ } catch (e) {
+ return true;
+ }
+ }()) {
+ String.prototype.endsWith = function (searchString, position) {
+ var subjectString = this.toString();
+ if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
+ position = subjectString.length;
+ }
+ position -= searchString.length;
+ var lastIndex = subjectString.indexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+ };
+ }
+
+ if (!String.prototype.startsWith || function () {
+ try {
+ return !"ab".startsWith("b", 1);
+ } catch (e) {
+ return true;
+ }
+ }()) {
+ String.prototype.startsWith = function (searchString, position) {
+ position = position || 0;
+ return this.substr(position, searchString.length) === searchString;
+ };
+ }
+
+ if (!Array.from) {
+ Array.from = function () {
+ var toInteger = function toInteger(it) {
+ return isNaN(it = +it) ? 0 : (it > 0 ? Math.floor : Math.ceil)(it);
+ };
+ var toLength = function toLength(it) {
+ return it > 0 ? Math.min(toInteger(it), 0x1fffffffffffff) : 0;
+ };
+ var iterCall = function iterCall(iter, fn, val, index) {
+ try {
+ return fn(val, index);
+ } catch (E) {
+ if (typeof iter.return == 'function') iter.return();
+ throw E;
+ }
+ };
+
+ return function from(arrayLike) {
+ var O = Object(arrayLike),
+ C = typeof this == 'function' ? this : Array,
+ aLen = arguments.length,
+ mapfn = aLen > 1 ? arguments[1] : undefined,
+ mapping = mapfn !== undefined,
+ index = 0,
+ iterFn = O[Symbol.iterator],
+ length,
+ result,
+ step,
+ iterator;
+ if (mapping) mapfn = mapfn.bind(aLen > 2 ? arguments[2] : undefined);
+ if (iterFn != undefined && !Array.isArray(arrayLike)) {
+ for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
+ result[index] = mapping ? iterCall(iterator, mapfn, step.value, index) : 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;
+ };
+ }();
+ }
+
+ if (!Array.prototype.find) {
+ Object.defineProperty(Array.prototype, 'find', {
+ configurable: true,
+ writable: true,
+ enumerable: false,
+ value: function value(predicate) {
+ if (this === null) {
+ throw new TypeError('Array.prototype.find called on null or undefined');
+ }
+ if (typeof predicate !== 'function') {
+ throw new TypeError('predicate must be a function');
+ }
+ var list = Object(this);
+ var length = list.length >>> 0;
+ var thisArg = arguments[1];
+ var value;
+
+ for (var i = 0; i < length; i++) {
+ value = list[i];
+ if (predicate.call(thisArg, value, i, list)) {
+ return value;
+ }
+ }
+ return undefined;
+ }
+ });
+ }
+
+ if (!Array.prototype.findIndex) {
+ Object.defineProperty(Array.prototype, 'findIndex', {
+ configurable: true,
+ writable: true,
+ enumerable: false,
+ value: function value(predicate) {
+ if (this === null) {
+ throw new TypeError('Array.prototype.findIndex called on null or undefined');
+ }
+ if (typeof predicate !== 'function') {
+ throw new TypeError('predicate must be a function');
+ }
+ var list = Object(this);
+ var length = list.length >>> 0;
+ var thisArg = arguments[1];
+ var value;
+
+ for (var i = 0; i < length; i++) {
+ value = list[i];
+ if (predicate.call(thisArg, value, i, list)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+ });
+ }
+
+ if (!Array.prototype.includes) {
+ Object.defineProperty(Array.prototype, 'includes', {
+ configurable: true,
+ writable: true,
+ enumerable: false,
+ value: function value(searchElement) {
+ var O = Object(this);
+ var len = parseInt(O.length) || 0;
+ if (len === 0) {
+ return false;
+ }
+ var n = parseInt(arguments[1]) || 0;
+ var k;
+ if (n >= 0) {
+ k = n;
+ } else {
+ k = len + n;
+ if (k < 0) {
+ k = 0;
+ }
+ }
+ var currentElement;
+ while (k < len) {
+ currentElement = O[k];
+ if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
+ return true;
+ }
+ k++;
+ }
+ return false;
+ }
+ });
+ }
+
+ (function () {
+ var needsFix = false;
+
+ try {
+ var s = Object.keys('a');
+ needsFix = s.length !== 1 || s[0] !== '0';
+ } catch (e) {
+ needsFix = true;
+ }
+
+ if (needsFix) {
+ Object.keys = function () {
+ var hasOwnProperty = Object.prototype.hasOwnProperty,
+ hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'),
+ dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ return function (obj) {
+ if (obj === undefined || obj === null) {
+ throw TypeError('Cannot convert undefined or null to object');
+ }
+
+ obj = Object(obj);
+
+ var result = [],
+ prop,
+ i;
+
+ for (prop in obj) {
+ if (hasOwnProperty.call(obj, prop)) {
+ result.push(prop);
+ }
+ }
+
+ if (hasDontEnumBug) {
+ for (i = 0; i < dontEnumsLength; i++) {
+ if (hasOwnProperty.call(obj, dontEnums[i])) {
+ result.push(dontEnums[i]);
+ }
+ }
+ }
+
+ return result;
+ };
+ }();
+ }
+ })();
+
+ (function (O) {
+ if ('assign' in O) {
+ return;
+ }
+
+ O.defineProperty(O, 'assign', {
+ configurable: true,
+ writable: true,
+ value: function () {
+ var gOPS = O.getOwnPropertySymbols,
+ pIE = O.propertyIsEnumerable,
+ filterOS = gOPS ? function (self) {
+ return gOPS(self).filter(pIE, self);
+ } : function () {
+ return Array.prototype;
+ };
+
+ return function assign(where) {
+ if (gOPS && !(where instanceof O)) {
+ console.warn('problematic Symbols', where);
+ }
+
+ function set(keyOrSymbol) {
+ where[keyOrSymbol] = arg[keyOrSymbol];
+ }
+
+ for (var i = 1, ii = arguments.length; i < ii; ++i) {
+ var arg = arguments[i];
+
+ if (arg === null || arg === undefined) {
+ continue;
+ }
+
+ O.keys(arg).concat(filterOS(arg)).forEach(set);
+ }
+
+ return where;
+ };
+ }()
+ });
+ })(Object);
+
+ (function (global) {
+ var i;
+
+ var defineProperty = Object.defineProperty,
+ is = function is(a, b) {
+ return a === b || a !== a && b !== b;
+ };
+
+ if (typeof WeakMap == 'undefined') {
+ global.WeakMap = createCollection({
+ 'delete': sharedDelete,
+
+ clear: sharedClear,
+
+ get: sharedGet,
+
+ has: mapHas,
+
+ set: sharedSet
+ }, true);
+ }
+
+ if (typeof Map == 'undefined' || typeof new Map().values !== 'function' || !new Map().values().next) {
+ var _createCollection;
+
+ global.Map = createCollection((_createCollection = {
+ 'delete': sharedDelete,
+
+ has: mapHas,
+
+ get: sharedGet,
+
+ set: sharedSet,
+
+ keys: sharedKeys,
+
+ values: sharedValues,
+
+ entries: mapEntries,
+
+ forEach: sharedForEach,
+
+ clear: sharedClear
+ }, _createCollection[Symbol.iterator] = mapEntries, _createCollection));
+ }
+
+ if (typeof Set == 'undefined' || typeof new Set().values !== 'function' || !new Set().values().next) {
+ var _createCollection2;
+
+ global.Set = createCollection((_createCollection2 = {
+ has: setHas,
+
+ add: sharedAdd,
+
+ 'delete': sharedDelete,
+
+ clear: sharedClear,
+
+ keys: sharedValues,
+ values: sharedValues,
+
+ entries: setEntries,
+
+ forEach: sharedForEach
+ }, _createCollection2[Symbol.iterator] = sharedValues, _createCollection2));
+ }
+
+ if (typeof WeakSet == 'undefined') {
+ global.WeakSet = createCollection({
+ 'delete': sharedDelete,
+
+ add: sharedAdd,
+
+ clear: sharedClear,
+
+ has: setHas
+ }, true);
+ }
+
+ function createCollection(proto, objectOnly) {
+ function Collection(a) {
+ if (!this || this.constructor !== Collection) return new Collection(a);
+ this._keys = [];
+ this._values = [];
+ this._itp = [];
+ this.objectOnly = objectOnly;
+
+ if (a) init.call(this, a);
+ }
+
+ if (!objectOnly) {
+ defineProperty(proto, 'size', {
+ get: sharedSize
+ });
+ }
+
+ proto.constructor = Collection;
+ Collection.prototype = proto;
+
+ return Collection;
+ }
+
+ function init(a) {
+ var i;
+
+ if (this.add) a.forEach(this.add, this);else a.forEach(function (a) {
+ this.set(a[0], a[1]);
+ }, this);
+ }
+
+ function sharedDelete(key) {
+ if (this.has(key)) {
+ this._keys.splice(i, 1);
+ this._values.splice(i, 1);
+
+ this._itp.forEach(function (p) {
+ if (i < p[0]) p[0]--;
+ });
+ }
+
+ return -1 < i;
+ };
+
+ function sharedGet(key) {
+ return this.has(key) ? this._values[i] : undefined;
+ }
+
+ function has(list, key) {
+ if (this.objectOnly && key !== Object(key)) throw new TypeError("Invalid value used as weak collection key");
+
+ if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);) {} else i = list.indexOf(key);
+ return -1 < i;
+ }
+
+ function setHas(value) {
+ return has.call(this, this._values, value);
+ }
+
+ function mapHas(value) {
+ return has.call(this, this._keys, value);
+ }
+
+ function sharedSet(key, value) {
+ this.has(key) ? this._values[i] = value : this._values[this._keys.push(key) - 1] = value;
+ return this;
+ }
+
+ function sharedAdd(value) {
+ if (!this.has(value)) this._values.push(value);
+ return this;
+ }
+
+ function sharedClear() {
+ (this._keys || 0).length = this._values.length = 0;
+ }
+
+ function sharedKeys() {
+ return sharedIterator(this._itp, this._keys);
+ }
+
+ function sharedValues() {
+ return sharedIterator(this._itp, this._values);
+ }
+
+ function mapEntries() {
+ return sharedIterator(this._itp, this._keys, this._values);
+ }
+
+ function setEntries() {
+ return sharedIterator(this._itp, this._values, this._values);
+ }
+
+ function sharedIterator(itp, array, array2) {
+ var _ref;
+
+ var p = [0],
+ done = false;
+ itp.push(p);
+ return _ref = {}, _ref[Symbol.iterator] = function () {
+ return this;
+ }, _ref.next = function next() {
+ var v,
+ k = p[0];
+ if (!done && k < array.length) {
+ v = array2 ? [array[k], array2[k]] : array[k];
+ p[0]++;
+ } else {
+ done = true;
+ itp.splice(itp.indexOf(p), 1);
+ }
+ return { done: done, value: v };
+ }, _ref;
+ }
+
+ function sharedSize() {
+ return this._values.length;
+ }
+
+ function sharedForEach(callback, context) {
+ var it = this.entries();
+ for (;;) {
+ var r = it.next();
+ if (r.done) break;
+ callback.call(context, r.value[1], r.value[0], this);
+ }
+ }
+ })(_aureliaPal.PLATFORM.global);
+
+ var emptyMetadata = Object.freeze({});
+ var metadataContainerKey = '__metadata__';
+ var bind = Function.prototype.bind;
+
+ if (typeof _aureliaPal.PLATFORM.global.Reflect === 'undefined') {
+ _aureliaPal.PLATFORM.global.Reflect = {};
+ }
+
+ if (typeof Reflect.getOwnMetadata !== 'function') {
+ Reflect.getOwnMetadata = function (metadataKey, target, targetKey) {
+ if (target.hasOwnProperty(metadataContainerKey)) {
+ return (target[metadataContainerKey][targetKey] || emptyMetadata)[metadataKey];
+ }
+ };
+ }
+
+ if (typeof Reflect.defineMetadata !== 'function') {
+ Reflect.defineMetadata = function (metadataKey, metadataValue, target, targetKey) {
+ var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : target[metadataContainerKey] = {};
+ var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
+ targetContainer[metadataKey] = metadataValue;
+ };
+ }
+
+ if (typeof Reflect.metadata !== 'function') {
+ Reflect.metadata = function (metadataKey, metadataValue) {
+ return function (target, targetKey) {
+ Reflect.defineMetadata(metadataKey, metadataValue, target, targetKey);
+ };
+ };
+ }
+
+ if (typeof Reflect.defineProperty !== 'function') {
+ Reflect.defineProperty = function (target, propertyKey, descriptor) {
+ if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' ? target === null : typeof target !== 'function') {
+ throw new TypeError('Reflect.defineProperty called on non-object');
+ }
+ try {
+ Object.defineProperty(target, propertyKey, descriptor);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ };
+ }
+
+ if (typeof Reflect.construct !== 'function') {
+ Reflect.construct = function (Target, args) {
+ if (args) {
+ switch (args.length) {
+ case 0:
+ return new Target();
+ case 1:
+ return new Target(args[0]);
+ case 2:
+ return new Target(args[0], args[1]);
+ case 3:
+ return new Target(args[0], args[1], args[2]);
+ case 4:
+ return new Target(args[0], args[1], args[2], args[3]);
+ }
+ }
+
+ var a = [null];
+ a.push.apply(a, args);
+ return new (bind.apply(Target, a))();
+ };
+ }
+
+ if (typeof Reflect.ownKeys !== 'function') {
+ Reflect.ownKeys = function (o) {
+ return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o));
+ };
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/index.js
new file mode 100644
index 000000000..ea9bd93fb
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-polyfills@1.1.1/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-polyfills'], function (exports, _aureliaPolyfills) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaPolyfills).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaPolyfills[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0.js
new file mode 100644
index 000000000..141154f4c
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-route-recognizer@1.1.0/aurelia-route-recognizer"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/.jspm-hash
new file mode 100644
index 000000000..ce26d16c5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/.jspm-hash
@@ -0,0 +1 @@
+13e21580ae7ddf24b9d4b3bb96ce6453321fbc0599914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/aurelia-route-recognizer.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/aurelia-route-recognizer.js
new file mode 100644
index 000000000..b3291d3e5
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/aurelia-route-recognizer.js
@@ -0,0 +1,517 @@
+/* */
+define(['exports', 'aurelia-path'], function (exports, _aureliaPath) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.RouteRecognizer = exports.EpsilonSegment = exports.StarSegment = exports.DynamicSegment = exports.StaticSegment = exports.State = undefined;
+
+
+
+ var State = exports.State = function () {
+ function State(charSpec) {
+
+
+ this.charSpec = charSpec;
+ this.nextStates = [];
+ }
+
+ State.prototype.get = function get(charSpec) {
+ for (var _iterator = this.nextStates, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
+ var _ref;
+
+ if (_isArray) {
+ if (_i >= _iterator.length) break;
+ _ref = _iterator[_i++];
+ } else {
+ _i = _iterator.next();
+ if (_i.done) break;
+ _ref = _i.value;
+ }
+
+ var child = _ref;
+
+ var isEqual = child.charSpec.validChars === charSpec.validChars && child.charSpec.invalidChars === charSpec.invalidChars;
+
+ if (isEqual) {
+ return child;
+ }
+ }
+
+ return undefined;
+ };
+
+ State.prototype.put = function put(charSpec) {
+ var state = this.get(charSpec);
+
+ if (state) {
+ return state;
+ }
+
+ state = new State(charSpec);
+
+ this.nextStates.push(state);
+
+ if (charSpec.repeat) {
+ state.nextStates.push(state);
+ }
+
+ return state;
+ };
+
+ State.prototype.match = function match(ch) {
+ var nextStates = this.nextStates;
+ var results = [];
+
+ for (var i = 0, l = nextStates.length; i < l; i++) {
+ var child = nextStates[i];
+ var charSpec = child.charSpec;
+
+ if (charSpec.validChars !== undefined) {
+ if (charSpec.validChars.indexOf(ch) !== -1) {
+ results.push(child);
+ }
+ } else if (charSpec.invalidChars !== undefined) {
+ if (charSpec.invalidChars.indexOf(ch) === -1) {
+ results.push(child);
+ }
+ }
+ }
+
+ return results;
+ };
+
+ return State;
+ }();
+
+ var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
+
+ var escapeRegex = new RegExp('(\\' + specials.join('|\\') + ')', 'g');
+
+ var StaticSegment = exports.StaticSegment = function () {
+ function StaticSegment(string, caseSensitive) {
+
+
+ this.string = string;
+ this.caseSensitive = caseSensitive;
+ }
+
+ StaticSegment.prototype.eachChar = function eachChar(callback) {
+ var s = this.string;
+ for (var i = 0, ii = s.length; i < ii; ++i) {
+ var ch = s[i];
+ callback({ validChars: this.caseSensitive ? ch : ch.toUpperCase() + ch.toLowerCase() });
+ }
+ };
+
+ StaticSegment.prototype.regex = function regex() {
+ return this.string.replace(escapeRegex, '\\$1');
+ };
+
+ StaticSegment.prototype.generate = function generate() {
+ return this.string;
+ };
+
+ return StaticSegment;
+ }();
+
+ var DynamicSegment = exports.DynamicSegment = function () {
+ function DynamicSegment(name, optional) {
+
+
+ this.name = name;
+ this.optional = optional;
+ }
+
+ DynamicSegment.prototype.eachChar = function eachChar(callback) {
+ callback({ invalidChars: '/', repeat: true });
+ };
+
+ DynamicSegment.prototype.regex = function regex() {
+ return this.optional ? '([^/]+)?' : '([^/]+)';
+ };
+
+ DynamicSegment.prototype.generate = function generate(params, consumed) {
+ consumed[this.name] = true;
+ return params[this.name];
+ };
+
+ return DynamicSegment;
+ }();
+
+ var StarSegment = exports.StarSegment = function () {
+ function StarSegment(name) {
+
+
+ this.name = name;
+ }
+
+ StarSegment.prototype.eachChar = function eachChar(callback) {
+ callback({ invalidChars: '', repeat: true });
+ };
+
+ StarSegment.prototype.regex = function regex() {
+ return '(.+)';
+ };
+
+ StarSegment.prototype.generate = function generate(params, consumed) {
+ consumed[this.name] = true;
+ return params[this.name];
+ };
+
+ return StarSegment;
+ }();
+
+ var EpsilonSegment = exports.EpsilonSegment = function () {
+ function EpsilonSegment() {
+
+ }
+
+ EpsilonSegment.prototype.eachChar = function eachChar() {};
+
+ EpsilonSegment.prototype.regex = function regex() {
+ return '';
+ };
+
+ EpsilonSegment.prototype.generate = function generate() {
+ return '';
+ };
+
+ return EpsilonSegment;
+ }();
+
+ var RouteRecognizer = exports.RouteRecognizer = function () {
+ function RouteRecognizer() {
+
+
+ this.rootState = new State();
+ this.names = {};
+ }
+
+ RouteRecognizer.prototype.add = function add(route) {
+ var _this = this;
+
+ if (Array.isArray(route)) {
+ route.forEach(function (r) {
+ return _this.add(r);
+ });
+ return undefined;
+ }
+
+ var currentState = this.rootState;
+ var regex = '^';
+ var types = { statics: 0, dynamics: 0, stars: 0 };
+ var names = [];
+ var routeName = route.handler.name;
+ var isEmpty = true;
+ var isAllOptional = true;
+ var segments = parse(route.path, names, types, route.caseSensitive);
+
+ for (var i = 0, ii = segments.length; i < ii; i++) {
+ var segment = segments[i];
+ if (segment instanceof EpsilonSegment) {
+ continue;
+ }
+
+ isEmpty = false;
+ isAllOptional = isAllOptional && segment.optional;
+
+ currentState = addSegment(currentState, segment);
+ regex += segment.optional ? '/?' : '/';
+ regex += segment.regex();
+ }
+
+ if (isAllOptional) {
+ if (isEmpty) {
+ currentState = currentState.put({ validChars: '/' });
+ regex += '/';
+ } else {
+ var finalState = this.rootState.put({ validChars: '/' });
+ currentState.epsilon = [finalState];
+ currentState = finalState;
+ }
+ }
+
+ var handlers = [{ handler: route.handler, names: names }];
+
+ if (routeName) {
+ var routeNames = Array.isArray(routeName) ? routeName : [routeName];
+ for (var _i2 = 0; _i2 < routeNames.length; _i2++) {
+ this.names[routeNames[_i2]] = {
+ segments: segments,
+ handlers: handlers
+ };
+ }
+ }
+
+ currentState.handlers = handlers;
+ currentState.regex = new RegExp(regex + '$', route.caseSensitive ? '' : 'i');
+ currentState.types = types;
+
+ return currentState;
+ };
+
+ RouteRecognizer.prototype.handlersFor = function handlersFor(name) {
+ var route = this.names[name];
+ if (!route) {
+ throw new Error('There is no route named ' + name);
+ }
+
+ return [].concat(route.handlers);
+ };
+
+ RouteRecognizer.prototype.hasRoute = function hasRoute(name) {
+ return !!this.names[name];
+ };
+
+ RouteRecognizer.prototype.generate = function generate(name, params) {
+ var route = this.names[name];
+ if (!route) {
+ throw new Error('There is no route named ' + name);
+ }
+
+ var handler = route.handlers[0].handler;
+ if (handler.generationUsesHref) {
+ return handler.href;
+ }
+
+ var routeParams = Object.assign({}, params);
+ var segments = route.segments;
+ var consumed = {};
+ var output = '';
+
+ for (var i = 0, l = segments.length; i < l; i++) {
+ var segment = segments[i];
+
+ if (segment instanceof EpsilonSegment) {
+ continue;
+ }
+
+ var segmentValue = segment.generate(routeParams, consumed);
+ if (segmentValue === null || segmentValue === undefined) {
+ if (!segment.optional) {
+ throw new Error('A value is required for route parameter \'' + segment.name + '\' in route \'' + name + '\'.');
+ }
+ } else {
+ output += '/';
+ output += segmentValue;
+ }
+ }
+
+ if (output.charAt(0) !== '/') {
+ output = '/' + output;
+ }
+
+ for (var param in consumed) {
+ delete routeParams[param];
+ }
+
+ var queryString = (0, _aureliaPath.buildQueryString)(routeParams);
+ output += queryString ? '?' + queryString : '';
+
+ return output;
+ };
+
+ RouteRecognizer.prototype.recognize = function recognize(path) {
+ var states = [this.rootState];
+ var queryParams = {};
+ var isSlashDropped = false;
+ var normalizedPath = path;
+
+ var queryStart = normalizedPath.indexOf('?');
+ if (queryStart !== -1) {
+ var queryString = normalizedPath.substr(queryStart + 1, normalizedPath.length);
+ normalizedPath = normalizedPath.substr(0, queryStart);
+ queryParams = (0, _aureliaPath.parseQueryString)(queryString);
+ }
+
+ normalizedPath = decodeURI(normalizedPath);
+
+ if (normalizedPath.charAt(0) !== '/') {
+ normalizedPath = '/' + normalizedPath;
+ }
+
+ var pathLen = normalizedPath.length;
+ if (pathLen > 1 && normalizedPath.charAt(pathLen - 1) === '/') {
+ normalizedPath = normalizedPath.substr(0, pathLen - 1);
+ isSlashDropped = true;
+ }
+
+ for (var i = 0, l = normalizedPath.length; i < l; i++) {
+ states = recognizeChar(states, normalizedPath.charAt(i));
+ if (!states.length) {
+ break;
+ }
+ }
+
+ var solutions = [];
+ for (var _i3 = 0, _l = states.length; _i3 < _l; _i3++) {
+ if (states[_i3].handlers) {
+ solutions.push(states[_i3]);
+ }
+ }
+
+ states = sortSolutions(solutions);
+
+ var state = solutions[0];
+ if (state && state.handlers) {
+ if (isSlashDropped && state.regex.source.slice(-5) === '(.+)$') {
+ normalizedPath = normalizedPath + '/';
+ }
+
+ return findHandler(state, normalizedPath, queryParams);
+ }
+
+ return undefined;
+ };
+
+ return RouteRecognizer;
+ }();
+
+ var RecognizeResults = function RecognizeResults(queryParams) {
+
+
+ this.splice = Array.prototype.splice;
+ this.slice = Array.prototype.slice;
+ this.push = Array.prototype.push;
+ this.length = 0;
+ this.queryParams = queryParams || {};
+ };
+
+ function parse(route, names, types, caseSensitive) {
+ var normalizedRoute = route;
+ if (route.charAt(0) === '/') {
+ normalizedRoute = route.substr(1);
+ }
+
+ var results = [];
+
+ var splitRoute = normalizedRoute.split('/');
+ for (var i = 0, ii = splitRoute.length; i < ii; ++i) {
+ var segment = splitRoute[i];
+
+ var match = segment.match(/^:([^?]+)(\?)?$/);
+ if (match) {
+ var _match = match;
+ var _name = _match[1];
+ var optional = _match[2];
+
+ if (_name.indexOf('=') !== -1) {
+ throw new Error('Parameter ' + _name + ' in route ' + route + ' has a default value, which is not supported.');
+ }
+ results.push(new DynamicSegment(_name, !!optional));
+ names.push(_name);
+ types.dynamics++;
+ continue;
+ }
+
+ match = segment.match(/^\*(.+)$/);
+ if (match) {
+ results.push(new StarSegment(match[1]));
+ names.push(match[1]);
+ types.stars++;
+ } else if (segment === '') {
+ results.push(new EpsilonSegment());
+ } else {
+ results.push(new StaticSegment(segment, caseSensitive));
+ types.statics++;
+ }
+ }
+
+ return results;
+ }
+
+ function sortSolutions(states) {
+ return states.sort(function (a, b) {
+ if (a.types.stars !== b.types.stars) {
+ return a.types.stars - b.types.stars;
+ }
+
+ if (a.types.stars) {
+ if (a.types.statics !== b.types.statics) {
+ return b.types.statics - a.types.statics;
+ }
+ if (a.types.dynamics !== b.types.dynamics) {
+ return b.types.dynamics - a.types.dynamics;
+ }
+ }
+
+ if (a.types.dynamics !== b.types.dynamics) {
+ return a.types.dynamics - b.types.dynamics;
+ }
+
+ if (a.types.statics !== b.types.statics) {
+ return b.types.statics - a.types.statics;
+ }
+
+ return 0;
+ });
+ }
+
+ function recognizeChar(states, ch) {
+ var nextStates = [];
+
+ for (var i = 0, l = states.length; i < l; i++) {
+ var state = states[i];
+ nextStates.push.apply(nextStates, state.match(ch));
+ }
+
+ var skippableStates = nextStates.filter(function (s) {
+ return s.epsilon;
+ });
+
+ var _loop = function _loop() {
+ var newStates = [];
+ skippableStates.forEach(function (s) {
+ nextStates.push.apply(nextStates, s.epsilon);
+ newStates.push.apply(newStates, s.epsilon);
+ });
+ skippableStates = newStates.filter(function (s) {
+ return s.epsilon;
+ });
+ };
+
+ while (skippableStates.length > 0) {
+ _loop();
+ }
+
+ return nextStates;
+ }
+
+ function findHandler(state, path, queryParams) {
+ var handlers = state.handlers;
+ var regex = state.regex;
+ var captures = path.match(regex);
+ var currentCapture = 1;
+ var result = new RecognizeResults(queryParams);
+
+ for (var i = 0, l = handlers.length; i < l; i++) {
+ var _handler = handlers[i];
+ var _names = _handler.names;
+ var _params = {};
+
+ for (var j = 0, m = _names.length; j < m; j++) {
+ _params[_names[j]] = captures[currentCapture++];
+ }
+
+ result.push({ handler: _handler.handler, params: _params, isDynamic: !!_names.length });
+ }
+
+ return result;
+ }
+
+ function addSegment(currentState, segment) {
+ var state = currentState.put({ validChars: '/' });
+ segment.eachChar(function (ch) {
+ state = state.put(ch);
+ });
+
+ if (segment.optional) {
+ currentState.epsilon = currentState.epsilon || [];
+ currentState.epsilon.push(state);
+ }
+
+ return state;
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/index.js
new file mode 100644
index 000000000..c75afbf40
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-route-recognizer@1.1.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-route-recognizer'], function (exports, _aureliaRouteRecognizer) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaRouteRecognizer).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaRouteRecognizer[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6.js
new file mode 100644
index 000000000..3b4774537
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-router@1.0.6/aurelia-router"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/.jspm-hash
new file mode 100644
index 000000000..48ad35845
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/.jspm-hash
@@ -0,0 +1 @@
+31925e9da344dd9503e1110a1a2ef17cfe9c7a1b99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/aurelia-router.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/aurelia-router.js
new file mode 100644
index 000000000..ff891e090
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/aurelia-router.js
@@ -0,0 +1,1834 @@
+/* */
+define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-dependency-injection', 'aurelia-history', 'aurelia-event-aggregator'], function (exports, _aureliaLogging, _aureliaRouteRecognizer, _aureliaDependencyInjection, _aureliaHistory, _aureliaEventAggregator) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.AppRouter = exports.PipelineProvider = exports.LoadRouteStep = exports.RouteLoader = exports.ActivateNextStep = exports.DeactivatePreviousStep = exports.CanActivateNextStep = exports.CanDeactivatePreviousStep = exports.Router = exports.BuildNavigationPlanStep = exports.activationStrategy = exports.RouterConfiguration = exports.RedirectToRoute = exports.Redirect = exports.NavModel = exports.NavigationInstruction = exports.CommitChangesStep = exports.Pipeline = exports.pipelineStatus = undefined;
+ exports._normalizeAbsolutePath = _normalizeAbsolutePath;
+ exports._createRootedPath = _createRootedPath;
+ exports._resolveUrl = _resolveUrl;
+ exports.isNavigationCommand = isNavigationCommand;
+ exports._buildNavigationPlan = _buildNavigationPlan;
+
+ var LogManager = _interopRequireWildcard(_aureliaLogging);
+
+ function _interopRequireWildcard(obj) {
+ if (obj && obj.__esModule) {
+ return obj;
+ } else {
+ var newObj = {};
+
+ if (obj != null) {
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
+ }
+ }
+
+ newObj.default = obj;
+ return newObj;
+ }
+ }
+
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }
+
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+ 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 _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;
+ };
+ }();
+
+
+
+ function _normalizeAbsolutePath(path, hasPushState) {
+ var absolute = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
+
+ if (!hasPushState && path[0] !== '#') {
+ path = '#' + path;
+ }
+
+ if (hasPushState && absolute) {
+ path = path.substring(1, path.length);
+ }
+
+ return path;
+ }
+
+ function _createRootedPath(fragment, baseUrl, hasPushState, absolute) {
+ if (isAbsoluteUrl.test(fragment)) {
+ return fragment;
+ }
+
+ var path = '';
+
+ if (baseUrl.length && baseUrl[0] !== '/') {
+ path += '/';
+ }
+
+ path += baseUrl;
+
+ if ((!path.length || path[path.length - 1] !== '/') && fragment[0] !== '/') {
+ path += '/';
+ }
+
+ if (path.length && path[path.length - 1] === '/' && fragment[0] === '/') {
+ path = path.substring(0, path.length - 1);
+ }
+
+ return _normalizeAbsolutePath(path + fragment, hasPushState, absolute);
+ }
+
+ function _resolveUrl(fragment, baseUrl, hasPushState) {
+ if (isRootedPath.test(fragment)) {
+ return _normalizeAbsolutePath(fragment, hasPushState);
+ }
+
+ return _createRootedPath(fragment, baseUrl, hasPushState);
+ }
+
+ var isRootedPath = /^#?\//;
+ var isAbsoluteUrl = /^([a-z][a-z0-9+\-.]*:)?\/\//i;
+
+ var pipelineStatus = exports.pipelineStatus = {
+ completed: 'completed',
+ canceled: 'canceled',
+ rejected: 'rejected',
+ running: 'running'
+ };
+
+ var Pipeline = exports.Pipeline = function () {
+ function Pipeline() {
+
+
+ this.steps = [];
+ }
+
+ Pipeline.prototype.addStep = function addStep(step) {
+ var run = void 0;
+
+ if (typeof step === 'function') {
+ run = step;
+ } else if (typeof step.getSteps === 'function') {
+ var steps = step.getSteps();
+ for (var i = 0, l = steps.length; i < l; i++) {
+ this.addStep(steps[i]);
+ }
+
+ return this;
+ } else {
+ run = step.run.bind(step);
+ }
+
+ this.steps.push(run);
+
+ return this;
+ };
+
+ Pipeline.prototype.run = function run(instruction) {
+ var index = -1;
+ var steps = this.steps;
+
+ function next() {
+ index++;
+
+ if (index < steps.length) {
+ var currentStep = steps[index];
+
+ try {
+ return currentStep(instruction, next);
+ } catch (e) {
+ return next.reject(e);
+ }
+ } else {
+ return next.complete();
+ }
+ }
+
+ next.complete = createCompletionHandler(next, pipelineStatus.completed);
+ next.cancel = createCompletionHandler(next, pipelineStatus.canceled);
+ next.reject = createCompletionHandler(next, pipelineStatus.rejected);
+
+ return next();
+ };
+
+ return Pipeline;
+ }();
+
+ function createCompletionHandler(next, status) {
+ return function (output) {
+ return Promise.resolve({ status: status, output: output, completed: status === pipelineStatus.completed });
+ };
+ }
+
+ var CommitChangesStep = exports.CommitChangesStep = function () {
+ function CommitChangesStep() {
+
+ }
+
+ CommitChangesStep.prototype.run = function run(navigationInstruction, next) {
+ return navigationInstruction._commitChanges(true).then(function () {
+ navigationInstruction._updateTitle();
+ return next();
+ });
+ };
+
+ return CommitChangesStep;
+ }();
+
+ var NavigationInstruction = exports.NavigationInstruction = function () {
+ function NavigationInstruction(init) {
+
+
+ this.plan = null;
+ this.options = {};
+
+ Object.assign(this, init);
+
+ this.params = this.params || {};
+ this.viewPortInstructions = {};
+
+ var ancestorParams = [];
+ var current = this;
+ do {
+ var currentParams = Object.assign({}, current.params);
+ if (current.config && current.config.hasChildRouter) {
+ delete currentParams[current.getWildCardName()];
+ }
+
+ ancestorParams.unshift(currentParams);
+ current = current.parentInstruction;
+ } while (current);
+
+ var allParams = Object.assign.apply(Object, [{}, this.queryParams].concat(ancestorParams));
+ this.lifecycleArgs = [allParams, this.config, this];
+ }
+
+ NavigationInstruction.prototype.getAllInstructions = function getAllInstructions() {
+ var instructions = [this];
+ for (var key in this.viewPortInstructions) {
+ var childInstruction = this.viewPortInstructions[key].childNavigationInstruction;
+ if (childInstruction) {
+ instructions.push.apply(instructions, childInstruction.getAllInstructions());
+ }
+ }
+
+ return instructions;
+ };
+
+ NavigationInstruction.prototype.getAllPreviousInstructions = function getAllPreviousInstructions() {
+ return this.getAllInstructions().map(function (c) {
+ return c.previousInstruction;
+ }).filter(function (c) {
+ return c;
+ });
+ };
+
+ NavigationInstruction.prototype.addViewPortInstruction = function addViewPortInstruction(viewPortName, strategy, moduleId, component) {
+ var viewportInstruction = this.viewPortInstructions[viewPortName] = {
+ name: viewPortName,
+ strategy: strategy,
+ moduleId: moduleId,
+ component: component,
+ childRouter: component.childRouter,
+ lifecycleArgs: this.lifecycleArgs.slice()
+ };
+
+ return viewportInstruction;
+ };
+
+ NavigationInstruction.prototype.getWildCardName = function getWildCardName() {
+ var wildcardIndex = this.config.route.lastIndexOf('*');
+ return this.config.route.substr(wildcardIndex + 1);
+ };
+
+ NavigationInstruction.prototype.getWildcardPath = function getWildcardPath() {
+ var wildcardName = this.getWildCardName();
+ var path = this.params[wildcardName] || '';
+
+ if (this.queryString) {
+ path += '?' + this.queryString;
+ }
+
+ return path;
+ };
+
+ NavigationInstruction.prototype.getBaseUrl = function getBaseUrl() {
+ if (!this.params) {
+ return this.fragment;
+ }
+
+ var wildcardName = this.getWildCardName();
+ var path = this.params[wildcardName] || '';
+
+ if (!path) {
+ return this.fragment;
+ }
+
+ path = encodeURI(path);
+ return this.fragment.substr(0, this.fragment.lastIndexOf(path));
+ };
+
+ NavigationInstruction.prototype._commitChanges = function _commitChanges(waitToSwap) {
+ var _this = this;
+
+ var router = this.router;
+ router.currentInstruction = this;
+
+ if (this.previousInstruction) {
+ this.previousInstruction.config.navModel.isActive = false;
+ }
+
+ this.config.navModel.isActive = true;
+
+ router._refreshBaseUrl();
+ router.refreshNavigation();
+
+ var loads = [];
+ var delaySwaps = [];
+
+ var _loop = function _loop(viewPortName) {
+ var viewPortInstruction = _this.viewPortInstructions[viewPortName];
+ var viewPort = router.viewPorts[viewPortName];
+
+ if (!viewPort) {
+ throw new Error('There was no router-view found in the view for ' + viewPortInstruction.moduleId + '.');
+ }
+
+ if (viewPortInstruction.strategy === activationStrategy.replace) {
+ if (waitToSwap) {
+ delaySwaps.push({ viewPort: viewPort, viewPortInstruction: viewPortInstruction });
+ }
+
+ loads.push(viewPort.process(viewPortInstruction, waitToSwap).then(function (x) {
+ if (viewPortInstruction.childNavigationInstruction) {
+ return viewPortInstruction.childNavigationInstruction._commitChanges();
+ }
+
+ return undefined;
+ }));
+ } else {
+ if (viewPortInstruction.childNavigationInstruction) {
+ loads.push(viewPortInstruction.childNavigationInstruction._commitChanges(waitToSwap));
+ }
+ }
+ };
+
+ for (var viewPortName in this.viewPortInstructions) {
+ _loop(viewPortName);
+ }
+
+ return Promise.all(loads).then(function () {
+ delaySwaps.forEach(function (x) {
+ return x.viewPort.swap(x.viewPortInstruction);
+ });
+ return null;
+ }).then(function () {
+ return prune(_this);
+ });
+ };
+
+ NavigationInstruction.prototype._updateTitle = function _updateTitle() {
+ var title = this._buildTitle();
+ if (title) {
+ this.router.history.setTitle(title);
+ }
+ };
+
+ NavigationInstruction.prototype._buildTitle = function _buildTitle() {
+ var separator = arguments.length <= 0 || arguments[0] === undefined ? ' | ' : arguments[0];
+
+ var title = this.config.navModel.title || '';
+ var childTitles = [];
+
+ for (var viewPortName in this.viewPortInstructions) {
+ var _viewPortInstruction = this.viewPortInstructions[viewPortName];
+
+ if (_viewPortInstruction.childNavigationInstruction) {
+ var childTitle = _viewPortInstruction.childNavigationInstruction._buildTitle(separator);
+ if (childTitle) {
+ childTitles.push(childTitle);
+ }
+ }
+ }
+
+ if (childTitles.length) {
+ title = childTitles.join(separator) + (title ? separator : '') + title;
+ }
+
+ if (this.router.title) {
+ title += (title ? separator : '') + this.router.title;
+ }
+
+ return title;
+ };
+
+ return NavigationInstruction;
+ }();
+
+ function prune(instruction) {
+ instruction.previousInstruction = null;
+ instruction.plan = null;
+ }
+
+ var NavModel = exports.NavModel = function () {
+ function NavModel(router, relativeHref) {
+
+
+ this.isActive = false;
+ this.title = null;
+ this.href = null;
+ this.relativeHref = null;
+ this.settings = {};
+ this.config = null;
+
+ this.router = router;
+ this.relativeHref = relativeHref;
+ }
+
+ NavModel.prototype.setTitle = function setTitle(title) {
+ this.title = title;
+
+ if (this.isActive) {
+ this.router.updateTitle();
+ }
+ };
+
+ return NavModel;
+ }();
+
+ function isNavigationCommand(obj) {
+ return obj && typeof obj.navigate === 'function';
+ }
+
+ var Redirect = exports.Redirect = function () {
+ function Redirect(url) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+
+
+ this.url = url;
+ this.options = Object.assign({ trigger: true, replace: true }, options);
+ this.shouldContinueProcessing = false;
+ }
+
+ Redirect.prototype.setRouter = function setRouter(router) {
+ this.router = router;
+ };
+
+ Redirect.prototype.navigate = function navigate(appRouter) {
+ var navigatingRouter = this.options.useAppRouter ? appRouter : this.router || appRouter;
+ navigatingRouter.navigate(this.url, this.options);
+ };
+
+ return Redirect;
+ }();
+
+ var RedirectToRoute = exports.RedirectToRoute = function () {
+ function RedirectToRoute(route) {
+ var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+
+
+ this.route = route;
+ this.params = params;
+ this.options = Object.assign({ trigger: true, replace: true }, options);
+ this.shouldContinueProcessing = false;
+ }
+
+ RedirectToRoute.prototype.setRouter = function setRouter(router) {
+ this.router = router;
+ };
+
+ RedirectToRoute.prototype.navigate = function navigate(appRouter) {
+ var navigatingRouter = this.options.useAppRouter ? appRouter : this.router || appRouter;
+ navigatingRouter.navigateToRoute(this.route, this.params, this.options);
+ };
+
+ return RedirectToRoute;
+ }();
+
+ var RouterConfiguration = exports.RouterConfiguration = function () {
+ function RouterConfiguration() {
+
+
+ this.instructions = [];
+ this.options = {};
+ this.pipelineSteps = [];
+ }
+
+ RouterConfiguration.prototype.addPipelineStep = function addPipelineStep(name, step) {
+ this.pipelineSteps.push({ name: name, step: step });
+ return this;
+ };
+
+ RouterConfiguration.prototype.addAuthorizeStep = function addAuthorizeStep(step) {
+ return this.addPipelineStep('authorize', step);
+ };
+
+ RouterConfiguration.prototype.addPreActivateStep = function addPreActivateStep(step) {
+ return this.addPipelineStep('preActivate', step);
+ };
+
+ RouterConfiguration.prototype.addPreRenderStep = function addPreRenderStep(step) {
+ return this.addPipelineStep('preRender', step);
+ };
+
+ RouterConfiguration.prototype.addPostRenderStep = function addPostRenderStep(step) {
+ return this.addPipelineStep('postRender', step);
+ };
+
+ RouterConfiguration.prototype.map = function map(route) {
+ if (Array.isArray(route)) {
+ route.forEach(this.map.bind(this));
+ return this;
+ }
+
+ return this.mapRoute(route);
+ };
+
+ RouterConfiguration.prototype.mapRoute = function mapRoute(config) {
+ this.instructions.push(function (router) {
+ var routeConfigs = [];
+
+ if (Array.isArray(config.route)) {
+ for (var i = 0, ii = config.route.length; i < ii; ++i) {
+ var current = Object.assign({}, config);
+ current.route = config.route[i];
+ routeConfigs.push(current);
+ }
+ } else {
+ routeConfigs.push(Object.assign({}, config));
+ }
+
+ var navModel = void 0;
+ for (var _i = 0, _ii = routeConfigs.length; _i < _ii; ++_i) {
+ var _routeConfig = routeConfigs[_i];
+ _routeConfig.settings = _routeConfig.settings || {};
+ if (!navModel) {
+ navModel = router.createNavModel(_routeConfig);
+ }
+
+ router.addRoute(_routeConfig, navModel);
+ }
+ });
+
+ return this;
+ };
+
+ RouterConfiguration.prototype.mapUnknownRoutes = function mapUnknownRoutes(config) {
+ this.unknownRouteConfig = config;
+ return this;
+ };
+
+ RouterConfiguration.prototype.exportToRouter = function exportToRouter(router) {
+ var instructions = this.instructions;
+ for (var i = 0, ii = instructions.length; i < ii; ++i) {
+ instructions[i](router);
+ }
+
+ if (this.title) {
+ router.title = this.title;
+ }
+
+ if (this.unknownRouteConfig) {
+ router.handleUnknownRoutes(this.unknownRouteConfig);
+ }
+
+ router.options = this.options;
+
+ var pipelineSteps = this.pipelineSteps;
+ if (pipelineSteps.length) {
+ if (!router.isRoot) {
+ throw new Error('Pipeline steps can only be added to the root router');
+ }
+
+ var pipelineProvider = router.pipelineProvider;
+ for (var _i2 = 0, _ii2 = pipelineSteps.length; _i2 < _ii2; ++_i2) {
+ var _pipelineSteps$_i = pipelineSteps[_i2];
+ var _name = _pipelineSteps$_i.name;
+ var step = _pipelineSteps$_i.step;
+
+ pipelineProvider.addStep(_name, step);
+ }
+ }
+ };
+
+ return RouterConfiguration;
+ }();
+
+ var activationStrategy = exports.activationStrategy = {
+ noChange: 'no-change',
+ invokeLifecycle: 'invoke-lifecycle',
+ replace: 'replace'
+ };
+
+ var BuildNavigationPlanStep = exports.BuildNavigationPlanStep = function () {
+ function BuildNavigationPlanStep() {
+
+ }
+
+ BuildNavigationPlanStep.prototype.run = function run(navigationInstruction, next) {
+ return _buildNavigationPlan(navigationInstruction).then(function (plan) {
+ navigationInstruction.plan = plan;
+ return next();
+ }).catch(next.cancel);
+ };
+
+ return BuildNavigationPlanStep;
+ }();
+
+ function _buildNavigationPlan(instruction, forceLifecycleMinimum) {
+ var prev = instruction.previousInstruction;
+ var config = instruction.config;
+ var plan = {};
+
+ if ('redirect' in config) {
+ var redirectLocation = _resolveUrl(config.redirect, getInstructionBaseUrl(instruction));
+ if (instruction.queryString) {
+ redirectLocation += '?' + instruction.queryString;
+ }
+
+ return Promise.reject(new Redirect(redirectLocation));
+ }
+
+ if (prev) {
+ var newParams = hasDifferentParameterValues(prev, instruction);
+ var pending = [];
+
+ var _loop2 = function _loop2(viewPortName) {
+ var prevViewPortInstruction = prev.viewPortInstructions[viewPortName];
+ var nextViewPortConfig = config.viewPorts[viewPortName];
+
+ if (!nextViewPortConfig) throw new Error('Invalid Route Config: Configuration for viewPort "' + viewPortName + '" was not found for route: "' + instruction.config.route + '."');
+
+ var viewPortPlan = plan[viewPortName] = {
+ name: viewPortName,
+ config: nextViewPortConfig,
+ prevComponent: prevViewPortInstruction.component,
+ prevModuleId: prevViewPortInstruction.moduleId
+ };
+
+ if (prevViewPortInstruction.moduleId !== nextViewPortConfig.moduleId) {
+ viewPortPlan.strategy = activationStrategy.replace;
+ } else if ('determineActivationStrategy' in prevViewPortInstruction.component.viewModel) {
+ var _prevViewPortInstruct;
+
+ viewPortPlan.strategy = (_prevViewPortInstruct = prevViewPortInstruction.component.viewModel).determineActivationStrategy.apply(_prevViewPortInstruct, instruction.lifecycleArgs);
+ } else if (config.activationStrategy) {
+ viewPortPlan.strategy = config.activationStrategy;
+ } else if (newParams || forceLifecycleMinimum) {
+ viewPortPlan.strategy = activationStrategy.invokeLifecycle;
+ } else {
+ viewPortPlan.strategy = activationStrategy.noChange;
+ }
+
+ if (viewPortPlan.strategy !== activationStrategy.replace && prevViewPortInstruction.childRouter) {
+ var path = instruction.getWildcardPath();
+ var task = prevViewPortInstruction.childRouter._createNavigationInstruction(path, instruction).then(function (childInstruction) {
+ viewPortPlan.childNavigationInstruction = childInstruction;
+
+ return _buildNavigationPlan(childInstruction, viewPortPlan.strategy === activationStrategy.invokeLifecycle).then(function (childPlan) {
+ childInstruction.plan = childPlan;
+ });
+ });
+
+ pending.push(task);
+ }
+ };
+
+ for (var viewPortName in prev.viewPortInstructions) {
+ _loop2(viewPortName);
+ }
+
+ return Promise.all(pending).then(function () {
+ return plan;
+ });
+ }
+
+ for (var _viewPortName in config.viewPorts) {
+ plan[_viewPortName] = {
+ name: _viewPortName,
+ strategy: activationStrategy.replace,
+ config: instruction.config.viewPorts[_viewPortName]
+ };
+ }
+
+ return Promise.resolve(plan);
+ }
+
+ function hasDifferentParameterValues(prev, next) {
+ var prevParams = prev.params;
+ var nextParams = next.params;
+ var nextWildCardName = next.config.hasChildRouter ? next.getWildCardName() : null;
+
+ for (var key in nextParams) {
+ if (key === nextWildCardName) {
+ continue;
+ }
+
+ if (prevParams[key] !== nextParams[key]) {
+ return true;
+ }
+ }
+
+ for (var _key in prevParams) {
+ if (_key === nextWildCardName) {
+ continue;
+ }
+
+ if (prevParams[_key] !== nextParams[_key]) {
+ return true;
+ }
+ }
+
+ if (!next.options.compareQueryParams) {
+ return false;
+ }
+
+ var prevQueryParams = prev.queryParams;
+ var nextQueryParams = next.queryParams;
+ for (var _key2 in nextQueryParams) {
+ if (prevQueryParams[_key2] !== nextQueryParams[_key2]) {
+ return true;
+ }
+ }
+
+ for (var _key3 in prevQueryParams) {
+ if (prevQueryParams[_key3] !== nextQueryParams[_key3]) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ function getInstructionBaseUrl(instruction) {
+ var instructionBaseUrlParts = [];
+ instruction = instruction.parentInstruction;
+
+ while (instruction) {
+ instructionBaseUrlParts.unshift(instruction.getBaseUrl());
+ instruction = instruction.parentInstruction;
+ }
+
+ instructionBaseUrlParts.unshift('/');
+ return instructionBaseUrlParts.join('');
+ }
+
+ var Router = exports.Router = function () {
+ function Router(container, history) {
+
+
+ this.parent = null;
+ this.options = {};
+
+ this.container = container;
+ this.history = history;
+ this.reset();
+ }
+
+ Router.prototype.reset = function reset() {
+ var _this2 = this;
+
+ this.viewPorts = {};
+ this.routes = [];
+ this.baseUrl = '';
+ this.isConfigured = false;
+ this.isNavigating = false;
+ this.navigation = [];
+ this.currentInstruction = null;
+ this._fallbackOrder = 100;
+ this._recognizer = new _aureliaRouteRecognizer.RouteRecognizer();
+ this._childRecognizer = new _aureliaRouteRecognizer.RouteRecognizer();
+ this._configuredPromise = new Promise(function (resolve) {
+ _this2._resolveConfiguredPromise = resolve;
+ });
+ };
+
+ Router.prototype.registerViewPort = function registerViewPort(viewPort, name) {
+ name = name || 'default';
+ this.viewPorts[name] = viewPort;
+ };
+
+ Router.prototype.ensureConfigured = function ensureConfigured() {
+ return this._configuredPromise;
+ };
+
+ Router.prototype.configure = function configure(callbackOrConfig) {
+ var _this3 = this;
+
+ this.isConfigured = true;
+
+ var result = callbackOrConfig;
+ var config = void 0;
+ if (typeof callbackOrConfig === 'function') {
+ config = new RouterConfiguration();
+ result = callbackOrConfig(config);
+ }
+
+ return Promise.resolve(result).then(function (c) {
+ if (c && c.exportToRouter) {
+ config = c;
+ }
+
+ config.exportToRouter(_this3);
+ _this3.isConfigured = true;
+ _this3._resolveConfiguredPromise();
+ });
+ };
+
+ Router.prototype.navigate = function navigate(fragment, options) {
+ if (!this.isConfigured && this.parent) {
+ return this.parent.navigate(fragment, options);
+ }
+
+ return this.history.navigate(_resolveUrl(fragment, this.baseUrl, this.history._hasPushState), options);
+ };
+
+ Router.prototype.navigateToRoute = function navigateToRoute(route, params, options) {
+ var path = this.generate(route, params);
+ return this.navigate(path, options);
+ };
+
+ Router.prototype.navigateBack = function navigateBack() {
+ this.history.navigateBack();
+ };
+
+ Router.prototype.createChild = function createChild(container) {
+ var childRouter = new Router(container || this.container.createChild(), this.history);
+ childRouter.parent = this;
+ return childRouter;
+ };
+
+ Router.prototype.generate = function generate(name, params) {
+ var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
+
+ var hasRoute = this._recognizer.hasRoute(name);
+ if ((!this.isConfigured || !hasRoute) && this.parent) {
+ return this.parent.generate(name, params);
+ }
+
+ if (!hasRoute) {
+ throw new Error('A route with name \'' + name + '\' could not be found. Check that `name: \'' + name + '\'` was specified in the route\'s config.');
+ }
+
+ var path = this._recognizer.generate(name, params);
+ var rootedPath = _createRootedPath(path, this.baseUrl, this.history._hasPushState, options.absolute);
+ return options.absolute ? '' + this.history.getAbsoluteRoot() + rootedPath : rootedPath;
+ };
+
+ Router.prototype.createNavModel = function createNavModel(config) {
+ var navModel = new NavModel(this, 'href' in config ? config.href : config.route);
+ navModel.title = config.title;
+ navModel.order = config.nav;
+ navModel.href = config.href;
+ navModel.settings = config.settings;
+ navModel.config = config;
+
+ return navModel;
+ };
+
+ Router.prototype.addRoute = function addRoute(config, navModel) {
+ validateRouteConfig(config, this.routes);
+
+ if (!('viewPorts' in config) && !config.navigationStrategy) {
+ config.viewPorts = {
+ 'default': {
+ moduleId: config.moduleId,
+ view: config.view
+ }
+ };
+ }
+
+ if (!navModel) {
+ navModel = this.createNavModel(config);
+ }
+
+ this.routes.push(config);
+
+ var path = config.route;
+ if (path.charAt(0) === '/') {
+ path = path.substr(1);
+ }
+ var caseSensitive = config.caseSensitive === true;
+ var state = this._recognizer.add({ path: path, handler: config, caseSensitive: caseSensitive });
+
+ if (path) {
+ var _settings = config.settings;
+ delete config.settings;
+ var withChild = JSON.parse(JSON.stringify(config));
+ config.settings = _settings;
+ withChild.route = path + '/*childRoute';
+ withChild.hasChildRouter = true;
+ this._childRecognizer.add({
+ path: withChild.route,
+ handler: withChild,
+ caseSensitive: caseSensitive
+ });
+
+ withChild.navModel = navModel;
+ withChild.settings = config.settings;
+ withChild.navigationStrategy = config.navigationStrategy;
+ }
+
+ config.navModel = navModel;
+
+ if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) {
+ if (!navModel.href && navModel.href !== '' && (state.types.dynamics || state.types.stars)) {
+ throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.');
+ }
+
+ if (typeof navModel.order !== 'number') {
+ navModel.order = ++this._fallbackOrder;
+ }
+
+ this.navigation.push(navModel);
+ this.navigation = this.navigation.sort(function (a, b) {
+ return a.order - b.order;
+ });
+ }
+ };
+
+ Router.prototype.hasRoute = function hasRoute(name) {
+ return !!(this._recognizer.hasRoute(name) || this.parent && this.parent.hasRoute(name));
+ };
+
+ Router.prototype.hasOwnRoute = function hasOwnRoute(name) {
+ return this._recognizer.hasRoute(name);
+ };
+
+ Router.prototype.handleUnknownRoutes = function handleUnknownRoutes(config) {
+ var _this4 = this;
+
+ if (!config) {
+ throw new Error('Invalid unknown route handler');
+ }
+
+ this.catchAllHandler = function (instruction) {
+ return _this4._createRouteConfig(config, instruction).then(function (c) {
+ instruction.config = c;
+ return instruction;
+ });
+ };
+ };
+
+ Router.prototype.updateTitle = function updateTitle() {
+ if (this.parent) {
+ return this.parent.updateTitle();
+ }
+
+ this.currentInstruction._updateTitle();
+ return undefined;
+ };
+
+ Router.prototype.refreshNavigation = function refreshNavigation() {
+ var nav = this.navigation;
+
+ for (var i = 0, length = nav.length; i < length; i++) {
+ var current = nav[i];
+ if (!current.config.href) {
+ current.href = _createRootedPath(current.relativeHref, this.baseUrl, this.history._hasPushState);
+ } else {
+ current.href = _normalizeAbsolutePath(current.config.href, this.history._hasPushState);
+ }
+ }
+ };
+
+ Router.prototype._refreshBaseUrl = function _refreshBaseUrl() {
+ if (this.parent) {
+ var baseUrl = this.parent.currentInstruction.getBaseUrl();
+ this.baseUrl = this.parent.baseUrl + baseUrl;
+ }
+ };
+
+ Router.prototype._createNavigationInstruction = function _createNavigationInstruction() {
+ var url = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
+ var parentInstruction = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
+
+ var fragment = url;
+ var queryString = '';
+
+ var queryIndex = url.indexOf('?');
+ if (queryIndex !== -1) {
+ fragment = url.substr(0, queryIndex);
+ queryString = url.substr(queryIndex + 1);
+ }
+
+ var results = this._recognizer.recognize(url);
+ if (!results || !results.length) {
+ results = this._childRecognizer.recognize(url);
+ }
+
+ var instructionInit = {
+ fragment: fragment,
+ queryString: queryString,
+ config: null,
+ parentInstruction: parentInstruction,
+ previousInstruction: this.currentInstruction,
+ router: this,
+ options: {
+ compareQueryParams: this.options.compareQueryParams
+ }
+ };
+
+ if (results && results.length) {
+ var first = results[0];
+ var _instruction = new NavigationInstruction(Object.assign({}, instructionInit, {
+ params: first.params,
+ queryParams: first.queryParams || results.queryParams,
+ config: first.config || first.handler
+ }));
+
+ if (typeof first.handler === 'function') {
+ return evaluateNavigationStrategy(_instruction, first.handler, first);
+ } else if (first.handler && typeof first.handler.navigationStrategy === 'function') {
+ return evaluateNavigationStrategy(_instruction, first.handler.navigationStrategy, first.handler);
+ }
+
+ return Promise.resolve(_instruction);
+ } else if (this.catchAllHandler) {
+ var _instruction2 = new NavigationInstruction(Object.assign({}, instructionInit, {
+ params: { path: fragment },
+ queryParams: results && results.queryParams,
+ config: null }));
+
+ return evaluateNavigationStrategy(_instruction2, this.catchAllHandler);
+ }
+
+ return Promise.reject(new Error('Route not found: ' + url));
+ };
+
+ Router.prototype._createRouteConfig = function _createRouteConfig(config, instruction) {
+ var _this5 = this;
+
+ return Promise.resolve(config).then(function (c) {
+ if (typeof c === 'string') {
+ return { moduleId: c };
+ } else if (typeof c === 'function') {
+ return c(instruction);
+ }
+
+ return c;
+ }).then(function (c) {
+ return typeof c === 'string' ? { moduleId: c } : c;
+ }).then(function (c) {
+ c.route = instruction.params.path;
+ validateRouteConfig(c, _this5.routes);
+
+ if (!c.navModel) {
+ c.navModel = _this5.createNavModel(c);
+ }
+
+ return c;
+ });
+ };
+
+ _createClass(Router, [{
+ key: 'isRoot',
+ get: function get() {
+ return !this.parent;
+ }
+ }]);
+
+ return Router;
+ }();
+
+ function validateRouteConfig(config, routes) {
+ if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) !== 'object') {
+ throw new Error('Invalid Route Config');
+ }
+
+ if (typeof config.route !== 'string') {
+ var _name2 = config.name || '(no name)';
+ throw new Error('Invalid Route Config for "' + _name2 + '": You must specify a "route:" pattern.');
+ }
+
+ if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) {
+ throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".');
+ }
+ }
+
+ function evaluateNavigationStrategy(instruction, evaluator, context) {
+ return Promise.resolve(evaluator.call(context, instruction)).then(function () {
+ if (!('viewPorts' in instruction.config)) {
+ instruction.config.viewPorts = {
+ 'default': {
+ moduleId: instruction.config.moduleId
+ }
+ };
+ }
+
+ return instruction;
+ });
+ }
+
+ var CanDeactivatePreviousStep = exports.CanDeactivatePreviousStep = function () {
+ function CanDeactivatePreviousStep() {
+
+ }
+
+ CanDeactivatePreviousStep.prototype.run = function run(navigationInstruction, next) {
+ return processDeactivatable(navigationInstruction.plan, 'canDeactivate', next);
+ };
+
+ return CanDeactivatePreviousStep;
+ }();
+
+ var CanActivateNextStep = exports.CanActivateNextStep = function () {
+ function CanActivateNextStep() {
+
+ }
+
+ CanActivateNextStep.prototype.run = function run(navigationInstruction, next) {
+ return processActivatable(navigationInstruction, 'canActivate', next);
+ };
+
+ return CanActivateNextStep;
+ }();
+
+ var DeactivatePreviousStep = exports.DeactivatePreviousStep = function () {
+ function DeactivatePreviousStep() {
+
+ }
+
+ DeactivatePreviousStep.prototype.run = function run(navigationInstruction, next) {
+ return processDeactivatable(navigationInstruction.plan, 'deactivate', next, true);
+ };
+
+ return DeactivatePreviousStep;
+ }();
+
+ var ActivateNextStep = exports.ActivateNextStep = function () {
+ function ActivateNextStep() {
+
+ }
+
+ ActivateNextStep.prototype.run = function run(navigationInstruction, next) {
+ return processActivatable(navigationInstruction, 'activate', next, true);
+ };
+
+ return ActivateNextStep;
+ }();
+
+ function processDeactivatable(plan, callbackName, next, ignoreResult) {
+ var infos = findDeactivatable(plan, callbackName);
+ var i = infos.length;
+
+ function inspect(val) {
+ if (ignoreResult || shouldContinue(val)) {
+ return iterate();
+ }
+
+ return next.cancel(val);
+ }
+
+ function iterate() {
+ if (i--) {
+ try {
+ var viewModel = infos[i];
+ var _result = viewModel[callbackName]();
+ return processPotential(_result, inspect, next.cancel);
+ } catch (error) {
+ return next.cancel(error);
+ }
+ }
+
+ return next();
+ }
+
+ return iterate();
+ }
+
+ function findDeactivatable(plan, callbackName) {
+ var list = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];
+
+ for (var viewPortName in plan) {
+ var _viewPortPlan = plan[viewPortName];
+ var prevComponent = _viewPortPlan.prevComponent;
+
+ if ((_viewPortPlan.strategy === activationStrategy.invokeLifecycle || _viewPortPlan.strategy === activationStrategy.replace) && prevComponent) {
+ var viewModel = prevComponent.viewModel;
+
+ if (callbackName in viewModel) {
+ list.push(viewModel);
+ }
+ }
+
+ if (_viewPortPlan.childNavigationInstruction) {
+ findDeactivatable(_viewPortPlan.childNavigationInstruction.plan, callbackName, list);
+ } else if (prevComponent) {
+ addPreviousDeactivatable(prevComponent, callbackName, list);
+ }
+ }
+
+ return list;
+ }
+
+ function addPreviousDeactivatable(component, callbackName, list) {
+ var childRouter = component.childRouter;
+
+ if (childRouter && childRouter.currentInstruction) {
+ var viewPortInstructions = childRouter.currentInstruction.viewPortInstructions;
+
+ for (var viewPortName in viewPortInstructions) {
+ var _viewPortInstruction2 = viewPortInstructions[viewPortName];
+ var prevComponent = _viewPortInstruction2.component;
+ var prevViewModel = prevComponent.viewModel;
+
+ if (callbackName in prevViewModel) {
+ list.push(prevViewModel);
+ }
+
+ addPreviousDeactivatable(prevComponent, callbackName, list);
+ }
+ }
+ }
+
+ function processActivatable(navigationInstruction, callbackName, next, ignoreResult) {
+ var infos = findActivatable(navigationInstruction, callbackName);
+ var length = infos.length;
+ var i = -1;
+
+ function inspect(val, router) {
+ if (ignoreResult || shouldContinue(val, router)) {
+ return iterate();
+ }
+
+ return next.cancel(val);
+ }
+
+ function iterate() {
+ i++;
+
+ if (i < length) {
+ try {
+ var _ret3 = function () {
+ var _current$viewModel;
+
+ var current = infos[i];
+ var result = (_current$viewModel = current.viewModel)[callbackName].apply(_current$viewModel, current.lifecycleArgs);
+ return {
+ v: processPotential(result, function (val) {
+ return inspect(val, current.router);
+ }, next.cancel)
+ };
+ }();
+
+ if ((typeof _ret3 === 'undefined' ? 'undefined' : _typeof(_ret3)) === "object") return _ret3.v;
+ } catch (error) {
+ return next.cancel(error);
+ }
+ }
+
+ return next();
+ }
+
+ return iterate();
+ }
+
+ function findActivatable(navigationInstruction, callbackName) {
+ var list = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];
+ var router = arguments[3];
+
+ var plan = navigationInstruction.plan;
+
+ Object.keys(plan).filter(function (viewPortName) {
+ var viewPortPlan = plan[viewPortName];
+ var viewPortInstruction = navigationInstruction.viewPortInstructions[viewPortName];
+ var viewModel = viewPortInstruction.component.viewModel;
+
+ if ((viewPortPlan.strategy === activationStrategy.invokeLifecycle || viewPortPlan.strategy === activationStrategy.replace) && callbackName in viewModel) {
+ list.push({
+ viewModel: viewModel,
+ lifecycleArgs: viewPortInstruction.lifecycleArgs,
+ router: router
+ });
+ }
+
+ if (viewPortPlan.childNavigationInstruction) {
+ findActivatable(viewPortPlan.childNavigationInstruction, callbackName, list, viewPortInstruction.component.childRouter || router);
+ }
+ });
+
+ return list;
+ }
+
+ function shouldContinue(output, router) {
+ if (output instanceof Error) {
+ return false;
+ }
+
+ if (isNavigationCommand(output)) {
+ if (typeof output.setRouter === 'function') {
+ output.setRouter(router);
+ }
+
+ return !!output.shouldContinueProcessing;
+ }
+
+ if (output === undefined) {
+ return true;
+ }
+
+ return output;
+ }
+
+ var SafeSubscription = function () {
+ function SafeSubscription(subscriptionFunc) {
+
+
+ this._subscribed = true;
+ this._subscription = subscriptionFunc(this);
+
+ if (!this._subscribed) this.unsubscribe();
+ }
+
+ SafeSubscription.prototype.unsubscribe = function unsubscribe() {
+ if (this._subscribed && this._subscription) this._subscription.unsubscribe();
+
+ this._subscribed = false;
+ };
+
+ _createClass(SafeSubscription, [{
+ key: 'subscribed',
+ get: function get() {
+ return this._subscribed;
+ }
+ }]);
+
+ return SafeSubscription;
+ }();
+
+ function processPotential(obj, resolve, reject) {
+ if (obj && typeof obj.then === 'function') {
+ return Promise.resolve(obj).then(resolve).catch(reject);
+ }
+
+ if (obj && typeof obj.subscribe === 'function') {
+ var _ret4 = function () {
+ var obs = obj;
+ return {
+ v: new SafeSubscription(function (sub) {
+ return obs.subscribe({
+ next: function next() {
+ if (sub.subscribed) {
+ sub.unsubscribe();
+ resolve(obj);
+ }
+ },
+ error: function error(_error) {
+ if (sub.subscribed) {
+ sub.unsubscribe();
+ reject(_error);
+ }
+ },
+ complete: function complete() {
+ if (sub.subscribed) {
+ sub.unsubscribe();
+ resolve(obj);
+ }
+ }
+ });
+ })
+ };
+ }();
+
+ if ((typeof _ret4 === 'undefined' ? 'undefined' : _typeof(_ret4)) === "object") return _ret4.v;
+ }
+
+ try {
+ return resolve(obj);
+ } catch (error) {
+ return reject(error);
+ }
+ }
+
+ var RouteLoader = exports.RouteLoader = function () {
+ function RouteLoader() {
+
+ }
+
+ RouteLoader.prototype.loadRoute = function loadRoute(router, config, navigationInstruction) {
+ throw Error('Route loaders must implement "loadRoute(router, config, navigationInstruction)".');
+ };
+
+ return RouteLoader;
+ }();
+
+ var LoadRouteStep = exports.LoadRouteStep = function () {
+ LoadRouteStep.inject = function inject() {
+ return [RouteLoader];
+ };
+
+ function LoadRouteStep(routeLoader) {
+
+
+ this.routeLoader = routeLoader;
+ }
+
+ LoadRouteStep.prototype.run = function run(navigationInstruction, next) {
+ return loadNewRoute(this.routeLoader, navigationInstruction).then(next).catch(next.cancel);
+ };
+
+ return LoadRouteStep;
+ }();
+
+ function loadNewRoute(routeLoader, navigationInstruction) {
+ var toLoad = determineWhatToLoad(navigationInstruction);
+ var loadPromises = toLoad.map(function (current) {
+ return loadRoute(routeLoader, current.navigationInstruction, current.viewPortPlan);
+ });
+
+ return Promise.all(loadPromises);
+ }
+
+ function determineWhatToLoad(navigationInstruction) {
+ var toLoad = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
+
+ var plan = navigationInstruction.plan;
+
+ for (var viewPortName in plan) {
+ var _viewPortPlan2 = plan[viewPortName];
+
+ if (_viewPortPlan2.strategy === activationStrategy.replace) {
+ toLoad.push({ viewPortPlan: _viewPortPlan2, navigationInstruction: navigationInstruction });
+
+ if (_viewPortPlan2.childNavigationInstruction) {
+ determineWhatToLoad(_viewPortPlan2.childNavigationInstruction, toLoad);
+ }
+ } else {
+ var _viewPortInstruction3 = navigationInstruction.addViewPortInstruction(viewPortName, _viewPortPlan2.strategy, _viewPortPlan2.prevModuleId, _viewPortPlan2.prevComponent);
+
+ if (_viewPortPlan2.childNavigationInstruction) {
+ _viewPortInstruction3.childNavigationInstruction = _viewPortPlan2.childNavigationInstruction;
+ determineWhatToLoad(_viewPortPlan2.childNavigationInstruction, toLoad);
+ }
+ }
+ }
+
+ return toLoad;
+ }
+
+ function loadRoute(routeLoader, navigationInstruction, viewPortPlan) {
+ var moduleId = viewPortPlan.config.moduleId;
+
+ return loadComponent(routeLoader, navigationInstruction, viewPortPlan.config).then(function (component) {
+ var viewPortInstruction = navigationInstruction.addViewPortInstruction(viewPortPlan.name, viewPortPlan.strategy, moduleId, component);
+
+ var childRouter = component.childRouter;
+ if (childRouter) {
+ var path = navigationInstruction.getWildcardPath();
+
+ return childRouter._createNavigationInstruction(path, navigationInstruction).then(function (childInstruction) {
+ viewPortPlan.childNavigationInstruction = childInstruction;
+
+ return _buildNavigationPlan(childInstruction).then(function (childPlan) {
+ childInstruction.plan = childPlan;
+ viewPortInstruction.childNavigationInstruction = childInstruction;
+
+ return loadNewRoute(routeLoader, childInstruction);
+ });
+ });
+ }
+
+ return undefined;
+ });
+ }
+
+ function loadComponent(routeLoader, navigationInstruction, config) {
+ var router = navigationInstruction.router;
+ var lifecycleArgs = navigationInstruction.lifecycleArgs;
+
+ return routeLoader.loadRoute(router, config, navigationInstruction).then(function (component) {
+ var viewModel = component.viewModel;
+ var childContainer = component.childContainer;
+
+ component.router = router;
+ component.config = config;
+
+ if ('configureRouter' in viewModel) {
+ var _ret5 = function () {
+ var childRouter = childContainer.getChildRouter();
+ component.childRouter = childRouter;
+
+ return {
+ v: childRouter.configure(function (c) {
+ return viewModel.configureRouter.apply(viewModel, [c, childRouter].concat(lifecycleArgs));
+ }).then(function () {
+ return component;
+ })
+ };
+ }();
+
+ if ((typeof _ret5 === 'undefined' ? 'undefined' : _typeof(_ret5)) === "object") return _ret5.v;
+ }
+
+ return component;
+ });
+ }
+
+ var PipelineSlot = function () {
+ function PipelineSlot(container, name, alias) {
+
+
+ this.steps = [];
+
+ this.container = container;
+ this.slotName = name;
+ this.slotAlias = alias;
+ }
+
+ PipelineSlot.prototype.getSteps = function getSteps() {
+ var _this6 = this;
+
+ return this.steps.map(function (x) {
+ return _this6.container.get(x);
+ });
+ };
+
+ return PipelineSlot;
+ }();
+
+ var PipelineProvider = exports.PipelineProvider = function () {
+ PipelineProvider.inject = function inject() {
+ return [_aureliaDependencyInjection.Container];
+ };
+
+ function PipelineProvider(container) {
+
+
+ this.container = container;
+ this.steps = [BuildNavigationPlanStep, CanDeactivatePreviousStep, LoadRouteStep, this._createPipelineSlot('authorize'), CanActivateNextStep, this._createPipelineSlot('preActivate', 'modelbind'), DeactivatePreviousStep, ActivateNextStep, this._createPipelineSlot('preRender', 'precommit'), CommitChangesStep, this._createPipelineSlot('postRender', 'postcomplete')];
+ }
+
+ PipelineProvider.prototype.createPipeline = function createPipeline() {
+ var _this7 = this;
+
+ var pipeline = new Pipeline();
+ this.steps.forEach(function (step) {
+ return pipeline.addStep(_this7.container.get(step));
+ });
+ return pipeline;
+ };
+
+ PipelineProvider.prototype._findStep = function _findStep(name) {
+ return this.steps.find(function (x) {
+ return x.slotName === name || x.slotAlias === name;
+ });
+ };
+
+ PipelineProvider.prototype.addStep = function addStep(name, step) {
+ var found = this._findStep(name);
+ if (found) {
+ if (!found.steps.includes(step)) {
+ found.steps.push(step);
+ }
+ } else {
+ throw new Error('Invalid pipeline slot name: ' + name + '.');
+ }
+ };
+
+ PipelineProvider.prototype.removeStep = function removeStep(name, step) {
+ var slot = this._findStep(name);
+ if (slot) {
+ slot.steps.splice(slot.steps.indexOf(step), 1);
+ }
+ };
+
+ PipelineProvider.prototype._clearSteps = function _clearSteps() {
+ var name = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];
+
+ var slot = this._findStep(name);
+ if (slot) {
+ slot.steps = [];
+ }
+ };
+
+ PipelineProvider.prototype.reset = function reset() {
+ this._clearSteps('authorize');
+ this._clearSteps('preActivate');
+ this._clearSteps('preRender');
+ this._clearSteps('postRender');
+ };
+
+ PipelineProvider.prototype._createPipelineSlot = function _createPipelineSlot(name, alias) {
+ return new PipelineSlot(this.container, name, alias);
+ };
+
+ return PipelineProvider;
+ }();
+
+ var logger = LogManager.getLogger('app-router');
+
+ var AppRouter = exports.AppRouter = function (_Router) {
+ _inherits(AppRouter, _Router);
+
+ AppRouter.inject = function inject() {
+ return [_aureliaDependencyInjection.Container, _aureliaHistory.History, PipelineProvider, _aureliaEventAggregator.EventAggregator];
+ };
+
+ function AppRouter(container, history, pipelineProvider, events) {
+
+
+ var _this8 = _possibleConstructorReturn(this, _Router.call(this, container, history));
+
+ _this8.pipelineProvider = pipelineProvider;
+ _this8.events = events;
+ return _this8;
+ }
+
+ AppRouter.prototype.reset = function reset() {
+ _Router.prototype.reset.call(this);
+ this.maxInstructionCount = 10;
+ if (!this._queue) {
+ this._queue = [];
+ } else {
+ this._queue.length = 0;
+ }
+ };
+
+ AppRouter.prototype.loadUrl = function loadUrl(url) {
+ var _this9 = this;
+
+ return this._createNavigationInstruction(url).then(function (instruction) {
+ return _this9._queueInstruction(instruction);
+ }).catch(function (error) {
+ logger.error(error);
+ restorePreviousLocation(_this9);
+ });
+ };
+
+ AppRouter.prototype.registerViewPort = function registerViewPort(viewPort, name) {
+ var _this10 = this;
+
+ _Router.prototype.registerViewPort.call(this, viewPort, name);
+
+ if (!this.isActive) {
+ var _ret6 = function () {
+ var viewModel = _this10._findViewModel(viewPort);
+ if ('configureRouter' in viewModel) {
+ if (!_this10.isConfigured) {
+ var _ret7 = function () {
+ var resolveConfiguredPromise = _this10._resolveConfiguredPromise;
+ _this10._resolveConfiguredPromise = function () {};
+ return {
+ v: {
+ v: _this10.configure(function (config) {
+ return viewModel.configureRouter(config, _this10);
+ }).then(function () {
+ _this10.activate();
+ resolveConfiguredPromise();
+ })
+ }
+ };
+ }();
+
+ if ((typeof _ret7 === 'undefined' ? 'undefined' : _typeof(_ret7)) === "object") return _ret7.v;
+ }
+ } else {
+ _this10.activate();
+ }
+ }();
+
+ if ((typeof _ret6 === 'undefined' ? 'undefined' : _typeof(_ret6)) === "object") return _ret6.v;
+ } else {
+ this._dequeueInstruction();
+ }
+
+ return Promise.resolve();
+ };
+
+ AppRouter.prototype.activate = function activate(options) {
+ if (this.isActive) {
+ return;
+ }
+
+ this.isActive = true;
+ this.options = Object.assign({ routeHandler: this.loadUrl.bind(this) }, this.options, options);
+ this.history.activate(this.options);
+ this._dequeueInstruction();
+ };
+
+ AppRouter.prototype.deactivate = function deactivate() {
+ this.isActive = false;
+ this.history.deactivate();
+ };
+
+ AppRouter.prototype._queueInstruction = function _queueInstruction(instruction) {
+ var _this11 = this;
+
+ return new Promise(function (resolve) {
+ instruction.resolve = resolve;
+ _this11._queue.unshift(instruction);
+ _this11._dequeueInstruction();
+ });
+ };
+
+ AppRouter.prototype._dequeueInstruction = function _dequeueInstruction() {
+ var _this12 = this;
+
+ var instructionCount = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
+
+ return Promise.resolve().then(function () {
+ if (_this12.isNavigating && !instructionCount) {
+ return undefined;
+ }
+
+ var instruction = _this12._queue.shift();
+ _this12._queue.length = 0;
+
+ if (!instruction) {
+ return undefined;
+ }
+
+ _this12.isNavigating = true;
+ instruction.previousInstruction = _this12.currentInstruction;
+
+ if (!instructionCount) {
+ _this12.events.publish('router:navigation:processing', { instruction: instruction });
+ } else if (instructionCount === _this12.maxInstructionCount - 1) {
+ logger.error(instructionCount + 1 + ' navigation instructions have been attempted without success. Restoring last known good location.');
+ restorePreviousLocation(_this12);
+ return _this12._dequeueInstruction(instructionCount + 1);
+ } else if (instructionCount > _this12.maxInstructionCount) {
+ throw new Error('Maximum navigation attempts exceeded. Giving up.');
+ }
+
+ var pipeline = _this12.pipelineProvider.createPipeline();
+
+ return pipeline.run(instruction).then(function (result) {
+ return processResult(instruction, result, instructionCount, _this12);
+ }).catch(function (error) {
+ return { output: error instanceof Error ? error : new Error(error) };
+ }).then(function (result) {
+ return resolveInstruction(instruction, result, !!instructionCount, _this12);
+ });
+ });
+ };
+
+ AppRouter.prototype._findViewModel = function _findViewModel(viewPort) {
+ if (this.container.viewModel) {
+ return this.container.viewModel;
+ }
+
+ if (viewPort.container) {
+ var container = viewPort.container;
+
+ while (container) {
+ if (container.viewModel) {
+ this.container.viewModel = container.viewModel;
+ return container.viewModel;
+ }
+
+ container = container.parent;
+ }
+ }
+
+ return undefined;
+ };
+
+ return AppRouter;
+ }(Router);
+
+ function processResult(instruction, result, instructionCount, router) {
+ if (!(result && 'completed' in result && 'output' in result)) {
+ result = result || {};
+ result.output = new Error('Expected router pipeline to return a navigation result, but got [' + JSON.stringify(result) + '] instead.');
+ }
+
+ var finalResult = null;
+ if (isNavigationCommand(result.output)) {
+ result.output.navigate(router);
+ } else {
+ finalResult = result;
+
+ if (!result.completed) {
+ if (result.output instanceof Error) {
+ logger.error(result.output);
+ }
+
+ restorePreviousLocation(router);
+ }
+ }
+
+ return router._dequeueInstruction(instructionCount + 1).then(function (innerResult) {
+ return finalResult || innerResult || result;
+ });
+ }
+
+ function resolveInstruction(instruction, result, isInnerInstruction, router) {
+ instruction.resolve(result);
+
+ if (!isInnerInstruction) {
+ router.isNavigating = false;
+ var eventArgs = { instruction: instruction, result: result };
+ var eventName = void 0;
+
+ if (result.output instanceof Error) {
+ eventName = 'error';
+ } else if (!result.completed) {
+ eventName = 'canceled';
+ } else {
+ var _queryString = instruction.queryString ? '?' + instruction.queryString : '';
+ router.history.previousLocation = instruction.fragment + _queryString;
+ eventName = 'success';
+ }
+
+ router.events.publish('router:navigation:' + eventName, eventArgs);
+ router.events.publish('router:navigation:complete', eventArgs);
+ }
+
+ return result;
+ }
+
+ function restorePreviousLocation(router) {
+ var previousLocation = router.history.previousLocation;
+ if (previousLocation) {
+ router.navigate(router.history.previousLocation, { trigger: false, replace: true });
+ } else {
+ logger.error('Router navigation failed, and no previous location could be restored.');
+ }
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/index.js
new file mode 100644
index 000000000..230fbd7fd
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-router@1.0.6/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-router'], function (exports, _aureliaRouter) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaRouter).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaRouter[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0.js
new file mode 100644
index 000000000..9c1c25bfd
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-task-queue@1.1.0/aurelia-task-queue"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/.jspm-hash
new file mode 100644
index 000000000..7e6c08d45
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/.jspm-hash
@@ -0,0 +1 @@
+45afddb2ecb07e1b1b2d1f85e90f095220c24ade99914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/aurelia-task-queue.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/aurelia-task-queue.js
new file mode 100644
index 000000000..b97957f08
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/aurelia-task-queue.js
@@ -0,0 +1,149 @@
+/* */
+define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.TaskQueue = undefined;
+
+
+
+ var hasSetImmediate = typeof setImmediate === 'function';
+
+ function makeRequestFlushFromMutationObserver(flush) {
+ var toggle = 1;
+ var observer = _aureliaPal.DOM.createMutationObserver(flush);
+ var node = _aureliaPal.DOM.createTextNode('');
+ observer.observe(node, { characterData: true });
+ return function requestFlush() {
+ toggle = -toggle;
+ node.data = toggle;
+ };
+ }
+
+ function makeRequestFlushFromTimer(flush) {
+ return function requestFlush() {
+ var timeoutHandle = setTimeout(handleFlushTimer, 0);
+
+ var intervalHandle = setInterval(handleFlushTimer, 50);
+ function handleFlushTimer() {
+ clearTimeout(timeoutHandle);
+ clearInterval(intervalHandle);
+ flush();
+ }
+ };
+ }
+
+ function onError(error, task) {
+ if ('onError' in task) {
+ task.onError(error);
+ } else if (hasSetImmediate) {
+ setImmediate(function () {
+ throw error;
+ });
+ } else {
+ setTimeout(function () {
+ throw error;
+ }, 0);
+ }
+ }
+
+ var TaskQueue = exports.TaskQueue = function () {
+ function TaskQueue() {
+ var _this = this;
+
+
+
+ this.flushing = false;
+
+ this.microTaskQueue = [];
+ this.microTaskQueueCapacity = 1024;
+ this.taskQueue = [];
+
+ if (_aureliaPal.FEATURE.mutationObserver) {
+ this.requestFlushMicroTaskQueue = makeRequestFlushFromMutationObserver(function () {
+ return _this.flushMicroTaskQueue();
+ });
+ } else {
+ this.requestFlushMicroTaskQueue = makeRequestFlushFromTimer(function () {
+ return _this.flushMicroTaskQueue();
+ });
+ }
+
+ this.requestFlushTaskQueue = makeRequestFlushFromTimer(function () {
+ return _this.flushTaskQueue();
+ });
+ }
+
+ TaskQueue.prototype.queueMicroTask = function queueMicroTask(task) {
+ if (this.microTaskQueue.length < 1) {
+ this.requestFlushMicroTaskQueue();
+ }
+
+ this.microTaskQueue.push(task);
+ };
+
+ TaskQueue.prototype.queueTask = function queueTask(task) {
+ if (this.taskQueue.length < 1) {
+ this.requestFlushTaskQueue();
+ }
+
+ this.taskQueue.push(task);
+ };
+
+ TaskQueue.prototype.flushTaskQueue = function flushTaskQueue() {
+ var queue = this.taskQueue;
+ var index = 0;
+ var task = void 0;
+
+ this.taskQueue = [];
+
+ try {
+ this.flushing = true;
+ while (index < queue.length) {
+ task = queue[index];
+ task.call();
+ index++;
+ }
+ } catch (error) {
+ onError(error, task);
+ } finally {
+ this.flushing = false;
+ }
+ };
+
+ TaskQueue.prototype.flushMicroTaskQueue = function flushMicroTaskQueue() {
+ var queue = this.microTaskQueue;
+ var capacity = this.microTaskQueueCapacity;
+ var index = 0;
+ var task = void 0;
+
+ try {
+ this.flushing = true;
+ while (index < queue.length) {
+ task = queue[index];
+ task.call();
+ index++;
+
+ if (index > capacity) {
+ for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
+ queue[scan] = queue[scan + index];
+ }
+
+ queue.length -= index;
+ index = 0;
+ }
+ }
+ } catch (error) {
+ onError(error, task);
+ } finally {
+ this.flushing = false;
+ }
+
+ queue.length = 0;
+ };
+
+ return TaskQueue;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/index.js
new file mode 100644
index 000000000..fd254db14
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-task-queue@1.1.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-task-queue'], function (exports, _aureliaTaskQueue) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaTaskQueue).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaTaskQueue[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0.js
new file mode 100644
index 000000000..a76eb0e90
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-templating-binding@1.0.0/aurelia-templating-binding"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/.jspm-hash
new file mode 100644
index 000000000..7345573e4
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/.jspm-hash
@@ -0,0 +1 @@
+abf17a09212ffce27278d6fd042232e61b146f9299914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/aurelia-templating-binding.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/aurelia-templating-binding.js
new file mode 100644
index 000000000..6ec129c1a
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/aurelia-templating-binding.js
@@ -0,0 +1,667 @@
+/* */
+define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'], function (exports, _aureliaLogging, _aureliaBinding, _aureliaTemplating) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.TemplatingBindingLanguage = exports.SyntaxInterpreter = exports.ChildInterpolationBinding = exports.InterpolationBinding = exports.InterpolationBindingExpression = exports.AttributeMap = undefined;
+ exports.configure = configure;
+
+ var LogManager = _interopRequireWildcard(_aureliaLogging);
+
+ function _interopRequireWildcard(obj) {
+ if (obj && obj.__esModule) {
+ return obj;
+ } else {
+ var newObj = {};
+
+ if (obj != null) {
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
+ }
+ }
+
+ newObj.default = obj;
+ return newObj;
+ }
+ }
+
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }
+
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+
+
+ var _class, _temp, _dec, _class2, _class3, _temp2, _class4, _temp3;
+
+ var AttributeMap = exports.AttributeMap = (_temp = _class = function () {
+ function AttributeMap(svg) {
+
+
+ this.elements = Object.create(null);
+ this.allElements = Object.create(null);
+
+ this.svg = svg;
+
+ this.registerUniversal('accesskey', 'accessKey');
+ this.registerUniversal('contenteditable', 'contentEditable');
+ this.registerUniversal('tabindex', 'tabIndex');
+ this.registerUniversal('textcontent', 'textContent');
+ this.registerUniversal('innerhtml', 'innerHTML');
+ this.registerUniversal('scrolltop', 'scrollTop');
+ this.registerUniversal('scrollleft', 'scrollLeft');
+ this.registerUniversal('readonly', 'readOnly');
+
+ this.register('label', 'for', 'htmlFor');
+
+ this.register('input', 'maxlength', 'maxLength');
+ this.register('input', 'minlength', 'minLength');
+ this.register('input', 'formaction', 'formAction');
+ this.register('input', 'formenctype', 'formEncType');
+ this.register('input', 'formmethod', 'formMethod');
+ this.register('input', 'formnovalidate', 'formNoValidate');
+ this.register('input', 'formtarget', 'formTarget');
+
+ this.register('textarea', 'maxlength', 'maxLength');
+
+ this.register('td', 'rowspan', 'rowSpan');
+ this.register('td', 'colspan', 'colSpan');
+ this.register('th', 'rowspan', 'rowSpan');
+ this.register('th', 'colspan', 'colSpan');
+ }
+
+ AttributeMap.prototype.register = function register(elementName, attributeName, propertyName) {
+ elementName = elementName.toLowerCase();
+ attributeName = attributeName.toLowerCase();
+ var element = this.elements[elementName] = this.elements[elementName] || Object.create(null);
+ element[attributeName] = propertyName;
+ };
+
+ AttributeMap.prototype.registerUniversal = function registerUniversal(attributeName, propertyName) {
+ attributeName = attributeName.toLowerCase();
+ this.allElements[attributeName] = propertyName;
+ };
+
+ AttributeMap.prototype.map = function map(elementName, attributeName) {
+ if (this.svg.isStandardSvgAttribute(elementName, attributeName)) {
+ return attributeName;
+ }
+ elementName = elementName.toLowerCase();
+ attributeName = attributeName.toLowerCase();
+ var element = this.elements[elementName];
+ if (element !== undefined && attributeName in element) {
+ return element[attributeName];
+ }
+ if (attributeName in this.allElements) {
+ return this.allElements[attributeName];
+ }
+
+ if (/(^data-)|(^aria-)|:/.test(attributeName)) {
+ return attributeName;
+ }
+ return (0, _aureliaBinding.camelCase)(attributeName);
+ };
+
+ return AttributeMap;
+ }(), _class.inject = [_aureliaBinding.SVGAnalyzer], _temp);
+
+ var InterpolationBindingExpression = exports.InterpolationBindingExpression = function () {
+ function InterpolationBindingExpression(observerLocator, targetProperty, parts, mode, lookupFunctions, attribute) {
+
+
+ this.observerLocator = observerLocator;
+ this.targetProperty = targetProperty;
+ this.parts = parts;
+ this.mode = mode;
+ this.lookupFunctions = lookupFunctions;
+ this.attribute = this.attrToRemove = attribute;
+ this.discrete = false;
+ }
+
+ InterpolationBindingExpression.prototype.createBinding = function createBinding(target) {
+ if (this.parts.length === 3) {
+ return new ChildInterpolationBinding(target, this.observerLocator, this.parts[1], this.mode, this.lookupFunctions, this.targetProperty, this.parts[0], this.parts[2]);
+ }
+ return new InterpolationBinding(this.observerLocator, this.parts, target, this.targetProperty, this.mode, this.lookupFunctions);
+ };
+
+ return InterpolationBindingExpression;
+ }();
+
+ function validateTarget(target, propertyName) {
+ if (propertyName === 'style') {
+ LogManager.getLogger('templating-binding').info('Internet Explorer does not support interpolation in "style" attributes. Use the style attribute\'s alias, "css" instead.');
+ } else if (target.parentElement && target.parentElement.nodeName === 'TEXTAREA' && propertyName === 'textContent') {
+ throw new Error('Interpolation binding cannot be used in the content of a textarea element. Use instead.');
+ }
+ }
+
+ var InterpolationBinding = exports.InterpolationBinding = function () {
+ function InterpolationBinding(observerLocator, parts, target, targetProperty, mode, lookupFunctions) {
+
+
+ validateTarget(target, targetProperty);
+ this.observerLocator = observerLocator;
+ this.parts = parts;
+ this.target = target;
+ this.targetProperty = targetProperty;
+ this.targetAccessor = observerLocator.getAccessor(target, targetProperty);
+ this.mode = mode;
+ this.lookupFunctions = lookupFunctions;
+ }
+
+ InterpolationBinding.prototype.interpolate = function interpolate() {
+ if (this.isBound) {
+ var value = '';
+ var parts = this.parts;
+ for (var i = 0, ii = parts.length; i < ii; i++) {
+ value += i % 2 === 0 ? parts[i] : this['childBinding' + i].value;
+ }
+ this.targetAccessor.setValue(value, this.target, this.targetProperty);
+ }
+ };
+
+ InterpolationBinding.prototype.updateOneTimeBindings = function updateOneTimeBindings() {
+ for (var i = 1, ii = this.parts.length; i < ii; i += 2) {
+ var child = this['childBinding' + i];
+ if (child.mode === _aureliaBinding.bindingMode.oneTime) {
+ child.call();
+ }
+ }
+ };
+
+ InterpolationBinding.prototype.bind = function bind(source) {
+ if (this.isBound) {
+ if (this.source === source) {
+ return;
+ }
+ this.unbind();
+ }
+ this.source = source;
+
+ var parts = this.parts;
+ for (var i = 1, ii = parts.length; i < ii; i += 2) {
+ var binding = new ChildInterpolationBinding(this, this.observerLocator, parts[i], this.mode, this.lookupFunctions);
+ binding.bind(source);
+ this['childBinding' + i] = binding;
+ }
+
+ this.isBound = true;
+ this.interpolate();
+ };
+
+ InterpolationBinding.prototype.unbind = function unbind() {
+ if (!this.isBound) {
+ return;
+ }
+ this.isBound = false;
+ this.source = null;
+ var parts = this.parts;
+ for (var i = 1, ii = parts.length; i < ii; i += 2) {
+ var name = 'childBinding' + i;
+ this[name].unbind();
+ }
+ };
+
+ return InterpolationBinding;
+ }();
+
+ var ChildInterpolationBinding = exports.ChildInterpolationBinding = (_dec = (0, _aureliaBinding.connectable)(), _dec(_class2 = function () {
+ function ChildInterpolationBinding(target, observerLocator, sourceExpression, mode, lookupFunctions, targetProperty, left, right) {
+
+
+ if (target instanceof InterpolationBinding) {
+ this.parent = target;
+ } else {
+ validateTarget(target, targetProperty);
+ this.target = target;
+ this.targetProperty = targetProperty;
+ this.targetAccessor = observerLocator.getAccessor(target, targetProperty);
+ }
+ this.observerLocator = observerLocator;
+ this.sourceExpression = sourceExpression;
+ this.mode = mode;
+ this.lookupFunctions = lookupFunctions;
+ this.left = left;
+ this.right = right;
+ }
+
+ ChildInterpolationBinding.prototype.updateTarget = function updateTarget(value) {
+ value = value === null || value === undefined ? '' : value.toString();
+ if (value !== this.value) {
+ this.value = value;
+ if (this.parent) {
+ this.parent.interpolate();
+ } else {
+ this.targetAccessor.setValue(this.left + value + this.right, this.target, this.targetProperty);
+ }
+ }
+ };
+
+ ChildInterpolationBinding.prototype.call = function call() {
+ if (!this.isBound) {
+ return;
+ }
+
+ this.rawValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);
+ this.updateTarget(this.rawValue);
+
+ if (this.mode !== _aureliaBinding.bindingMode.oneTime) {
+ this._version++;
+ this.sourceExpression.connect(this, this.source);
+ if (this.rawValue instanceof Array) {
+ this.observeArray(this.rawValue);
+ }
+ this.unobserve(false);
+ }
+ };
+
+ ChildInterpolationBinding.prototype.bind = function bind(source) {
+ if (this.isBound) {
+ if (this.source === source) {
+ return;
+ }
+ this.unbind();
+ }
+ this.isBound = true;
+ this.source = source;
+
+ var sourceExpression = this.sourceExpression;
+ if (sourceExpression.bind) {
+ sourceExpression.bind(this, source, this.lookupFunctions);
+ }
+
+ this.rawValue = sourceExpression.evaluate(source, this.lookupFunctions);
+ this.updateTarget(this.rawValue);
+
+ if (this.mode === _aureliaBinding.bindingMode.oneWay) {
+ (0, _aureliaBinding.enqueueBindingConnect)(this);
+ }
+ };
+
+ ChildInterpolationBinding.prototype.unbind = function unbind() {
+ if (!this.isBound) {
+ return;
+ }
+ this.isBound = false;
+ var sourceExpression = this.sourceExpression;
+ if (sourceExpression.unbind) {
+ sourceExpression.unbind(this, this.source);
+ }
+ this.source = null;
+ this.value = null;
+ this.rawValue = null;
+ this.unobserve(true);
+ };
+
+ ChildInterpolationBinding.prototype.connect = function connect(evaluate) {
+ if (!this.isBound) {
+ return;
+ }
+ if (evaluate) {
+ this.rawValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);
+ this.updateTarget(this.rawValue);
+ }
+ this.sourceExpression.connect(this, this.source);
+ if (this.rawValue instanceof Array) {
+ this.observeArray(this.rawValue);
+ }
+ };
+
+ return ChildInterpolationBinding;
+ }()) || _class2);
+ var SyntaxInterpreter = exports.SyntaxInterpreter = (_temp2 = _class3 = function () {
+ function SyntaxInterpreter(parser, observerLocator, eventManager, attributeMap) {
+
+
+ this.parser = parser;
+ this.observerLocator = observerLocator;
+ this.eventManager = eventManager;
+ this.attributeMap = attributeMap;
+ }
+
+ SyntaxInterpreter.prototype.interpret = function interpret(resources, element, info, existingInstruction, context) {
+ if (info.command in this) {
+ return this[info.command](resources, element, info, existingInstruction, context);
+ }
+
+ return this.handleUnknownCommand(resources, element, info, existingInstruction, context);
+ };
+
+ SyntaxInterpreter.prototype.handleUnknownCommand = function handleUnknownCommand(resources, element, info, existingInstruction, context) {
+ LogManager.getLogger('templating-binding').warn('Unknown binding command.', info);
+ return existingInstruction;
+ };
+
+ SyntaxInterpreter.prototype.determineDefaultBindingMode = function determineDefaultBindingMode(element, attrName, context) {
+ var tagName = element.tagName.toLowerCase();
+
+ if (tagName === 'input' && (attrName === 'value' || attrName === 'files') && element.type !== 'checkbox' && element.type !== 'radio' || tagName === 'input' && attrName === 'checked' && (element.type === 'checkbox' || element.type === 'radio') || (tagName === 'textarea' || tagName === 'select') && attrName === 'value' || (attrName === 'textcontent' || attrName === 'innerhtml') && element.contentEditable === 'true' || attrName === 'scrolltop' || attrName === 'scrollleft') {
+ return _aureliaBinding.bindingMode.twoWay;
+ }
+
+ if (context && attrName in context.attributes && context.attributes[attrName] && context.attributes[attrName].defaultBindingMode >= _aureliaBinding.bindingMode.oneTime) {
+ return context.attributes[attrName].defaultBindingMode;
+ }
+
+ return _aureliaBinding.bindingMode.oneWay;
+ };
+
+ SyntaxInterpreter.prototype.bind = function bind(resources, element, info, existingInstruction, context) {
+ var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+
+ instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName, context), resources.lookupFunctions);
+
+ return instruction;
+ };
+
+ SyntaxInterpreter.prototype.trigger = function trigger(resources, element, info) {
+ return new _aureliaBinding.ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), false, true, resources.lookupFunctions);
+ };
+
+ SyntaxInterpreter.prototype.delegate = function delegate(resources, element, info) {
+ return new _aureliaBinding.ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), true, true, resources.lookupFunctions);
+ };
+
+ SyntaxInterpreter.prototype.call = function call(resources, element, info, existingInstruction) {
+ var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+
+ instruction.attributes[info.attrName] = new _aureliaBinding.CallExpression(this.observerLocator, info.attrName, this.parser.parse(info.attrValue), resources.lookupFunctions);
+
+ return instruction;
+ };
+
+ SyntaxInterpreter.prototype.options = function options(resources, element, info, existingInstruction, context) {
+ var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+ var attrValue = info.attrValue;
+ var language = this.language;
+ var name = null;
+ var target = '';
+ var current = void 0;
+ var i = void 0;
+ var ii = void 0;
+ var inString = false;
+ var inEscape = false;
+
+ for (i = 0, ii = attrValue.length; i < ii; ++i) {
+ current = attrValue[i];
+
+ if (current === ';' && !inString) {
+ info = language.inspectAttribute(resources, '?', name, target.trim());
+ language.createAttributeInstruction(resources, element, info, instruction, context);
+
+ if (!instruction.attributes[info.attrName]) {
+ instruction.attributes[info.attrName] = info.attrValue;
+ }
+
+ target = '';
+ name = null;
+ } else if (current === ':' && name === null) {
+ name = target.trim();
+ target = '';
+ } else if (current === '\\') {
+ target += current;
+ inEscape = true;
+ continue;
+ } else {
+ target += current;
+
+ if (name !== null && inEscape === false && current === '\'') {
+ inString = !inString;
+ }
+ }
+
+ inEscape = false;
+ }
+
+ if (name !== null) {
+ info = language.inspectAttribute(resources, '?', name, target.trim());
+ language.createAttributeInstruction(resources, element, info, instruction, context);
+
+ if (!instruction.attributes[info.attrName]) {
+ instruction.attributes[info.attrName] = info.attrValue;
+ }
+ }
+
+ return instruction;
+ };
+
+ SyntaxInterpreter.prototype['for'] = function _for(resources, element, info, existingInstruction) {
+ var parts = void 0;
+ var keyValue = void 0;
+ var instruction = void 0;
+ var attrValue = void 0;
+ var isDestructuring = void 0;
+
+ attrValue = info.attrValue;
+ isDestructuring = attrValue.match(/^ *[[].+[\]]/);
+ parts = isDestructuring ? attrValue.split('of ') : attrValue.split(' of ');
+
+ if (parts.length !== 2) {
+ throw new Error('Incorrect syntax for "for". The form is: "$local of $items" or "[$key, $value] of $items".');
+ }
+
+ instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+
+ if (isDestructuring) {
+ keyValue = parts[0].replace(/[[\]]/g, '').replace(/,/g, ' ').replace(/\s+/g, ' ').trim().split(' ');
+ instruction.attributes.key = keyValue[0];
+ instruction.attributes.value = keyValue[1];
+ } else {
+ instruction.attributes.local = parts[0];
+ }
+
+ instruction.attributes.items = new _aureliaBinding.BindingExpression(this.observerLocator, 'items', this.parser.parse(parts[1]), _aureliaBinding.bindingMode.oneWay, resources.lookupFunctions);
+
+ return instruction;
+ };
+
+ SyntaxInterpreter.prototype['two-way'] = function twoWay(resources, element, info, existingInstruction) {
+ var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+
+ instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), _aureliaBinding.bindingMode.twoWay, resources.lookupFunctions);
+
+ return instruction;
+ };
+
+ SyntaxInterpreter.prototype['one-way'] = function oneWay(resources, element, info, existingInstruction) {
+ var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+
+ instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), _aureliaBinding.bindingMode.oneWay, resources.lookupFunctions);
+
+ return instruction;
+ };
+
+ SyntaxInterpreter.prototype['one-time'] = function oneTime(resources, element, info, existingInstruction) {
+ var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
+
+ instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), _aureliaBinding.bindingMode.oneTime, resources.lookupFunctions);
+
+ return instruction;
+ };
+
+ return SyntaxInterpreter;
+ }(), _class3.inject = [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, _aureliaBinding.EventManager, AttributeMap], _temp2);
+
+ var info = {};
+
+ var TemplatingBindingLanguage = exports.TemplatingBindingLanguage = (_temp3 = _class4 = function (_BindingLanguage) {
+ _inherits(TemplatingBindingLanguage, _BindingLanguage);
+
+ function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter, attributeMap) {
+
+
+ var _this = _possibleConstructorReturn(this, _BindingLanguage.call(this));
+
+ _this.parser = parser;
+ _this.observerLocator = observerLocator;
+ _this.syntaxInterpreter = syntaxInterpreter;
+ _this.emptyStringExpression = _this.parser.parse('\'\'');
+ syntaxInterpreter.language = _this;
+ _this.attributeMap = attributeMap;
+ return _this;
+ }
+
+ TemplatingBindingLanguage.prototype.inspectAttribute = function inspectAttribute(resources, elementName, attrName, attrValue) {
+ var parts = attrName.split('.');
+
+ info.defaultBindingMode = null;
+
+ if (parts.length === 2) {
+ info.attrName = parts[0].trim();
+ info.attrValue = attrValue;
+ info.command = parts[1].trim();
+
+ if (info.command === 'ref') {
+ info.expression = new _aureliaBinding.NameExpression(this.parser.parse(attrValue), info.attrName, resources.lookupFunctions);
+ info.command = null;
+ info.attrName = 'ref';
+ } else {
+ info.expression = null;
+ }
+ } else if (attrName === 'ref') {
+ info.attrName = attrName;
+ info.attrValue = attrValue;
+ info.command = null;
+ info.expression = new _aureliaBinding.NameExpression(this.parser.parse(attrValue), 'element', resources.lookupFunctions);
+ } else {
+ info.attrName = attrName;
+ info.attrValue = attrValue;
+ info.command = null;
+ var interpolationParts = this.parseInterpolation(resources, attrValue);
+ if (interpolationParts === null) {
+ info.expression = null;
+ } else {
+ info.expression = new InterpolationBindingExpression(this.observerLocator, this.attributeMap.map(elementName, attrName), interpolationParts, _aureliaBinding.bindingMode.oneWay, resources.lookupFunctions, attrName);
+ }
+ }
+
+ return info;
+ };
+
+ TemplatingBindingLanguage.prototype.createAttributeInstruction = function createAttributeInstruction(resources, element, theInfo, existingInstruction, context) {
+ var instruction = void 0;
+
+ if (theInfo.expression) {
+ if (theInfo.attrName === 'ref') {
+ return theInfo.expression;
+ }
+
+ instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(theInfo.attrName);
+ instruction.attributes[theInfo.attrName] = theInfo.expression;
+ } else if (theInfo.command) {
+ instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction, context);
+ }
+
+ return instruction;
+ };
+
+ TemplatingBindingLanguage.prototype.inspectTextContent = function inspectTextContent(resources, value) {
+ var parts = this.parseInterpolation(resources, value);
+ if (parts === null) {
+ return null;
+ }
+ return new InterpolationBindingExpression(this.observerLocator, 'textContent', parts, _aureliaBinding.bindingMode.oneWay, resources.lookupFunctions, 'textContent');
+ };
+
+ TemplatingBindingLanguage.prototype.parseInterpolation = function parseInterpolation(resources, value) {
+ var i = value.indexOf('${', 0);
+ var ii = value.length;
+ var char = void 0;
+ var pos = 0;
+ var open = 0;
+ var quote = null;
+ var interpolationStart = void 0;
+ var parts = void 0;
+ var partIndex = 0;
+
+ while (i >= 0 && i < ii - 2) {
+ open = 1;
+ interpolationStart = i;
+ i += 2;
+
+ do {
+ char = value[i];
+ i++;
+
+ if (char === "'" || char === '"') {
+ if (quote === null) {
+ quote = char;
+ } else if (quote === char) {
+ quote = null;
+ }
+ continue;
+ }
+
+ if (char === '\\') {
+ i++;
+ continue;
+ }
+
+ if (quote !== null) {
+ continue;
+ }
+
+ if (char === '{') {
+ open++;
+ } else if (char === '}') {
+ open--;
+ }
+ } while (open > 0 && i < ii);
+
+ if (open === 0) {
+ parts = parts || [];
+ if (value[interpolationStart - 1] === '\\' && value[interpolationStart - 2] !== '\\') {
+ parts[partIndex] = value.substring(pos, interpolationStart - 1) + value.substring(interpolationStart, i);
+ partIndex++;
+ parts[partIndex] = this.emptyStringExpression;
+ partIndex++;
+ } else {
+ parts[partIndex] = value.substring(pos, interpolationStart);
+ partIndex++;
+ parts[partIndex] = this.parser.parse(value.substring(interpolationStart + 2, i - 1));
+ partIndex++;
+ }
+ pos = i;
+ i = value.indexOf('${', i);
+ } else {
+ break;
+ }
+ }
+
+ if (partIndex === 0) {
+ return null;
+ }
+
+ parts[partIndex] = value.substr(pos);
+ return parts;
+ };
+
+ return TemplatingBindingLanguage;
+ }(_aureliaTemplating.BindingLanguage), _class4.inject = [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, SyntaxInterpreter, AttributeMap], _temp3);
+ function configure(config) {
+ config.container.registerSingleton(_aureliaTemplating.BindingLanguage, TemplatingBindingLanguage);
+ config.container.registerAlias(_aureliaTemplating.BindingLanguage, TemplatingBindingLanguage);
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/index.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/index.js
new file mode 100644
index 000000000..d01ec25e3
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-binding@1.0.0/index.js
@@ -0,0 +1,17 @@
+/* */
+define(['exports', './aurelia-templating-binding'], function (exports, _aureliaTemplatingBinding) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ Object.keys(_aureliaTemplatingBinding).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _aureliaTemplatingBinding[key];
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1.js
new file mode 100644
index 000000000..42f063729
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1.js
@@ -0,0 +1,3 @@
+define(["npm:aurelia-templating-resources@1.1.1/aurelia-templating-resources"], function(main) {
+ return main;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/.jspm-hash b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/.jspm-hash
new file mode 100644
index 000000000..03afff561
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/.jspm-hash
@@ -0,0 +1 @@
+fd55bbdde07d2a7249ac244ae5c696efb8b0bfb799914b932bd37a50b983c5e7c90ae93bjspm-npm@0.260.16.1
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/abstract-repeater.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/abstract-repeater.js
new file mode 100644
index 000000000..b1bbff120
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/abstract-repeater.js
@@ -0,0 +1,67 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+
+
+ var AbstractRepeater = exports.AbstractRepeater = function () {
+ function AbstractRepeater(options) {
+
+
+ Object.assign(this, {
+ local: 'items',
+ viewsRequireLifecycle: true
+ }, options);
+ }
+
+ AbstractRepeater.prototype.viewCount = function viewCount() {
+ throw new Error('subclass must implement `viewCount`');
+ };
+
+ AbstractRepeater.prototype.views = function views() {
+ throw new Error('subclass must implement `views`');
+ };
+
+ AbstractRepeater.prototype.view = function view(index) {
+ throw new Error('subclass must implement `view`');
+ };
+
+ AbstractRepeater.prototype.matcher = function matcher() {
+ throw new Error('subclass must implement `matcher`');
+ };
+
+ AbstractRepeater.prototype.addView = function addView(bindingContext, overrideContext) {
+ throw new Error('subclass must implement `addView`');
+ };
+
+ AbstractRepeater.prototype.insertView = function insertView(index, bindingContext, overrideContext) {
+ throw new Error('subclass must implement `insertView`');
+ };
+
+ AbstractRepeater.prototype.moveView = function moveView(sourceIndex, targetIndex) {
+ throw new Error('subclass must implement `moveView`');
+ };
+
+ AbstractRepeater.prototype.removeAllViews = function removeAllViews(returnToCache, skipAnimation) {
+ throw new Error('subclass must implement `removeAllViews`');
+ };
+
+ AbstractRepeater.prototype.removeViews = function removeViews(viewsToRemove, returnToCache, skipAnimation) {
+ throw new Error('subclass must implement `removeView`');
+ };
+
+ AbstractRepeater.prototype.removeView = function removeView(index, returnToCache, skipAnimation) {
+ throw new Error('subclass must implement `removeView`');
+ };
+
+ AbstractRepeater.prototype.updateBindings = function updateBindings(view) {
+ throw new Error('subclass must implement `updateBindings`');
+ };
+
+ return AbstractRepeater;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/analyze-view-factory.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/analyze-view-factory.js
new file mode 100644
index 000000000..60eb85c04
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/analyze-view-factory.js
@@ -0,0 +1,58 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.viewsRequireLifecycle = viewsRequireLifecycle;
+ var lifecycleOptionalBehaviors = exports.lifecycleOptionalBehaviors = ['focus', 'if', 'repeat', 'show', 'with'];
+
+ function behaviorRequiresLifecycle(instruction) {
+ var t = instruction.type;
+ var name = t.elementName !== null ? t.elementName : t.attributeName;
+ return lifecycleOptionalBehaviors.indexOf(name) === -1 && (t.handlesAttached || t.handlesBind || t.handlesCreated || t.handlesDetached || t.handlesUnbind) || t.viewFactory && viewsRequireLifecycle(t.viewFactory) || instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);
+ }
+
+ function targetRequiresLifecycle(instruction) {
+ var behaviors = instruction.behaviorInstructions;
+ if (behaviors) {
+ var i = behaviors.length;
+ while (i--) {
+ if (behaviorRequiresLifecycle(behaviors[i])) {
+ return true;
+ }
+ }
+ }
+
+ return instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);
+ }
+
+ function viewsRequireLifecycle(viewFactory) {
+ if ('_viewsRequireLifecycle' in viewFactory) {
+ return viewFactory._viewsRequireLifecycle;
+ }
+
+ viewFactory._viewsRequireLifecycle = false;
+
+ if (viewFactory.viewFactory) {
+ viewFactory._viewsRequireLifecycle = viewsRequireLifecycle(viewFactory.viewFactory);
+ return viewFactory._viewsRequireLifecycle;
+ }
+
+ if (viewFactory.template.querySelector('.au-animate')) {
+ viewFactory._viewsRequireLifecycle = true;
+ return true;
+ }
+
+ for (var id in viewFactory.instructions) {
+ if (targetRequiresLifecycle(viewFactory.instructions[id])) {
+ viewFactory._viewsRequireLifecycle = true;
+ return true;
+ }
+ }
+
+ viewFactory._viewsRequireLifecycle = false;
+ return false;
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/array-repeat-strategy.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/array-repeat-strategy.js
new file mode 100644
index 000000000..616eb45cf
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/array-repeat-strategy.js
@@ -0,0 +1,244 @@
+/* */
+define(['exports', './repeat-utilities', 'aurelia-binding'], function (exports, _repeatUtilities, _aureliaBinding) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.ArrayRepeatStrategy = undefined;
+
+
+
+ var ArrayRepeatStrategy = exports.ArrayRepeatStrategy = function () {
+ function ArrayRepeatStrategy() {
+
+ }
+
+ ArrayRepeatStrategy.prototype.getCollectionObserver = function getCollectionObserver(observerLocator, items) {
+ return observerLocator.getArrayObserver(items);
+ };
+
+ ArrayRepeatStrategy.prototype.instanceChanged = function instanceChanged(repeat, items) {
+ var _this = this;
+
+ var itemsLength = items.length;
+
+ if (!items || itemsLength === 0) {
+ repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);
+ return;
+ }
+
+ var children = repeat.views();
+ var viewsLength = children.length;
+
+ if (viewsLength === 0) {
+ this._standardProcessInstanceChanged(repeat, items);
+ return;
+ }
+
+ if (repeat.viewsRequireLifecycle) {
+ (function () {
+ var childrenSnapshot = children.slice(0);
+ var itemNameInBindingContext = repeat.local;
+ var matcher = repeat.matcher();
+
+ var itemsPreviouslyInViews = [];
+ var viewsToRemove = [];
+
+ for (var index = 0; index < viewsLength; index++) {
+ var view = childrenSnapshot[index];
+ var oldItem = view.bindingContext[itemNameInBindingContext];
+
+ if ((0, _repeatUtilities.indexOf)(items, oldItem, matcher) === -1) {
+ viewsToRemove.push(view);
+ } else {
+ itemsPreviouslyInViews.push(oldItem);
+ }
+ }
+
+ var updateViews = void 0;
+ var removePromise = void 0;
+
+ if (itemsPreviouslyInViews.length > 0) {
+ removePromise = repeat.removeViews(viewsToRemove, true, !repeat.viewsRequireLifecycle);
+ updateViews = function updateViews() {
+ for (var _index = 0; _index < itemsLength; _index++) {
+ var item = items[_index];
+ var indexOfView = (0, _repeatUtilities.indexOf)(itemsPreviouslyInViews, item, matcher, _index);
+ var _view = void 0;
+
+ if (indexOfView === -1) {
+ var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[_index], _index, itemsLength);
+ repeat.insertView(_index, overrideContext.bindingContext, overrideContext);
+
+ itemsPreviouslyInViews.splice(_index, 0, undefined);
+ } else if (indexOfView === _index) {
+ _view = children[indexOfView];
+ itemsPreviouslyInViews[indexOfView] = undefined;
+ } else {
+ _view = children[indexOfView];
+ repeat.moveView(indexOfView, _index);
+ itemsPreviouslyInViews.splice(indexOfView, 1);
+ itemsPreviouslyInViews.splice(_index, 0, undefined);
+ }
+
+ if (_view) {
+ (0, _repeatUtilities.updateOverrideContext)(_view.overrideContext, _index, itemsLength);
+ }
+ }
+
+ _this._inPlaceProcessItems(repeat, items);
+ };
+ } else {
+ removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);
+ updateViews = function updateViews() {
+ return _this._standardProcessInstanceChanged(repeat, items);
+ };
+ }
+
+ if (removePromise instanceof Promise) {
+ removePromise.then(updateViews);
+ } else {
+ updateViews();
+ }
+ })();
+ } else {
+ this._inPlaceProcessItems(repeat, items);
+ }
+ };
+
+ ArrayRepeatStrategy.prototype._standardProcessInstanceChanged = function _standardProcessInstanceChanged(repeat, items) {
+ for (var i = 0, ii = items.length; i < ii; i++) {
+ var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[i], i, ii);
+ repeat.addView(overrideContext.bindingContext, overrideContext);
+ }
+ };
+
+ ArrayRepeatStrategy.prototype._inPlaceProcessItems = function _inPlaceProcessItems(repeat, items) {
+ var itemsLength = items.length;
+ var viewsLength = repeat.viewCount();
+
+ while (viewsLength > itemsLength) {
+ viewsLength--;
+ repeat.removeView(viewsLength, true, !repeat.viewsRequireLifecycle);
+ }
+
+ var local = repeat.local;
+
+ for (var i = 0; i < viewsLength; i++) {
+ var view = repeat.view(i);
+ var last = i === itemsLength - 1;
+ var middle = i !== 0 && !last;
+
+ if (view.bindingContext[local] === items[i] && view.overrideContext.$middle === middle && view.overrideContext.$last === last) {
+ continue;
+ }
+
+ view.bindingContext[local] = items[i];
+ view.overrideContext.$middle = middle;
+ view.overrideContext.$last = last;
+ repeat.updateBindings(view);
+ }
+
+ for (var _i = viewsLength; _i < itemsLength; _i++) {
+ var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, items[_i], _i, itemsLength);
+ repeat.addView(overrideContext.bindingContext, overrideContext);
+ }
+ };
+
+ ArrayRepeatStrategy.prototype.instanceMutated = function instanceMutated(repeat, array, splices) {
+ var _this2 = this;
+
+ if (repeat.__queuedSplices) {
+ for (var i = 0, ii = splices.length; i < ii; ++i) {
+ var _splices$i = splices[i];
+ var index = _splices$i.index;
+ var removed = _splices$i.removed;
+ var addedCount = _splices$i.addedCount;
+
+ (0, _aureliaBinding.mergeSplice)(repeat.__queuedSplices, index, removed, addedCount);
+ }
+
+ repeat.__array = array.slice(0);
+ return;
+ }
+
+ var maybePromise = this._runSplices(repeat, array.slice(0), splices);
+ if (maybePromise instanceof Promise) {
+ (function () {
+ var queuedSplices = repeat.__queuedSplices = [];
+
+ var runQueuedSplices = function runQueuedSplices() {
+ if (!queuedSplices.length) {
+ repeat.__queuedSplices = undefined;
+ repeat.__array = undefined;
+ return;
+ }
+
+ var nextPromise = _this2._runSplices(repeat, repeat.__array, queuedSplices) || Promise.resolve();
+ queuedSplices = repeat.__queuedSplices = [];
+ nextPromise.then(runQueuedSplices);
+ };
+
+ maybePromise.then(runQueuedSplices);
+ })();
+ }
+ };
+
+ ArrayRepeatStrategy.prototype._runSplices = function _runSplices(repeat, array, splices) {
+ var _this3 = this;
+
+ var removeDelta = 0;
+ var rmPromises = [];
+
+ for (var i = 0, ii = splices.length; i < ii; ++i) {
+ var splice = splices[i];
+ var removed = splice.removed;
+
+ for (var j = 0, jj = removed.length; j < jj; ++j) {
+ var viewOrPromise = repeat.removeView(splice.index + removeDelta + rmPromises.length, true);
+ if (viewOrPromise instanceof Promise) {
+ rmPromises.push(viewOrPromise);
+ }
+ }
+ removeDelta -= splice.addedCount;
+ }
+
+ if (rmPromises.length > 0) {
+ return Promise.all(rmPromises).then(function () {
+ var spliceIndexLow = _this3._handleAddedSplices(repeat, array, splices);
+ (0, _repeatUtilities.updateOverrideContexts)(repeat.views(), spliceIndexLow);
+ });
+ }
+
+ var spliceIndexLow = this._handleAddedSplices(repeat, array, splices);
+ (0, _repeatUtilities.updateOverrideContexts)(repeat.views(), spliceIndexLow);
+
+ return undefined;
+ };
+
+ ArrayRepeatStrategy.prototype._handleAddedSplices = function _handleAddedSplices(repeat, array, splices) {
+ var spliceIndex = void 0;
+ var spliceIndexLow = void 0;
+ var arrayLength = array.length;
+ for (var i = 0, ii = splices.length; i < ii; ++i) {
+ var splice = splices[i];
+ var addIndex = spliceIndex = splice.index;
+ var end = splice.index + splice.addedCount;
+
+ if (typeof spliceIndexLow === 'undefined' || spliceIndexLow === null || spliceIndexLow > splice.index) {
+ spliceIndexLow = spliceIndex;
+ }
+
+ for (; addIndex < end; ++addIndex) {
+ var overrideContext = (0, _repeatUtilities.createFullOverrideContext)(repeat, array[addIndex], addIndex, arrayLength);
+ repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext);
+ }
+ }
+
+ return spliceIndexLow;
+ };
+
+ return ArrayRepeatStrategy;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/attr-binding-behavior.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/attr-binding-behavior.js
new file mode 100644
index 000000000..b0a8be9f3
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/attr-binding-behavior.js
@@ -0,0 +1,25 @@
+/* */
+define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.AttrBindingBehavior = undefined;
+
+
+
+ var AttrBindingBehavior = exports.AttrBindingBehavior = function () {
+ function AttrBindingBehavior() {
+
+ }
+
+ AttrBindingBehavior.prototype.bind = function bind(binding, source) {
+ binding.targetObserver = new _aureliaBinding.DataAttributeObserver(binding.target, binding.targetProperty);
+ };
+
+ AttrBindingBehavior.prototype.unbind = function unbind(binding, source) {};
+
+ return AttrBindingBehavior;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/aurelia-hide-style.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/aurelia-hide-style.js
new file mode 100644
index 000000000..65f04231f
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/aurelia-hide-style.js
@@ -0,0 +1,25 @@
+/* */
+define(['exports', 'aurelia-pal'], function (exports, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.aureliaHideClassName = undefined;
+ exports.injectAureliaHideStyleAtHead = injectAureliaHideStyleAtHead;
+ exports.injectAureliaHideStyleAtBoundary = injectAureliaHideStyleAtBoundary;
+ var aureliaHideClassName = exports.aureliaHideClassName = 'aurelia-hide';
+
+ var aureliaHideClass = '.' + aureliaHideClassName + ' { display:none !important; }';
+
+ function injectAureliaHideStyleAtHead() {
+ _aureliaPal.DOM.injectStyles(aureliaHideClass);
+ }
+
+ function injectAureliaHideStyleAtBoundary(domBoundary) {
+ if (_aureliaPal.FEATURE.shadowDOM && domBoundary && !domBoundary.hasAureliaHideStyle) {
+ domBoundary.hasAureliaHideStyle = true;
+ _aureliaPal.DOM.injectStyles(aureliaHideClass, domBoundary);
+ }
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/aurelia-templating-resources.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/aurelia-templating-resources.js
new file mode 100644
index 000000000..70212d768
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/aurelia-templating-resources.js
@@ -0,0 +1,62 @@
+/* */
+define(['exports', './compose', './if', './with', './repeat', './show', './hide', './sanitize-html', './replaceable', './focus', 'aurelia-templating', './css-resource', './html-sanitizer', './attr-binding-behavior', './binding-mode-behaviors', './throttle-binding-behavior', './debounce-binding-behavior', './signal-binding-behavior', './binding-signaler', './update-trigger-binding-behavior', './abstract-repeater', './repeat-strategy-locator', './html-resource-plugin', './null-repeat-strategy', './array-repeat-strategy', './map-repeat-strategy', './set-repeat-strategy', './number-repeat-strategy', './repeat-utilities', './analyze-view-factory', './aurelia-hide-style'], function (exports, _compose, _if, _with, _repeat, _show, _hide, _sanitizeHtml, _replaceable, _focus, _aureliaTemplating, _cssResource, _htmlSanitizer, _attrBindingBehavior, _bindingModeBehaviors, _throttleBindingBehavior, _debounceBindingBehavior, _signalBindingBehavior, _bindingSignaler, _updateTriggerBindingBehavior, _abstractRepeater, _repeatStrategyLocator, _htmlResourcePlugin, _nullRepeatStrategy, _arrayRepeatStrategy, _mapRepeatStrategy, _setRepeatStrategy, _numberRepeatStrategy, _repeatUtilities, _analyzeViewFactory, _aureliaHideStyle) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.viewsRequireLifecycle = exports.unwrapExpression = exports.updateOneTimeBinding = exports.isOneTime = exports.getItemsSourceExpression = exports.updateOverrideContext = exports.createFullOverrideContext = exports.NumberRepeatStrategy = exports.SetRepeatStrategy = exports.MapRepeatStrategy = exports.ArrayRepeatStrategy = exports.NullRepeatStrategy = exports.RepeatStrategyLocator = exports.AbstractRepeater = exports.UpdateTriggerBindingBehavior = exports.BindingSignaler = exports.SignalBindingBehavior = exports.DebounceBindingBehavior = exports.ThrottleBindingBehavior = exports.TwoWayBindingBehavior = exports.OneWayBindingBehavior = exports.OneTimeBindingBehavior = exports.AttrBindingBehavior = exports.configure = exports.Focus = exports.Replaceable = exports.SanitizeHTMLValueConverter = exports.HTMLSanitizer = exports.Hide = exports.Show = exports.Repeat = exports.With = exports.If = exports.Compose = undefined;
+
+
+ function configure(config) {
+ (0, _aureliaHideStyle.injectAureliaHideStyleAtHead)();
+
+ config.globalResources('./compose', './if', './with', './repeat', './show', './hide', './replaceable', './sanitize-html', './focus', './binding-mode-behaviors', './throttle-binding-behavior', './debounce-binding-behavior', './signal-binding-behavior', './update-trigger-binding-behavior', './attr-binding-behavior');
+
+ (0, _htmlResourcePlugin.configure)(config);
+
+ var viewEngine = config.container.get(_aureliaTemplating.ViewEngine);
+ viewEngine.addResourcePlugin('.css', {
+ 'fetch': function fetch(address) {
+ var _ref;
+
+ return _ref = {}, _ref[address] = (0, _cssResource._createCSSResource)(address), _ref;
+ }
+ });
+ }
+
+ exports.Compose = _compose.Compose;
+ exports.If = _if.If;
+ exports.With = _with.With;
+ exports.Repeat = _repeat.Repeat;
+ exports.Show = _show.Show;
+ exports.Hide = _hide.Hide;
+ exports.HTMLSanitizer = _htmlSanitizer.HTMLSanitizer;
+ exports.SanitizeHTMLValueConverter = _sanitizeHtml.SanitizeHTMLValueConverter;
+ exports.Replaceable = _replaceable.Replaceable;
+ exports.Focus = _focus.Focus;
+ exports.configure = configure;
+ exports.AttrBindingBehavior = _attrBindingBehavior.AttrBindingBehavior;
+ exports.OneTimeBindingBehavior = _bindingModeBehaviors.OneTimeBindingBehavior;
+ exports.OneWayBindingBehavior = _bindingModeBehaviors.OneWayBindingBehavior;
+ exports.TwoWayBindingBehavior = _bindingModeBehaviors.TwoWayBindingBehavior;
+ exports.ThrottleBindingBehavior = _throttleBindingBehavior.ThrottleBindingBehavior;
+ exports.DebounceBindingBehavior = _debounceBindingBehavior.DebounceBindingBehavior;
+ exports.SignalBindingBehavior = _signalBindingBehavior.SignalBindingBehavior;
+ exports.BindingSignaler = _bindingSignaler.BindingSignaler;
+ exports.UpdateTriggerBindingBehavior = _updateTriggerBindingBehavior.UpdateTriggerBindingBehavior;
+ exports.AbstractRepeater = _abstractRepeater.AbstractRepeater;
+ exports.RepeatStrategyLocator = _repeatStrategyLocator.RepeatStrategyLocator;
+ exports.NullRepeatStrategy = _nullRepeatStrategy.NullRepeatStrategy;
+ exports.ArrayRepeatStrategy = _arrayRepeatStrategy.ArrayRepeatStrategy;
+ exports.MapRepeatStrategy = _mapRepeatStrategy.MapRepeatStrategy;
+ exports.SetRepeatStrategy = _setRepeatStrategy.SetRepeatStrategy;
+ exports.NumberRepeatStrategy = _numberRepeatStrategy.NumberRepeatStrategy;
+ exports.createFullOverrideContext = _repeatUtilities.createFullOverrideContext;
+ exports.updateOverrideContext = _repeatUtilities.updateOverrideContext;
+ exports.getItemsSourceExpression = _repeatUtilities.getItemsSourceExpression;
+ exports.isOneTime = _repeatUtilities.isOneTime;
+ exports.updateOneTimeBinding = _repeatUtilities.updateOneTimeBinding;
+ exports.unwrapExpression = _repeatUtilities.unwrapExpression;
+ exports.viewsRequireLifecycle = _analyzeViewFactory.viewsRequireLifecycle;
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/binding-mode-behaviors.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/binding-mode-behaviors.js
new file mode 100644
index 000000000..4bacc991c
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/binding-mode-behaviors.js
@@ -0,0 +1,40 @@
+/* */
+define(['exports', 'aurelia-binding', 'aurelia-metadata'], function (exports, _aureliaBinding, _aureliaMetadata) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.TwoWayBindingBehavior = exports.OneWayBindingBehavior = exports.OneTimeBindingBehavior = undefined;
+
+
+
+ var _dec, _class, _dec2, _class2, _dec3, _class3;
+
+ var modeBindingBehavior = {
+ bind: function bind(binding, source, lookupFunctions) {
+ binding.originalMode = binding.mode;
+ binding.mode = this.mode;
+ },
+ unbind: function unbind(binding, source) {
+ binding.mode = binding.originalMode;
+ binding.originalMode = null;
+ }
+ };
+
+ var OneTimeBindingBehavior = exports.OneTimeBindingBehavior = (_dec = (0, _aureliaMetadata.mixin)(modeBindingBehavior), _dec(_class = function OneTimeBindingBehavior() {
+
+
+ this.mode = _aureliaBinding.bindingMode.oneTime;
+ }) || _class);
+ var OneWayBindingBehavior = exports.OneWayBindingBehavior = (_dec2 = (0, _aureliaMetadata.mixin)(modeBindingBehavior), _dec2(_class2 = function OneWayBindingBehavior() {
+
+
+ this.mode = _aureliaBinding.bindingMode.oneWay;
+ }) || _class2);
+ var TwoWayBindingBehavior = exports.TwoWayBindingBehavior = (_dec3 = (0, _aureliaMetadata.mixin)(modeBindingBehavior), _dec3(_class3 = function TwoWayBindingBehavior() {
+
+
+ this.mode = _aureliaBinding.bindingMode.twoWay;
+ }) || _class3);
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/binding-signaler.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/binding-signaler.js
new file mode 100644
index 000000000..8922b03e1
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/binding-signaler.js
@@ -0,0 +1,32 @@
+/* */
+define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.BindingSignaler = undefined;
+
+
+
+ var BindingSignaler = exports.BindingSignaler = function () {
+ function BindingSignaler() {
+
+
+ this.signals = {};
+ }
+
+ BindingSignaler.prototype.signal = function signal(name) {
+ var bindings = this.signals[name];
+ if (!bindings) {
+ return;
+ }
+ var i = bindings.length;
+ while (i--) {
+ bindings[i].call(_aureliaBinding.sourceContext);
+ }
+ };
+
+ return BindingSignaler;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/compose.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/compose.js
new file mode 100644
index 000000000..ccfd3a67d
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/compose.js
@@ -0,0 +1,194 @@
+/* */
+define(['exports', 'aurelia-dependency-injection', 'aurelia-task-queue', 'aurelia-templating', 'aurelia-pal'], function (exports, _aureliaDependencyInjection, _aureliaTaskQueue, _aureliaTemplating, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.Compose = undefined;
+
+ function _initDefineProp(target, property, descriptor, context) {
+ if (!descriptor) return;
+ Object.defineProperty(target, property, {
+ enumerable: descriptor.enumerable,
+ configurable: descriptor.configurable,
+ writable: descriptor.writable,
+ value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
+ });
+ }
+
+
+
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
+ var desc = {};
+ Object['ke' + 'ys'](descriptor).forEach(function (key) {
+ desc[key] = descriptor[key];
+ });
+ desc.enumerable = !!desc.enumerable;
+ desc.configurable = !!desc.configurable;
+
+ if ('value' in desc || desc.initializer) {
+ desc.writable = true;
+ }
+
+ desc = decorators.slice().reverse().reduce(function (desc, decorator) {
+ return decorator(target, property, desc) || desc;
+ }, desc);
+
+ if (context && desc.initializer !== void 0) {
+ desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
+ desc.initializer = undefined;
+ }
+
+ if (desc.initializer === void 0) {
+ Object['define' + 'Property'](target, property, desc);
+ desc = null;
+ }
+
+ return desc;
+ }
+
+ function _initializerWarningHelper(descriptor, context) {
+ throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
+ }
+
+ var _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3;
+
+ var Compose = exports.Compose = (_dec = (0, _aureliaTemplating.customElement)('compose'), _dec2 = (0, _aureliaDependencyInjection.inject)(_aureliaPal.DOM.Element, _aureliaDependencyInjection.Container, _aureliaTemplating.CompositionEngine, _aureliaTemplating.ViewSlot, _aureliaTemplating.ViewResources, _aureliaTaskQueue.TaskQueue), _dec(_class = (0, _aureliaTemplating.noView)(_class = _dec2(_class = (_class2 = function () {
+ function Compose(element, container, compositionEngine, viewSlot, viewResources, taskQueue) {
+
+
+ _initDefineProp(this, 'model', _descriptor, this);
+
+ _initDefineProp(this, 'view', _descriptor2, this);
+
+ _initDefineProp(this, 'viewModel', _descriptor3, this);
+
+ this.element = element;
+ this.container = container;
+ this.compositionEngine = compositionEngine;
+ this.viewSlot = viewSlot;
+ this.viewResources = viewResources;
+ this.taskQueue = taskQueue;
+ this.currentController = null;
+ this.currentViewModel = null;
+ }
+
+ Compose.prototype.created = function created(owningView) {
+ this.owningView = owningView;
+ };
+
+ Compose.prototype.bind = function bind(bindingContext, overrideContext) {
+ this.bindingContext = bindingContext;
+ this.overrideContext = overrideContext;
+ processInstruction(this, createInstruction(this, {
+ view: this.view,
+ viewModel: this.viewModel,
+ model: this.model
+ }));
+ };
+
+ Compose.prototype.unbind = function unbind(bindingContext, overrideContext) {
+ this.bindingContext = null;
+ this.overrideContext = null;
+ var returnToCache = true;
+ var skipAnimation = true;
+ this.viewSlot.removeAll(returnToCache, skipAnimation);
+ };
+
+ Compose.prototype.modelChanged = function modelChanged(newValue, oldValue) {
+ var _this = this;
+
+ if (this.currentInstruction) {
+ this.currentInstruction.model = newValue;
+ return;
+ }
+
+ this.taskQueue.queueMicroTask(function () {
+ if (_this.currentInstruction) {
+ _this.currentInstruction.model = newValue;
+ return;
+ }
+
+ var vm = _this.currentViewModel;
+
+ if (vm && typeof vm.activate === 'function') {
+ vm.activate(newValue);
+ }
+ });
+ };
+
+ Compose.prototype.viewChanged = function viewChanged(newValue, oldValue) {
+ var _this2 = this;
+
+ var instruction = createInstruction(this, {
+ view: newValue,
+ viewModel: this.currentViewModel || this.viewModel,
+ model: this.model
+ });
+
+ if (this.currentInstruction) {
+ this.currentInstruction = instruction;
+ return;
+ }
+
+ this.currentInstruction = instruction;
+ this.taskQueue.queueMicroTask(function () {
+ return processInstruction(_this2, _this2.currentInstruction);
+ });
+ };
+
+ Compose.prototype.viewModelChanged = function viewModelChanged(newValue, oldValue) {
+ var _this3 = this;
+
+ var instruction = createInstruction(this, {
+ viewModel: newValue,
+ view: this.view,
+ model: this.model
+ });
+
+ if (this.currentInstruction) {
+ this.currentInstruction = instruction;
+ return;
+ }
+
+ this.currentInstruction = instruction;
+ this.taskQueue.queueMicroTask(function () {
+ return processInstruction(_this3, _this3.currentInstruction);
+ });
+ };
+
+ return Compose;
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'model', [_aureliaTemplating.bindable], {
+ enumerable: true,
+ initializer: null
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'view', [_aureliaTemplating.bindable], {
+ enumerable: true,
+ initializer: null
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'viewModel', [_aureliaTemplating.bindable], {
+ enumerable: true,
+ initializer: null
+ })), _class2)) || _class) || _class) || _class);
+
+
+ function createInstruction(composer, instruction) {
+ return Object.assign(instruction, {
+ bindingContext: composer.bindingContext,
+ overrideContext: composer.overrideContext,
+ owningView: composer.owningView,
+ container: composer.container,
+ viewSlot: composer.viewSlot,
+ viewResources: composer.viewResources,
+ currentController: composer.currentController,
+ host: composer.element
+ });
+ }
+
+ function processInstruction(composer, instruction) {
+ composer.currentInstruction = null;
+ composer.compositionEngine.compose(instruction).then(function (controller) {
+ composer.currentController = controller;
+ composer.currentViewModel = controller ? controller.viewModel : null;
+ });
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/css-resource.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/css-resource.js
new file mode 100644
index 000000000..bab88c51e
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/css-resource.js
@@ -0,0 +1,131 @@
+/* */
+define(['exports', 'aurelia-templating', 'aurelia-loader', 'aurelia-dependency-injection', 'aurelia-path', 'aurelia-pal'], function (exports, _aureliaTemplating, _aureliaLoader, _aureliaDependencyInjection, _aureliaPath, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports._createCSSResource = _createCSSResource;
+
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }
+
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+
+
+ var cssUrlMatcher = /url\((?!['"]data)([^)]+)\)/gi;
+
+ function fixupCSSUrls(address, css) {
+ if (typeof css !== 'string') {
+ throw new Error('Failed loading required CSS file: ' + address);
+ }
+ return css.replace(cssUrlMatcher, function (match, p1) {
+ var quote = p1.charAt(0);
+ if (quote === '\'' || quote === '"') {
+ p1 = p1.substr(1, p1.length - 2);
+ }
+ return 'url(\'' + (0, _aureliaPath.relativeToFile)(p1, address) + '\')';
+ });
+ }
+
+ var CSSResource = function () {
+ function CSSResource(address) {
+
+
+ this.address = address;
+ this._scoped = null;
+ this._global = false;
+ this._alreadyGloballyInjected = false;
+ }
+
+ CSSResource.prototype.initialize = function initialize(container, target) {
+ this._scoped = new target(this);
+ };
+
+ CSSResource.prototype.register = function register(registry, name) {
+ if (name === 'scoped') {
+ registry.registerViewEngineHooks(this._scoped);
+ } else {
+ this._global = true;
+ }
+ };
+
+ CSSResource.prototype.load = function load(container) {
+ var _this = this;
+
+ return container.get(_aureliaLoader.Loader).loadText(this.address).catch(function (err) {
+ return null;
+ }).then(function (text) {
+ text = fixupCSSUrls(_this.address, text);
+ _this._scoped.css = text;
+ if (_this._global) {
+ _this._alreadyGloballyInjected = true;
+ _aureliaPal.DOM.injectStyles(text);
+ }
+ });
+ };
+
+ return CSSResource;
+ }();
+
+ var CSSViewEngineHooks = function () {
+ function CSSViewEngineHooks(owner) {
+
+
+ this.owner = owner;
+ this.css = null;
+ }
+
+ CSSViewEngineHooks.prototype.beforeCompile = function beforeCompile(content, resources, instruction) {
+ if (instruction.targetShadowDOM) {
+ _aureliaPal.DOM.injectStyles(this.css, content, true);
+ } else if (_aureliaPal.FEATURE.scopedCSS) {
+ var styleNode = _aureliaPal.DOM.injectStyles(this.css, content, true);
+ styleNode.setAttribute('scoped', 'scoped');
+ } else if (!this.owner._alreadyGloballyInjected) {
+ _aureliaPal.DOM.injectStyles(this.css);
+ this.owner._alreadyGloballyInjected = true;
+ }
+ };
+
+ return CSSViewEngineHooks;
+ }();
+
+ function _createCSSResource(address) {
+ var _dec, _class;
+
+ var ViewCSS = (_dec = (0, _aureliaTemplating.resource)(new CSSResource(address)), _dec(_class = function (_CSSViewEngineHooks) {
+ _inherits(ViewCSS, _CSSViewEngineHooks);
+
+ function ViewCSS() {
+
+
+ return _possibleConstructorReturn(this, _CSSViewEngineHooks.apply(this, arguments));
+ }
+
+ return ViewCSS;
+ }(CSSViewEngineHooks)) || _class);
+
+ return ViewCSS;
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/debounce-binding-behavior.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/debounce-binding-behavior.js
new file mode 100644
index 000000000..572b895b6
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/debounce-binding-behavior.js
@@ -0,0 +1,63 @@
+/* */
+define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.DebounceBindingBehavior = undefined;
+
+
+
+ function debounce(newValue) {
+ var _this = this;
+
+ var state = this.debounceState;
+ if (state.immediate) {
+ state.immediate = false;
+ this.debouncedMethod(newValue);
+ return;
+ }
+ clearTimeout(state.timeoutId);
+ state.timeoutId = setTimeout(function () {
+ return _this.debouncedMethod(newValue);
+ }, state.delay);
+ }
+
+ var DebounceBindingBehavior = exports.DebounceBindingBehavior = function () {
+ function DebounceBindingBehavior() {
+
+ }
+
+ DebounceBindingBehavior.prototype.bind = function bind(binding, source) {
+ var delay = arguments.length <= 2 || arguments[2] === undefined ? 200 : arguments[2];
+
+ var methodToDebounce = 'updateTarget';
+ if (binding.callSource) {
+ methodToDebounce = 'callSource';
+ } else if (binding.updateSource && binding.mode === _aureliaBinding.bindingMode.twoWay) {
+ methodToDebounce = 'updateSource';
+ }
+
+ binding.debouncedMethod = binding[methodToDebounce];
+ binding.debouncedMethod.originalName = methodToDebounce;
+
+ binding[methodToDebounce] = debounce;
+
+ binding.debounceState = {
+ delay: delay,
+ timeoutId: null,
+ immediate: methodToDebounce === 'updateTarget' };
+ };
+
+ DebounceBindingBehavior.prototype.unbind = function unbind(binding, source) {
+ var methodToRestore = binding.debouncedMethod.originalName;
+ binding[methodToRestore] = binding.debouncedMethod;
+ binding.debouncedMethod = null;
+ clearTimeout(binding.debounceState.timeoutId);
+ binding.debounceState = null;
+ };
+
+ return DebounceBindingBehavior;
+ }();
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/dynamic-element.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/dynamic-element.js
new file mode 100644
index 000000000..e2ee103cd
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/dynamic-element.js
@@ -0,0 +1,32 @@
+/* */
+define(['exports', 'aurelia-templating'], function (exports, _aureliaTemplating) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports._createDynamicElement = _createDynamicElement;
+
+
+
+ function _createDynamicElement(name, viewUrl, bindableNames) {
+ var _dec, _dec2, _class;
+
+ var DynamicElement = (_dec = (0, _aureliaTemplating.customElement)(name), _dec2 = (0, _aureliaTemplating.useView)(viewUrl), _dec(_class = _dec2(_class = function () {
+ function DynamicElement() {
+
+ }
+
+ DynamicElement.prototype.bind = function bind(bindingContext) {
+ this.$parent = bindingContext;
+ };
+
+ return DynamicElement;
+ }()) || _class) || _class);
+
+ for (var i = 0, ii = bindableNames.length; i < ii; ++i) {
+ (0, _aureliaTemplating.bindable)(bindableNames[i])(DynamicElement);
+ }
+ return DynamicElement;
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/focus.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/focus.js
new file mode 100644
index 000000000..74dbd0d54
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/focus.js
@@ -0,0 +1,75 @@
+/* */
+define(['exports', 'aurelia-templating', 'aurelia-binding', 'aurelia-dependency-injection', 'aurelia-task-queue', 'aurelia-pal'], function (exports, _aureliaTemplating, _aureliaBinding, _aureliaDependencyInjection, _aureliaTaskQueue, _aureliaPal) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.Focus = undefined;
+
+
+
+ var _dec, _dec2, _class;
+
+ var Focus = exports.Focus = (_dec = (0, _aureliaTemplating.customAttribute)('focus', _aureliaBinding.bindingMode.twoWay), _dec2 = (0, _aureliaDependencyInjection.inject)(_aureliaPal.DOM.Element, _aureliaTaskQueue.TaskQueue), _dec(_class = _dec2(_class = function () {
+ function Focus(element, taskQueue) {
+ var _this = this;
+
+
+
+ this.element = element;
+ this.taskQueue = taskQueue;
+ this.isAttached = false;
+ this.needsApply = false;
+
+ this.focusListener = function (e) {
+ _this.value = true;
+ };
+ this.blurListener = function (e) {
+ if (_aureliaPal.DOM.activeElement !== _this.element) {
+ _this.value = false;
+ }
+ };
+ }
+
+ Focus.prototype.valueChanged = function valueChanged(newValue) {
+ if (this.isAttached) {
+ this._apply();
+ } else {
+ this.needsApply = true;
+ }
+ };
+
+ Focus.prototype._apply = function _apply() {
+ var _this2 = this;
+
+ if (this.value) {
+ this.taskQueue.queueMicroTask(function () {
+ if (_this2.value) {
+ _this2.element.focus();
+ }
+ });
+ } else {
+ this.element.blur();
+ }
+ };
+
+ Focus.prototype.attached = function attached() {
+ this.isAttached = true;
+ if (this.needsApply) {
+ this.needsApply = false;
+ this._apply();
+ }
+ this.element.addEventListener('focus', this.focusListener);
+ this.element.addEventListener('blur', this.blurListener);
+ };
+
+ Focus.prototype.detached = function detached() {
+ this.isAttached = false;
+ this.element.removeEventListener('focus', this.focusListener);
+ this.element.removeEventListener('blur', this.blurListener);
+ };
+
+ return Focus;
+ }()) || _class) || _class);
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/hide.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/hide.js
new file mode 100644
index 000000000..8033100f4
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/hide.js
@@ -0,0 +1,41 @@
+/* */
+define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aurelia-pal', './aurelia-hide-style'], function (exports, _aureliaDependencyInjection, _aureliaTemplating, _aureliaPal, _aureliaHideStyle) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.Hide = undefined;
+
+
+
+ var _dec, _dec2, _class;
+
+ var Hide = exports.Hide = (_dec = (0, _aureliaTemplating.customAttribute)('hide'), _dec2 = (0, _aureliaDependencyInjection.inject)(_aureliaPal.DOM.Element, _aureliaTemplating.Animator, _aureliaDependencyInjection.Optional.of(_aureliaPal.DOM.boundary, true)), _dec(_class = _dec2(_class = function () {
+ function Hide(element, animator, domBoundary) {
+
+
+ this.element = element;
+ this.animator = animator;
+ this.domBoundary = domBoundary;
+ }
+
+ Hide.prototype.created = function created() {
+ (0, _aureliaHideStyle.injectAureliaHideStyleAtBoundary)(this.domBoundary);
+ };
+
+ Hide.prototype.valueChanged = function valueChanged(newValue) {
+ if (newValue) {
+ this.animator.addClass(this.element, _aureliaHideStyle.aureliaHideClassName);
+ } else {
+ this.animator.removeClass(this.element, _aureliaHideStyle.aureliaHideClassName);
+ }
+ };
+
+ Hide.prototype.bind = function bind(bindingContext) {
+ this.valueChanged(this.value);
+ };
+
+ return Hide;
+ }()) || _class) || _class);
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/html-resource-plugin.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/html-resource-plugin.js
new file mode 100644
index 000000000..3c5eab1c2
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/html-resource-plugin.js
@@ -0,0 +1,41 @@
+/* */
+define(['exports', 'aurelia-templating', './dynamic-element'], function (exports, _aureliaTemplating, _dynamicElement) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+ exports.getElementName = getElementName;
+ exports.configure = configure;
+ function getElementName(address) {
+ return (/([^\/^\?]+)\.html/i.exec(address)[1].toLowerCase()
+ );
+ }
+
+ function configure(config) {
+ var viewEngine = config.container.get(_aureliaTemplating.ViewEngine);
+ var loader = config.aurelia.loader;
+
+ viewEngine.addResourcePlugin('.html', {
+ 'fetch': function fetch(address) {
+ return loader.loadTemplate(address).then(function (registryEntry) {
+ var _ref;
+
+ var bindable = registryEntry.template.getAttribute('bindable');
+ var elementName = getElementName(address);
+
+ if (bindable) {
+ bindable = bindable.split(',').map(function (x) {
+ return x.trim();
+ });
+ registryEntry.template.removeAttribute('bindable');
+ } else {
+ bindable = [];
+ }
+
+ return _ref = {}, _ref[elementName] = (0, _dynamicElement._createDynamicElement)(elementName, address, bindable), _ref;
+ });
+ }
+ });
+ }
+});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/html-sanitizer.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/html-sanitizer.js
new file mode 100644
index 000000000..be68ac41b
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/aurelia-templating-resources@1.1.1/html-sanitizer.js
@@ -0,0 +1,24 @@
+/* */
+define(['exports'], function (exports) {
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+
+
+ var SCRIPT_REGEX = /
+```
+
+#### Babel
+
+[Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.
+
+```js
+import $ from "jquery";
+```
+
+#### Browserify/Webpack
+
+There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this...
+
+```js
+var $ = require("jquery");
+```
+
+#### AMD (Asynchronous Module Definition)
+
+AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html).
+
+```js
+define(["jquery"], function($) {
+
+});
+```
+
+### Node
+
+To include jQuery in [Node](nodejs.org), first install with npm.
+
+```sh
+npm install jquery
+```
+
+For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes.
+
+```js
+require("jsdom").env("", function(err, window) {
+ if (err) {
+ console.error(err);
+ return;
+ }
+
+ var $ = require("jquery")(window);
+});
+```
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/jquery@2.2.4/bower.json b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/jquery@2.2.4/bower.json
new file mode 100644
index 000000000..95798d5ad
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/jquery@2.2.4/bower.json
@@ -0,0 +1,14 @@
+{
+ "name": "jquery",
+ "main": "dist/jquery.js",
+ "license": "MIT",
+ "ignore": [
+ "package.json"
+ ],
+ "keywords": [
+ "jquery",
+ "javascript",
+ "browser",
+ "library"
+ ]
+}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/jquery@2.2.4/dist/jquery.js b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/jquery@2.2.4/dist/jquery.js
new file mode 100644
index 000000000..5c3c456ac
--- /dev/null
+++ b/shrine-webclient/src/main/js/client/js-shrine/jspm_packages/npm/jquery@2.2.4/dist/jquery.js
@@ -0,0 +1,9814 @@
+/*!
+ * jQuery JavaScript Library v2.2.4
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2016-05-20T17:23Z
+ */
+
+(function( global, factory ) {
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Support: Firefox 18+
+// Can't be in strict mode, several libs including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+//"use strict";
+var arr = [];
+
+var document = window.document;
+
+var slice = arr.slice;
+
+var concat = arr.concat;
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var support = {};
+
+
+
+var
+ version = "2.2.4",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android<4.1
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num != null ?
+
+ // Return just the one element from the set
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+
+ // Return all the elements in a clean array
+ slice.call( this );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ each: function( callback ) {
+ return jQuery.each( this, callback );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map( this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ } ) );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor();
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: arr.sort,
+ splice: arr.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[ 0 ] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // Skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
+ target = {};
+ }
+
+ // Extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+
+ // Only deal with non-null/undefined values
+ if ( ( options = arguments[ i ] ) != null ) {
+
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
+ ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
+
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray( src ) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject( src ) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend( {
+
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ isFunction: function( obj ) {
+ return jQuery.type( obj ) === "function";
+ },
+
+ isArray: Array.isArray,
+
+ isWindow: function( obj ) {
+ return obj != null && obj === obj.window;
+ },
+
+ isNumeric: function( obj ) {
+
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ // adding 1 corrects loss of precision from parseFloat (#15100)
+ var realStringObj = obj && obj.toString();
+ return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Not plain objects:
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
+ // - DOM nodes
+ // - window
+ if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call( obj, "constructor" ) &&
+ !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+
+ // Support: Android<4.0, iOS<6 (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call( obj ) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ globalEval: function( code ) {
+ var script,
+ indirect = eval;
+
+ code = jQuery.trim( code );
+
+ if ( code ) {
+
+ // If the code includes a valid, prologue position
+ // strict mode pragma, execute code by injecting a
+ // script tag into the document.
+ if ( code.indexOf( "use strict" ) === 1 ) {
+ script = document.createElement( "script" );
+ script.text = code;
+ document.head.appendChild( script ).parentNode.removeChild( script );
+ } else {
+
+ // Otherwise, avoid the DOM node creation, insertion
+ // and removal by using an indirect global eval
+
+ indirect( code );
+ }
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Support: IE9-11+
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ each: function( obj, callback ) {
+ var length, i = 0;
+
+ if ( isArrayLike( obj ) ) {
+ length = obj.length;
+ for ( ; i < length; i++ ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android<4.1
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArrayLike( Object( arr ) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ return arr == null ? -1 : indexOf.call( arr, elem, i );
+ },
+
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ for ( ; j < len; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var length, value,
+ i = 0,
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArrayLike( elems ) ) {
+ length = elems.length;
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: Date.now,
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+} );
+
+// JSHint would error on this code due to the Symbol not being defined in ES5.
+// Defining this global in .jshintrc would create a danger of using the global
+// unguarded in another place, it seems safer to just disable JSHint for these
+// three lines.
+/* jshint ignore: start */
+if ( typeof Symbol === "function" ) {
+ jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
+}
+/* jshint ignore: end */
+
+// Populate the class2type map
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
+function( i, name ) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+} );
+
+function isArrayLike( obj ) {
+
+ // Support: iOS 8.2 (not reproducible in simulator)
+ // `in` check used to prevent JIT error (gh-2145)
+ // hasOwn isn't used here due to false negatives
+ // regarding Nodelist length in IE
+ var length = !!obj && "length" in obj && obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v2.2.1
+ * http://sizzlejs.com/
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2015-10-17
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + 1 * new Date(),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf as it's faster than native
+ // http://jsperf.com/thor-indexof-vs-for/5
+ indexOf = function( list, elem ) {
+ var i = 0,
+ len = list.length;
+ for ( ; i < len; i++ ) {
+ if ( list[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+
+ // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + identifier + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + identifier + ")" ),
+ "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+ "TAG": new RegExp( "^(" + identifier + "|[*])" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ },
+
+ // Used for iframes
+ // See setDocument()
+ // Removing the function wrapper causes a "Permission Denied"
+ // error in IE
+ unloadHandler = function() {
+ setDocument();
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var m, i, elem, nid, nidselect, match, groups, newSelector,
+ newContext = context && context.ownerDocument,
+
+ // nodeType defaults to 9, since context defaults to document
+ nodeType = context ? context.nodeType : 9;
+
+ results = results || [];
+
+ // Return early from calls with invalid selector or context
+ if ( typeof selector !== "string" || !selector ||
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
+
+ return results;
+ }
+
+ // Try to shortcut find operations (as opposed to filters) in HTML documents
+ if ( !seed ) {
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+ context = context || document;
+
+ if ( documentIsHTML ) {
+
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method
+ // (excepting DocumentFragment context, where the methods don't exist)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+
+ // ID selector
+ if ( (m = match[1]) ) {
+
+ // Document context
+ if ( nodeType === 9 ) {
+ if ( (elem = context.getElementById( m )) ) {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+
+ // Element context
+ } else {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( newContext && (elem = newContext.getElementById( m )) &&
+ contains( context, elem ) &&
+ elem.id === m ) {
+
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Type selector
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Class selector
+ } else if ( (m = match[3]) && support.getElementsByClassName &&
+ context.getElementsByClassName ) {
+
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // Take advantage of querySelectorAll
+ if ( support.qsa &&
+ !compilerCache[ selector + " " ] &&
+ (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+
+ if ( nodeType !== 1 ) {
+ newContext = context;
+ newSelector = selector;
+
+ // qSA looks outside Element context, which is not what we want
+ // Thanks to Andrew Dupont for this workaround technique
+ // Support: IE <=8
+ // Exclude object elements
+ } else if ( context.nodeName.toLowerCase() !== "object" ) {
+
+ // Capture the context ID, setting it first if necessary
+ if ( (nid = context.getAttribute( "id" )) ) {
+ nid = nid.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", (nid = expando) );
+ }
+
+ // Prefix every selector in the list
+ groups = tokenize( selector );
+ i = groups.length;
+ nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
+ while ( i-- ) {
+ groups[i] = nidselect + " " + toSelector( groups[i] );
+ }
+ newSelector = groups.join( "," );
+
+ // Expand context for sibling selectors
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
+ context;
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch ( qsaError ) {
+ } finally {
+ if ( nid === expando ) {
+ context.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = arr.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare, parent,
+ doc = node ? node.ownerDocument || node : preferredDoc;
+
+ // Return early if doc is invalid or already selected
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Update global variables
+ document = doc;
+ docElem = document.documentElement;
+ documentIsHTML = !isXML( document );
+
+ // Support: IE 9-11, Edge
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
+ if ( (parent = document.defaultView) && parent.top !== parent ) {
+ // Support: IE 11
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", unloadHandler, false );
+
+ // Support: IE 9 - 10 only
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", unloadHandler );
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties
+ // (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( document.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Support: IE<9
+ support.getElementsByClassName = rnative.test( document.getElementsByClassName );
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !document.getElementsByName || !document.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var m = context.getElementById( id );
+ return m ? [ m ] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== "undefined" &&
+ elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( tag );
+
+ // DocumentFragment nodes don't have gEBTN
+ } else if ( support.qsa ) {
+ return context.querySelectorAll( tag );
+ }
+ } :
+
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ docElem.appendChild( div ).innerHTML = "" +
+ "";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( div.querySelectorAll("[msallowcapture^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push("~=");
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+
+ // Support: Safari 8+, iOS 8+
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibing-combinator selector` fails
+ if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push(".#.+[+~]");
+ }
+ });
+
+ assert(function( div ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = document.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully self-exclusive
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === document ? -1 :
+ b === document ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return document;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ !compilerCache[ expr + " " ] &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch (e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, uniqueCache, outerCache, node, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType,
+ diff = false;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) {
+
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+
+ // Seek `elem` from a previously-cached index
+
+ // ...in a gzip-friendly way
+ node = parent;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex && cache[ 2 ];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ } else {
+ // Use previously-cached element index if available
+ if ( useCache ) {
+ // ...in a gzip-friendly way
+ node = elem;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex;
+ }
+
+ // xml :nth-child(...)
+ // or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ if ( diff === false ) {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) &&
+ ++diff ) {
+
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ uniqueCache[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ // Don't keep the element (issue #299)
+ input[0] = null;
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ text = text.replace( runescape, funescape );
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, uniqueCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
+
+ if ( (oldCache = uniqueCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ uniqueCache[ dir ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ // Avoid hanging onto element (issue #299)
+ checkContext = null;
+ return ret;
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context === document || context || outermost;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ if ( !context && elem.ownerDocument !== document ) {
+ setDocument( elem );
+ xml = !documentIsHTML;
+ }
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context || document, xml) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // `i` is now the count of elements visited above, and adding it to `matchedCount`
+ // makes the latter nonnegative.
+ matchedCount += i;
+
+ // Apply set filters to unmatched elements
+ // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
+ // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
+ // no element matchers and no seed.
+ // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
+ // case, which will result in a "00" `matchedCount` that differs from `i` but is also
+ // numerically zero.
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is only one selector in the list and no seed
+ // (the latter of which guarantees us context)
+ if ( match.length === 1 ) {
+
+ // Reduce context if the leading compound selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[ ":" ] = jQuery.expr.pseudos;
+jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+
+var dir = function( elem, dir, until ) {
+ var matched = [],
+ truncate = until !== undefined;
+
+ while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
+ if ( elem.nodeType === 1 ) {
+ if ( truncate && jQuery( elem ).is( until ) ) {
+ break;
+ }
+ matched.push( elem );
+ }
+ }
+ return matched;
+};
+
+
+var siblings = function( n, elem ) {
+ var matched = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ matched.push( n );
+ }
+ }
+
+ return matched;
+};
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ } );
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ } );
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
+ } );
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ } ) );
+};
+
+jQuery.fn.extend( {
+ find: function( selector ) {
+ var i,
+ len = this.length,
+ ret = [],
+ self = this;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter( function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ } ) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], false ) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], true ) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+} );
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ init = jQuery.fn.init = function( selector, context, root ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Method init() accepts an alternate rootjQuery
+ // so migrate can support jQuery.sub (gh-2101)
+ root = root || rootjQuery;
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector[ 0 ] === "<" &&
+ selector[ selector.length - 1 ] === ">" &&
+ selector.length >= 3 ) {
+
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && ( match[ 1 ] || !context ) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[ 1 ] ) {
+ context = context instanceof jQuery ? context[ 0 ] : context;
+
+ // Option to run scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[ 1 ],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[ 2 ] );
+
+ // Support: Blackberry 4.6
+ // gEBID returns nodes no longer in the document (#6963)
+ if ( elem && elem.parentNode ) {
+
+ // Inject the element directly into the jQuery object
+ this.length = 1;
+ this[ 0 ] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || root ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[ 0 ] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return root.ready !== undefined ?
+ root.ready( selector ) :
+
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+
+ // Methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend( {
+ has: function( target ) {
+ var targets = jQuery( target, this ),
+ l = targets.length;
+
+ return this.filter( function() {
+ var i = 0;
+ for ( ; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[ i ] ) ) {
+ return true;
+ }
+ }
+ } );
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
+
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && ( pos ?
+ pos.index( cur ) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector( cur, selectors ) ) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
+ },
+
+ // Determine the position of an element within the set
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // Index in selector
+ if ( typeof elem === "string" ) {
+ return indexOf.call( jQuery( elem ), this[ 0 ] );
+ }
+
+ // Locate the position of the desired element
+ return indexOf.call( this,
+
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[ 0 ] : elem
+ );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.uniqueSort(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ }
+} );
+
+function sibling( cur, dir ) {
+ while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
+ return cur;
+}
+
+jQuery.each( {
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return siblings( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return siblings( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return elem.contentDocument || jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var matched = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ matched = jQuery.filter( selector, matched );
+ }
+
+ if ( this.length > 1 ) {
+
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ jQuery.uniqueSort( matched );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ matched.reverse();
+ }
+ }
+
+ return this.pushStack( matched );
+ };
+} );
+var rnotwhite = ( /\S+/g );
+
+
+
+// Convert String-formatted options into Object-formatted ones
+function createOptions( options ) {
+ var object = {};
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ } );
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ createOptions( options ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+
+ // Last fire value for non-forgettable lists
+ memory,
+
+ // Flag to know if list was already fired
+ fired,
+
+ // Flag to prevent firing
+ locked,
+
+ // Actual callback list
+ list = [],
+
+ // Queue of execution data for repeatable lists
+ queue = [],
+
+ // Index of currently firing callback (modified by add/remove as needed)
+ firingIndex = -1,
+
+ // Fire callbacks
+ fire = function() {
+
+ // Enforce single-firing
+ locked = options.once;
+
+ // Execute callbacks for all pending executions,
+ // respecting firingIndex overrides and runtime changes
+ fired = firing = true;
+ for ( ; queue.length; firingIndex = -1 ) {
+ memory = queue.shift();
+ while ( ++firingIndex < list.length ) {
+
+ // Run callback and check for early termination
+ if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
+ options.stopOnFalse ) {
+
+ // Jump to end and forget the data so .add doesn't re-fire
+ firingIndex = list.length;
+ memory = false;
+ }
+ }
+ }
+
+ // Forget the data if we're done with it
+ if ( !options.memory ) {
+ memory = false;
+ }
+
+ firing = false;
+
+ // Clean up if we're done firing for good
+ if ( locked ) {
+
+ // Keep an empty list if we have data for future add calls
+ if ( memory ) {
+ list = [];
+
+ // Otherwise, this object is spent
+ } else {
+ list = "";
+ }
+ }
+ },
+
+ // Actual Callbacks object
+ self = {
+
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+
+ // If we have memory from a past run, we should fire after adding
+ if ( memory && !firing ) {
+ firingIndex = list.length - 1;
+ queue.push( memory );
+ }
+
+ ( function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ if ( jQuery.isFunction( arg ) ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
+
+ // Inspect recursively
+ add( arg );
+ }
+ } );
+ } )( arguments );
+
+ if ( memory && !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Remove a callback from the list
+ remove: function() {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+
+ // Handle firing indexes
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ } );
+ return this;
+ },
+
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ?
+ jQuery.inArray( fn, list ) > -1 :
+ list.length > 0;
+ },
+
+ // Remove all callbacks from the list
+ empty: function() {
+ if ( list ) {
+ list = [];
+ }
+ return this;
+ },
+
+ // Disable .fire and .add
+ // Abort any current/pending executions
+ // Clear all callbacks and values
+ disable: function() {
+ locked = queue = [];
+ list = memory = "";
+ return this;
+ },
+ disabled: function() {
+ return !list;
+ },
+
+ // Disable .fire
+ // Also disable .add unless we have memory (since it would have no effect)
+ // Abort any pending executions
+ lock: function() {
+ locked = queue = [];
+ if ( !memory ) {
+ list = memory = "";
+ }
+ return this;
+ },
+ locked: function() {
+ return !!locked;
+ },
+
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( !locked ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ queue.push( args );
+ if ( !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+jQuery.extend( {
+
+ Deferred: function( func ) {
+ var tuples = [
+
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred( function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[ 1 ] ]( function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .progress( newDefer.notify )
+ .done( newDefer.resolve )
+ .fail( newDefer.reject );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ](
+ this === promise ? newDefer.promise() : this,
+ fn ? [ returned ] : arguments
+ );
+ }
+ } );
+ } );
+ fns = null;
+ } ).promise();
+ },
+
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[ 1 ] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add( function() {
+
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[ 0 ] ] = function() {
+ deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
+ } );
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 ||
+ ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred.
+ // If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // Add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .progress( updateFunc( i, progressContexts, progressValues ) )
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // If we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+} );
+
+
+// The deferred used on DOM ready
+var readyList;
+
+jQuery.fn.ready = function( fn ) {
+
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+};
+
+jQuery.extend( {
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ jQuery( document ).off( "ready" );
+ }
+ }
+} );
+
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+ document.removeEventListener( "DOMContentLoaded", completed );
+ window.removeEventListener( "load", completed );
+ jQuery.ready();
+}
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called
+ // after the browser event has already occurred.
+ // Support: IE9-10 only
+ // Older IE sometimes signals "interactive" too soon
+ if ( document.readyState === "complete" ||
+ ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
+
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ window.setTimeout( jQuery.ready );
+
+ } else {
+
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed );
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Kick off the DOM ready check even if the user does not
+jQuery.ready.promise();
+
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ len = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ access( elems, fn, i, key[ i ], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < len; i++ ) {
+ fn(
+ elems[ i ], key, raw ?
+ value :
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
+ );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ len ? fn( elems[ 0 ], key ) : emptyGet;
+};
+var acceptData = function( owner ) {
+
+ // Accepts only:
+ // - Node
+ // - Node.ELEMENT_NODE
+ // - Node.DOCUMENT_NODE
+ // - Object
+ // - Any
+ /* jshint -W018 */
+ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
+};
+
+
+
+
+function Data() {
+ this.expando = jQuery.expando + Data.uid++;
+}
+
+Data.uid = 1;
+
+Data.prototype = {
+
+ register: function( owner, initial ) {
+ var value = initial || {};
+
+ // If it is a node unlikely to be stringify-ed or looped over
+ // use plain assignment
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = value;
+
+ // Otherwise secure it in a non-enumerable, non-writable property
+ // configurability must be true to allow the property to be
+ // deleted with the delete operator
+ } else {
+ Object.defineProperty( owner, this.expando, {
+ value: value,
+ writable: true,
+ configurable: true
+ } );
+ }
+ return owner[ this.expando ];
+ },
+ cache: function( owner ) {
+
+ // We can accept data for non-element nodes in modern browsers,
+ // but we should not, see #8335.
+ // Always return an empty object.
+ if ( !acceptData( owner ) ) {
+ return {};
+ }
+
+ // Check if the owner object already has a cache
+ var value = owner[ this.expando ];
+
+ // If not, create one
+ if ( !value ) {
+ value = {};
+
+ // We can accept data for non-element nodes in modern browsers,
+ // but we should not, see #8335.
+ // Always return an empty object.
+ if ( acceptData( owner ) ) {
+
+ // If it is a node unlikely to be stringify-ed or looped over
+ // use plain assignment
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = value;
+
+ // Otherwise secure it in a non-enumerable property
+ // configurable must be true to allow the property to be
+ // deleted when data is removed
+ } else {
+ Object.defineProperty( owner, this.expando, {
+ value: value,
+ configurable: true
+ } );
+ }
+ }
+ }
+
+ return value;
+ },
+ set: function( owner, data, value ) {
+ var prop,
+ cache = this.cache( owner );
+
+ // Handle: [ owner, key, value ] args
+ if ( typeof data === "string" ) {
+ cache[ data ] = value;
+
+ // Handle: [ owner, { properties } ] args
+ } else {
+
+ // Copy the properties one-by-one to the cache object
+ for ( prop in data ) {
+ cache[ prop ] = data[ prop ];
+ }
+ }
+ return cache;
+ },
+ get: function( owner, key ) {
+ return key === undefined ?
+ this.cache( owner ) :
+ owner[ this.expando ] && owner[ this.expando ][ key ];
+ },
+ access: function( owner, key, value ) {
+ var stored;
+
+ // In cases where either:
+ //
+ // 1. No key was specified
+ // 2. A string key was specified, but no value provided
+ //
+ // Take the "read" path and allow the get method to determine
+ // which value to return, respectively either:
+ //
+ // 1. The entire cache object
+ // 2. The data stored at the key
+ //
+ if ( key === undefined ||
+ ( ( key && typeof key === "string" ) && value === undefined ) ) {
+
+ stored = this.get( owner, key );
+
+ return stored !== undefined ?
+ stored : this.get( owner, jQuery.camelCase( key ) );
+ }
+
+ // When the key is not a string, or both a key and value
+ // are specified, set or extend (existing objects) with either:
+ //
+ // 1. An object of properties
+ // 2. A key and value
+ //
+ this.set( owner, key, value );
+
+ // Since the "set" path can have two possible entry points
+ // return the expected data based on which path was taken[*]
+ return value !== undefined ? value : key;
+ },
+ remove: function( owner, key ) {
+ var i, name, camel,
+ cache = owner[ this.expando ];
+
+ if ( cache === undefined ) {
+ return;
+ }
+
+ if ( key === undefined ) {
+ this.register( owner );
+
+ } else {
+
+ // Support array or space separated string of keys
+ if ( jQuery.isArray( key ) ) {
+
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = key.concat( key.map( jQuery.camelCase ) );
+ } else {
+ camel = jQuery.camelCase( key );
+
+ // Try the string as a key before any manipulation
+ if ( key in cache ) {
+ name = [ key, camel ];
+ } else {
+
+ // If a key with the spaces exists, use it.
+ // Otherwise, create an array by matching non-whitespace
+ name = camel;
+ name = name in cache ?
+ [ name ] : ( name.match( rnotwhite ) || [] );
+ }
+ }
+
+ i = name.length;
+
+ while ( i-- ) {
+ delete cache[ name[ i ] ];
+ }
+ }
+
+ // Remove the expando if there's no more data
+ if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
+
+ // Support: Chrome <= 35-45+
+ // Webkit & Blink performance suffers when deleting properties
+ // from DOM nodes, so set to undefined instead
+ // https://code.google.com/p/chromium/issues/detail?id=378607
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = undefined;
+ } else {
+ delete owner[ this.expando ];
+ }
+ }
+ },
+ hasData: function( owner ) {
+ var cache = owner[ this.expando ];
+ return cache !== undefined && !jQuery.isEmptyObject( cache );
+ }
+};
+var dataPriv = new Data();
+
+var dataUser = new Data();
+
+
+
+// Implementation Summary
+//
+// 1. Enforce API surface and semantic compatibility with 1.9.x branch
+// 2. Improve the module's maintainability by reducing the storage
+// paths to a single mechanism.
+// 3. Use the same single mechanism to support "private" and "user" data.
+// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
+// 5. Avoid exposing implementation details on user objects (eg. expando properties)
+// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /[A-Z]/g;
+
+function dataAttr( elem, key, data ) {
+ var name;
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch ( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ dataUser.set( elem, key, data );
+ } else {
+ data = undefined;
+ }
+ }
+ return data;
+}
+
+jQuery.extend( {
+ hasData: function( elem ) {
+ return dataUser.hasData( elem ) || dataPriv.hasData( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return dataUser.access( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ dataUser.remove( elem, name );
+ },
+
+ // TODO: Now that all calls to _data and _removeData have been replaced
+ // with direct calls to dataPriv methods, these can be deprecated.
+ _data: function( elem, name, data ) {
+ return dataPriv.access( elem, name, data );
+ },
+
+ _removeData: function( elem, name ) {
+ dataPriv.remove( elem, name );
+ }
+} );
+
+jQuery.fn.extend( {
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[ 0 ],
+ attrs = elem && elem.attributes;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = dataUser.get( elem );
+
+ if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE11+
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice( 5 ) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ dataPriv.set( elem, "hasDataAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each( function() {
+ dataUser.set( this, key );
+ } );
+ }
+
+ return access( this, function( value ) {
+ var data, camelKey;
+
+ // The calling jQuery object (element matches) is not empty
+ // (and therefore has an element appears at this[ 0 ]) and the
+ // `value` parameter was not undefined. An empty jQuery object
+ // will result in `undefined` for elem = this[ 0 ] which will
+ // throw an exception if an attempt to read a data cache is made.
+ if ( elem && value === undefined ) {
+
+ // Attempt to get data from the cache
+ // with the key as-is
+ data = dataUser.get( elem, key ) ||
+
+ // Try to find dashed key if it exists (gh-2779)
+ // This is for 2.2.x only
+ dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
+
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ camelKey = jQuery.camelCase( key );
+
+ // Attempt to get data from the cache
+ // with the key camelized
+ data = dataUser.get( elem, camelKey );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to "discover" the data in
+ // HTML5 custom data-* attrs
+ data = dataAttr( elem, camelKey, undefined );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // We tried really hard, but the data doesn't exist.
+ return;
+ }
+
+ // Set the data...
+ camelKey = jQuery.camelCase( key );
+ this.each( function() {
+
+ // First, attempt to store a copy or reference of any
+ // data that might've been store with a camelCased key.
+ var data = dataUser.get( this, camelKey );
+
+ // For HTML5 data-* attribute interop, we have to
+ // store property names with dashes in a camelCase form.
+ // This might not apply to all properties...*
+ dataUser.set( this, camelKey, value );
+
+ // *... In the case of properties that might _actually_
+ // have dashes, we need to also store a copy of that
+ // unchanged property.
+ if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
+ dataUser.set( this, key, value );
+ }
+ } );
+ }, null, value, arguments.length > 1, null, true );
+ },
+
+ removeData: function( key ) {
+ return this.each( function() {
+ dataUser.remove( this, key );
+ } );
+ }
+} );
+
+
+jQuery.extend( {
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = dataPriv.get( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray( data ) ) {
+ queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // Clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // Not public - generate a queueHooks object, or return the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
+ empty: jQuery.Callbacks( "once memory" ).add( function() {
+ dataPriv.remove( elem, [ type + "queue", key ] );
+ } )
+ } );
+ }
+} );
+
+jQuery.fn.extend( {
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[ 0 ], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each( function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // Ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ } );
+ },
+ dequeue: function( type ) {
+ return this.each( function() {
+ jQuery.dequeue( this, type );
+ } );
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+} );
+var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
+
+var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
+
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" ||
+ !jQuery.contains( elem.ownerDocument, elem );
+ };
+
+
+
+function adjustCSS( elem, prop, valueParts, tween ) {
+ var adjusted,
+ scale = 1,
+ maxIterations = 20,
+ currentValue = tween ?
+ function() { return tween.cur(); } :
+ function() { return jQuery.css( elem, prop, "" ); },
+ initial = currentValue(),
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
+ rcssNum.exec( jQuery.css( elem, prop ) );
+
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
+
+ // Trust units reported by jQuery.css
+ unit = unit || initialInUnit[ 3 ];
+
+ // Make sure we update the tween properties later on
+ valueParts = valueParts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ initialInUnit = +initial || 1;
+
+ do {
+
+ // If previous iteration zeroed out, double until we get *something*.
+ // Use string for doubling so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ initialInUnit = initialInUnit / scale;
+ jQuery.style( elem, prop, initialInUnit + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // Break the loop if scale is unchanged or perfect, or if we've just had enough.
+ } while (
+ scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
+ );
+ }
+
+ if ( valueParts ) {
+ initialInUnit = +initialInUnit || +initial || 0;
+
+ // Apply relative offset (+=/-=) if specified
+ adjusted = valueParts[ 1 ] ?
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
+ +valueParts[ 2 ];
+ if ( tween ) {
+ tween.unit = unit;
+ tween.start = initialInUnit;
+ tween.end = adjusted;
+ }
+ }
+ return adjusted;
+}
+var rcheckableType = ( /^(?:checkbox|radio)$/i );
+
+var rtagName = ( /<([\w:-]+)/ );
+
+var rscriptType = ( /^$|\/(?:java|ecma)script/i );
+
+
+
+// We have to close these tags to support XHTML (#13200)
+var wrapMap = {
+
+ // Support: IE9
+ option: [ 1, "" ],
+
+ // XHTML parsers do not magically insert elements in the
+ // same way that tag soup parsers do. So we cannot shorten
+ // this by omitting or other required elements.
+ thead: [ 1, "" ],
+ col: [ 2, "" ],
+ tr: [ 2, "" ],
+ td: [ 3, "" ],
+
+ _default: [ 0, "", "" ]
+};
+
+// Support: IE9
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+
+function getAll( context, tag ) {
+
+ // Support: IE9-11+
+ // Use typeof to avoid zero-argument method invocation on host objects (#15151)
+ var ret = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( tag || "*" ) :
+ typeof context.querySelectorAll !== "undefined" ?
+ context.querySelectorAll( tag || "*" ) :
+ [];
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], ret ) :
+ ret;
+}
+
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ dataPriv.set(
+ elems[ i ],
+ "globalEval",
+ !refElements || dataPriv.get( refElements[ i ], "globalEval" )
+ );
+ }
+}
+
+
+var rhtml = /<|?\w+;/;
+
+function buildFragment( elems, context, scripts, selection, ignored ) {
+ var elem, tmp, tag, wrap, contains, j,
+ fragment = context.createDocumentFragment(),
+ nodes = [],
+ i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+
+ // Support: Android<4.1, PhantomJS<2
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Support: Android<4.1, PhantomJS<2
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Remember the top-level container
+ tmp = fragment.firstChild;
+
+ // Ensure the created nodes are orphaned (#12392)
+ tmp.textContent = "";
+ }
+ }
+ }
+
+ // Remove wrapper from fragment
+ fragment.textContent = "";
+
+ i = 0;
+ while ( ( elem = nodes[ i++ ] ) ) {
+
+ // Skip elements already in the context collection (trac-4087)
+ if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
+ if ( ignored ) {
+ ignored.push( elem );
+ }
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( fragment.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( ( elem = tmp[ j++ ] ) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ return fragment;
+}
+
+
+( function() {
+ var fragment = document.createDocumentFragment(),
+ div = fragment.appendChild( document.createElement( "div" ) ),
+ input = document.createElement( "input" );
+
+ // Support: Android 4.0-4.3, Safari<=5.1
+ // Check state lost if the name is set (#11217)
+ // Support: Windows Web Apps (WWA)
+ // `name` and `type` must use .setAttribute for WWA (#14901)
+ input.setAttribute( "type", "radio" );
+ input.setAttribute( "checked", "checked" );
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+
+ // Support: Safari<=5.1, Android<4.2
+ // Older WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<=11+
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ div.innerHTML = "";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+} )();
+
+
+var
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+// Support: IE9
+// See #13393 for more info
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+function on( elem, types, selector, data, fn, one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ on( elem, type, selector, data, types[ type ], one );
+ }
+ return elem;
+ }
+
+ if ( data == null && fn == null ) {
+
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return elem;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return elem.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ } );
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var handleObjIn, eventHandle, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = dataPriv.get( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !( events = elemData.events ) ) {
+ events = elemData.events = {};
+ }
+ if ( !( eventHandle = elemData.handle ) ) {
+ eventHandle = elemData.handle = function( e ) {
+
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
+ jQuery.event.dispatch.apply( elem, arguments ) : undefined;
+ };
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend( {
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join( "." )
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !( handlers = events[ type ] ) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener if the special events handler returns false
+ if ( !special.setup ||
+ special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var j, origCount, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
+
+ if ( !elemData || !( events = elemData.events ) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[ 2 ] &&
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector ||
+ selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown ||
+ special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove data and the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ dataPriv.remove( elem, "handle events" );
+ }
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, j, ret, matched, handleObj,
+ handlerQueue = [],
+ args = slice.call( arguments ),
+ handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[ 0 ] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( ( handleObj = matched.handlers[ j++ ] ) &&
+ !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or 2) have namespace(s)
+ // a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
+ handleObj.handler ).apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( ( event.result = ret ) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var i, matches, sel, handleObj,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Support (at least): Chrome, IE9
+ // Find delegate handlers
+ // Black-hole SVG