/**
 * @license RequireJS domReady 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs 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) 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 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs 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) 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 k(a){for(var g=0,c;c=a[g];g++)c(e)}function f(){var d=a,b=g;c&&(d.length&&(a=[],k(d)),j.resourcesDone&&b.length&&(g=[],k(b)))}function i(){c||(c=!0,t&&clearInterval(t),f())}function d(g){c?g(e):a.push(g);return d}var b=typeof window!=="undefined"&&window.document,c=!b,e=b?document:null,a=[],g=[],j=requirejs||require||{},u=j.resourcesReady,t;if("resourcesReady"in j)j.resourcesReady=function(a){u&&u(a);a&&f()};b&&(document.addEventListener?(document.addEventListener("DOMContentLoaded",
i,!1),window.addEventListener("load",i,!1)):window.attachEvent&&(window.attachEvent("onload",i),self===self.top&&(t=setInterval(function(){try{document.body&&(document.documentElement.doScroll("left"),i())}catch(a){}},30))),document.readyState==="complete"&&i());d.withResources=function(a){c&&j.resourcesDone?a(e):g.push(a);return d};d.version="1.0.0";d.load=function(a,g,c,j){j.isBuild?c(null):d(c)};return d});
(function(k,f){typeof define==="function"&&define.amd?define("orion/Deferred",[],f):typeof exports==="object"?module.exports=f():(k.orion=k.orion||{},k.orion.Deferred=f())})(this,function(){function k(){for(var c;c=e.shift()||a.shift();)c();g=!1}function f(c,d){(d?a:e).push(c);g||(g=!0,d?setTimeout(k,0):k())}function i(a){return function(){a.apply(null,arguments)}}function d(){}function b(){var a=Error("Cancel");a.name="Cancel";return a}function c(){function a(){for(var c;c=l.shift();){var b=c.deferred,
f=e==="resolved"?"resolve":"reject";if(typeof c[f]==="function")try{var h=c[f](g);h&&typeof h.then==="function"?(b.cancel=h.cancel||d,h.then(i(b.resolve),i(b.reject),b.progress)):b.resolve(h)}catch(r){b.reject(r)}else b[f](g)}}var g,e,l=[],s=this;this.reject=function(c){e||(e="rejected",g=c,l.length&&f(a));return s.promise};this.resolve=function(c){e||(e="resolved",g=c,l.length&&f(a));return s.promise};this.progress=function(a){e||l.forEach(function(c){c.progress&&c.progress(a)});return s.promise};
this.cancel=function(){e||s.reject(b())};this.then=function(g,b,d){var g={resolve:g,reject:b,progress:d,deferred:new c},h=g.deferred,r=this.cancel.bind(this),i=function(){f(function(){(h.cancel===i?r:h.cancel)()},!0)};h.cancel=i;b=h.promise;b.cancel=function(){h.cancel()};l.push(g);e&&f(a,!0);return b};this.promise={then:this.then,cancel:this.cancel}}var e=[],a=[],g=!1;c.all=function(a,g){function b(h,a){i||(f[h]=a,--e===0&&k.resolve(f))}function d(h,a){if(!i){if(g)try{b(h,g(a));return}catch(c){a=
c}k.reject(a)}}var e=a.length,f=[],i=!1,k=new c;k.then(null,function(){i=!0;a.forEach(function(h){h.cancel&&h.cancel()})});e===0?k.resolve(f):a.forEach(function(h,a){h.then(b.bind(null,a),d.bind(null,a))});return k.promise};c.when=function(a,g,b,d){var e;if(!(a&&typeof a.then==="function"))e=new c,e.resolve(a),a=e.promise;return a.then(g,b,d)};return c});
define("orion/xhr",["orion/Deferred"],function(k){function f(f,d,b,c){var e=typeof b.response!=="undefined"?b.response:b.responseText,a;try{a=b.status}catch(g){a=0}f={args:d,response:e,responseText:typeof e==="string"?e:null,status:a,url:f,xhr:b};if(typeof c!=="undefined")f.error=c;return f}return function(i,d,b){var b=b||{},c=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,e=new k,a=b.headers||{},g=b.log||!1,j;typeof a["X-Requested-With"]==="undefined"&&(a["X-Requested-With"]="XMLHttpRequest");
if(typeof b.data!=="undefined"&&(i==="POST"||i==="PUT"))j=b.data;if(typeof b.responseType==="string")c.responseType=b.responseType;c.onprogress=function(a){a.xhr=c;e.progress(a)};c.onreadystatechange=function(){if(c.readyState===4){var a=f(d,b,c),i=c.status;200<=i&&i<400?e.resolve(a):(g&&typeof console!=="undefined"&&console.log(Error(c.statusText)),e.reject(a))}};try{c.open(i,d,!0);if(typeof b.timeout==="number")if(typeof c.timeout==="number")c.timeout=b.timeout,c.addEventListener("timeout",function(){e.reject(f(d,
b,c,"Timeout exceeded"))});else{var u=setTimeout(function(){e.reject(f(d,b,c,"Timeout exceeded"))},b.timeout);e.then(clearTimeout.bind(null,u),clearTimeout.bind(null,u))}Object.keys(a).forEach(function(g){c.setRequestHeader(g,a[g])});c.send(j)}catch(t){e.reject(f(d,b,c,t))}return e.promise}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{matchResourceParameters:function(f){var f=f||window.location.toString(),i={resource:""},d=f.indexOf("#");if(d!==-1&&(f=f.substring(d+1),f.length!==0)){f=f.split(",");Object.defineProperty(i,"resourceRaw",{value:f[0]});i.resource=decodeURIComponent(f[0]);for(d=1;d<f.length;d++){var b=/([^=]*)(=?)(.*)/.exec(f[d]),c=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");c!==""&&c!=="resource"&&(i[c]=b)}}return i},validateURLScheme:function(f,
i){var d=f;if(f.indexOf("://")===-1){var b=document.createElement("a");b.href=f;d=b.href}b=!1;return(b=i?i.some(function(c){return RegExp("^"+c+":","i").test(d)}):k.test(d))?f:(console.log("Illegal URL Scheme: '"+f+"'"),"")}}});
define("orion/webui/littlelib",["require"],function(){function k(a,g){g||(g=document);return g.querySelectorAll(a)}function f(a,g){var c=a.compareDocumentPosition(g);return a===g||Boolean(c&16)}function i(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++){var b=i(a.childNodes[c]);if(b)return b}return null}function d(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var c=a.childNodes.length-1;c>=0;c--){var b=d(a.childNodes[c]);if(b)return b}return null}function b(a,
g){if(a.nodeType===3){var d=c.exec(a.nodeValue);d&&d.length>1&&a.parentNode.replaceChild(document.createTextNode(g[d[1]]||d[1]),a)}if(a.hasChildNodes())for(d=0;d<a.childNodes.length;d++)b(a.childNodes[d],g)}var c=/\$\{([^\}]+)\}/,e=[];return{$:function(a,c){c||(c=document);return c.querySelector(a)},$$:k,$$array:function(a,c){return Array.prototype.slice.call(k(a,c))},node:function(a){var c=a;typeof a==="string"&&(c=document.getElementById(a));return c},contains:f,bounds:function(a){a=a.getBoundingClientRect();
return{left:a.left+document.body.scrollLeft,top:a.top+document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:i,lastTabbable:d,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:b,addAutoDismiss:function(a,c){e.length===0&&document.addEventListener("click",function(a){for(var c=[],b=0;b<e.length;b++){for(var d=e[b].excludeNodes,g=e[b].dismiss,i=!1,k=!0,q=0;q<
d.length;q++)if((i=document.compareDocumentPosition(document,d[q])!==1)&&f(d[q],a.target)){k=!1;break}k&&(g(),i=document.compareDocumentPosition(document,d[q])!==1);i&&c.push(e[b])}e=c},!0);e.push({excludeNodes:a,dismiss:c})},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 k=function(){function a(c){return Array.isArray?Array.isArray(c):c.constructor.toString().indexOf("Array")!=-1}function c(a,h,b,g){function e(h){for(var c=0;c<h.length;c++)if(h[c].win===a)return!0;return!1}var f=!1;if(h==="*")for(var i in d){if(d.hasOwnProperty(i)&&i!=="*"&&typeof d[i][b]=="object"&&(f=e(d[i][b])))break}else d["*"]&&d["*"][b]&&(f=e(d["*"][b])),!f&&d[h]&&d[h][b]&&(f=e(d[h][b]));if(f)throw"A channel is already bound to the same window which overlaps with origin '"+h+
"' and has scope '"+b+"'";typeof d[h]!="object"&&(d[h]={});typeof d[h][b]!="object"&&(d[h][b]=[]);d[h][b].push({win:a,handler:g})}var b=Math.floor(Math.random()*1000001),d={},g={},e=function(a){try{var h=JSON.parse(a.data);if(typeof h!="object"||h===null)throw"malformed";}catch(c){return}var b=a.source,a=a.origin,e,f,i;if(typeof h.method=="string"){var m=h.method.split("::");m.length==2?(e=m[0],i=m[1]):i=h.method}typeof h.id!="undefined"&&(f=h.id);if(typeof i=="string"){f=!1;if(d[a]&&d[a][e])for(m=
0;m<d[a][e].length;m++)if(d[a][e][m].win===b){d[a][e][m].handler(a,i,h);f=!0;break}if(!f&&d["*"]&&d["*"][e])for(m=0;m<d["*"][e].length;m++)if(d["*"][e][m].win===b){d["*"][e][m].handler(a,i,h);break}}else typeof f!="undefined"&&g[f]&&g[f](a,i,h)};window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e);return{build:function(e){var f=function(a){if(e.debugOutput&&window.console&&window.console.log){try{typeof a!="string"&&(a=JSON.stringify(a))}catch(h){}console.log("["+
k+"] "+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 i=!1;if(typeof e.origin==
"string"){var v;e.origin==="*"?i=!0:null!==(v=e.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))&&(e.origin=v[0].toLowerCase(),i=!0)}if(!i)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 k=function(){for(var a="",h=0;h<5;h++)a+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*
62));return a}(),o={},n={},m={},p=!1,y=[],J=function(a,h,c){var e=!1,d=!1;return{origin:h,invoke:function(h,e){if(!m[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;for(var d=!1,b=0;b<c.length;b++)if(h===c[b]){d=!0;break}if(!d)throw"request supports no such callback '"+h+"'";l({id:a,callback:h,params:e})},error:function(h,c){d=!0;if(!m[a])throw"error called for nonexistent message: "+a;delete m[a];l({id:a,error:h,message:c})},complete:function(h){d=!0;if(!m[a])throw"complete called for nonexistent message: "+
a;delete m[a];l({id:a,result:h})},delayReturn:function(a){typeof a=="boolean"&&(e=a===!0);return e},completed:function(){return d}}},K=function(a,h,c){return window.setTimeout(function(){n[a]&&((0,n[a].error)("timeout_error","timeout ("+h+"ms) exceeded on method '"+c+"'"),delete n[a],delete g[a])},h)},C=function(c,d,b){if(typeof e.gotMessageObserver=="function")try{e.gotMessageObserver(c,b)}catch(i){f("gotMessageObserver() raised an exception: "+i.toString())}if(b.id&&d){if(o[d]){var p=J(b.id,c,b.callbacks?
b.callbacks:[]);m[b.id]={};try{if(b.callbacks&&a(b.callbacks)&&b.callbacks.length>0)for(c=0;c<b.callbacks.length;c++){for(var y=b.callbacks[c],v=b.params,r=y.split("/"),k=0;k<r.length-1;k++){var z=r[k];typeof v[z]!="object"&&(v[z]={});v=v[z]}v[r[r.length-1]]=function(){var a=y;return function(b){return p.invoke(a,b)}}()}var l=o[d](p,b.params);!p.delayReturn()&&!p.completed()&&p.complete(l)}catch(j){d="runtime_error";b=null;typeof j=="string"?b=j:typeof j=="object"&&(j&&a(j)&&j.length==2?(d=j[0],b=
j[1]):typeof j.error=="string"&&(d=j.error,j.message?typeof j.message=="string"?b=j.message:j=j.message:b=""));if(b===null)try{b=JSON.stringify(j),typeof b=="undefined"&&(b=j.toString())}catch(C){b=j.toString()}p.error(d,b)}}}else b.id&&b.callback?!n[b.id]||!n[b.id].callbacks||!n[b.id].callbacks[b.callback]?f("ignoring invalid callback, id:"+b.id+" ("+b.callback+")"):n[b.id].callbacks[b.callback](b.params):b.id?n[b.id]?(b.error?(0,n[b.id].error)(b.error,b.message):b.result!==void 0?(0,n[b.id].success)(b.result):
(0,n[b.id].success)(),delete n[b.id],delete g[b.id]):f("ignoring invalid response: "+b.id):d&&o[d]&&o[d](null,b.params)};c(e.window,e.origin,typeof e.scope=="string"?e.scope:"",C);var D=function(a){typeof e.scope=="string"&&e.scope.length&&(a=[e.scope,a].join("::"));return a},l=function(a,b){if(!a)throw"postMessage called with null message";f((p?"post  ":"queue ")+" message: "+JSON.stringify(a));if(!b&&!p)y.push(a);else{if(typeof e.postMessageObserver=="function")try{e.postMessageObserver(e.origin,
a)}catch(h){f("postMessageObserver() raised an exception: "+h.toString())}e.window.postMessage(JSON.stringify(a),e.origin)}},j={unbind:function(a){if(o[a]){if(delete o[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(o[a])throw"method '"+a+"' is already bound!";o[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 h={},c=[],d=function(a,b){if(typeof b=="object")for(var e in b)if(b.hasOwnProperty(e)){var m=a+(a.length?"/":"")+e;typeof b[e]=="function"?(h[m]=b[e],c.push(m),delete b[e]):typeof b[e]=="object"&&d(m,b[e])}};d("",a.params);var e={id:b,method:D(a.method),params:a.params};c.length&&(e.callbacks=c);a.timeout&&K(b,a.timeout,
D(a.method));n[b]={callbacks:h,error:a.error,success:a.success};g[b]=C;b++;l(e)},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";l({method:D(a.method),params:a.params})},destroy:function(){for(var a=e.window,b=e.origin,h=typeof e.scope=="string"?e.scope:"",c=d[b][h],g=0;g<c.length;g++)c[g].win===a&&c.splice(g,1);d[b][h].length===0&&delete d[b][h];window.removeEventListener?window.removeEventListener("message",
C,!1):window.detachEvent&&window.detachEvent("onmessage",C);p=!1;o={};m={};n={};e.origin=null;y=[];f("channel destroyed");k=""}};j.bind("__ready",function(a,b){f("ready msg received");if(p)throw"received ready message while in ready state.  help!";for(b==="ping"?k+="-R":k+="-L",j.unbind("__ready"),p=!0,f("ready msg accepted."),b==="ping"&&j.notify({method:"__ready",params:"pong"});y.length;)l(y.pop());typeof e.onReady=="function"&&e.onReady(j)});setTimeout(function(){},0);return j}}}();WinChan=function(){function a(b){/^https?:\/\//.test(b)||
(b=window.location.href);var h=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(b);return h?h[1]:b}function b(){try{var a=navigator.userAgent;return a.indexOf("Fennec/")!=-1||a.indexOf("Firefox/")!=-1&&a.indexOf("Android")!=-1}catch(h){}return!1}function c(a,b,h){a.attachEvent?a.attachEvent("on"+b,h):a.addEventListener&&a.addEventListener(b,h,!1)}var e="die",d=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 i(a){try{var b=JSON.parse(a.data);if(b.a==="ready")n.postMessage(p,o);else if(b.a==="error")g&&(g(b.d),g=null);else if(b.a==="response"){var a=window,h=i;a.detachEvent?a.detachEvent("onmessage",h):a.removeEventListener&&a.removeEventListener("message",h,!1);a=window;h=j;a.detachEvent?a.detachEvent("onunload",h):a.removeEventListener&&a.removeEventListener("unload",h,!1);j();
g&&(g(null,b.d),g=null)}}catch(c){}}function j(){l&&document.body.removeChild(l);l=void 0;if(m)try{m.close()}catch(a){n.postMessage(e,o)}m=n=void 0}if(!g)throw"missing required callback argument";var k;f.url||(k="missing required 'url' parameter");f.relay_url||(k="missing required 'relay_url' parameter");k&&setTimeout(function(){g(k)},0);f.window_name||(f.window_name=null);if(!f.window_features||b())f.window_features=void 0;var l,o=a(f.url);if(o!==a(f.relay_url))return setTimeout(function(){g("invalid arguments: origin of url and relay_url must match")},
0);var n;d&&(l=document.createElement("iframe"),l.setAttribute("src",f.relay_url),l.style.display="none",l.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(l),n=l.contentWindow);var m=window.open(f.url,f.window_name,f.window_features);n||(n=m);var p=JSON.stringify({a:"request",d:f.params});c(window,"unload",j);c(window,"message",i);return{close:j,focus:function(){if(m)try{m.focus()}catch(a){}}}}}:{open:function(a,b,h,c){setTimeout(function(){c("unsupported browser")},0)}}}();
var f=function(){var a=window,b=navigator,c;return{setTestEnv:function(c,e){b=c;a=e},isSupported:function(){var e;var d;d=-1;b.appName=="Microsoft Internet Explorer"&&/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(b.userAgent)!=null&&(d=parseFloat(RegExp.$1));d>-1&&d<8&&(e="BAD_IE_VERSION");if(!e){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 i;a.postMessage||
(i="POSTMESSAGE_NOT_SUPPORTED");i||(i=!window.JSON||!window.JSON.stringify||!window.JSON.parse?"JSON_NOT_SUPPORTED":void 0);f=i}e=f}c=e;return!c},getNoSupportReason:function(){return c}}}();navigator.id||(navigator.id={});if(!navigator.id.request||navigator.id._shimmed){var i=navigator.userAgent,d=i.indexOf("Fennec/")!=-1||i.indexOf("Firefox/")!=-1&&i.indexOf("Android")!=-1?void 0:"menubar=0,location=1,resizable=1,scrollbars=1,status=0,dialog=1,minimizable=1,width=700,height=375",b,c={login:null,
logout:null,ready:null},e=void 0,a=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()";},g,j=f.isSupported(),u=function(){if(j)try{if(!g){var a=window.document,b=a.createElement("iframe");b.style.display="none";a.body.appendChild(b);b.src="https://login.persona.org/communication_iframe";g=k.build({window:b.contentWindow,
origin:"https://login.persona.org",scope:"mozid_ni",onReady:function(){g.call({method:"loaded",success:function(){c.ready&&c.ready()},error:function(){}})}});g.bind("logout",function(){c.logout&&c.logout()});g.bind("login",function(a,b){c.login&&c.login(b)})}}catch(e){g=void 0}},t=function(a){return typeof a!="undefined"},l=function(a){try{console.warn(a)}catch(b){}},s=function(a,b){if(t(a[b]))return l(b+" has been deprecated"),!0},B=function(a,b,c){if(t(a[b])&&t(a[c]))throw"you cannot supply *both* "+
b+" and "+c;s(a,b)&&(a[c]=a[b],delete a[b])},w=function(a){if(typeof a=="object"){if(a.onlogin&&typeof a.onlogin!="function"||a.onlogout&&typeof a.onlogout!="function"||a.onready&&typeof a.onready!="function")throw"non-function where function expected in parameters to navigator.id.watch()";if(!a.onlogin)throw"'onlogin' is a required argument to navigator.id.watch()";if(!a.onlogout)throw"'onlogout' is a required argument to navigator.id.watch()";c.login=a.onlogin||null;c.logout=a.onlogout||null;c.ready=
a.onready||null;u();B(a,"loggedInEmail","loggedInUser");typeof a.loggedInUser!="undefined"&&g&&g.notify({method:"loggedInUser",params:a.loggedInUser})}},q=function(a){s(a,"requiredEmail");B(a,"tosURL","termsOfService");B(a,"privacyURL","privacyPolicy");a.termsOfService&&!a.privacyPolicy&&l("termsOfService ignored unless privacyPolicy also defined");a.privacyPolicy&&!a.termsOfService&&l("privacyPolicy ignored unless termsOfService also defined");if(b)try{b.focus()}catch(e){}else if(f.isSupported())g&&
g.notify({method:"dialog_running"}),b=WinChan.open({url:"https://login.persona.org/sign_in",relay_url:"https://login.persona.org/relay",window_features:d,window_name:"__persona_dialog",params:{method:"get",params:a}},function(e,d){g&&(!e&&d&&d.email&&g.notify({method:"loggedInUser",params:d.email}),g.notify({method:"dialog_complete"}));b=void 0;if(!e&&d&&d.assertion)try{c.login&&c.login(d.assertion)}catch(f){}if(e==="client closed window"||!d)a&&a.oncancel&&a.oncancel(),delete a.oncancel});else{var i=
"unsupported_dialog";f.getNoSupportReason()==="LOCALSTORAGE_DISABLED"&&(i="cookies_disabled");b=window.open("https://login.persona.org/"+i,null,d)}};navigator.id={request:function(b){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");b=b||{};a(!1);b.returnTo||(b.returnTo=document.location.pathname);return q(b)},watch:function(b){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");a(!1);w(b)},logout:function(a){if(this!=
navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");u();g&&g.notify({method:"logout"});typeof a=="function"&&setTimeout(a,0)},get:function(b,e){var d={};e=e||{};d.privacyPolicy=e.privacyPolicy||void 0;d.termsOfService=e.termsOfService||void 0;d.privacyURL=e.privacyURL||void 0;d.tosURL=e.tosURL||void 0;s(e,"silent")?b&&setTimeout(function(){b(null)},0):(a(!0),w({onlogin:function(a){b&&(b(a),b=null)},onlogout:function(){}}),d.oncancel=function(){b&&(b(null),b=
null);c.login=c.logout=c.ready=null},q(d))},getVerifiedEmail:function(b){l("navigator.id.getVerifiedEmail has been deprecated");a(!0);navigator.id.get(b)},_shimmed:!0}}})();define("persona/include",function(){});
define("mixloginstatic/LoginWindow",["domReady","orion/xhr","orion/PageUtil","orion/webui/littlelib","persona/include"],function(k,f,i,d){function b(a){a=RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);return a===null?void 0:a[1]}function c(a){for(var b="",c,e,d,f,g,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),
f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),c=c<<2|e>>4,e=(e&15)<<4|f>>2,d=(f&3)<<6|g,b+=String.fromCharCode(c),f!==64&&(b+=String.fromCharCode(e)),g!==64&&(b+=String.fromCharCode(d));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 a(){document.getElementById("errorMessage").textContent="\u00a0";document.getElementById("errorWin").style.visibility="hidden"}function g(){var b;if(document.getElementById("reset").value===""&&document.getElementById("resetEmail").value==="")e("Provide username or email to reset.");
else{var c=new XMLHttpRequest;c.onreadystatechange=function(){a();if(c.readyState===4)if(c.status===200)b=JSON.parse(c.responseText),b.Message?e(b.Message):e();else{try{if(b=JSON.parse(c.responseText),b.Message){e(b.Message);return}}catch(d){}e(c.statusText)}};c.open("POST","../useremailconfirmation",!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("Orion-Version","1");c.send("{login='"+document.getElementById("reset").value+"', email='"+document.getElementById("resetEmail").value+
"'}");e("Sending password reset confirmation...")}}function j(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return a===null?null:a[1]}function u(){var a=j();if(a!==null&&(a=decodeURIComponent(a),i.validateURLScheme(a))){window.location=decodeURIComponent(a);return}window.close()}function t(a){if(a!==""&&a!==null){var b=j();return b!==null&&i.validateURLScheme(decodeURIComponent(b))?"../login/openid?openid="+encodeURIComponent(a)+"&redirect="+b:"../login/openid?openid="+encodeURIComponent(a)}}
function l(a){var b=!1;if(a.type==="click"||a.keyCode===13)b=!0;a.stopPropagation();return b}function s(a){l(a)&&(n=!0,navigator.id.request())}function B(){navigator.id.watch({loggedInUser:null,onlogin:function(a){n&&f("POST","../login/persona",{headers:{"Content-type":"application/x-www-form-urlencoded","Orion-Version":"1"},data:"assertion="+encodeURIComponent(a)}).then(function(){u()},function(a){e(JSON.parse(a.responseText).error)})},onlogout:function(){}})}function w(a,b){if(!a)a=document.getElementById("login").value,
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 u()};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 q(){if(document.getElementById("create_password").value!==
document.getElementById("create_passwordRetype").value)return e("Passwords don't match!"),!1;a();return!0}function h(){document.getElementById("newUserHeaderShown").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(A||x)document.getElementById("orionRegister").style.visibility="";document.getElementById("registerButton").focus()}function r(){if(q()){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&&h()}}else w(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 z(a){if(l(a))!A&&x?window.open(x):(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 H(){document.getElementById("orionLoginForm").style.visibility="hidden";if(!A&&!x)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 I(){document.getElementById("orionLoginForm").style.visibility="";document.getElementById("newUserHeaderShown").style.display="";document.getElementById("orionReset").style.visibility="hidden"}function v(){window.open("/mixloginstatic/ServerStatus.html")}function E(a){if(l(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 F(){document.getElementById("orionLoginForm").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(A||x)document.getElementById("orionRegister").style.visibility="";document.getElementById("orionLogin").focus();a()}function G(a){l(a)&&a.srcElement.click()}var A,x,o,n=!1;k(function(){B(document.getElementById("personaLogin"));var a=b("error");a&&(a=c(a),e(a));var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===
4&&i.status===200){var a=JSON.parse(i.responseText);A=a.CanAddUsers;o=a.ForceEmail;document.getElementById("create_email").setAttribute("aria-required",o);x=a.RegistrationURI;if(!A&&!x)document.getElementById("orionRegister").style.visibility="hidden";document.getElementById("login-window").style.display="";document.getElementById("orionLogin").focus()}};i.open("POST","../login/canaddusers",!0);i.setRequestHeader("Content-type","application/x-www-form-urlencoded");i.setRequestHeader("Orion-Version",
"1");i.send();var j=new XMLHttpRequest;j.onreadystatechange=function(){if(j.readyState===4&&j.status===200&&JSON.parse(j.responseText).emailConfigured===!1)document.getElementById("resetUserLink").style.display="none"};j.open("POST","../useremailconfirmation/cansendemails",!0);j.setRequestHeader("Content-type","application/x-www-form-urlencoded");j.setRequestHeader("Orion-Version","1");j.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===d.KEY.ENTER&&(w(),d.stop(a))});document.getElementById("password").addEventListener("keypress",function(a){a.keyCode===d.KEY.ENTER&&(w(),d.stop(a))});
document.getElementById("loginButton").addEventListener("click",function(){w()});document.getElementById("orionLoginForm").addEventListener("keyup",function(a){a.keyCode===d.KEY.ESCAPE&&(F(),d.stop(a))});document.getElementById("orionInfoArea").addEventListener("click",v);document.getElementById("orionInfoArea").onclick=v;document.getElementById("resetUserLink").addEventListener("click",H);document.getElementById("reset").addEventListener("keypress",function(a){a.keyCode===d.KEY.ENTER&&(g(),d.stop(a))});
document.getElementById("resetEmail").addEventListener("keypress",function(a){a.keyCode===d.KEY.ENTER&&(g(),d.stop(a))});document.getElementById("registerButton").addEventListener("click",z);document.getElementById("registerButton").addEventListener("keydown",z);document.getElementById("create_password").addEventListener("keyup",function(a){a.keyCode===d.KEY.ENTER?r():q()});document.getElementById("create_passwordRetype").addEventListener("keyup",function(a){a.keyCode===d.KEY.ENTER?r():q()});document.getElementById("newUserHeaderShown").addEventListener("keyup",
function(a){a.keyCode===d.KEY.ESCAPE&&h()});document.getElementById("createButton").addEventListener("click",r);document.getElementById("cancelLoginButton").addEventListener("click",F);document.getElementById("newUserHeaderShown").onkeyup=function(a){a.keyCode===d.KEY.ESCAPE&&h()};document.getElementById("hideRegisterButton").addEventListener("click",h);document.getElementById("googleLoginLink").href=t("https://www.google.com/accounts/o8/id");document.getElementById("googleLogin").addEventListener("keydown",
G);document.getElementById("orionLoginLink").addEventListener("click",E);document.getElementById("orionLogin").onkeydown=E;document.getElementById("personaLogin").onclick=s;document.getElementById("personaLogin").onkeydown=s;document.getElementById("cancelResetButton").onclick=I;document.getElementById("sendResetButton").onclick=g})});