/**
 * @license 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
 */

/*******************************************************************************
 * @license
 * 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
 ******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 *******************************************************************************/

/*******************************************************************************
 * @license
 * 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
 ******************************************************************************/

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