/*
 RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/domReady for details

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made
 available under the terms of the Eclipse Public License v1.0
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
     IBM Corporation - initial API and implementation
*/
define("domReady",[],function(){function g(){if(!h){h=!0;b&&clearInterval(b);var d=a;if(h&&d.length){a=[];var c;for(c=0;c<d.length;c+=1)d[c](l)}}}function e(c){h?c(l):a.push(c);return e}var q,f,b,d="undefined"!==typeof window&&window.document,h=!d,l=d?document:null,a=[];if(d){if(document.addEventListener)document.addEventListener("DOMContentLoaded",g,!1),window.addEventListener("load",g,!1);else if(window.attachEvent){window.attachEvent("onload",g);f=document.createElement("div");try{q=null===window.frameElement}catch(c){}f.doScroll&&
(q&&window.external)&&(b=setInterval(function(){try{f.doScroll(),g()}catch(a){}},30))}"complete"===document.readyState&&g()}e.version="2.0.1";e.load=function(a,c,d,f){f.isBuild?d(null):e(d)};return e});
(function(g,e){"function"===typeof define&&define.amd?define("orion/Deferred",e):"object"===typeof exports?module.exports=e():(g.orion=g.orion||{},g.orion.Deferred=e())})(this,function(){function g(){for(var f;f=b.shift();)f();d=!1}function e(f){b.push(f);d||(d=!0,h())}function q(d){return function(a){d(a)}}function f(){function d(){for(var a;a=g.shift();){var c=a.deferred,m="fulfilled"===p?"resolve":"reject";a=a[m];if("function"===typeof a)try{var f=a(h),b=f&&("object"===typeof f||"function"===typeof f)&&
f.then;if("function"===typeof b)if(f===c.promise)c.reject(new TypeError);else{var n=f.cancel;"function"===typeof n?c._parentCancel=n.bind(f):delete c._parentCancel;b.call(f,q(c.resolve),q(c.reject),q(c.progress))}else c.resolve(f)}catch(e){c.reject(e)}else c[m](h)}}function a(a){delete n._parentCancel;p="rejected";h=a;g.length&&e(d)}function c(b){function t(a){return function(m){(!p||"assumed"===p)&&a(m)}}delete n._parentCancel;try{var m=b&&("object"===typeof b||"function"===typeof b)&&b.then;if("function"===
typeof m)if(b===n)a(new TypeError);else{p="assumed";var w=b&&b.cancel;if("function"!==typeof w){var x=new f;b=x.promise;try{m(x.resolve,x.reject,x.progress)}catch(s){x.reject(s)}w=b.cancel;m=b.then}h=b;m.call(b,t(c),t(a));n._parentCancel=w.bind(b)}else p="fulfilled",h=b,g.length&&e(d)}catch(q){t(a)(q)}}function b(){var c=n._parentCancel;c?(delete n._parentCancel,c()):p||(c=Error("Cancel"),c.name="Cancel",a(c))}var h,p,g=[],n=this;this.resolve=function(a){p||c(a);return n};this.reject=function(c){p||
a(c);return n};this.progress=function(a){p||g.forEach(function(c){if(c.progress)try{c.progress(a)}catch(m){}});return n.promise};this.cancel=function(){n._parentCancel?setTimeout(b,0):b();return n};this.then=function(a,c,m){var b=new f;b._parentCancel=n.promise.cancel;g.push({resolve:a,reject:c,progress:m,deferred:b});("fulfilled"===p||"rejected"===p)&&e(d);return b.promise};this.promise={then:n.then,cancel:n.cancel}}var b=[],d=!1,h=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var b=
process.nextTick;return function(){b(g)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(g)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(g,0)}}();f.all=function(b,a){function c(a,c){g||(h[a]=c,0===--e&&n.resolve(h))}function d(b,f){if(!g){if(a)try{c(b,a(f));return}catch(m){f=m}n.reject(f)}}var e=b.length,h=[],g=!1,n=new f;n.then(void 0,function(){g=!0;b.forEach(function(a){a.cancel&&a.cancel()})});
0===e?n.resolve(h):b.forEach(function(a,b){a.then(c.bind(void 0,b),d.bind(void 0,b))});return n.promise};f.when=function(b,a,c,d){var e;b&&"function"===typeof b.then||(e=new f,e.resolve(b),b=e.promise);return b.then(a,c,d)};return f});
define("orion/xhr",["orion/Deferred"],function(g){function e(e,f,b,d){var h="undefined"!==typeof b.response?b.response:b.responseText,g;try{g=b.status}catch(a){g=0}e={args:f,response:h,responseText:"string"===typeof h?h:null,status:g,url:e,xhr:b};"undefined"!==typeof d&&(e.error=d);return e}return function(q,f,b){b=b||{};var d=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,h=new g,l=b.headers||{},a=b.log||!1,c;"undefined"===typeof l["X-Requested-With"]&&(l["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof b.data&&("POST"===q||"PUT"===q))c=b.data;var t=!1,u=!1;h.promise.then(void 0,function(a){t=!0;!u&&(a instanceof Error&&"Cancel"===a.name)&&d.abort()});d.onabort=function(){u=!0;if(!t){var a=Error("Cancel");a.name="Cancel";h.reject(a)}};d.onload=function(){var c=e(f,b,d);200<=d.status&&400>d.status?h.resolve(c):(h.reject(c),a&&"undefined"!==typeof console&&console.log(Error(d.statusText)))};d.onerror=function(){var c=e(f,b,d);h.reject(c);a&&"undefined"!==typeof console&&console.log(Error(d.statusText))};
d.onprogress=function(a){a.xhr=d;h.progress(a)};try{d.open(q,f,!0);"string"===typeof b.responseType&&(d.responseType=b.responseType);if("number"===typeof b.timeout)if("number"===typeof d.timeout)d.timeout=b.timeout,d.addEventListener("timeout",function(a){h.reject(e(f,b,d,"Timeout exceeded"))});else{var p=setTimeout(function(){h.reject(e(f,b,d,"Timeout exceeded"))},b.timeout);h.promise.then(clearTimeout.bind(null,p),clearTimeout.bind(null,p))}Object.keys(l).forEach(function(a){d.setRequestHeader(a,
l[a])});d.send(c||null)}catch(v){h.reject(e(f,b,d,v))}return h.promise}});
define("orion/PageUtil",[],function(){var g=/^http[s]?/i;return{hash:function(){var e=window.location.href.split("#")[1];return e?"#"+e:""},matchResourceParameters:function(e){e=e||window.location.toString();var g={resource:""},f=e.indexOf("#");if(-1!==f&&(e=e.substring(f+1),0!==e.length)){e=e.split(",");g.resource=decodeURIComponent(e[0]);for(f=1;f<e.length;f++){var b=/([^=]*)(=?)(.*)/.exec(e[f]),d=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");""!==d&&"resource"!==d&&(g[d]=b)}}return g},
validateURLScheme:function(e,q){var f=e;if(-1===e.indexOf("://")){var b=document.createElement("a");b.href=e;f=b.href}b=!1;if(b=q?q.some(function(b){return RegExp("^"+b+":","i").test(f)}):g.test(f))return e;console.log("Illegal URL Scheme: '"+e+"'");return""}}});
define("orion/util",[],function(){var g=navigator.userAgent,e=-1!==g.indexOf("MSIE")||-1!==g.indexOf("Trident")?document.documentMode:void 0,q=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,f=-1!==g.indexOf("Opera")?parseFloat(g.split("Version/")[1]):void 0,b=parseFloat(g.split("Chrome/")[1])||void 0,d=-1!==g.indexOf("Safari")&&!b,h=parseFloat(g.split("WebKit/")[1])||void 0,l=-1!==g.indexOf("Android"),a=-1!==g.indexOf("iPad"),g=-1!==g.indexOf("iPhone"),c=a||g,t=-1!==navigator.platform.indexOf("Mac"),
u=-1!==navigator.platform.indexOf("Win"),p=-1!==navigator.platform.indexOf("Linux"),v="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,m){return c[(m<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:e,isFirefox:q,isOpera:f,isChrome:b,isSafari:d,isWebkit:h,isAndroid:l,isIPad:a,isIPhone:g,
isIOS:c,isMac:t,isWindows:u,isLinux:p,isTouch:v,platformDelimiter:u?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(g){function e(a,c){c||(c=document);return c.querySelectorAll(a)}function q(a){var c=a.tabIndex;0===c&&g.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(c=-1);return c}function f(a){if(0<=q(a))return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var b=f(a.childNodes[c]);if(b)return b}return null}function b(a){if(0<=
q(a))return a;if(a.hasChildNodes())for(var c=a.childNodes.length-1;0<=c;c--){var d=b(a.childNodes[c]);if(d)return d}return null}function d(a,c){if(3===a.nodeType){var b=h.exec(a.nodeValue);b&&1<b.length&&c(a,b)}if(a.hasChildNodes())for(b=0;b<a.childNodes.length;b++)d(a.childNodes[b],c)}var h=/\$\{([^\}]+)\}/,l=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:e,$$array:function(a,b){return Array.prototype.slice.call(e(a,b))},node:function(a){var b=a;"string"===typeof a&&(b=
document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var d=a.compareDocumentPosition(b);return Boolean(d&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:f,lastTabbable:b,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){d(a,function(a,d){a.parentNode.replaceChild(document.createTextNode(b[d[1]]||d[1]),a)})},processDOMNodes:function(a,b){d(a,function(a,d){var f=b[d[1]];if(f){var e=document.createRange(),g=d.index;e.setStart(a,g);e.setEnd(a,g+d[0].length);e.deleteContents();e.insertNode(f)}})},addAutoDismiss:function(a,b){function d(a){l.forEach(function(b){var d=!1,c=b.excludeNodes.some(function(b){return document.body.contains(b)?(d=!0,b.contains(a.target)):
!1});if(d&&!c)try{b.dismiss(a)}catch(f){"undefined"!==typeof console&&console&&console.error(f&&f.message)}});l=l.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===l&&(l=[],document.addEventListener("click",d,!0),g.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));l.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var b=
document.getElementsByTagName("iframe"),d=0;d<b.length;d++)b[d].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){l=l.filter(function(b){return a!==b.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
(function(){var g=function(){function a(b){return Array.isArray?Array.isArray(b):-1!=b.constructor.toString().indexOf("Array")}function b(a,d,m,f){function e(b){for(var k=0;k<b.length;k++)if(b[k].win===a)return!0;return!1}var g=!1;if("*"===d)for(var k in c){if(c.hasOwnProperty(k)&&("*"!==k&&"object"==typeof c[k][m])&&(g=e(c[k][m])))break}else c["*"]&&c["*"][m]&&(g=e(c["*"][m])),!g&&c[d]&&c[d][m]&&(g=e(c[d][m]));if(g)throw"A channel is already bound to the same window which overlaps with origin '"+
d+"' and has scope '"+m+"'";"object"!=typeof c[d]&&(c[d]={});"object"!=typeof c[d][m]&&(c[d][m]=[]);c[d][m].push({win:a,handler:f})}var d=Math.floor(1000001*Math.random()),c={},f={},e=function(a){try{var b=JSON.parse(a.data);if("object"!=typeof b||null===b)throw"malformed";}catch(d){return}var m=a.source;a=a.origin;var e,g,k;if("string"==typeof b.method){var r=b.method.split("::");2==r.length?(e=r[0],k=r[1]):k=b.method}"undefined"!=typeof b.id&&(g=b.id);if("string"==typeof k){g=!1;if(c[a]&&c[a][e])for(r=
0;r<c[a][e].length;r++)if(c[a][e][r].win===m){c[a][e][r].handler(a,k,b);g=!0;break}if(!g&&c["*"]&&c["*"][e])for(r=0;r<c["*"][e].length;r++)if(c["*"][e][r].win===m){c["*"][e][r].handler(a,k,b);break}}else"undefined"!=typeof g&&f[g]&&f[g](a,k,b)};window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e);return{build:function(e){var g=function(a){if(e.debugOutput&&window.console&&window.console.log){try{"string"!=typeof a&&(a=JSON.stringify(a))}catch(b){}console.log("["+
n+"] "+a)}};if(!window.postMessage)throw"jschannel cannot run this browser, no postMessage";if(!window.JSON||!window.JSON.stringify||!window.JSON.parse)throw"jschannel cannot run this browser, no JSON parsing/serialization";if("object"!=typeof e)throw"Channel build invoked without a proper object argument";if(!e.window||!e.window.postMessage)throw"Channel.build() called without a valid window argument";if(window===e.window)throw"target window is same as present window -- not allowed";var h=!1;if("string"==
typeof e.origin){var z;"*"===e.origin?h=!0:null!==(z=e.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))&&(e.origin=z[0].toLowerCase(),h=!0)}if(!h)throw"Channel.build() called with an invalid origin";if("undefined"!=typeof e.scope){if("string"!=typeof e.scope)throw"scope, when specified, must be a string";if(1<e.scope.split("::").length)throw"scope may not contain double colons: '::'";}var n=function(){for(var a="",b=0;5>b;b++)a+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(62*
Math.random()));return a}(),l={},k={},r={},y=!1,E=[],q=function(a,b,e){var k=!1,d=!1;return{origin:b,invoke:function(b,k){if(!r[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;for(var d=!1,m=0;m<e.length;m++)if(b===e[m]){d=!0;break}if(!d)throw"request supports no such callback '"+b+"'";u({id:a,callback:b,params:k})},error:function(b,k){d=!0;if(!r[a])throw"error called for nonexistent message: "+a;delete r[a];u({id:a,error:b,message:k})},complete:function(b){d=!0;if(!r[a])throw"complete called for nonexistent message: "+
a;delete r[a];u({id:a,result:b})},delayReturn:function(a){"boolean"==typeof a&&(k=!0===a);return k},completed:function(){return d}}},p=function(a,b,e){return window.setTimeout(function(){if(k[a]){var d="timeout ("+b+"ms) exceeded on method '"+e+"'";(1,k[a].error)("timeout_error",d);delete k[a];delete f[a]}},b)},F=function(b,d,c){if("function"==typeof e.gotMessageObserver)try{e.gotMessageObserver(b,c)}catch(E){g("gotMessageObserver() raised an exception: "+E.toString())}if(c.id&&d){if(l[d]){var h=
q(c.id,b,c.callbacks?c.callbacks:[]);r[c.id]={};try{if(c.callbacks&&a(c.callbacks)&&0<c.callbacks.length)for(b=0;b<c.callbacks.length;b++){for(var z=c.callbacks[b],w=c.params,n=z.split("/"),y=0;y<n.length-1;y++){var x=n[y];"object"!=typeof w[x]&&(w[x]={});w=w[x]}w[n[n.length-1]]=function(){var a=z;return function(b){return h.invoke(a,b)}}()}var p=l[d](h,c.params);!h.delayReturn()&&!h.completed()&&h.complete(p)}catch(s){d="runtime_error";c=null;"string"==typeof s?c=s:"object"==typeof s&&(s&&a(s)&&
2==s.length?(d=s[0],c=s[1]):"string"==typeof s.error&&(d=s.error,s.message?"string"==typeof s.message?c=s.message:s=s.message:c=""));if(null===c)try{c=JSON.stringify(s),"undefined"==typeof c&&(c=s.toString())}catch(L){c=s.toString()}h.error(d,c)}}}else c.id&&c.callback?!k[c.id]||!k[c.id].callbacks||!k[c.id].callbacks[c.callback]?g("ignoring invalid callback, id:"+c.id+" ("+c.callback+")"):k[c.id].callbacks[c.callback](c.params):c.id?k[c.id]?(c.error?(1,k[c.id].error)(c.error,c.message):void 0!==c.result?
(1,k[c.id].success)(c.result):(1,k[c.id].success)(),delete k[c.id],delete f[c.id]):g("ignoring invalid response: "+c.id):d&&l[d]&&l[d](null,c.params)};b(e.window,e.origin,"string"==typeof e.scope?e.scope:"",F);var t=function(a){"string"==typeof e.scope&&e.scope.length&&(a=[e.scope,a].join("::"));return a},u=function(a,b){if(!a)throw"postMessage called with null message";g((y?"post  ":"queue ")+" message: "+JSON.stringify(a));if(!b&&!y)E.push(a);else{if("function"==typeof e.postMessageObserver)try{e.postMessageObserver(e.origin,
a)}catch(c){g("postMessageObserver() raised an exception: "+c.toString())}e.window.postMessage(JSON.stringify(a),e.origin)}},v={unbind:function(a){if(l[a]){if(delete l[a])return!0;throw"can't delete method: "+a;}return!1},bind:function(a,b){if(!a||"string"!=typeof a)throw"'method' argument to bind must be string";if(!b||"function"!=typeof b)throw"callback missing from bind params";if(l[a])throw"method '"+a+"' is already bound!";l[a]=b;return this},call:function(a){if(!a)throw"missing arguments to call function";
if(!a.method||"string"!=typeof a.method)throw"'method' argument to call must be string";if(!a.success||"function"!=typeof a.success)throw"'success' callback missing from call";var b={},c=[],e=function(a,d){if("object"==typeof d)for(var k in d)if(d.hasOwnProperty(k)){var m=a+(a.length?"/":"")+k;"function"==typeof d[k]?(b[m]=d[k],c.push(m),delete d[k]):"object"==typeof d[k]&&e(m,d[k])}};e("",a.params);var m={id:d,method:t(a.method),params:a.params};c.length&&(m.callbacks=c);a.timeout&&p(d,a.timeout,
t(a.method));k[d]={callbacks:b,error:a.error,success:a.success};f[d]=F;d++;u(m)},notify:function(a){if(!a)throw"missing arguments to notify function";if(!a.method||"string"!=typeof a.method)throw"'method' argument to notify must be string";u({method:t(a.method),params:a.params})},destroy:function(){for(var a=e.window,b=e.origin,d="string"==typeof e.scope?e.scope:"",m=c[b][d],f=0;f<m.length;f++)m[f].win===a&&m.splice(f,1);0===c[b][d].length&&delete c[b][d];window.removeEventListener?window.removeEventListener("message",
F,!1):window.detachEvent&&window.detachEvent("onmessage",F);y=!1;l={};r={};k={};e.origin=null;E=[];g("channel destroyed");n=""}};v.bind("__ready",function(a,b){g("ready msg received");if(y)throw"received ready message while in ready state.  help!";"ping"===b?n+="-R":n+="-L";v.unbind("__ready");y=!0;g("ready msg accepted.");for("ping"===b&&v.notify({method:"__ready",params:"pong"});E.length;)u(E.pop());"function"==typeof e.onReady&&e.onReady(v)});setTimeout(function(){},0);return v}}}();WinChan=function(){function a(b){/^https?:\/\//.test(b)||
(b=window.location.href);var c=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(b);return c?c[1]:b}function b(){try{var a=navigator.userAgent;return-1!=a.indexOf("Fennec/")||-1!=a.indexOf("Firefox/")&&-1!=a.indexOf("Android")}catch(c){}return!1}function c(a,b,d){a.attachEvent?a.attachEvent("on"+b,d):a.addEventListener&&a.addEventListener(b,d,!1)}var d="die",e=function(){var a=-1;"Microsoft Internet Explorer"===navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));
return 8<=a}();return window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(f,g){function h(a){try{var b=JSON.parse(a.data);if("ready"===b.a)k.postMessage(y,q);else if("error"===b.a)g&&(g(b.d),g=null);else if("response"===b.a){a=window;var c=h;a.detachEvent?a.detachEvent("onmessage",c):a.removeEventListener&&a.removeEventListener("message",c,!1);a=window;c=n;a.detachEvent?a.detachEvent("onunload",c):a.removeEventListener&&a.removeEventListener("unload",c,!1);n();
g&&(g(null,b.d),g=null)}}catch(d){}}function n(){p&&document.body.removeChild(p);p=void 0;if(r)try{r.close()}catch(a){k.postMessage(d,q)}r=k=void 0}if(!g)throw"missing required callback argument";var l;f.url||(l="missing required 'url' parameter");f.relay_url||(l="missing required 'relay_url' parameter");l&&setTimeout(function(){g(l)},0);f.window_name||(f.window_name=null);if(!f.window_features||b())f.window_features=void 0;var p,q=a(f.url);if(q!==a(f.relay_url))return setTimeout(function(){g("invalid arguments: origin of url and relay_url must match")},
0);var k;e&&(p=document.createElement("iframe"),p.setAttribute("src",f.relay_url),p.style.display="none",p.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(p),k=p.contentWindow);var r=window.open(f.url,f.window_name,f.window_features);k||(k=r);var y=JSON.stringify({a:"request",d:f.params});c(window,"unload",n);c(window,"message",h);return{close:n,focus:function(){if(r)try{r.focus()}catch(a){}}}}}:{open:function(a,b,c,d){setTimeout(function(){d("unsupported browser")},0)}}}();
var e=function(){var a=window,b=navigator,c;return{setTestEnv:function(c,d){b=c;a=d},isSupported:function(){var d;d=-1;"Microsoft Internet Explorer"==b.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(b.userAgent)&&(d=parseFloat(RegExp.$1));if(!(d=-1<d&&8>d?"BAD_IE_VERSION":void 0)){var e;a:{try{if("localStorage"in a&&null!==a.localStorage)a.localStorage.setItem("test","true"),a.localStorage.removeItem("test");else{e="LOCALSTORAGE_NOT_SUPPORTED";break a}}catch(f){e="LOCALSTORAGE_DISABLED";break a}e=
void 0}e||(e=a.postMessage?void 0:"POSTMESSAGE_NOT_SUPPORTED",e||(e=!window.JSON||!window.JSON.stringify||!window.JSON.parse?"JSON_NOT_SUPPORTED":void 0));d=e}c=d;return!c},getNoSupportReason:function(){return c}}}();navigator.id||(navigator.id={});if(!navigator.id.request||navigator.id._shimmed){var q=navigator.userAgent,f=-1!=q.indexOf("Fennec/")||-1!=q.indexOf("Firefox/")&&-1!=q.indexOf("Android")?void 0:"menubar\x3d0,location\x3d1,resizable\x3d1,scrollbars\x3d1,status\x3d0,dialog\x3d1,minimizable\x3d1,width\x3d700,height\x3d375",
b,d={login:null,logout:null,ready:null},h=void 0,l=function(a){!0!==a;if(void 0===h)h=a;else if(h!=a)throw"you cannot combine the navigator.id.watch() API with navigator.id.getVerifiedEmail() or navigator.id.get()this site should instead use navigator.id.request() and navigator.id.watch()";},a,c=e.isSupported(),t=function(){if(c)try{if(!a){var b=window.document,e=b.createElement("iframe");e.style.display="none";b.body.appendChild(e);e.src="https://login.persona.org/communication_iframe";a=g.build({window:e.contentWindow,
origin:"https://login.persona.org",scope:"mozid_ni",onReady:function(){a.call({method:"loaded",success:function(){d.ready&&d.ready()},error:function(){}})}});a.bind("logout",function(a,b){d.logout&&d.logout()});a.bind("login",function(a,b){d.login&&d.login(b)})}}catch(f){a=void 0}},u=function(a){return"undefined"!=typeof a},p=function(a){try{console.warn(a)}catch(b){}},v=function(a,b){if(u(a[b]))return p(b+" has been deprecated"),!0},n=function(a,b,c){if(u(a[b])&&u(a[c]))throw"you cannot supply *both* "+
b+" and "+c;v(a,b)&&(a[c]=a[b],delete a[b])},A=function(b){if("object"==typeof b){if(b.onlogin&&"function"!=typeof b.onlogin||b.onlogout&&"function"!=typeof b.onlogout||b.onready&&"function"!=typeof b.onready)throw"non-function where function expected in parameters to navigator.id.watch()";if(!b.onlogin)throw"'onlogin' is a required argument to navigator.id.watch()";if(!b.onlogout)throw"'onlogout' is a required argument to navigator.id.watch()";d.login=b.onlogin||null;d.logout=b.onlogout||null;d.ready=
b.onready||null;t();n(b,"loggedInEmail","loggedInUser");"undefined"!=typeof b.loggedInUser&&a&&a.notify({method:"loggedInUser",params:b.loggedInUser})}},C=function(c){v(c,"requiredEmail");n(c,"tosURL","termsOfService");n(c,"privacyURL","privacyPolicy");c.termsOfService&&!c.privacyPolicy&&p("termsOfService ignored unless privacyPolicy also defined");c.privacyPolicy&&!c.termsOfService&&p("privacyPolicy ignored unless termsOfService also defined");if(b)try{b.focus()}catch(g){}else if(e.isSupported())a&&
a.notify({method:"dialog_running"}),b=WinChan.open({url:"https://login.persona.org/sign_in",relay_url:"https://login.persona.org/relay",window_features:f,window_name:"__persona_dialog",params:{method:"get",params:c}},function(e,f){a&&(!e&&f&&f.email&&a.notify({method:"loggedInUser",params:f.email}),a.notify({method:"dialog_complete"}));b=void 0;if(!e&&f&&f.assertion)try{d.login&&d.login(f.assertion)}catch(g){}if("client closed window"===e||!f)c&&c.oncancel&&c.oncancel(),delete c.oncancel});else{var h=
"unsupported_dialog";"LOCALSTORAGE_DISABLED"===e.getNoSupportReason()&&(h="cookies_disabled");b=window.open("https://login.persona.org/"+h,null,f)}};navigator.id={request:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");a=a||{};l(!1);a.returnTo||(a.returnTo=document.location.pathname);return C(a)},watch:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");l(!1);A(a)},logout:function(b){if(this!=
navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");t();a&&a.notify({method:"logout"});"function"==typeof b&&setTimeout(b,0)},get:function(a,b){var c={};b=b||{};c.privacyPolicy=b.privacyPolicy||void 0;c.termsOfService=b.termsOfService||void 0;c.privacyURL=b.privacyURL||void 0;c.tosURL=b.tosURL||void 0;v(b,"silent")?a&&setTimeout(function(){a(null)},0):(l(!0),A({onlogin:function(b){a&&(a(b),a=null)},onlogout:function(){}}),c.oncancel=function(){a&&(a(null),a=
null);d.login=d.logout=d.ready=null},C(c))},getVerifiedEmail:function(a){p("navigator.id.getVerifiedEmail has been deprecated");l(!0);navigator.id.get(a)},_shimmed:!0}}})();define("persona/include",function(){});
define("mixloginstatic/LoginWindow",["domReady","orion/xhr","orion/PageUtil","orion/webui/littlelib","persona/include"],function(g,e,q,f){function b(a){a=RegExp("[\\?\x26]"+a+"\x3d([^\x26#]*)").exec(window.location.href);if(null!==a)return a[1]}function d(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),
f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!==f&&(b+=String.fromCharCode(d)),64!==g&&(b+=String.fromCharCode(e));b=b.replace(/\r\n/g,"\n");a="";for(f=0;f<b.length;f++)g=b.charCodeAt(f),128>g?a+=String.fromCharCode(g):(127<g&&2048>g?a+=String.fromCharCode(g>>6|192):(a+=String.fromCharCode(g>>
12|224),a+=String.fromCharCode(g>>6&63|128)),a+=String.fromCharCode(g&63|128));return a}function h(a){"undefined"!==typeof a&&(document.getElementById("errorMessage").textContent=a);document.getElementById("errorWin").style.visibility=""}function l(){document.getElementById("errorMessage").textContent="\u00a0";document.getElementById("errorWin").style.visibility="hidden"}function a(){var a;if(""===document.getElementById("reset").value&&""===document.getElementById("resetEmail").value)h("Provide username or email to reset.");
else{var b=new XMLHttpRequest;b.onreadystatechange=function(){l();if(4===b.readyState)if(200===b.status)a=JSON.parse(b.responseText),a.Message?h(a.Message):h();else{try{if(a=JSON.parse(b.responseText),a.Message){h(a.Message);return}}catch(c){}h(b.statusText)}};b.open("POST","../useremailconfirmation",!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Orion-Version","1");b.send("{login\x3d'"+document.getElementById("reset").value+"', email\x3d'"+document.getElementById("resetEmail").value+
"'}");h("Sending password reset confirmation...")}}function c(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return null===a?null:a[1]}function t(){var a=c();if(null!==a&&(a=decodeURIComponent(a),q.validateURLScheme(a))){window.location=a;return}window.close()}function u(a){if(""!==a&&null!==a){var b=c();return null!==b&&q.validateURLScheme(decodeURIComponent(b))?"../login/openid?openid\x3d"+encodeURIComponent(a)+"\x26redirect\x3d"+b:"../login/openid?openid\x3d"+encodeURIComponent(a)}}
function p(a){var b=!1;if("click"===a.type||13===a.keyCode)b=!0;a.stopPropagation();return b}function v(a){p(a)&&(I=!0,navigator.id.request())}function n(a){navigator.id.watch({loggedInUser:null,onlogin:function(a){I&&e("POST","../login/persona",{headers:{"Content-type":"application/x-www-form-urlencoded","Orion-Version":"1"},data:"assertion\x3d"+encodeURIComponent(a)}).then(function(){t()},function(a){h(JSON.parse(a.responseText).error)})},onlogout:function(){}})}function A(a,b){a||(a=document.getElementById("login").value.trim(),
b=document.getElementById("password").value);if(0<a.length&&0<b.length){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(4===c.readyState)if(200!==c.status&&-1!==window.location.href.indexOf("http")){var a=JSON.parse(c.responseText);h(a.error)}else t()};var d="login\x3d"+encodeURIComponent(a)+"\x26password\x3d"+encodeURIComponent(b);c.open("POST","../login/form",!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("Orion-Version","1");c.send(d)}}
function C(){if(document.getElementById("create_password").value!==document.getElementById("create_passwordRetype").value)return h("Passwords don't match!"),!1;l();return!0}function m(){document.getElementById("newUserHeaderShown").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(D||B)document.getElementById("orionRegister").style.visibility="";document.getElementById("registerButton").focus()}function w(){if(C()){document.getElementById("create_password").setAttribute("aria-invalid",
"false");document.getElementById("create_passwordRetype").setAttribute("aria-invalid","false");var a=new XMLHttpRequest,b=document.getElementById("create_login").value,c=document.getElementById("create_password").value,d=document.getElementById("create_email").value;a.onreadystatechange=function(){if(4===a.readyState)if(200!==a.status&&-1!==window.location.href.indexOf("http")){if(a.responseText){var d=JSON.parse(a.responseText);h(d.Message);201===a.status&&m()}}else A(b,c)};d="login\x3d"+encodeURIComponent(b)+
"\x26password\x3d"+encodeURIComponent(c)+"\x26email\x3d"+encodeURIComponent(d);a.open("POST","../users",!0);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");a.setRequestHeader("Orion-Version","1");a.send(d)}else document.getElementById("create_password").setAttribute("aria-invalid","true"),document.getElementById("create_passwordRetype").setAttribute("aria-invalid","true")}function x(a){p(a)&&(!D&&B?window.open(B):(document.getElementById("orionOpen").style.visibility="hidden",
document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLoginForm").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("newUserHeaderShown").style.visibility="",document.getElementById("create_login").focus()))}function s(){document.getElementById("orionLoginForm").style.visibility="hidden";!D&&!B&&(document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionReset").style.height=
"212px");document.getElementById("newUserHeaderShown").style.display="none";document.getElementById("orionReset").style.visibility="";document.getElementById("reset").focus()}function J(){document.getElementById("orionLoginForm").style.visibility="";document.getElementById("newUserHeaderShown").style.display="";document.getElementById("orionReset").style.visibility="hidden"}function z(a){p(a)&&(f.stop(a),document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility=
"hidden",document.getElementById("orionLoginForm").style.visibility="",document.getElementById("login").focus())}function G(){document.getElementById("orionLoginForm").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(D||B)document.getElementById("orionRegister").style.visibility="";document.getElementById("orionLogin").focus();l()}function K(a){p(a)&&a.srcElement.click()}var D,B,H,I=!1;g(function(){n(document.getElementById("personaLogin"));var c=b("error");c&&
(c=d(c),h(c));var g=new XMLHttpRequest;g.onreadystatechange=function(){if(4===g.readyState&&200===g.status){var a=JSON.parse(g.responseText);D=a.CanAddUsers;H=a.ForceEmail;document.getElementById("create_email").setAttribute("aria-required",H);B=a.RegistrationURI;!D&&!B&&(document.getElementById("orionRegister").style.visibility="hidden");document.getElementById("login-window").style.display="";document.getElementById("orionLogin").focus()}};g.open("POST","../login/canaddusers",!0);g.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");g.setRequestHeader("Orion-Version","1");g.send();var l=new XMLHttpRequest;l.onreadystatechange=function(){4===l.readyState&&(200===l.status&&!1===JSON.parse(l.responseText).emailConfigured)&&(document.getElementById("resetUserLink").style.display="none")};l.open("POST","../useremailconfirmation/cansendemails",!0);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.setRequestHeader("Orion-Version","1");l.send();e("GET","../server-status.json",
{timeout:15E3}).then(function(a){a=JSON.parse(a.response).messages;if(0<a.length){var b=new Date,c=new Date(a[0].startdate);c.setHours(0,0,0,0);c>b||(c=new Date(a[0].enddate),c.setHours(23,59,59),c<=b||(document.getElementById("orionInfoArea").style.visibility="",document.getElementById("orionInfoMessage").textContent=a[0].title))}},function(a){});document.getElementById("login").addEventListener("keypress",function(a){a.keyCode===f.KEY.ENTER&&(A(),f.stop(a))});document.getElementById("password").addEventListener("keypress",
function(a){a.keyCode===f.KEY.ENTER&&(A(),f.stop(a))});document.getElementById("loginButton").addEventListener("click",function(){A()});document.getElementById("orionLoginForm").addEventListener("keyup",function(a){a.keyCode===f.KEY.ESCAPE&&(G(),f.stop(a))});document.getElementById("resetUserLink").addEventListener("click",s);document.getElementById("reset").addEventListener("keypress",function(b){b.keyCode===f.KEY.ENTER&&(a(),f.stop(b))});document.getElementById("resetEmail").addEventListener("keypress",
function(b){b.keyCode===f.KEY.ENTER&&(a(),f.stop(b))});document.getElementById("registerButton").addEventListener("click",x);document.getElementById("registerButton").addEventListener("keydown",x);document.getElementById("create_password").addEventListener("keyup",function(a){a.keyCode===f.KEY.ENTER?w():C()});document.getElementById("create_passwordRetype").addEventListener("keyup",function(a){a.keyCode===f.KEY.ENTER?w():C()});document.getElementById("newUserHeaderShown").addEventListener("keyup",
function(a){a.keyCode===f.KEY.ESCAPE&&m()});document.getElementById("createButton").addEventListener("click",w);document.getElementById("cancelLoginButton").addEventListener("click",G);document.getElementById("newUserHeaderShown").onkeyup=function(a){a.keyCode===f.KEY.ESCAPE&&m()};document.getElementById("hideRegisterButton").addEventListener("click",m);document.getElementById("googleLogin").href=u("https://www.google.com/accounts/o8/id");document.getElementById("googleLogin").addEventListener("keydown",
K);document.getElementById("orionLogin").addEventListener("click",z);document.getElementById("orionLogin").onkeydown=z;document.getElementById("personaLogin").onclick=v;document.getElementById("personaLogin").onkeydown=v;document.getElementById("cancelResetButton").onclick=J;document.getElementById("sendResetButton").onclick=a})});
//@ sourceMappingURL=LoginWindow.js.map