/*

 Copyright (c) 2011 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 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 text 0.24.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
 RequireJS i18n 0.24.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) 2009, 2011 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) 2010,2011 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 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 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 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 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) 2010, 2011 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) 2010, 2011 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 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 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 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 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) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2011 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) 2010, 2011 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
 Andy Clement (vmware) - bug 344614

 Copyright (c) 2010, 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 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) 2010, 2011 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) 2010, 2011 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) 2010, 2011 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 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 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) 2009, 2011 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) 2010, 2011 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) 2009, 2011 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) 2009, 2011 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) 2010, 2011 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 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 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) 2010, 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) 2010, 2011 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) 2010, 2011 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) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2011 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) 2010, 2011 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 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) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation
 Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#362835 Bug#362428 Bug#362286 Bug#354270 Bug#361474 Bug#363945 Bug#366312 Bug#370584

 Copyright (c) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2010, 2011 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) 2010, 2011 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) 2010, 2011 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2011 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) 2009, 2011 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) 2010, 2011 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) 2010, 2011 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) 2010, 2011 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) 2010, 2011 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 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) 2010, 2011 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
 Alex Lakatos - fix for bug#369781

 Copyright (c) 2011 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 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: 
 Anton McConville (IBM Corporation) - initial API and implementation
 Felipe Heidrich (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) 2004, 2011, The Dojo Foundation and others. All Rights Reserved.
 Available via Academic Free License >= 2.1 OR the modified BSD license.
 see: http://dojotoolkit.org/license for details

 Contributors:
 Dojo Foundation: _handleOnChange function, and cookie management code
 IBM Corporation: Initial API and implementation of the remainder of the script

 Copyright (c) 2010, 2011 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 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
*/
(function(){function c(a,b,d){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var f=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],g=0,j;j=f[g++];)console[j]||function(){var t=j+"";console[t]="log"in console?function(){var w=Array.apply({},arguments);w.unshift(t+":");console.log(w.join(" "))}:function(){};console[t]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var i=a;if(typeof b=="undefined")b={_scopeName:"dijit"};if(typeof d=="undefined")d={_scopeName:"dojox"};if(!i._scopeArgs)i._scopeArgs=[a,b,d];i.global=this;i.config={isDebug:false,debugAtAllCosts:false};if(f=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var k in f)i.config[k]=f[k];a.locale=i.config.locale;k="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:k?+k[0]:NaN,toString:function(){with(i.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",i.version.toString());var m,o,v={};for(g in{toString:1}){m=[];break}a._extraNames=m=m||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];o=m.length;a._mixin=function(t,w){var u,s,q;for(u in w){s=w[u];
if(!(u in t)||t[u]!==s&&(!(u in v)||v[u]!==s))t[u]=s}if(o&&w)for(q=0;q<o;++q){u=m[q];s=w[u];if(!(u in t)||t[u]!==s&&(!(u in v)||v[u]!==s))t[u]=s}return t};a.mixin=function(t){t||(t={});for(var w=1,u=arguments.length;w<u;w++)i._mixin(t,arguments[w]);return t};a._getProp=function(t,w,u){u=u||i.global;for(var s=0,q;u&&(q=t[s]);s++){if(s==0&&i._scopeMap[q])q=i._scopeMap[q];u=q in u?u[q]:w?(u[q]={}):undefined}return u};a.setObject=function(t,w,u){var s=t.split(".");t=s.pop();return(u=i._getProp(s,true,
u))&&t?(u[t]=w):undefined};a.getObject=function(t,w,u){return i._getProp(t.split("."),w,u)};a.exists=function(t,w){return i.getObject(t,false,w)!==undefined};a.eval=function(t){return i.global.eval?i.global.eval(t):eval(t)};i.deprecated=i.experimental=function(){}})();return{dojo:a,dijit:b,dojox:d}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=c();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var e=c();dojo=e.dojo;dijit=e.dijit;dojox=e.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(c,e){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],b,d;for(b=0;b<a.length;){d=a[b++];e[d]=function(t){return function(){console.warn("dojo."+t+" not available when using an AMD loader.")}}(d)}var f=function(t){var w=[],u;for(u=0;u<t.length;)w.push(t[u++]);
return w},g=function(t,w){return w?typeof w=="string"?function(){t[w]()}:function(){w.call(t)}:t};e.ready=e.addOnLoad=function(t,w){c.ready(w?g(t,w):t)};e.addOnLoad(function(){e.postLoad=e.config.afterOnLoad=true});if(a=e.config.addOnLoad)e.addOnLoad[a instanceof Array?"apply":"call"](e,a);var j=e._loaders=[],i=function(){var t=j.slice(0);for(Array.prototype.splice.apply(j,[0,j.length]);t.length;)t.shift().call()};j.unshift=function(){Array.prototype.unshift.apply(j,f(arguments));c.ready(i)};j.splice=
function(){Array.prototype.splice.apply(j,f(arguments));c.ready(i)};var k=e._unloaders=[];e.unloaded=function(){for(;k.length;)k.pop().call()};e._onto=function(t,w,u){t.push(u?g(w,u):w)};e._modulesLoaded=function(){};e.loadInit=function(t){t()};var m=function(t){return t.replace(/\./g,"/")};e.getL10nName=function(t,w,u){u=u?u.toLowerCase():e.locale;t="i18n!"+m(t);return/root/i.test(u)?t+"/nls/"+w:t+"/nls/"+u+"/"+w};e.requireLocalization=function(t,w,u){if(c.vendor!="altoviso.com")u=!u||u.toLowerCase()===
e.locale?"root":u;return c(e.getL10nName(t,w,u))};e.i18n={getLocalization:e.requireLocalization,normalizeLocale:function(t){t=t?t.toLowerCase():e.locale;if(t=="root")t="ROOT";return t}};var o=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,v=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;e._Url=function(){for(var t=arguments,w=[t[0]],u=1;u<t.length;u++)if(t[u]){var s=new e._Url(t[u]+"");w=new e._Url(w[0]+"");if(s.path==""&&!s.scheme&&!s.authority&&!s.query){if(s.fragment!=
null)w.fragment=s.fragment;s=w}else if(!s.scheme){s.scheme=w.scheme;if(!s.authority){s.authority=w.authority;if(s.path.charAt(0)!="/"){w=(w.path.substring(0,w.path.lastIndexOf("/")+1)+s.path).split("/");for(var q=0;q<w.length;q++)if(w[q]==".")if(q==w.length-1)w[q]="";else{w.splice(q,1);q--}else if(q>0&&!(q==1&&w[0]=="")&&w[q]==".."&&w[q-1]!="..")if(q==w.length-1){w.splice(q,1);w[q-1]=""}else{w.splice(q-1,2);q-=2}s.path=w.join("/")}}}w=[];s.scheme&&w.push(s.scheme,":");s.authority&&w.push("//",s.authority);
w.push(s.path);s.query&&w.push("?",s.query);s.fragment&&w.push("#",s.fragment)}this.uri=w.join("");u=this.uri.match(o);this.scheme=u[2]||(u[1]?"":null);this.authority=u[4]||(u[3]?"":null);this.path=u[5];this.query=u[7]||(u[6]?"":null);this.fragment=u[9]||(u[8]?"":null);if(this.authority!=null){u=this.authority.match(v);this.user=u[3]||null;this.password=u[4]||null;this.host=u[6]||u[7];this.port=u[9]||null}};e._Url.prototype.toString=function(){return this.uri};e.moduleUrl=function(t,w){if(!t)return null;
t=m(t)+(w?"/"+w:"");w="";var u=t.match(/(.+)(\.[^\/]*)$/);if(u){t=u[1];w=u[2]}return new e._Url(c.nameToUrl(t,w))};return e});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(c){if(typeof window!="undefined"){c.isBrowser=true;c._name="browser";(function(){var a=c;if(document&&document.getElementsByTagName)for(var b=document.getElementsByTagName("script"),d=/dojo(\.xd)?\.js(\W|$)/i,f=0;f<b.length;f++){var g=b[f].getAttribute("src");if(g){var j=g.match(d);if(j){if(!a.config.baseUrl)a.config.baseUrl=g.substring(0,j.index);if(b=b[f].getAttribute("djConfig")||b[f].getAttribute("data-dojo-config")){b=
eval("({ "+b+" })");for(var i in b)c.config[i]=b[i]}break}}}a.baseUrl=a.config.baseUrl;i=navigator;b=i.userAgent;d=i.appVersion;f=parseFloat(d);if(b.indexOf("Opera")>=0)a.isOpera=f;if(b.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=d.indexOf("Konqueror")>=0?f:0;a.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;a.isMac=d.indexOf("Macintosh")>=0;if((g=Math.max(d.indexOf("WebKit"),d.indexOf("Safari"),0))&&!c.isChrome){a.isSafari=parseFloat(d.split("Version/")[1]);
if(!a.isSafari||parseFloat(d.substr(g+7))<=419.3)a.isSafari=2}if(b.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=f;if(a.isMoz)a.isFF=parseFloat(b.split("Firefox/")[1]||b.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(d.split("MSIE ")[1])||undefined;if((b=document.documentMode)&&b!=5&&Math.floor(a.isIE)!=b)a.isIE=b}if(c.isIE&&window.location.protocol==="file:")c.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
c.config.locale||(a.isIE?i.userLanguage:i.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var u,s;if(!c.isIE||!c.config.ieForceActiveXXhr)try{u=new XMLHttpRequest}catch(q){}if(!u)for(var x=0;x<3;++x){var A=a._XMLHTTP_PROGIDS[x];try{u=new ActiveXObject(A)}catch(D){s=D}if(u){a._XMLHTTP_PROGIDS=[A];break}}if(!u)throw new Error("XMLHTTP not available: "+s);return u};a._isDocumentOk=function(u){u=u.status||0;var s=location.protocol;
return u>=200&&u<300||u==304||u==1223||!u&&(s=="file:"||s=="chrome:"||s=="chrome-extension:"||s=="app:")};var k=window.location+"";var m=(i=document.getElementsByTagName("base"))&&i.length>0;a._getText=function(u,s){var q=a._xhrObj();if(!m&&c._Url)u=(new c._Url(k,u)).toString();if(a.config.cacheBust){u+="";u+=(u.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}q.open("GET",u,false);try{q.send(null);if(!a._isDocumentOk(q)){var x=Error("Unable to load "+u+" status:"+q.status);
x.status=q.status;x.responseText=q.responseText;throw x;}}catch(A){if(s)return null;throw A;}return q.responseText};var o=window,v=function(u,s){var q=o.attachEvent||o.addEventListener;u=o.attachEvent?u:u.substring(2);q(u,function(){s.apply(o,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var u=a._windowUnloaders;u.length;)u.pop()();a=null};var t=0;a.addOnWindowUnload=function(u,s){a._onto(a._windowUnloaders,u,s);if(!t){t=1;v("onunload",a.windowUnloaded)}};var w=0;a.addOnUnload=
function(u,s){a._onto(a._unloaders,u,s);if(!w){w=1;v("onbeforeunload",c.unloaded)}}})();c._initFired=false;c._loadInit=function(){if(c._scrollIntervalId){clearInterval(c._scrollIntervalId);c._scrollIntervalId=0}if(!c._initFired){c._initFired=true;!c.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",c._loadInit);c._inFlightCount==0&&c._modulesLoaded()}};if(!c.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",c._loadInit,false);window.addEventListener("load",
c._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",c._loadInit);if(!c.config.skipIeDomLoaded&&self===self.top)c._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");c._loadInit()}}catch(a){}},30)}if(c.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],b=0,d=1,f=document.createStyleSheet();if(c.isIE>=8){b=
1;d=a.length}for(;b<d;++b)f.addRule("v\\:"+a[b],"behavior:url(#default#VML); display:inline-block")})()}catch(e){}}(function(){var a=c.config.modulePaths;if(a)for(var b in a)c.registerModulePath(b,a[b])})();c.config.isDebug&&c.require("dojo._firebug.firebug");if(c.config.debugAtAllCosts){c.require("dojo._base._loader.loader_debug");c.require("dojo.i18n")}return c});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(c){return dojo=c});
define("dojo/_base/lang",["dojo/lib/kernel"],function(c){(function(){var e=Object.prototype.toString;c.isString=function(i){return typeof i=="string"||i instanceof String};c.isArray=function(i){return i&&(i instanceof Array||typeof i=="array")};c.isFunction=function(i){return e.call(i)==="[object Function]"};c.isObject=function(i){return i!==undefined&&(i===null||typeof i=="object"||c.isArray(i)||c.isFunction(i))};c.isArrayLike=function(i){return i&&i!==undefined&&!c.isString(i)&&!c.isFunction(i)&&
!(i.tagName&&i.tagName.toLowerCase()=="form")&&(c.isArray(i)||isFinite(i.length))};c.isAlien=function(i){return i&&!c.isFunction(i)&&/\{\s*\[native code\]\s*\}/.test(String(i))};c.extend=function(i){for(var k=1,m=arguments.length;k<m;k++)c._mixin(i.prototype,arguments[k]);return i};c._hitchArgs=function(i,k){var m=c._toArray(arguments,2),o=c.isString(k);return function(){var v=c._toArray(arguments),t=o?(i||c.global)[k]:k;return t&&t.apply(i||this,m.concat(v))}};c.hitch=function(i,k){if(arguments.length>
2)return c._hitchArgs.apply(c,arguments);if(!k){k=i;i=null}if(c.isString(k)){i=i||c.global;if(!i[k])throw['dojo.hitch: scope["',k,'"] is null (scope="',i,'")'].join("");return function(){return i[k].apply(i,arguments||[])}}return!i?k:function(){return k.apply(i,arguments||[])}};c.delegate=c._delegate=function(){function i(){}return function(k,m){i.prototype=k;k=new i;i.prototype=null;m&&c._mixin(k,m);return k}}();var a=function(i,k,m){return(m||[]).concat(Array.prototype.slice.call(i,k||0))},b=function(i,
k,m){m=m||[];for(k=k||0;k<i.length;k++)m.push(i[k]);return m};c._toArray=c.isIE?function(i){return(i.item?b:a).apply(this,arguments)}:a;c.partial=function(){return c.hitch.apply(c,[null].concat(c._toArray(arguments)))};var d=c._extraNames,f=d.length,g={};c.clone=function(i){if(!i||typeof i!="object"||c.isFunction(i))return i;if(i.nodeType&&"cloneNode"in i)return i.cloneNode(true);if(i instanceof Date)return new Date(i.getTime());if(i instanceof RegExp)return new RegExp(i);var k,m,o,v;if(c.isArray(i)){k=
[];m=0;for(o=i.length;m<o;++m)m in i&&k.push(c.clone(i[m]))}else k=i.constructor?new i.constructor:{};for(v in i){o=i[v];if(!(v in k)||k[v]!==o&&(!(v in g)||g[v]!==o))k[v]=c.clone(o)}if(f)for(m=0;m<f;++m){v=d[m];o=i[v];if(!(v in k)||k[v]!==o&&(!(v in g)||g[v]!==o))k[v]=o}return k};c.trim=String.prototype.trim?function(i){return i.trim()}:function(i){return i.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var j=/\{([^\}]+)\}/g;c.replace=function(i,k,m){return i.replace(m||j,c.isFunction(k)?k:function(o,
v){return c.getObject(v,false,k)})}})();return c});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(c){(function(){var e=function(b,d,f){return[typeof b=="string"?b.split(""):b,d||c.global,typeof f=="string"?new Function("item","index","array",f):f]},a=function(b,d,f,g){var j=e(d,g,f);d=j[0];f=0;for(g=d.length;f<g;++f){var i=!!j[2].call(j[1],d[f],f,d);if(b^i)return i}return b};c.mixin(c,{indexOf:function(b,d,f,g){var j=1,i=b.length||0,k=0;if(g){k=i-1;j=i=-1}if(f!=undefined)k=f;if(g&&k>i||k<i)for(;k!=i;k+=j)if(b[k]==d)return k;
return-1},lastIndexOf:function(b,d,f){return c.indexOf(b,d,f,true)},forEach:function(b,d,f){if(b&&b.length){var g=e(b,f,d);b=g[0];d=0;for(f=b.length;d<f;++d)g[2].call(g[1],b[d],d,b)}},every:function(b,d,f){return a(true,b,d,f)},some:function(b,d,f){return a(false,b,d,f)},map:function(b,d,f,g){var j=e(b,f,d);b=j[0];d=g?new g:[];f=0;for(g=b.length;f<g;++f)d.push(j[2].call(j[1],b[f],f,b));return d},filter:function(b,d,f){var g=e(b,f,d);b=g[0];d=[];f=0;for(var j=b.length;f<j;++f)g[2].call(g[1],b[f],f,
b)&&d.push(b[f]);return d}})})();return c});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(c){(function(){function e(l,n){throw new Error("declare"+(n?" "+n:"")+": "+l);}function a(l,n){for(var p=[],r=[{cls:0,refs:[]}],y={},B=1,z=l.length,E=0,G,M,H,N,L;E<z;++E){if(G=l[E])x.call(G)!="[object Function]"&&e("mixin #"+E+" is not a callable constructor.",n);else e("mixin #"+E+" is unknown. Did you use dojo.require to pull it in?",n);M=G._meta?G._meta.bases:[G];H=0;for(G=M.length-1;G>=0;--G){N=M[G].prototype;
if(!N.hasOwnProperty("declaredClass"))N.declaredClass="uniqName_"+D++;N=N.declaredClass;if(!y.hasOwnProperty(N)){y[N]={count:0,refs:[],cls:M[G]};++B}N=y[N];if(H&&H!==N){N.refs.push(H);++H.count}H=N}++H.count;r[0].refs.push(H)}for(;r.length;){H=r.pop();p.push(H.cls);for(--B;L=H.refs,L.length==1;){H=L[0];if(!H||--H.count){H=0;break}p.push(H.cls);--B}if(H){E=0;for(z=L.length;E<z;++E){H=L[E];--H.count||r.push(H)}}}B&&e("can't build consistent linearization",n);G=l[0];p[0]=G?G._meta&&G===p[p.length-G._meta.bases.length]?
G._meta.bases.length:1:0;return p}function b(l,n,p){var r,y,B,z,E,G,M,H=this._inherited=this._inherited||{};if(typeof l=="string"){r=l;l=n;n=p}p=0;z=l.callee;(r=r||z.nom)||e("can't deduce a name to call inherited()",this.declaredClass);E=this.constructor._meta;B=E.bases;M=H.p;if(r!=h){if(H.c!==z){M=0;G=B[0];E=G._meta;if(E.hidden[r]!==z){(y=E.chains)&&typeof y[r]=="string"&&e("calling chained method with inherited: "+r,this.declaredClass);do{E=G._meta;y=G.prototype;if(E&&(y[r]===z&&y.hasOwnProperty(r)||
E.hidden[r]===z))break}while(G=B[++M]);M=G?M:-1}}if(G=B[++M]){y=G.prototype;if(G._meta&&y.hasOwnProperty(r))p=y[r];else{z=q[r];do{y=G.prototype;if((p=y[r])&&(G._meta?y.hasOwnProperty(r):p!==z))break}while(G=B[++M])}}p=G&&p||q[r]}else{if(H.c!==z){M=0;if((E=B[0]._meta)&&E.ctor!==z){y=E.chains;if(!y||y.constructor!=="manual")e("calling chained constructor with inherited",this.declaredClass);for(;G=B[++M];)if((E=G._meta)&&E.ctor===z)break;M=G?M:-1}}for(;G=B[++M];)if(p=(E=G._meta)?E.ctor:G)break;p=G&&
p}H.c=p;H.p=M;if(p)return n===true?p:p.apply(this,n||l)}function d(l,n){if(typeof l=="string")return this.inherited(l,n,true);return this.inherited(l,true)}function f(l){for(var n=this.constructor._meta.bases,p=0,r=n.length;p<r;++p)if(n[p]===l)return true;return this instanceof l}function g(l,n){var p,r=0,y=u._extraNames.length;for(p in n)if(p!=h&&n.hasOwnProperty(p))l[p]=n[p];for(;r<y;++r){p=u._extraNames[r];if(p!=h&&n.hasOwnProperty(p))l[p]=n[p]}}function j(l,n){var p,r,y=0,B=u._extraNames.length;
for(p in n){r=n[p];if((r!==q[p]||!(p in q))&&p!=h){if(x.call(r)=="[object Function]")r.nom=p;l[p]=r}}for(;y<B;++y){p=u._extraNames[y];r=n[p];if((r!==q[p]||!(p in q))&&p!=h){if(x.call(r)=="[object Function]")r.nom=p;l[p]=r}}return l}function i(l){j(this.prototype,l);return this}function k(l,n){return function(){var p=arguments,r=p,y=p[0],B,z;z=l.length;var E;if(!(this instanceof p.callee))return w(p);if(n&&(y&&y.preamble||this.preamble)){E=new Array(l.length);E[0]=p;for(B=0;;){if(y=p[0])if(y=y.preamble)p=
y.apply(this,p)||p;y=l[B].prototype;if(y=y.hasOwnProperty("preamble")&&y.preamble)p=y.apply(this,p)||p;if(++B==z)break;E[B]=p}}for(B=z-1;B>=0;--B){y=l[B];if(y=(z=y._meta)?z.ctor:y)y.apply(this,E?E[B]:p)}(y=this.postscript)&&y.apply(this,r)}}function m(l,n){return function(){var p=arguments,r=p,y=p[0];if(!(this instanceof p.callee))return w(p);if(n){if(y)if(y=y.preamble)r=y.apply(this,r)||r;(y=this.preamble)&&y.apply(this,r)}l&&l.apply(this,p);(y=this.postscript)&&y.apply(this,p)}}function o(l){return function(){var n=
arguments,p=0,r,y;if(!(this instanceof n.callee))return w(n);for(;r=l[p];++p)if(r=(y=r._meta)?y.ctor:r){r.apply(this,n);break}(r=this.postscript)&&r.apply(this,n)}}function v(l,n,p){return function(){var r,y,B=0,z=1;if(p){B=n.length-1;z=-1}for(;r=n[B];B+=z){y=r._meta;(r=(y?y.hidden:r.prototype)[l])&&r.apply(this,arguments)}}}function t(l){A.prototype=l.prototype;l=new A;A.prototype=null;return l}function w(l){var n=l.callee,p=t(n);n.apply(p,l);return p}var u=c,s=u._mixin,q=Object.prototype,x=q.toString,
A=new Function,D=0,h="constructor";u.declare=function(l,n,p){if(typeof l!="string"){p=n;n=l;l=""}p=p||{};var r,y,B,z,E,G,M,H=1,N=n;if(x.call(n)=="[object Array]"){G=a(n,l);B=G[0];H=G.length-B;n=G[H]}else{G=[0];if(n)if(x.call(n)=="[object Function]"){B=n._meta;G=G.concat(B?B.bases:n)}else e("base class is not a callable constructor.",l);else n!==null&&e("unknown base class. Did you use dojo.require to pull it in?",l)}if(n)for(y=H-1;;--y){r=t(n);if(!y)break;B=G[y];(B._meta?g:s)(r,B.prototype);z=new Function;
z.superclass=n;z.prototype=r;n=r.constructor=z}else r={};j(r,p);B=p.constructor;if(B!==q.constructor){B.nom=h;r.constructor=B}for(y=H-1;y;--y)if((B=G[y]._meta)&&B.chains)M=s(M||{},B.chains);if(r["-chains-"])M=s(M||{},r["-chains-"]);B=!M||!M.hasOwnProperty(h);G[0]=z=M&&M.constructor==="manual"?o(G):G.length==1?m(p.constructor,B):k(G,B);z._meta={bases:G,hidden:p,chains:M,parents:N,ctor:p.constructor};z.superclass=n&&n.prototype;z.extend=i;z.prototype=r;r.constructor=z;r.getInherited=d;r.inherited=b;
r.isInstanceOf=f;if(l){r.declaredClass=l;u.setObject(l,z)}if(M)for(E in M)if(r[E]&&typeof M[E]=="string"&&E!=h){B=r[E]=v(E,G,M[E]==="after");B.nom=E}return z};u.safeMixin=j})();return c.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(c){c._listener={getDispatcher:function(){return function(){var e=Array.prototype,a=arguments.callee,b=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var d;b=[].concat(b);for(d in b)d in e||b[d].apply(this,arguments);return a}},add:function(e,a,b){e=e||c.global;var d=e[a];if(!d||!d._listeners){var f=c._listener.getDispatcher();f.target=d;f._listeners=[];d=e[a]=f}return d._listeners.push(b)},remove:function(e,a,b){(e=(e||
c.global)[a])&&e._listeners&&b--&&delete e._listeners[b]}};c.connect=function(){var e=arguments,a=[],b=0;a.push(c.isString(e[0])?null:e[b++],e[b++]);var d=e[b+1];a.push(c.isString(d)||c.isFunction(d)?e[b++]:null,e[b++]);for(d=e.length;b<d;b++)a.push(e[b]);return c._connect.apply(this,a)};c._connect=function(e,a,b,d){var f=c._listener;b=f.add(e,a,c.hitch(b,d));return[e,a,b,f]};c.disconnect=function(e){if(e&&e[0]!==undefined){c._disconnect.apply(this,e);delete e[0]}};c._disconnect=function(e,a,b,d){d.remove(e,
a,b)};c._topics={};c.subscribe=function(e,a,b){return[e,c._listener.add(c._topics,e,c.hitch(a,b))]};c.unsubscribe=function(e){e&&c._listener.remove(c._topics,e[0],e[1])};c.publish=function(e,a){if(e=c._topics[e])e.apply(this,a||[])};c.connectPublisher=function(e,a,b){var d=function(){c.publish(e,arguments)};return b?c.connect(a,b,d):c.connect(a,d)};return c.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(c){(function(){var e=function(){},a=Object.freeze||function(){},b=function(){var d,f,g,j,i=false,k=function(){};return function(m){if(i)if(d){f.next={task:m,next:null};f=f.next}else f=d={task:m,next:null};else{i=true;do try{for(;m;){m();if(g){if(d)f.next=g;else d=g;f=j}if(d){g=d.next;j=f;m=d.task;d=f=null}else m=null}i=false}catch(o){m=k;console.error(o)}while(i)}}}();c.Deferred=function(d){function f(w){if(i)throw new Error("This deferred has already been resolved");
j=w;i=true;b(g)}function g(){for(var w;!w&&o;){var u=o;o=o.next;if(w=u.progress==e)i=false;var s=k?u.error:u.resolved;if(s)try{var q=s(j);if(q&&typeof q.then==="function")q.then(c.hitch(u.deferred,"resolve"),c.hitch(u.deferred,"reject"),c.hitch(u.deferred,"progress"));else{s=w&&q===undefined;if(w&&!s)k=q instanceof Error;u.deferred[s&&k?"reject":"resolve"](s?j:q)}}catch(x){u.deferred.reject(x)}else k?u.deferred.reject(j):u.deferred.resolve(j)}}var j,i,k,m,o,v=this.promise={};this.resolve=this.callback=
function(w){this.fired=0;this.results=[w,null];f(w)};this.reject=this.errback=function(w){k=true;this.fired=1;f(w);this.results=[null,w];if(!w||w.log!==false)(c.config.deferredOnError||function(u){console.error(u)})(w)};this.progress=function(w){for(var u=o;u;){var s=u.progress;s&&s(w);u=u.next}};this.addCallbacks=function(w,u){this.then(w,u,e);return this};this.then=v.then=function(w,u,s){var q=s==e?this:new c.Deferred(v.cancel);w={resolved:w,error:u,progress:s,deferred:q};if(o)m=m.next=w;else o=
m=w;i&&b(g);return q.promise};var t=this;this.cancel=v.cancel=function(){if(!i){var w=d&&d(t);if(!i){w instanceof Error||(w=new Error(w));w.log=false;t.reject(w)}}};a(v)};c.extend(c.Deferred,{addCallback:function(){return this.addCallbacks(c.hitch.apply(c,arguments))},addErrback:function(){return this.addCallbacks(null,c.hitch.apply(c,arguments))},addBoth:function(){var d=c.hitch.apply(c,arguments);return this.addCallbacks(d,d)},fired:-1})})();c.when=function(e,a,b,d){if(e&&typeof e.then==="function")return e.then(a,
b,d);return a(e)};return c.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(c){c.fromJson=function(e){return eval("("+e+")")};c._escapeString=function(e){return('"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};c.toJsonIndentStr="\t";c.toJson=function(e,a,b){if(e===undefined)return"undefined";var d=typeof e;if(d=="number"||d=="boolean")return e+"";if(e===null)return"null";if(c.isString(e))return c._escapeString(e);var f=
arguments.callee,g;b=b||"";var j=a?b+c.toJsonIndentStr:"";g=e.__json__||e.json;if(c.isFunction(g)){g=g.call(e);if(e!==g)return f(g,a,j)}if(e.nodeType&&e.cloneNode)throw new Error("Can't serialize DOM nodes");g=a?" ":"";var i=a?"\n":"";if(c.isArray(e))return"["+c.map(e,function(v){v=f(v,a,j);if(typeof v!="string")v="undefined";return i+j+v}).join(","+g)+i+b+"]";if(d=="function")return null;d=[];var k;for(k in e){var m,o;if(typeof k=="number")m='"'+k+'"';else if(typeof k=="string")m=c._escapeString(k);
else continue;o=f(e[k],a,j);typeof o=="string"&&d.push(i+j+m+":"+g+o)}return"{"+d.join(","+g)+i+b+"}"};return c});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(c){(function(){c.Color=function(e){e&&this.setColor(e)};c.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:c.config.transparentColor||[255,255,255]};c.extend(c.Color,
{r:255,g:255,b:255,a:1,_set:function(e,a,b,d){this.r=e;this.g=a;this.b=b;this.a=d},setColor:function(e){if(c.isString(e))c.colorFromString(e,this);else if(c.isArray(e))c.colorFromArray(e,this);else{this._set(e.r,e.g,e.b,e.a);e instanceof c.Color||this.sanitize()}return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+c.map(["r","g","b"],function(e){e=this[e].toString(16);return e.length<
2?"0"+e:e},this).join("")},toCss:function(e){var a=this.r+", "+this.g+", "+this.b;return(e?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});c.blendColors=function(e,a,b,d){var f=d||new c.Color;c.forEach(["r","g","b","a"],function(g){f[g]=e[g]+(a[g]-e[g])*b;if(g!="a")f[g]=Math.round(f[g])});return f.sanitize()};c.colorFromRgb=function(e,a){return(e=e.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&c.colorFromArray(e[1].split(/\s*,\s*/),a)};c.colorFromHex=function(e,
a){var b=a||new c.Color,d=e.length==4?4:8,f=(1<<d)-1;e=Number("0x"+e.substr(1));if(isNaN(e))return null;c.forEach(["b","g","r"],function(g){var j=e&f;e>>=d;b[g]=d==4?17*j:j});b.a=1;return b};c.colorFromArray=function(e,a){a=a||new c.Color;a._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};c.colorFromString=function(e,a){var b=c.Color.named[e];return b&&c.colorFromArray(b,a)||c.colorFromRgb(e,a)||c.colorFromHex(e,a)}})();return c.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(c){c.doc=window.document||null;c.body=function(){return c.doc.body||c.doc.getElementsByTagName("body")[0]};c.setContext=function(e,a){c.global=e;c.doc=a};c.withGlobal=function(e,a,b,d){var f=c.global;try{c.global=e;return c.withDoc.call(null,e.document,a,b,d)}finally{c.global=f}};c.withDoc=function(e,a,b,d){var f=c.doc,g=c._bodyLtr,j=c.isQuirks;try{c.doc=e;delete c._bodyLtr;c.isQuirks=c.doc.compatMode=="BackCompat";if(b&&typeof a=="string")a=
b[a];return a.apply(b,d||[])}finally{c.doc=f;delete c._bodyLtr;if(g!==undefined)c._bodyLtr=g;c.isQuirks=j}};return c});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(c){(function(){var e=c._event_listener={add:function(i,k,m){if(i){k=e._normalizeEventName(k);m=e._fixCallback(k,m);if(!c.isIE&&(k=="mouseenter"||k=="mouseleave")){var o=m;k=k=="mouseenter"?"mouseover":"mouseout";m=function(v){if(!c.isDescendant(v.relatedTarget,i))return o.call(this,v)}}i.addEventListener(k,m,false);return m}},remove:function(i,k,m){if(i){k=e._normalizeEventName(k);if(!c.isIE&&(k=="mouseenter"||k=="mouseleave"))k=
k=="mouseenter"?"mouseover":"mouseout";i.removeEventListener(k,m,false)}},_normalizeEventName:function(i){return i.slice(0,2)=="on"?i.slice(2):i},_fixCallback:function(i,k){return i!="keypress"?k:function(m){return k.call(this,e._fixEvent(m,this))}},_fixEvent:function(i){switch(i.type){case "keypress":e._setKeyChar(i);break}return i},_setKeyChar:function(i){i.keyChar=i.charCode>=32?String.fromCharCode(i.charCode):"";i.charOrCode=i.keyChar||i.keyCode},_punctMap:{106:42,111:47,186:59,187:43,188:44,
189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}};c.fixEvent=function(i,k){return e._fixEvent(i,k)};c.stopEvent=function(i){i.preventDefault();i.stopPropagation()};var a=c._listener;c._connect=function(i,k,m,o,v){v=i&&(i.nodeType||i.attachEvent||i.addEventListener)?v?2:1:0;m=[c._listener,e,a][v].add(i,k,c.hitch(m,o));return[i,k,m,v]};c._disconnect=function(i,k,m,o){[c._listener,e,a][o].remove(i,k,m)};c.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:c.isSafari?91:224,
PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,
F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:c.isMac&&!c.isAIR?c.isSafari?91:224:17};var b=c.isMac?"metaKey":"ctrlKey";c.isCopyKey=function(i){return i[b]};c.mouseButtons=c.isIE<9||c.isIE&&c.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(i,k){return i.button&k},isLeft:function(i){return i.button&1},isMiddle:function(i){return i.button&4},isRight:function(i){return i.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(i,k){return i.button==k},isLeft:function(i){return i.button==
0},isMiddle:function(i){return i.button==1},isRight:function(i){return i.button==2}};if(c.isIE){var d=function(i,k){try{return i.keyCode=k}catch(m){return 0}},f=c._listener,g=c._ieListenersName="_"+c._scopeName+"_listeners";if(!c.config._allow_leaks){a=f=c._ie_listener={handlers:[],add:function(i,k,m){i=i||c.global;var o=i[k];if(!o||!o[g]){var v=c._getIeDispatcher();v.target=o&&j.push(o)-1;v[g]=[];o=i[k]=v}return o[g].push(j.push(m)-1)},remove:function(i,k,m){k=(i=(i||c.global)[k])&&i[g];if(i&&k&&
m--){delete j[k[m]];delete k[m]}}};var j=f.handlers}c.mixin(e,{add:function(i,k,m){if(i){k=e._normalizeEventName(k);if(k=="onkeypress"){var o=i.onkeydown;if(!o||!o[g]||!o._stealthKeydownHandle){var v=e.add(i,"onkeydown",e._stealthKeyDown);o=i.onkeydown;o._stealthKeydownHandle=v;o._stealthKeydownRefs=1}else o._stealthKeydownRefs++}return f.add(i,k,e._fixCallback(m))}},remove:function(i,k,m){k=e._normalizeEventName(k);f.remove(i,k,m);if(k=="onkeypress"){k=i.onkeydown;if(--k._stealthKeydownRefs<=0){f.remove(i,
"onkeydown",k._stealthKeydownHandle);delete k._stealthKeydownHandle}}},_normalizeEventName:function(i){return i.slice(0,2)!="on"?"on"+i:i},_nop:function(){},_fixEvent:function(i,k){if(!i)i=(k&&(k.ownerDocument||k.document||k).parentWindow||window).event;if(!i)return i;i.target=i.srcElement;i.currentTarget=k||i.srcElement;i.layerX=i.offsetX;i.layerY=i.offsetY;k=(k=i.srcElement)&&k.ownerDocument||document;k=c.isIE<6||k.compatMode=="BackCompat"?k.body:k.documentElement;var m=c._getIeDocumentElementOffset();
i.pageX=i.clientX+c._fixIeBiDiScrollLeft(k.scrollLeft||0)-m.x;i.pageY=i.clientY+(k.scrollTop||0)-m.y;if(i.type=="mouseover")i.relatedTarget=i.fromElement;if(i.type=="mouseout")i.relatedTarget=i.toElement;if(c.isIE<9||c.isQuirks){i.stopPropagation=e._stopPropagation;i.preventDefault=e._preventDefault}return e._fixKeys(i)},_fixKeys:function(i){switch(i.type){case "keypress":var k="charCode"in i?i.charCode:i.keyCode;if(k==10){k=0;i.keyCode=13}else if(k==13||k==27)k=0;else if(k==3)k=99;i.charCode=k;e._setKeyChar(i);
break}return i},_stealthKeyDown:function(i){var k=i.currentTarget.onkeypress;if(k&&k[g]){var m=i.keyCode,o=(m!=13||c.isIE>=9&&!c.isQuirks)&&m!=32&&m!=27&&(m<48||m>90)&&(m<96||m>111)&&(m<186||m>192)&&(m<219||m>222);if(o||i.ctrlKey){o=o?0:m;if(i.ctrlKey)if(m==3||m==13)return;else if(o>95&&o<106)o-=48;else if(!i.shiftKey&&o>=65&&o<=90)o+=32;else o=e._punctMap[o]||o;m=e._synthesizeEvent(i,{type:"keypress",faux:true,charCode:o});k.call(i.currentTarget,m);if(c.isIE<9||c.isIE&&c.isQuirks)i.cancelBubble=
m.cancelBubble;i.returnValue=m.returnValue;d(i,m.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&d(this,0);this.returnValue=false}});c.stopEvent=c.isIE<9||c.isQuirks?function(i){i=i||window.event;e._stopPropagation.call(i);e._preventDefault.call(i)}:c.stopEvent}e._synthesizeEvent=function(i,k){k=c.mixin({},i,k);e._setKeyChar(k);k.preventDefault=function(){i.preventDefault()};k.stopPropagation=function(){i.stopPropagation()};
return k};c.isOpera&&c.mixin(e,{_fixEvent:function(i){switch(i.type){case "keypress":var k=i.which;if(k==3)k=99;k=k<41&&!i.shiftKey?0:k;if(i.ctrlKey&&!i.shiftKey&&k>=65&&k<=90)k+=32;return e._synthesizeEvent(i,{charCode:k})}return i}});if(c.isWebKit){e._add=e.add;e._remove=e.remove;c.mixin(e,{add:function(i,k,m){if(i){var o=e._add(i,k,m);if(e._normalizeEventName(k)=="keypress")o._stealthKeyDownHandle=e._add(i,"keydown",function(v){var t=v.keyCode,w=t!=13&&t!=32&&(t<48||t>90)&&(t<96||t>111)&&(t<186||
t>192)&&(t<219||t>222);if(w||v.ctrlKey){w=w?0:t;if(v.ctrlKey)if(t==3||t==13)return;else if(w>95&&w<106)w-=48;else if(!v.shiftKey&&w>=65&&w<=90)w+=32;else w=e._punctMap[w]||w;t=e._synthesizeEvent(v,{type:"keypress",faux:true,charCode:w});m.call(v.currentTarget,t)}});return o}},remove:function(i,k,m){if(i){m._stealthKeyDownHandle&&e._remove(i,"keydown",m._stealthKeyDownHandle);e._remove(i,k,m)}},_fixEvent:function(i){switch(i.type){case "keypress":if(i.faux)return i;var k=i.charCode;k=k>=32?k:0;return e._synthesizeEvent(i,
{charCode:k,faux:true})}return i}})}})();if(c.isIE){c._ieDispatcher=function(e,a){var b=Array.prototype,d=c._ie_listener.handlers,f=e.callee,g=f[c._ieListenersName];f=(f=d[f.target])&&f.apply(a,e);g=[].concat(g);for(var j in g){var i=d[g[j]];!(j in b)&&i&&i.apply(a,e)}return f};c._getIeDispatcher=function(){return new Function(c._scopeName+"._ieDispatcher(arguments, this)")};c._event_listener._fixCallback=function(e){var a=c._event_listener._fixEvent;return function(b){return e.call(this,a(b,this))}}}return c.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(c){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}c.byId=c.isIE?function(a,b){if(typeof a!="string")return a;var d=b||c.doc;if((b=d.getElementById(a))&&(b.attributes.id.value==a||b.id==a))return b;else{var f=d.all[a];if(!f||f.nodeName)f=[f];for(var g=0;b=f[g++];)if(b.attributes&&b.attributes.id&&b.attributes.id.value==a||b.id==a)return b}}:function(a,b){return(typeof a=="string"?(b||c.doc).getElementById(a):
a)||null};(function(){var a=c.byId,b=null,d;c.addOnWindowUnload(function(){b=null});c._destroyElement=c.destroy=function(C){C=a(C);try{var F=C.ownerDocument;if(!b||d!=F){b=F.createElement("div");d=F}b.appendChild(C.parentNode?C.parentNode.removeChild(C):C);b.innerHTML=""}catch(K){}};c.isDescendant=function(C,F){try{C=a(C);for(F=a(F);C;){if(C==F)return true;C=C.parentNode}}catch(K){}return false};c.setSelectable=function(C,F){C=a(C);if(c.isMozilla)C.style.MozUserSelect=F?"":"none";else if(c.isKhtml||
c.isWebKit)C.style.KhtmlUserSelect=F?"auto":"none";else if(c.isIE){F=C.unselectable=F?"":"on";c.query("*",C).forEach("item.unselectable = '"+F+"'")}};var f=function(C,F){var K=F.parentNode;K&&K.insertBefore(C,F)},g=function(C,F){var K=F.parentNode;if(K)K.lastChild==F?K.appendChild(C):K.insertBefore(C,F.nextSibling)};c.place=function(C,F,K){F=a(F);if(typeof C=="string")C=/^\s*</.test(C)?c._toDom(C,F.ownerDocument):a(C);if(typeof K=="number"){var P=F.childNodes;!P.length||P.length<=K?F.appendChild(C):
f(C,P[K<0?0:K])}else switch(K){case "before":f(C,F);break;case "after":g(C,F);break;case "replace":F.parentNode.replaceChild(C,F);break;case "only":c.empty(F);F.appendChild(C);break;case "first":if(F.firstChild){f(C,F.firstChild);break}default:F.appendChild(C)}return C};c.boxModel="content-box";if(c.isIE)c.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var j;j=c.isWebKit?function(C){var F;if(C.nodeType==1){var K=C.ownerDocument.defaultView;F=K.getComputedStyle(C,null);if(!F&&
C.style){C.style.display="";F=K.getComputedStyle(C,null)}}return F||{}}:c.isIE?function(C){return C.nodeType==1?C.currentStyle:{}}:function(C){return C.nodeType==1?C.ownerDocument.defaultView.getComputedStyle(C,null):{}};c.getComputedStyle=j;c._toPixelValue=c.isIE?function(C,F){if(!F)return 0;if(F=="medium")return 4;if(F.slice&&F.slice(-2)=="px")return parseFloat(F);with(C){C=style.left;var K=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=F;F=style.pixelLeft}catch(P){F=0}style.left=
C;runtimeStyle.left=K}return F}:function(C,F){return parseFloat(F)||0};var i=c._toPixelValue,k=function(C,F){try{return C.filters.item("DXImageTransform.Microsoft.Alpha")}catch(K){return F?{}:null}};c._getOpacity=c.isIE<9?function(C){try{return k(C).Opacity/100}catch(F){return 1}}:function(C){return j(C).opacity};c._setOpacity=c.isIE<9?function(C,F){var K=F*100,P=F==1;C.style.zoom=P?"":1;if(k(C))k(C,1).Opacity=K;else{if(P)return F;C.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
K+")"}k(C,1).Enabled=!P;C.nodeName.toLowerCase()=="tr"&&c.query("> td",C).forEach(function(V){c._setOpacity(V,F)});return F}:function(C,F){return C.style.opacity=F};var m={left:true,top:true},o=/margin|padding|width|height|max|min|offset/,v=function(C,F,K){F=F.toLowerCase();if(c.isIE){if(K=="auto"){if(F=="height")return C.offsetHeight;if(F=="width")return C.offsetWidth}if(F=="fontweight")switch(K){case 700:return"bold";case 400:default:return"normal"}}F in m||(m[F]=o.test(F));return m[F]?i(C,K):K},
t=c.isIE?"styleFloat":"cssFloat",w={cssFloat:t,styleFloat:t,"float":t};c.style=function(C,F,K){var P=a(C),V=arguments.length,X=F=="opacity";F=w[F]||F;if(V==3)return X?c._setOpacity(P,K):(P.style[F]=K);if(V==2&&X)return c._getOpacity(P);X=j(P);if(V==2&&typeof F!="string"){for(var Y in F)c.style(C,Y,F[Y]);return X}return V==1?X:v(P,F,X[F]||P.style[F])};c._getPadExtents=function(C,F){F=F||j(C);var K=i(C,F.paddingLeft),P=i(C,F.paddingTop);return{l:K,t:P,w:K+i(C,F.paddingRight),h:P+i(C,F.paddingBottom)}};
c._getBorderExtents=function(C,F){F=F||j(C);var K=F.borderLeftStyle!="none"?i(C,F.borderLeftWidth):0,P=F.borderTopStyle!="none"?i(C,F.borderTopWidth):0;return{l:K,t:P,w:K+(F.borderRightStyle!="none"?i(C,F.borderRightWidth):0),h:P+(F.borderBottomStyle!="none"?i(C,F.borderBottomWidth):0)}};c._getPadBorderExtents=function(C,F){var K=F||j(C);F=c._getPadExtents(C,K);C=c._getBorderExtents(C,K);return{l:F.l+C.l,t:F.t+C.t,w:F.w+C.w,h:F.h+C.h}};c._getMarginExtents=function(C,F){F=F||j(C);var K=i(C,F.marginLeft),
P=i(C,F.marginTop),V=i(C,F.marginRight);C=i(C,F.marginBottom);if(c.isWebKit&&F.position!="absolute")V=K;return{l:K,t:P,w:K+V,h:P+C}};c._getMarginBox=function(C,F){var K=F||j(C);F=c._getMarginExtents(C,K);var P=C.offsetLeft-F.l,V=C.offsetTop-F.t,X=C.parentNode;if(c.isMoz){var Y=parseFloat(K.left);K=parseFloat(K.top);if(!isNaN(Y)&&!isNaN(K)){P=Y;V=K}else if(X&&X.style){Y=j(X);if(Y.overflow!="visible"){X=c._getBorderExtents(X,Y);P+=X.l;V+=X.t}}}else if(c.isOpera||c.isIE>7&&!c.isQuirks)if(X){X=c._getBorderExtents(X);
P-=X.l;V-=X.t}return{l:P,t:V,w:C.offsetWidth+F.w,h:C.offsetHeight+F.h}};c._getMarginSize=function(C,F){C=a(C);F=c._getMarginExtents(C,F||j(C));C=C.getBoundingClientRect();return{w:C.right-C.left+F.w,h:C.bottom-C.top+F.h}};c._getContentBox=function(C,F){var K=F||j(C);F=c._getPadExtents(C,K);K=c._getBorderExtents(C,K);var P=C.clientWidth;if(P){C=C.clientHeight;K.w=K.h=0}else{P=C.offsetWidth;C=C.offsetHeight}if(c.isOpera){F.l+=K.l;F.t+=K.t}return{l:F.l,t:F.t,w:P-F.w-K.w,h:C-F.h-K.h}};c._getBorderBox=
function(C,F){var K=F||j(C);F=c._getPadExtents(C,K);C=c._getContentBox(C,K);return{l:C.l-F.l,t:C.t-F.t,w:C.w+F.w,h:C.h+F.h}};c._setBox=function(C,F,K,P,V,X){X=X||"px";C=C.style;if(!isNaN(F))C.left=F+X;if(!isNaN(K))C.top=K+X;if(P>=0)C.width=P+X;if(V>=0)C.height=V+X};c._isButtonTag=function(C){return C.tagName=="BUTTON"||C.tagName=="INPUT"&&(C.getAttribute("type")||"").toUpperCase()=="BUTTON"};c._usesBorderBox=function(C){var F=C.tagName;return c.boxModel=="border-box"||F=="TABLE"||c._isButtonTag(C)};
c._setContentSize=function(C,F,K,P){if(c._usesBorderBox(C)){P=c._getPadBorderExtents(C,P);if(F>=0)F+=P.w;if(K>=0)K+=P.h}c._setBox(C,NaN,NaN,F,K)};c._setMarginBox=function(C,F,K,P,V,X){var Y=X||j(C);X=c._usesBorderBox(C)?u:c._getPadBorderExtents(C,Y);if(c.isWebKit)if(c._isButtonTag(C)){var ia=C.style;if(P>=0&&!ia.width)ia.width="4px";if(V>=0&&!ia.height)ia.height="4px"}Y=c._getMarginExtents(C,Y);if(P>=0)P=Math.max(P-X.w-Y.w,0);if(V>=0)V=Math.max(V-X.h-Y.h,0);c._setBox(C,F,K,P,V)};var u={l:0,t:0,w:0,
h:0};c.marginBox=function(C,F){C=a(C);var K=j(C);return!F?c._getMarginBox(C,K):c._setMarginBox(C,F.l,F.t,F.w,F.h,K)};c.contentBox=function(C,F){C=a(C);var K=j(C);return!F?c._getContentBox(C,K):c._setContentSize(C,F.w,F.h,K)};c._docScroll=function(){var C=c.global;return"pageXOffset"in C?{x:C.pageXOffset,y:C.pageYOffset}:(C=c.isQuirks?c.doc.body:c.doc.documentElement,{x:c._fixIeBiDiScrollLeft(C.scrollLeft||0),y:C.scrollTop||0})};c._isBodyLtr=function(){return"_bodyLtr"in c?c._bodyLtr:(c._bodyLtr=(c.body().dir||
c.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};c._getIeDocumentElementOffset=function(){var C=c.doc.documentElement;if(c.isIE<8){var F=C.getBoundingClientRect(),K=F.left;F=F.top;if(c.isIE<7){K+=C.clientLeft;F+=C.clientTop}return{x:K<0?0:K,y:F<0?0:F}}else return{x:0,y:0}};c._fixIeBiDiScrollLeft=function(C){var F=c.isIE;if(F&&!c._isBodyLtr()){var K=c.isQuirks,P=K?c.doc.body:c.doc.documentElement;if(F==6&&!K&&c.global.frameElement&&P.scrollHeight>P.clientHeight)C+=P.clientLeft;return F<8||
K?C+P.clientWidth-P.scrollWidth:-C}return C};c._abs=c.position=function(C,F){C=a(C);var K=c.body(),P=K.parentNode;C=C.getBoundingClientRect();C={x:C.left,y:C.top,w:C.right-C.left,h:C.bottom-C.top};if(c.isIE){P=c._getIeDocumentElementOffset();C.x-=P.x+(c.isQuirks?K.clientLeft+K.offsetLeft:0);C.y-=P.y+(c.isQuirks?K.clientTop+K.offsetTop:0)}else if(c.isFF==3){K=j(P);C.x-=i(P,K.marginLeft)+i(P,K.borderLeftWidth);C.y-=i(P,K.marginTop)+i(P,K.borderTopWidth)}if(F){F=c._docScroll();C.x+=F.x;C.y+=F.y}return C};
c.coords=function(C,F){C=a(C);var K=j(C);K=c._getMarginBox(C,K);F=c.position(C,F);K.x=F.x;K.y=F.y;return K};var s={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},q={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},x={innerHTML:1,className:1,htmlFor:c.isIE,value:1},A=function(C){return q[C.toLowerCase()]||C},D=function(C,F){return(C=C.getAttributeNode&&C.getAttributeNode(F))&&
C.specified};c.hasAttr=function(C,F){var K=F.toLowerCase();return x[s[K]||F]||D(a(C),q[K]||F)};var h={},l=0,n=c._scopeName+"attrid",p={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};c.attr=function(C,F,K){C=a(C);var P=arguments.length;if(P==2&&typeof F!="string"){for(var V in F)c.attr(C,V,F[V]);return C}var X=F.toLowerCase();V=s[X]||F;var Y=x[V];X=q[X]||F;if(P==3){if(V=="style"&&typeof K!="string")c.style(C,K);else if(V=="innerHTML")if(c.isIE&&C.tagName.toLowerCase()in p){c.empty(C);
C.appendChild(c._toDom(K,C.ownerDocument))}else C[V]=K;else if(c.isFunction(K)){P=c.attr(C,n);if(!P){P=l++;c.attr(C,n,P)}h[P]||(h[P]={});if(Y=h[P][V])c.disconnect(Y);else try{delete C[V]}catch(ia){}h[P][V]=c.connect(C,V,K)}else if(Y||typeof K=="boolean")C[V]=K;else C.setAttribute(X,K);return C}K=C[V];if(Y&&typeof K!="undefined")return K;if(V!="href"&&(typeof K=="boolean"||c.isFunction(K)))return K;return D(C,X)?C.getAttribute(X):null};c.removeAttr=function(C,F){a(C).removeAttribute(A(F))};c.getNodeProp=
function(C,F){C=a(C);var K=F.toLowerCase(),P=s[K]||F;if(P in C&&P!="href")return C[P];F=q[K]||F;return D(C,F)?C.getAttribute(F):null};c.create=function(C,F,K,P){var V=c.doc;if(K){K=a(K);V=K.ownerDocument}if(typeof C=="string")C=V.createElement(C);F&&c.attr(C,F);K&&c.place(C,K,P);return C};c.empty=c.isIE?function(C){C=a(C);for(var F;F=C.lastChild;)c.destroy(F)}:function(C){a(C).innerHTML=""};var r={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody",
"tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},y=/<\s*([\w\:]+)/,B={},z=0,E="__"+c._scopeName+"ToDomId";for(var G in r)if(r.hasOwnProperty(G)){var M=r[G];M.pre=G=="option"?'<select multiple="multiple">':"<"+M.join("><")+">";M.post="</"+M.reverse().join("></")+">"}c._toDom=function(C,F){F=F||c.doc;var K=F[E];if(!K){F[E]=K=++z+"";B[K]=F.createElement("div")}C+="";var P=C.match(y),V=P?P[1].toLowerCase():"";K=B[K];if(P&&r[V]){P=
r[V];K.innerHTML=P.pre+C+P.post;for(C=P.length;C;--C)K=K.firstChild}else K.innerHTML=C;if(K.childNodes.length==1)return K.removeChild(K.firstChild);for(C=F.createDocumentFragment();F=K.firstChild;)C.appendChild(F);return C};var H="className";c.hasClass=function(C,F){return(" "+a(C)[H]+" ").indexOf(" "+F+" ")>=0};var N=/\s+/,L=[""],R={},T=function(C){if(typeof C=="string"||C instanceof String)if(C.indexOf(" ")<0){L[0]=C;return L}else return C.split(N);return C||""};c.addClass=function(C,F){C=a(C);
F=T(F);var K=C[H],P;K=K?" "+K+" ":" ";P=K.length;for(var V=0,X=F.length,Y;V<X;++V)if((Y=F[V])&&K.indexOf(" "+Y+" ")<0)K+=Y+" ";if(P<K.length)C[H]=K.substr(1,K.length-2)};c.removeClass=function(C,F){C=a(C);var K;if(F!==undefined){F=T(F);K=" "+C[H]+" ";for(var P=0,V=F.length;P<V;++P)K=K.replace(" "+F[P]+" "," ");K=c.trim(K)}else K="";if(C[H]!=K)C[H]=K};c.replaceClass=function(C,F,K){C=a(C);R.className=C.className;c.removeClass(R,K);c.addClass(R,F);if(C.className!==R.className)C.className=R.className};
c.toggleClass=function(C,F,K){if(K===undefined)K=!c.hasClass(C,F);c[K?"addClass":"removeClass"](C,F)}})();return c});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(c){(function(){var e=Array.prototype,a=e.slice,b=e.concat,d=function(t,w,u){t.sort||(t=a.call(t,0));u=u||this._NodeListCtor||c._NodeListCtor;t.constructor=u;c._mixin(t,u.prototype);t._NodeListCtor=u;return w?t._stash(w):t},f=function(t,w,u){w=[0].concat(a.call(w,0));u=u||c.global;return function(s){w[0]=s;return t.apply(u,w)}},g=function(t,w){return function(){this.forEach(f(t,
arguments,w));return this}},j=function(t,w){return function(){return this.map(f(t,arguments,w))}},i=function(t,w,u){return function(){var s=arguments,q=f(t,s,u);if(w.call(u||c.global,s))return this.map(q);this.forEach(q);return this}},k=function(t){return t.length==1&&typeof t[0]=="string"},m=function(t){var w=t.parentNode;w&&w.removeChild(t)};c.NodeList=function(){return d(Array.apply(null,arguments))};var o=c._NodeListCtor=c.NodeList,v=o.prototype;o._wrap=v._wrap=d;o._adaptAsMap=j;o._adaptAsForEach=
g;o._adaptAsFilter=function(t,w){return function(){return this.filter(f(t,arguments,w))}};o._adaptWithCondition=i;c.forEach(["slice","splice"],function(t){var w=e[t];v[t]=function(){return this._wrap(w.apply(this,arguments),t=="slice"?this:null)}});c.forEach(["indexOf","lastIndexOf","every","some"],function(t){var w=c[t];v[t]=function(){return w.apply(c,[this].concat(a.call(arguments,0)))}});c.forEach(["attr","style"],function(t){v[t]=i(c[t],k)});c.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(t){v[t]=g(c[t])});c.extend(c.NodeList,{_normalize:function(t,w){var u=t.parse===true?true:false;if(typeof t.template=="string"){var s=t.templateFunc||c.string&&c.string.substitute;t=s?s(t.template,t):t}s=typeof t;if(s=="string"||s=="number"){t=c._toDom(t,w&&w.ownerDocument);t=t.nodeType==11?c._toArray(t.childNodes):[t]}else if(c.isArrayLike(t))c.isArray(t)||(t=c._toArray(t));else t=[t];if(u)t._runParse=true;return t},_cloneNode:function(t){return t.cloneNode(true)},
_place:function(t,w,u,s){if(!(w.nodeType!=1&&u=="only")){w=w;for(var q,x=t.length,A=x-1;A>=0;A--){var D=s?this._cloneNode(t[A]):t[A];if(t._runParse&&c.parser&&c.parser.parse){q||(q=w.ownerDocument.createElement("div"));q.appendChild(D);c.parser.parse(q);for(D=q.firstChild;q.firstChild;)q.removeChild(q.firstChild)}A==x-1?c.place(D,w,u):w.parentNode.insertBefore(D,w);w=D}}},_stash:function(t){this._parent=t;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var t=
c.isArray(this)?this:a.call(this,0),w=c.map(arguments,function(u){return u&&!c.isArray(u)&&(typeof NodeList!="undefined"&&u.constructor===NodeList||u.constructor===this._NodeListCtor)?a.call(u,0):u});return this._wrap(b.apply(t,w),this)},map:function(t,w){return this._wrap(c.map(this,t,w),this)},forEach:function(t,w){c.forEach(this,t,w);return this},coords:j(c.coords),position:j(c.position),place:function(t,w){var u=c.query(t)[0];return this.forEach(function(s){c.place(s,u,w)})},orphan:function(t){return(t?
c._filterQueryResult(this,t):this).forEach(m)},adopt:function(t,w){return c.query(t).place(this[0],w)._stash(this)},query:function(t){if(!t)return this;var w=this.map(function(u){return c.query(t,u).filter(function(s){return s!==undefined})});return this._wrap(b.apply([],w),this)},filter:function(t){var w=arguments,u=this,s=0;if(typeof t=="string"){u=c._filterQueryResult(this,w[0]);if(w.length==1)return u._stash(this);s=1}return this._wrap(c.filter(u,w[s],w[s+1]),this)},addContent:function(t,w){t=
this._normalize(t,this[0]);for(var u=0,s;s=this[u];u++)this._place(t,s,w,u>0);return this},instantiate:function(t,w){var u=c.isFunction(t)?t:c.getObject(t);w=w||{};return this.forEach(function(s){new u(w,s)})},at:function(){var t=new this._NodeListCtor;c.forEach(arguments,function(w){if(w<0)w=this.length+w;this[w]&&t.push(this[w])},this);return t._stash(this)}});o.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];c.forEach(o.events,function(t){var w="on"+t;v[w]=function(u,s){return this.connect(w,u,s)}})})();return c.NodeList});
(function(){var c=function(a){var b=a.trim,d=a.forEach,f=a._NodeListCtor=a.NodeList,g=function(){return a.doc},j=(a.isWebKit||a.isMozilla)&&g().compatMode=="BackCompat",i=g().firstChild.children?"children":"childNodes",k=false,m=function(){return true},o=function(J){J+=">~+".indexOf(J.slice(-1))>=0?" * ":" ";for(var I=function(qa,ta){return b(J.slice(qa,ta))},O=[],Q=-1,U=-1,Z=-1,fa=-1,S=-1,W=-1,aa=-1,da="",ca="",la,ga=0,ma=J.length,$=null,ea=null,oa=function(){if(aa>=0){var qa=aa==ga?null:I(aa,ga);
$[">~+".indexOf(qa)<0?"tag":"oper"]=qa;aa=-1}},ra=function(){if(W>=0){$.id=I(W,ga).replace(/\\/g,"");W=-1}},sa=function(){if(S>=0){$.classes.push(I(S+1,ga).replace(/\\/g,""));S=-1}},pa=function(){ra();oa();sa()},ua=function(){pa();fa>=0&&$.pseudos.push({name:I(fa+1,ga)});$.loops=$.pseudos.length||$.attrs.length||$.classes.length;$.oquery=$.query=I(la,ga);$.otag=$.tag=$.oper?null:$.tag||"*";if($.tag)$.tag=$.tag.toUpperCase();if(O.length&&O[O.length-1].oper){$.infixOper=O.pop();$.query=$.infixOper.query+
" "+$.query}O.push($);$=null};da=ca,ca=J.charAt(ga),ga<ma;ga++)if(da!="\\"){if(!$){la=ga;$={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return k?this.otag:this.tag}};aa=ga}if(Q>=0)if(ca=="]"){if(ea.attr)ea.matchFor=I(Z||Q+1,ga);else ea.attr=I(Q+1,ga);if(Q=ea.matchFor)if(Q.charAt(0)=='"'||Q.charAt(0)=="'")ea.matchFor=Q.slice(1,-1);$.attrs.push(ea);ea=null;Q=Z=-1}else{if(ca=="="){Z="|~^$*".indexOf(da)>=0?da:"";ea.type=Z+ca;ea.attr=I(Q+1,ga-Z.length);Z=ga+1}}else if(U>=
0){if(ca==")"){if(fa>=0)ea.value=I(U+1,ga);fa=U=-1}}else if(ca=="#"){pa();W=ga+1}else if(ca=="."){pa();S=ga}else if(ca==":"){pa();fa=ga}else if(ca=="["){pa();Q=ga;ea={}}else if(ca=="("){if(fa>=0){ea={name:I(fa+1,ga),value:null};$.pseudos.push(ea)}U=ga}else ca==" "&&da!=ca&&ua()}return O},v=function(J,I){if(!J)return I;if(!I)return J;return function(){return J.apply(window,arguments)&&I.apply(window,arguments)}},t=function(J,I){I=I||[];J&&I.push(J);return I},w=function(J){return 1==J.nodeType},u=function(J,
I){if(!J)return"";if(I=="class")return J.className||"";if(I=="for")return J.htmlFor||"";if(I=="style")return J.style.cssText||"";return(k?J.getAttribute(I):J.getAttribute(I,2))||""},s={"*=":function(J,I){return function(O){return u(O,J).indexOf(I)>=0}},"^=":function(J,I){return function(O){return u(O,J).indexOf(I)==0}},"$=":function(J,I){return function(O){O=" "+u(O,J);return O.lastIndexOf(I)==O.length-I.length}},"~=":function(J,I){var O=" "+I+" ";return function(Q){return(" "+u(Q,J)+" ").indexOf(O)>=
0}},"|=":function(J,I){var O=" "+I+"-";return function(Q){Q=" "+u(Q,J);return Q==I||Q.indexOf(O)==0}},"=":function(J,I){return function(O){return u(O,J)==I}}},q=typeof g().firstChild.nextElementSibling=="undefined",x=!q?"nextElementSibling":"nextSibling",A=!q?"previousElementSibling":"previousSibling",D=q?w:m,h=function(J){for(;J=J[A];)if(D(J))return false;return true},l=function(J){for(;J=J[x];)if(D(J))return false;return true},n=function(J){var I=J.parentNode,O=0,Q=I[i],U=J._i||-1,Z=I._l||-1;if(!Q)return-1;
Q=Q.length;if(Z==Q&&U>=0&&Z>=0)return U;I._l=Q;U=-1;for(I=I.firstElementChild||I.firstChild;I;I=I[x])if(D(I)){I._i=++O;if(J===I)U=O}return U},p=function(J){return!(n(J)%2)},r=function(J){return n(J)%2},y={checked:function(){return function(J){return!!("checked"in J?J.checked:J.selected)}},"first-child":function(){return h},"last-child":function(){return l},"only-child":function(){return function(J){if(!h(J))return false;if(!l(J))return false;return true}},empty:function(){return function(J){var I=
J.childNodes;for(J=J.childNodes.length-1;J>=0;J--){var O=I[J].nodeType;if(O===1||O==3)return false}return true}},contains:function(J,I){J=I.charAt(0);if(J=='"'||J=="'")I=I.slice(1,-1);return function(O){return O.innerHTML.indexOf(I)>=0}},not:function(J,I){J=o(I)[0];I={el:1};if(J.tag!="*")I.tag=1;if(!J.classes.length)I.classes=1;var O=z(J,I);return function(Q){return!O(Q)}},"nth-child":function(J,I){J=parseInt;if(I=="odd")return r;else if(I=="even")return p;if(I.indexOf("n")!=-1){I=I.split("n",2);
var O=I[0]?I[0]=="-"?-1:J(I[0]):1,Q=I[1]?J(I[1]):0,U=0,Z=-1;if(O>0)if(Q<0)Q=Q%O&&O+Q%O;else{if(Q>0){if(Q>=O)U=Q-Q%O;Q%=O}}else if(O<0){O*=-1;if(Q>0){Z=Q;Q%=O}}if(O>0)return function(S){S=n(S);return S>=U&&(Z<0||S<=Z)&&S%O==Q};else I=Q}var fa=J(I);return function(S){return n(S)==fa}}},B=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(J){var I=J.toLowerCase();if(I=="class")J="className";return function(O){return k?O.getAttribute(J):O[J]||O[I]}}:function(J){return function(I){return I&&I.getAttribute&&I.hasAttribute(J)}},
z=function(J,I){if(!J)return m;I=I||{};var O=null;"el"in I||(O=v(O,w));if(!("tag"in I))if(J.tag!="*")O=v(O,function(Q){return Q&&Q.tagName==J.getTag()});"classes"in I||d(J.classes,function(Q,U){var Z=new RegExp("(?:^|\\s)"+Q+"(?:\\s|$)");O=v(O,function(fa){return Z.test(fa.className)});O.count=U});"pseudos"in I||d(J.pseudos,function(Q){var U=Q.name;if(y[U])O=v(O,y[U](U,Q.value))});"attrs"in I||d(J.attrs,function(Q){var U,Z=Q.attr;if(Q.type&&s[Q.type])U=s[Q.type](Z,Q.matchFor);else if(Z.length)U=B(Z);
if(U)O=v(O,U)});if(!("id"in I))if(J.id)O=v(O,function(Q){return!!Q&&Q.id==J.id});O||"default"in I||(O=m);return O},E=function(J){return function(I,O,Q){for(;I=I[x];)if(!(q&&!w(I))){if((!Q||ha(I,Q))&&J(I))O.push(I);break}return O}},G=function(J){return function(I,O,Q){for(I=I[x];I;){if(D(I)){if(Q&&!ha(I,Q))break;J(I)&&O.push(I)}I=I[x]}return O}},M=function(J){J=J||m;return function(I,O,Q){for(var U=0,Z=I[i];I=Z[U++];)if(D(I)&&(!Q||ha(I,Q))&&J(I,U))O.push(I);return O}},H=function(J,I){for(J=J.parentNode;J;){if(J==
I)break;J=J.parentNode}return!!J},N={},L=function(J){var I=N[J.query];if(I)return I;var O=J.infixOper;O=O?O.oper:"";var Q=z(J,{el:1}),U="*"==J.tag,Z=g().getElementsByClassName;if(O){Z={el:1};if(U)Z.tag=1;Q=z(J,Z);if("+"==O)I=E(Q);else if("~"==O)I=G(Q);else if(">"==O)I=M(Q)}else if(J.id){Q=!J.loops&&U?m:z(J,{el:1,id:1});I=function(S,W){var aa=a.byId(J.id,S.ownerDocument||S);if(aa&&Q(aa))if(9==S.nodeType)return t(aa,W);else if(H(aa,S))return t(aa,W)}}else if(Z&&/\{\s*\[native code\]\s*\}/.test(String(Z))&&
J.classes.length&&!j){Q=z(J,{el:1,classes:1,id:1});var fa=J.classes.join(" ");I=function(S,W,aa){W=t(0,W);for(var da,ca=0,la=S.getElementsByClassName(fa);da=la[ca++];)Q(da,S)&&ha(da,aa)&&W.push(da);return W}}else if(!U&&!J.loops)I=function(S,W,aa){W=t(0,W);for(var da=0,ca=S.getElementsByTagName(J.getTag());S=ca[da++];)ha(S,aa)&&W.push(S);return W};else{Q=z(J,{el:1,tag:1,id:1});I=function(S,W,aa){W=t(0,W);for(var da,ca=0,la=S.getElementsByTagName(J.getTag());da=la[ca++];)Q(da,S)&&ha(da,aa)&&W.push(da);
return W}}return N[J.query]=I},R=function(J,I){J=t(J);for(var O,Q,U=I.length,Z,fa,S=0;S<U;S++){fa=[];O=I[S];Q=J.length-1;if(Q>0){Z={};fa.nozip=true}Q=L(O);for(var W=0;O=J[W];W++)Q(O,fa,Z);if(!fa.length)break;J=fa}return fa},T={},C={},F=function(J){var I=o(b(J));if(I.length==1){var O=L(I[0]);return function(Q){if(Q=O(Q,new f))Q.nozip=true;return Q}}return function(Q){return R(Q,I)}},K=navigator.userAgent;K=a.isWebKit&&K.indexOf("WebKit/")>0&&parseFloat(K.split("WebKit/")[1])>528;var P=a.isIE?"commentStrip":
"nozip",V=!!g().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||K),X=/n\+\d|([^ ])?([>~+])([^ =])?/g,Y=function(J,I,O,Q){return O?(I?I+" ":"")+O+(Q?" "+Q:""):J},ia=function(J,I){J=J.replace(X,Y);if(V){var O=C[J];if(O&&!I)return O}if(O=T[J])return O;O=J.charAt(0);var Q=-1==J.indexOf(" ");if(J.indexOf("#")>=0&&Q)I=true;if(V&&!I&&">~+".indexOf(O)==-1&&(!a.isIE||J.indexOf(":")==-1)&&!(j&&J.indexOf(".")>=0)&&J.indexOf(":contains")==-1&&J.indexOf(":checked")==-1&&J.indexOf("|=")==-1){var U=">~+".indexOf(J.charAt(J.length-
1))>=0?J+" *":J;return C[J]=function(fa){try{if(!(9==fa.nodeType||Q))throw"";var S=fa.querySelectorAll(U);S[P]=true;return S}catch(W){return ia(J,true)(fa)}}}else{var Z=J.split(/\s*,\s*/);return T[J]=Z.length<2?F(J):function(fa){for(var S=0,W=[],aa;aa=Z[S++];)W=W.concat(F(aa)(fa));return W}}},ba=0,ja=a.isIE?function(J){return k?J.getAttribute("_uid")||J.setAttribute("_uid",++ba)||ba:J.uniqueID}:function(J){return J._uid||(J._uid=++ba)},ha=function(J,I){if(!I)return 1;J=ja(J);if(!I[J])return I[J]=
1;return 0},ka="_zipIdx",na=function(J){if(J&&J.nozip)return f._wrap?f._wrap(J):J;var I=new f;if(!J||!J.length)return I;J[0]&&I.push(J[0]);if(J.length<2)return I;ba++;if(a.isIE&&k){var O=ba+"";J[0].setAttribute(ka,O);for(var Q=1,U;U=J[Q];Q++){J[Q].getAttribute(ka)!=O&&I.push(U);U.setAttribute(ka,O)}}else if(a.isIE&&J.commentStrip)try{for(Q=1;U=J[Q];Q++)w(U)&&I.push(U)}catch(Z){}else{if(J[0])J[0][ka]=ba;for(Q=1;U=J[Q];Q++){J[Q][ka]!=ba&&I.push(U);U[ka]=ba}}return I};a.query=function(J,I){f=a._NodeListCtor;
if(!J)return new f;if(J.constructor==f)return J;if(typeof J!="string")return new f(J);if(typeof I=="string"){I=a.byId(I);if(!I)return new f}I=I||g();var O=I.ownerDocument||I.documentElement;k=I.contentType&&I.contentType=="application/xml"||a.isOpera&&(I.doctype||O.toString()=="[object XMLDocument]")||!!O&&(a.isIE?O.xml:I.xmlVersion||O.xmlVersion);if((J=ia(J)(I))&&J.nozip&&!f._wrap)return J;return na(J)};a.query.pseudos=y;a._filterQueryResult=function(J,I,O){var Q=new a._NodeListCtor,U=o(I);U=U.length==
1&&!/[^\w#\.]/.test(I)?z(U[0]):function(S){return dojo.query(I,O).indexOf(S)!=-1};for(var Z=0,fa;fa=J[Z];Z++)U(fa)&&Q.push(fa);return Q}},e=function(){acme={trim:function(f){f=f.replace(/^\s+/,"");for(var g=f.length-1;g>=0;g--)if(/\S/.test(f.charAt(g))){f=f.substring(0,g+1);break}return f},forEach:function(f,g,j){if(f&&f.length)for(var i=0,k=f.length;i<k;++i)g.call(j||window,f[i],i,f)},byId:function(f,g){return typeof f=="string"?(g||document).getElementById(f):f},doc:document,NodeList:Array};var a=
navigator,b=a.userAgent;a=a.appVersion;var d=parseFloat(a);acme.isOpera=b.indexOf("Opera")>=0?d:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?d:undefined;acme.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;if((b=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(b+7))<=419.3)acme.isSafari=2}if(document.all&&!acme.isOpera)acme.isIE=
parseFloat(a.split("MSIE ")[1])||undefined;Array._wrap=function(f){return f};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){c(this.queryPortability||this.acme||a)});if(typeof define!="function")if(this.dojo){dojo.provide("dojo._base.query");dojo.require("dojo._base.NodeList");dojo.require("dojo._base.lang");c(this.queryPortability||this.acme||dojo)}else c(this.queryPortability||this.acme||
e())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(c){(function(){function e(q,x,A){if(A!==null){var D=q[x];if(typeof D=="string")q[x]=[D,A];else if(a.isArray(D))D.push(A);else q[x]=A}}var a=c,b=a.config;c.fieldToObject=function(q){var x=null;if(q=a.byId(q)){var A=q.name,D=(q.type||"").toLowerCase();if(A&&D&&!q.disabled)if(D=="radio"||D=="checkbox"){if(q.checked)x=q.value}else if(q.multiple){x=[];a.query("option",q).forEach(function(h){h.selected&&
x.push(h.value)})}else x=q.value}return x};c.formToObject=function(q){var x={};a.forEach(c.byId(q).elements,function(A){var D=A.name,h=(A.type||"").toLowerCase();if(D&&h&&"file|submit|image|reset|button|".indexOf(h)==-1&&!A.disabled){e(x,D,a.fieldToObject(A));if(h=="image")x[D+".x"]=x[D+".y"]=x[D].x=x[D].y=0}});return x};c.objectToQuery=function(q){var x=encodeURIComponent,A=[],D={};for(var h in q){var l=q[h];if(l!=D[h]){var n=x(h)+"=";if(a.isArray(l))for(var p=0;p<l.length;p++)A.push(n+x(l[p]));
else A.push(n+x(l))}}return A.join("&")};c.formToQuery=function(q){return a.objectToQuery(a.formToObject(q))};c.formToJson=function(q,x){return a.toJson(a.formToObject(q),x)};c.queryToObject=function(q){var x={};q=q.split("&");var A=decodeURIComponent;a.forEach(q,function(D){if(D.length){var h=D.split("=");D=A(h.shift());h=A(h.join("="));if(typeof x[D]=="string")x[D]=[x[D]];if(a.isArray(x[D]))x[D].push(h);else x[D]=h}});return x};c._blockAsync=false;var d=a._contentHandlers=c.contentHandlers={text:function(q){return q.responseText},
json:function(q){return a.fromJson(q.responseText||null)},"json-comment-filtered":function(q){c.config.useCommentedJson||console.warn("Consider using the standard mimetype:application/json. json-commenting can introduce security issues. To decrease the chances of hijacking, use the standard the 'json' handler and prefix your json with: {}&&\nUse djConfig.useCommentedJson=true to turn off this message.");q=q.responseText;var x=q.indexOf("/*"),A=q.lastIndexOf("*/");if(x==-1||A==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(q.substring(x+2,A))},javascript:function(q){return a.eval(q.responseText)},xml:function(q){var x=q.responseXML;if(a.isIE&&(!x||!x.documentElement)){var A=function(D){return"MSXML"+D+".DOMDocument"};A=["Microsoft.XMLDOM",A(6),A(4),A(3),A(2)];a.some(A,function(D){try{var h=new ActiveXObject(D);h.async=false;h.loadXML(q.responseText);x=h}catch(l){return false}return true})}return x},"json-comment-optional":function(q){return q.responseText&&/^[^{\[]*\/\*/.test(q.responseText)?d["json-comment-filtered"](q):
d.json(q)}};c._ioSetArgs=function(q,x,A,D){var h={args:q,url:q.url},l=null;if(q.form){l=a.byId(q.form);var n=l.getAttributeNode("action");h.url=h.url||(n?n.value:null);l=a.formToObject(l)}n=[{}];l&&n.push(l);q.content&&n.push(q.content);q.preventCache&&n.push({"dojo.preventCache":(new Date).valueOf()});h.query=a.objectToQuery(a.mixin.apply(null,n));h.handleAs=q.handleAs||"text";var p=new a.Deferred(x);p.addCallbacks(A,function(z){return D(z,p)});var r=q.load;r&&a.isFunction(r)&&p.addCallback(function(z){return r.call(q,
z,h)});var y=q.error;y&&a.isFunction(y)&&p.addErrback(function(z){return y.call(q,z,h)});var B=q.handle;B&&a.isFunction(B)&&p.addBoth(function(z){return B.call(q,z,h)});if(b.ioPublish&&a.publish&&h.args.ioPublish!==false){p.addCallbacks(function(z){a.publish("/dojo/io/load",[p,z]);return z},function(z){a.publish("/dojo/io/error",[p,z]);return z});p.addBoth(function(z){a.publish("/dojo/io/done",[p,z]);return z})}p.ioArgs=h;return p};var f=function(q){q.canceled=true;var x=q.ioArgs.xhr,A=typeof x.abort;
if(A=="function"||A=="object"||A=="unknown")x.abort();q=q.ioArgs.error;if(!q){q=new Error("xhr cancelled");q.dojoType="cancel"}return q},g=function(q){q=d[q.ioArgs.handleAs](q.ioArgs.xhr);return q===undefined?null:q},j=function(q,x){x.ioArgs.args.failOk||console.error(q);return q},i=null,k=[],m=0,o=function(q){if(m<=0){m=0;if(b.ioPublish&&a.publish&&(!q||q&&q.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},v=function(){var q=(new Date).getTime();if(!a._blockAsync)for(var x=0,A;x<k.length&&
(A=k[x]);x++){var D=A.dfd,h=function(){if(!D||D.canceled||!A.validCheck(D)){k.splice(x--,1);m-=1}else if(A.ioCheck(D)){k.splice(x--,1);A.resHandle(D);m-=1}else if(D.startTime)if(D.startTime+(D.ioArgs.args.timeout||0)<q){k.splice(x--,1);var n=new Error("timeout exceeded");n.dojoType="timeout";D.errback(n);D.cancel();m-=1}};if(c.config.debugAtAllCosts)h.call(this);else try{h.call(this)}catch(l){D.errback(l)}}o(D);if(!k.length){clearInterval(i);i=null}};c._ioCancelAll=function(){try{a.forEach(k,function(x){try{x.dfd.cancel()}catch(A){}})}catch(q){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(q){if(b.ioPublish&&a.publish&&q.ioArgs.args.ioPublish!==false){m||a.publish("/dojo/io/start");m+=1;a.publish("/dojo/io/send",[q])}};a._ioWatch=function(q,x,A,D){var h=q.ioArgs.args;if(h.timeout)q.startTime=(new Date).getTime();k.push({dfd:q,validCheck:x,ioCheck:A,resHandle:D});i||(i=setInterval(v,50));h.sync&&v()};var t="application/x-www-form-urlencoded",w=function(q){return q.ioArgs.xhr.readyState},u=function(q){return 4==q.ioArgs.xhr.readyState},
s=function(q){var x=q.ioArgs.xhr;if(a._isDocumentOk(x))q.callback(q);else{var A=new Error("Unable to load "+q.ioArgs.url+" status:"+x.status);A.status=x.status;A.responseText=x.responseText;q.errback(A)}};c._ioAddQueryToUrl=function(q){if(q.query.length){q.url+=(q.url.indexOf("?")==-1?"?":"&")+q.query;q.query=null}};c.xhr=function(q,x,A){var D=a._ioSetArgs(x,f,g,j),h=D.ioArgs,l=h.xhr=a._xhrObj(h.args);if(!l){D.cancel();return D}if("postData"in x)h.query=x.postData;else if("putData"in x)h.query=x.putData;
else if("rawBody"in x)h.query=x.rawBody;else if(arguments.length>2&&!A||"POST|PUT".indexOf(q.toUpperCase())==-1)a._ioAddQueryToUrl(h);l.open(q,h.url,x.sync!==true,x.user||undefined,x.password||undefined);if(x.headers)for(var n in x.headers)if(n.toLowerCase()==="content-type"&&!x.contentType)x.contentType=x.headers[n];else x.headers[n]&&l.setRequestHeader(n,x.headers[n]);l.setRequestHeader("Content-Type",x.contentType||t);if(!x.headers||!("X-Requested-With"in x.headers))l.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(D);if(c.config.debugAtAllCosts)l.send(h.query);else try{l.send(h.query)}catch(p){h.error=p;D.cancel()}a._ioWatch(D,w,u,s);return D};c.xhrGet=function(q){return a.xhr("GET",q)};c.rawXhrPost=c.xhrPost=function(q){return a.xhr("POST",q,true)};c.rawXhrPut=c.xhrPut=function(q){return a.xhr("PUT",q,true)};c.xhrDelete=function(q){return a.xhr("DELETE",q)}})();return c.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(c){(function(){var e=c._mixin;c._Line=function(j,i){this.start=j;this.end=i};c._Line.prototype.getValue=function(j){return(this.end-this.start)*j+this.start};c.Animation=function(j){e(this,j);if(c.isArray(this.curve))this.curve=new c._Line(this.curve[0],this.curve[1])};c._Animation=c.Animation;c.extend(c.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var j=this._percent,i=this.easing;return i?i(j):j},_fire:function(j,i){i=i||[];if(this[j])if(c.config.debugAtAllCosts)this[j].apply(this,i);else try{this[j].apply(this,i)}catch(k){console.error("exception in animation handler for:",j);console.error(k)}return this},play:function(j,i){var k=this;k._delayTimer&&k._clearTimer();if(i){k._stopTimer();k._active=k._paused=false;k._percent=0}else if(k._active&&!k._paused)return k;k._fire("beforeBegin",[k.node]);j=j||k.delay;var m=c.hitch(k,
"_play",i);if(j>0){k._delayTimer=setTimeout(m,j);return k}m();return k},_play:function(){var j=this;j._delayTimer&&j._clearTimer();j._startTime=(new Date).valueOf();if(j._paused)j._startTime-=j.duration*j._percent;j._active=true;j._paused=false;var i=j.curve.getValue(j._getStep());if(!j._percent){if(!j._startRepeatCount)j._startRepeatCount=j.repeat;j._fire("onBegin",[i])}j._fire("onPlay",[i]);j._cycle();return j},pause:function(){var j=this;j._delayTimer&&j._clearTimer();j._stopTimer();if(!j._active)return j;
j._paused=true;j._fire("onPause",[j.curve.getValue(j._getStep())]);return j},gotoPercent:function(j,i){var k=this;k._stopTimer();k._active=k._paused=true;k._percent=j;i&&k.play();return k},stop:function(j){var i=this;i._delayTimer&&i._clearTimer();if(!i._timer)return i;i._stopTimer();if(j)i._percent=1;i._fire("onStop",[i.curve.getValue(i._getStep())]);i._active=i._paused=false;return i},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var j=
this;if(j._active){var i=((new Date).valueOf()-j._startTime)/j.duration;if(i>=1)i=1;j._percent=i;if(j.easing)i=j.easing(i);j._fire("onAnimate",[j.curve.getValue(i)]);if(j._percent<1)j._startTimer();else{j._active=false;if(j.repeat>0){j.repeat--;j.play(null,true)}else if(j.repeat==-1)j.play(null,true);else if(j._startRepeatCount){j.repeat=j._startRepeatCount;j._startRepeatCount=0}j._percent=0;j._fire("onEnd",[j.node]);!j.repeat&&j._stopTimer()}}return j},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,b=null,d={run:function(){}};c.extend(c.Animation,{_startTimer:function(){if(!this._timer){this._timer=c.connect(d,"run",this,"_cycle");a++}b||(b=setInterval(c.hitch(d,"run"),this.rate))},_stopTimer:function(){if(this._timer){c.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(b);b=null;a=0}}});var f=c.isIE?function(j){var i=j.style;if(!i.width.length&&c.style(j,"width")=="auto")i.width="auto"}:function(){};c._fade=function(j){j.node=c.byId(j.node);
var i=e({properties:{}},j);j=i.properties.opacity={};j.start=!("start"in i)?function(){return+c.style(i.node,"opacity")||0}:i.start;j.end=i.end;j=c.animateProperty(i);c.connect(j,"beforeBegin",c.partial(f,i.node));return j};c.fadeIn=function(j){return c._fade(e({end:1},j))};c.fadeOut=function(j){return c._fade(e({end:0},j))};c._defaultEasing=function(j){return 0.5+Math.sin((j+1.5)*Math.PI)/2};var g=function(j){this._properties=j;for(var i in j){var k=j[i];if(k.start instanceof c.Color)k.tempColor=
new c.Color}};g.prototype.getValue=function(j){var i={};for(var k in this._properties){var m=this._properties[k],o=m.start;if(o instanceof c.Color)i[k]=c.blendColors(o,m.end,j,m.tempColor).toCss();else c.isArray(o)||(i[k]=(m.end-o)*j+o+(k!="opacity"?m.units||"px":0))}return i};c.animateProperty=function(j){var i=j.node=c.byId(j.node);if(!j.easing)j.easing=c._defaultEasing;j=new c.Animation(j);c.connect(j,"beforeBegin",j,function(){var k={};for(var m in this.properties){if(m=="width"||m=="height")this.node.display=
"block";var o=this.properties[m];if(c.isFunction(o))o=o(i);o=k[m]=e({},c.isObject(o)?o:{end:o});if(c.isFunction(o.start))o.start=o.start(i);if(c.isFunction(o.end))o.end=o.end(i);var v=m.toLowerCase().indexOf("color")>=0,t=function(w,u){var s={height:w.offsetHeight,width:w.offsetWidth}[u];if(s!==undefined)return s;s=c.style(w,u);return u=="opacity"?+s:v?s:parseFloat(s)};if("end"in o){if(!("start"in o))o.start=t(i,m)}else o.end=t(i,m);if(v){o.start=new c.Color(o.start);o.end=new c.Color(o.end)}else o.start=
m=="opacity"?+o.start:parseFloat(o.start)}this.curve=new g(k)});c.connect(j,"onAnimate",c.hitch(c,"style",j.node));return j};c.anim=function(j,i,k,m,o,v){return c.animateProperty({node:j,duration:k||c.Animation.prototype.duration,properties:i,easing:m,onEnd:o}).play(v||0)}})();return c.animateProperty});
define("dojo",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/Color","dojo/_base/window","dojo/_base/event","dojo/_base/html","dojo/_base/NodeList","dojo/_base/query","dojo/_base/xhr","dojo/_base/fx"],function(c){return c});
define("orion/serviceregistry",["dojo"],function(c){function e(g,j,i){this.serviceId=g;this.name=j;this.properties=i}function a(g,j,i){this.serviceId=g;this.serviceReference=j;this.internalRegistry=i}function b(g,j,i){this.serviceId=g;this.implementation=j;this.internalRegistry=i;var k;for(k in j)if(typeof j[k]==="function")this[k]=function(m){return function(){if(i.isRegistered(g)){var o=new c.Deferred;try{var v=j[m].apply(j,Array.prototype.slice.call(arguments));c.when(v,c.hitch(o,o.resolve),c.hitch(o,
o.reject),c.hitch(o,o.progress))}catch(t){o.reject(t)}return o}throw new Error("Service was unregistered");}}(k)}function d(){this._namedlisteners={}}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new d;var g=this;this.internalRegistry={isRegistered:function(j){return g._entries[j]?true:false},unregisterService:function(j){var i=g._entries[j];if(i){for(var k=i.reference,m=g._namedReferences[k.getName()],o=0;o<m.length;o++)if(m[o]===k){if(m.length===1)delete g._namedReferences[k.getName()];
else m.splice(o,1);break}g._entries[j]=null;g._serviceEventTarget.dispatchEvent("serviceRemoved",k,i.service)}},dispatchEvent:function(j,i){var k=g._entries[j];k&&k.eventTarget.dispatchEvent.apply(k.eventTarget,[i].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(j,i,k){(j=g._entries[j])&&j.eventTarget.addEventListener(i,k)},removeEventListener:function(j,i,k){(j=g._entries[j])&&j.eventTarget.removeEventListener(i,k)}}}e.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var g=[],j;for(j in this.properties)this.properties.hasOwnProperty(j)&&g.push(j);return g},getProperty:function(g){return this.properties[g]}};e.prototype.constructor=e;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(g){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,g].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;b.prototype={addEventListener:function(g,j){this.internalRegistry.addEventListener(this.serviceId,g,j)},removeEventListener:function(g,j){this.internalRegistry.removeEventListener(this.serviceId,g,j)}};b.prototype.constructor=b;d.prototype={dispatchEvent:function(g){var j=this._namedlisteners[g];if(j)for(var i=0;i<j.length;i++)try{var k=Array.prototype.slice.call(arguments,1);j[i].apply(null,k)}catch(m){console.log(m)}},addEventListener:function(g,j){this._namedlisteners[g]=
this._namedlisteners[g]||[];this._namedlisteners[g].push(j)},removeEventListener:function(g,j){var i=this._namedlisteners[g];if(i)for(var k=0;k<i.length;k++)if(i[k]===j){if(i.length===1)delete this._namedlisteners[g];else i.splice(k,1);break}}};d.prototype.constructor=d;f.prototype={getService:function(g){var j;if(typeof g==="string"){if(this._namedReferences[g])for(var i=0;i<this._namedReferences[g].length;i++)if(j=this._entries[this._namedReferences[g][i].getServiceId()].service)break}else j=this._entries[g.getServiceId()].service;
return j},getServiceReferences:function(g){if(g)return this._namedReferences[g]?this._namedReferences[g]:[];g=[];for(var j=0;j<this._entries.length;j++)this._entries[j]&&g.push(this._entries[j].reference);return g},registerService:function(g,j,i){var k=this._entries.length;i=new e(k,g,i);j=new b(k,j,this.internalRegistry);this._namedReferences[g]=this._namedReferences[g]||[];this._namedReferences[g].push(i);this._entries.push({reference:i,service:j,eventTarget:new d});this._serviceEventTarget.dispatchEvent("serviceAdded",
i,j);return new a(k,i,this.internalRegistry)},addEventListener:function(g,j){this._serviceEventTarget.addEventListener(g,j)},removeEventListener:function(g,j){this._serviceEventTarget.removeEventListener(g,j)}};f.prototype.constructor=f;return{ServiceReference:e,ServiceRegistration:a,Service:b,EventTarget:d,ServiceRegistry:f}});define("dijit",["dojo"],function(c){return dijit=c._dijit||{}});
define("orion/commonHTMLFragments",["require"],function(c){var e='<div id="staticBanner" class="layoutBlock topRowBanner"><a id="home" class="layoutLeft logo" href="'+c.toUrl("index.html")+'"><img src="'+c.toUrl("images/orion-small-lightondark.gif")+'" alt="Orion Logo"/></a><div id="primaryNav" class="layoutLeft primaryNav"></div><div id="userMenu" class="layoutRight textless"></div><div id="userInfo" class="layoutRight primaryNav"></div><div class="layoutRight primaryNav">|</div></div><div id="titleArea" class="layoutBlock titleArea"><div id="pageTitle" class="layoutLeft pageTitle"></div><input type="search" id="search" placeholder="Search" title="Type a keyword or wild card to search in root" class="layoutRight searchbox"><div id="relatedLinks" class="layoutRight pageNav"></div><div id="extras" class="layoutRight pageNav"><div id="globalActions" class="pageNav"></div><span id="pageFavorite" tabindex="0" role="button" aria-label="Add this page to the favorites list" class="imageSprite core-sprite-favorite_sml"></span></div><div id="dimension" class="clear dimension"></div><div id="location" class="clear currentLocation"></div></div>';
c='<div class="layoutLeft pageActions" id="pageActions"></div><div class="layoutLeft pageActions" id="selectionTools"></div><img class="layoutRight progressPane" src="'+c.toUrl("images/none.png")+'" id="progressPane"></img><div class="layoutRight status" id="statusPane"></div><div class="layoutRight pageActions" id="pageNavigationActions"></div><div id="notificationArea" class="layoutLeft layoutBlock slideContainer"><div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div><div class="layoutRight"><span tabindex: "0" role: "button" class="layoutRight core-sprite-close imageSprite" id="closeNotifications"></span></div></div><div id="parameterArea" class="layoutBlock slideParameters slideContainer"><span id="pageParameterArea" class="slide"><span id="pageCommandParameters" class="parameters"></span><span id="pageCommandDismiss" class="parametersDismiss"></span></span></div>';
return{topHTMLFragment:e,bottomHTMLFragment:'<div class="layoutBlock"><div class="footerBlock">Orion is in Beta. Please try it out but BEWARE your data may be lost.</div><div class="footerRightBlock"><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">FAQ</a> | <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=0.4" target="_blank">Report a Bug</a> | <a href="http://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a> | <a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a> | <a href="http://www.eclipse.org/legal/copyright.php" target="_blank">Copyright Agent</a></div></div>',
toolbarHTMLFragment:c}});
define("dojo/hash",["dojo"],function(c){(function(){function e(o,v){v=o.indexOf(v);return v>=0?o.substring(v+1):""}function a(){return e(location.href,"#")}function b(){c.publish("/dojo/hashchange",[a()])}function d(){if(a()!==j){j=a();b()}}function f(o){if(i)if(i.isTransitioning())setTimeout(c.hitch(null,f,o),m);else{var v=i.iframe.location.href,t=v.indexOf("?");i.iframe.location.replace(v.substring(0,t)+"?"+o)}else{location.replace("#"+o);!k&&d()}}function g(){function o(){j=a();w=x?j:e(A.href,
"?");u=false;s=null}var v=document.createElement("iframe"),t=c.config.dojoBlankHtmlUrl||c.moduleUrl("dojo","resources/blank.html");c.config.useXDomain&&!c.config.dojoBlankHtmlUrl&&console.warn("dojo.hash: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");v.id="dojo-hash-iframe";v.src=t+"?"+a();v.style.display="none";document.body.appendChild(v);this.iframe=c.global["dojo-hash-iframe"];
var w,u,s,q,x,A=this.iframe.location;this.isTransitioning=function(){return u};this.pollLocation=function(){if(!x)try{var D=e(A.href,"?");if(document.title!=q)q=this.iframe.document.title=document.title}catch(h){x=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var l=a();if(u&&j===l)if(x||D===s){o();b()}else{setTimeout(c.hitch(this,this.pollLocation),0);return}else if(!(j===l&&(x||w===D)))if(j!==l){j=l;u=true;s=l;v.src=t+"?"+s;x=false;setTimeout(c.hitch(this,this.pollLocation),
0);return}else if(!x){location.href="#"+A.search.substring(1);o();b()}setTimeout(c.hitch(this,this.pollLocation),m)};o();setTimeout(c.hitch(this,this.pollLocation),m)}c.hash=function(o,v){if(!arguments.length)return a();if(o.charAt(0)=="#")o=o.substring(1);if(v)f(o);else location.href="#"+o;return o};var j,i,k,m=c.config.hashPollFrequency||100;c.addOnLoad(function(){if("onhashchange"in c.global&&(!c.isIE||c.isIE>=8&&document.compatMode!="BackCompat"))k=c.connect(c.global,"onhashchange",b);else if(document.addEventListener){j=
a();setInterval(d,m)}else if(document.attachEvent)i=new g})})();return c.hash});
(function(){var c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=[];define("text",["require","exports","module"],function(){var d,f,g;if(typeof window!=="undefined"&&window.navigator&&window.document)f=function(j,i){var k=d.createXhr();k.open("GET",j,true);k.onreadystatechange=function(){k.readyState===4&&i(k.responseText)};k.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){g=require.nodeRequire("fs");f=function(j,i){i(g.readFileSync(j,"utf8"))}}else if(typeof Packages!=="undefined")f=function(j,i){var k=new java.io.File(j);j=java.lang.System.getProperty("line.separator");k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8"));var m,o,v="";try{m=new java.lang.StringBuffer;if((o=k.readLine())&&o.length()&&o.charAt(0)===65279)o=o.substring(1);for(m.append(o);(o=k.readLine())!==null;){m.append(j);m.append(o)}v=
String(m.toString())}finally{k.close()}i(v)};return d={version:"0.24.0",strip:function(j){if(j){j=j.replace(e,"");var i=j.match(a);if(i)j=i[1]}else j="";return j},jsEscape:function(j){return j.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var j,i,k;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(i=0;i<3;i++){k=c[i];try{j=new ActiveXObject(k)}catch(m){}if(j){c=
[k];break}}if(!j)throw new Error("require.getXhr(): XMLHttpRequest not available");return j},get:f,load:function(j,i,k,m){var o=false,v=j.indexOf("."),t=j.substring(0,v),w=j.substring(v+1,j.length);v=w.indexOf("!");if(v!==-1){o=w.substring(v+1,w.length);o=o==="strip";w=w.substring(0,v)}i=i.nameToUrl(t,"."+w);d.get(i,function(u){u=o?d.strip(u):u;if(m.isBuild&&m.inlineText)b[j]=u;k(u)})},write:function(j,i,k){if(i in b){var m=d.jsEscape(b[i]);k("define('"+j+"!"+i+"', function () { return '"+m+"';});\n")}}}})})();
define("text!dijit/form/templates/ValidationTextBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}" role="presentation"\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/i18n",["require","dojo"],function(c,e){e.getObject("i18n",true,e);e.i18n.getLocalization=e.i18n.getLocalization||function(a,b,d){d=e.i18n.normalizeLocale(d);var f=d.split("-"),g=[a,"nls",b].join(".");if(typeof e.global.require!=="undefined"){var j=c("i18n!"+[a.replace(/\./g,"/"),"nls",b].join("/"));(e._loadedModules[g]=e._loadedModules[g]||{})[f.join("_")]=j.root||j}if(g=e._loadedModules[g]){var i;for(j=f.length;j>0;j--){var k=f.slice(0,j).join("_");if(g[k]){i=g[k];break}}if(!i)i=g.ROOT;
if(i){a=function(){};a.prototype=i;return new a}}throw new Error("Bundle not found: "+b+" in "+a+" , locale="+d);};e.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():e.locale;if(a=="root")a="ROOT";return a};e.i18n._requireLocalization=function(a,b,d,f){d=e.i18n.normalizeLocale(d);var g=[a,"nls",b].join("."),j="";if(f){for(var i=f.split(","),k=0;k<i.length;k++)if(d.indexOf(i[k])==0)if(i[k].length>j.length)j=i[k];j||(j="ROOT")}i=f?j:d;var m=e._loadedModules[g];k=null;if(m){if(e.config.localizationComplete&&
m._built)return;k=i.replace(/-/g,"_");k=e._loadedModules[g+"."+k]}if(!k){m=e.provide(g);var o=e._getModuleSymbols(a).concat("nls").join("/"),v;e.i18n._searchLocalePath(i,f,function(t){var w=t.replace(/-/g,"_"),u=g+"."+w,s=false;if(e._loadedModules[u])s=true;else{e.provide(u);u=[o];t!="ROOT"&&u.push(t);u.push(b);t=u.join("/")+".js";s=e._loadPath(t,null,function(q){q=q.root||q;var x=function(){};x.prototype=v;m[w]=new x;for(var A in q)m[w][A]=q[A]})}if(s&&m[w])v=m[w];else m[w]=v;if(f)return true})}if(f&&
d!=j)m[d.replace(/-/g,"_")]=m[j.replace(/-/g,"_")]};(function(){var a=e.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var b=e.i18n._requireLocalization;e.i18n._requireLocalization=function(d,f,g,j){b(d,f,g,j);if(!g)for(g=0;g<a.length;g++)b(d,f,a[g],j)}}})();e.i18n._searchLocalePath=function(a,b,d){a=e.i18n.normalizeLocale(a);var f=a.split("-");a=[];for(var g=f.length;g>0;g--)a.push(f.slice(0,g).join("-"));a.push(false);b&&a.reverse();for(b=a.length-1;b>=0;b--)if(d(a[b]||"ROOT"))break};e.i18n._preloadLocalizations=
function(a,b){function d(j){j=e.i18n.normalizeLocale(j);e.i18n._searchLocalePath(j,true,function(i){for(var k=0;k<b.length;k++)if(b[k]==i){e.require(a+"_"+i);return true}return false})}d();for(var f=e.config.extraLocale||[],g=0;g<f.length;g++)d(f[g])};return e.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(c){c.getObject("window",true,c);c.window.getBox=function(){var e=c.doc.compatMode=="BackCompat"?c.body():c.doc.documentElement,a=c._docScroll();return{w:e.clientWidth,h:e.clientHeight,l:a.x,t:a.y}};c.window.get=function(e){if(c.isIE&&window!==document.parentWindow){e.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=e._parentWindow;e._parentWindow=null;return a}return e.parentWindow||e.defaultView};c.window.scrollIntoView=function(e,
a){try{e=c.byId(e);var b=e.ownerDocument||c.doc,d=b.body||c.body(),f=b.documentElement||d.parentNode,g=c.isIE,j=c.isWebKit;if((!(c.isMoz||g||j||c.isOpera)||e==d||e==f)&&typeof e.scrollIntoView!="undefined")e.scrollIntoView(false);else{var i=b.compatMode=="BackCompat",k=g>=9&&e.ownerDocument.parentWindow.frameElement?f.clientHeight>0&&f.clientWidth>0&&(d.clientHeight==0||d.clientWidth==0||d.clientHeight>f.clientHeight||d.clientWidth>f.clientWidth)?f:d:i?d:f;b=j?d:k;var m=k.clientWidth,o=k.clientHeight,
v=!c._isBodyLtr(),t=a||c.position(e),w=e.parentNode;a=function(y){return g<=6||g&&i?false:c.style(y,"position").toLowerCase()=="fixed"};if(!a(e))for(;w;){if(w==d)w=b;var u=c.position(w),s=a(w);if(w==b){u.w=m;u.h=o;if(b==f&&g&&v)u.x+=b.offsetWidth-u.w;if(u.x<0||!g)u.x=0;if(u.y<0||!g)u.y=0}else{var q=c._getPadBorderExtents(w);u.w-=q.w;u.h-=q.h;u.x+=q.l;u.y+=q.t;var x=w.clientWidth,A=u.w-x;if(x>0&&A>0){u.w=x;u.x+=v&&(g||w.clientLeft>q.l)?A:0}x=w.clientHeight;A=u.h-x;if(x>0&&A>0)u.h=x}if(s){if(u.y<0){u.h+=
u.y;u.y=0}if(u.x<0){u.w+=u.x;u.x=0}if(u.y+u.h>o)u.h=o-u.y;if(u.x+u.w>m)u.w=m-u.x}var D=t.x-u.x,h=t.y-Math.max(u.y,0),l=D+t.w-u.w,n=h+t.h-u.h;if(l*D>0){var p=Math[D<0?"max":"min"](D,l);if(v&&(g==8&&!i||g>=9))p=-p;t.x+=w.scrollLeft;w.scrollLeft+=p;t.x-=w.scrollLeft}if(n*h>0){t.y+=w.scrollTop;w.scrollTop+=Math[h<0?"max":"min"](h,n);t.y-=w.scrollTop}w=w!=b&&!s&&w.parentNode}}}catch(r){console.error("scrollIntoView: "+r);e.scrollIntoView(false)}};return c.window});
define("dijit/_base/manager",["dojo","dijit"],function(c,e){c.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,b){b=b||c.global;var d=0,f;for(f in this._hash)a.call(b,this._hash[f],d++,this._hash);return this},
filter:function(a,b){b=b||c.global;var d=new e.WidgetSet,f=0,g;for(g in this._hash){var j=this._hash[g];a.call(b,j,f++,this._hash)&&d.add(j)}return d},byId:function(a){return this._hash[a]},byClass:function(a){var b=new e.WidgetSet,d,f;for(d in this._hash){f=this._hash[d];f.declaredClass==a&&b.add(f)}return b},toArray:function(){var a=[];for(var b in this._hash)a.push(this._hash[b]);return a},map:function(a,b){return c.map(this.toArray(),a,b)},every:function(a,b){b=b||c.global;var d=0,f;for(f in this._hash)if(!a.call(b,
this._hash[f],d++,this._hash))return false;return true},some:function(a,b){b=b||c.global;var d=0,f;for(f in this._hash)if(a.call(b,this._hash[f],d++,this._hash))return true;return false}});(function(){e.registry=new e.WidgetSet;var a=e.registry._hash,b=c.attr,d=c.hasAttr,f=c.style;e.byId=function(k){return typeof k=="string"?a[k]:k};var g={};e.getUniqueId=function(k){var m;do m=k+"_"+(k in g?++g[k]:(g[k]=0));while(a[m]);return e._scopeName=="dijit"?m:e._scopeName+"_"+m};e.findWidgets=function(k){function m(v){for(v=
v.firstChild;v;v=v.nextSibling)if(v.nodeType==1){var t=v.getAttribute("widgetId");if(t)(t=a[t])&&o.push(t);else m(v)}}var o=[];m(k);return o};e._destroyAll=function(){e._curFocus=null;e._prevFocus=null;e._activeStack=[];c.forEach(e.findWidgets(c.body()),function(k){if(!k._destroyed)if(k.destroyRecursive)k.destroyRecursive();else k.destroy&&k.destroy()})};c.isIE&&c.addOnWindowUnload(function(){e._destroyAll()});e.byNode=function(k){return a[k.getAttribute("widgetId")]};e.getEnclosingWidget=function(k){for(;k;){var m=
k.getAttribute&&k.getAttribute("widgetId");if(m)return a[m];k=k.parentNode}return null};var j=e._isElementShown=function(k){var m=f(k);return m.visibility!="hidden"&&m.visibility!="collapsed"&&m.display!="none"&&b(k,"type")!="hidden"};e.hasDefaultTabStop=function(k){switch(k.nodeName.toLowerCase()){case "a":return d(k,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var m;try{var o=k.contentDocument;if("designMode"in o&&o.designMode==
"on")return true;m=o.body}catch(v){try{m=k.contentWindow.document.body}catch(t){return false}}return m.contentEditable=="true"||m.firstChild&&m.firstChild.contentEditable=="true";default:return k.contentEditable=="true"}};var i=e.isTabNavigable=function(k){return b(k,"disabled")?false:d(k,"tabIndex")?b(k,"tabIndex")>=0:e.hasDefaultTabStop(k)};e._getTabNavigable=function(k){function m(D){return D&&D.tagName.toLowerCase()=="input"&&D.type&&D.type.toLowerCase()=="radio"&&D.name&&D.name.toLowerCase()}
function o(D){return x[m(D)]||D}var v,t,w,u,s,q,x={},A=function(D){c.query("> *",D).forEach(function(h){if(!(c.isIE&&h.scopeName!=="HTML"||!j(h))){if(i(h)){var l=b(h,"tabIndex");if(!d(h,"tabIndex")||l==0){v||(v=h);t=h}else if(l>0){if(!w||l<u){u=l;w=h}if(!s||l>=q){q=l;s=h}}l=m(h);if(c.attr(h,"checked")&&l)x[l]=h}h.nodeName.toUpperCase()!="SELECT"&&A(h)}})};j(k)&&A(k);return{first:o(v),last:o(t),lowest:o(w),highest:o(s)}};e.getFirstInTabbingOrder=function(k){k=e._getTabNavigable(c.byId(k));return k.lowest?
k.lowest:k.first};e.getLastInTabbingOrder=function(k){k=e._getTabNavigable(c.byId(k));return k.last?k.last:k.highest};e.defaultDuration=c.config.defaultDuration||200})();return e});
define("dojo/Stateful",["dojo"],function(c){c.declare("dojo.Stateful",null,{postscript:function(e){e&&c.mixin(this,e)},get:function(e){return this[e]},set:function(e,a){if(typeof e==="object"){for(var b in e)this.set(b,e[b]);return this}b=this[e];this[e]=a;this._watchCallbacks&&this._watchCallbacks(e,b,a);return this},watch:function(e,a){var b=this._watchCallbacks;if(!b){var d=this;b=this._watchCallbacks=function(g,j,i,k){var m=function(o){if(o){o=o.slice();for(var v=0,t=o.length;v<t;v++)try{o[v].call(d,
g,j,i)}catch(w){console.error(w)}}};m(b["_"+g]);k||m(b["*"])}}if(!a&&typeof e==="function"){a=e;e="*"}else e="_"+e;var f=b[e];if(typeof f!=="object")f=b[e]=[];f.push(a);return{unwatch:function(){f.splice(c.indexOf(f,a),1)}}}});return c.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(c,e){(function(){c.declare("dijit._WidgetBase",c.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(c.config.blankGif||c.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,b){this.create(a,b)},create:function(a,b){this.srcNodeRef=
c.byId(b);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;c._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=e.getUniqueId(this.declaredClass.replace(/\./g,"_"));e.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(d,f){if(f.params&&d in f.params||f[d])f.set(d,f[d])};for(var b in this.attributeMap)a(b,this);c.forEach(this._getSetterAttributes(),function(d){d in this.attributeMap||a(d,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var b=a._setterAttrs=[],d,f=a.prototype;for(var g in f)if(c.isFunction(f[g])&&(d=g.match(/^_set([a-zA-Z]*)Attr$/))&&
d[1])b.push(d[1].charAt(0).toLowerCase()+d[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||c.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(c.map(a,function(b){return b+"Rtl"})));c.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var b=c.forEach,d=c.unsubscribe;b(this._connects,function(f){b(f,c.disconnect)});b(this._subscribes,function(f){d(f)});b(this._supportingWidgets||[],function(f){if(f.destroyRecursive)f.destroyRecursive();else f.destroy&&f.destroy()});this.destroyRendering(a);e.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?c.removeAttr(this.domNode,
"widgetId"):c.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||c.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){c.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){c.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var b=this[this.attributeMap.style||"domNode"];if(c.isObject(a))c.style(b,
a);else if(b.style.cssText)b.style.cssText+="; "+a;else b.style.cssText=a;this._set("style",a)},_attrToDom:function(a,b){var d=this.attributeMap[a];c.forEach(c.isArray(d)?d:[d],function(f){var g=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":if(c.isFunction(b))b=c.hitch(this,b);f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;c.attr(g,f,b);break;case "innerText":g.innerHTML="";g.appendChild(c.doc.createTextNode(b));break;case "innerHTML":g.innerHTML=
b;break;case "class":c.replaceClass(g,b,this[a]);break}},this)},get:function(a){var b=this._getAttrNames(a);return this[b.g]?this[b.g]():this[a]},set:function(a,b){if(typeof a==="object"){for(var d in a)this.set(d,a[d]);return this}d=this._getAttrNames(a);if(this[d.s])var f=this[d.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,b);this._set(a,b)}return f||this},_attrPairNames:{},_getAttrNames:function(a){var b=this._attrPairNames;if(b[a])return b[a];
var d=a.charAt(0).toUpperCase()+a.substr(1);return b[a]={n:a+"Node",s:"_set"+d+"Attr",g:"_get"+d+"Attr"}},_set:function(a,b){var d=this[a];this[a]=b;this._watchCallbacks&&this._created&&b!==d&&this._watchCallbacks(a,d,b)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?c.query("[widgetId]",this.containerNode).map(e.byNode):[]},getChildren:function(){return this.containerNode?e.findWidgets(this.containerNode):
[]},connect:function(a,b,d){a=[c._connect(a,b,this,d)];this._connects.push(a);return a},disconnect:function(a){for(var b=0;b<this._connects.length;b++)if(this._connects[b]==a){c.forEach(a,c.disconnect);this._connects.splice(b,1);return}},subscribe:function(a,b){a=c.subscribe(a,this,b);this._subscribes.push(a);return a},unsubscribe:function(a){for(var b=0;b<this._subscribes.length;b++)if(this._subscribes[b]==a){c.unsubscribe(a);this._subscribes.splice(b,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":c._isBodyLtr()},placeAt:function(a,b){a.declaredClass&&a.addChild?a.addChild(this,b):c.place(this.domNode,a,b);return this}})})();return e._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(c,e){c.mixin(e,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return e.getBookmark().isCollapsed},getBookmark:function(){var a,b,d=c.doc.selection,f=e._curFocus;if(c.global.getSelection){if(d=c.global.getSelection())if(d.isCollapsed){if(a=f?f.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!f.type||f.type.toLowerCase()=="text")){d={start:f.selectionStart,end:f.selectionEnd,node:f,pRange:true};
return{isCollapsed:d.end<=d.start,mark:d}}}a={isCollapsed:true};if(d.rangeCount)a.mark=d.getRangeAt(0).cloneRange()}else{b=d.getRangeAt(0);a={isCollapsed:false,mark:b.cloneRange()}}}else if(d){a=f?f.tagName:"";a=a.toLowerCase();if(f&&a&&(a=="button"||a=="textarea"||a=="input"))if(d.type&&d.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{b=d.createRange();return{isCollapsed:b.text&&b.text.length?false:true,mark:{range:b,pRange:true}}}a={};try{b=d.createRange();a.isCollapsed=!(d.type==
"Text"?b.htmlText.length:b.length)}catch(g){a.isCollapsed=true;return a}if(d.type.toUpperCase()=="CONTROL")if(b.length){a.mark=[];d=0;for(f=b.length;d<f;)a.mark.push(b.item(d++))}else{a.isCollapsed=true;a.mark=null}else a.mark=b.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var b=c.doc;if(a=a.mark)if(c.global.getSelection){var d=c.global.getSelection();if(d&&d.removeAllRanges)if(a.pRange){d=a.node;d.selectionStart=
a.start;d.selectionEnd=a.end}else{d.removeAllRanges();d.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(b.selection&&a){var f;if(a.pRange)f=a.range;else if(c.isArray(a)){f=b.body.createControlRange();c.forEach(a,function(g){f.addElement(g)})}else{f=b.body.createTextRange();f.moveToBookmark(a)}f.select()}},getFocus:function(a,b){a=!e._curFocus||a&&c.isDescendant(e._curFocus,a.domNode)?e._prevFocus:e._curFocus;return{node:a,bookmark:a==e._curFocus&&c.withGlobal(b||
c.global,e.getBookmark),openedForWindow:b}},focus:function(a){if(a){var b="node"in a?a.node:a,d=a.bookmark;a=a.openedForWindow;var f=d?d.isCollapsed:false;if(b){var g=b.tagName.toLowerCase()=="iframe"?b.contentWindow:b;if(g&&g.focus)try{g.focus()}catch(j){}e._onFocusNode(b)}if(d&&c.withGlobal(a||c.global,e.isCollapsed)&&!f){a&&a.focus();try{c.withGlobal(a||c.global,e.moveToBookmark,null,[d])}catch(i){}}}},_activeStack:[],registerIframe:function(a){return e.registerWin(a.contentWindow,a)},unregisterIframe:function(a){e.unregisterWin(a)},
registerWin:function(a,b){var d=function(m){e._justMouseDowned=true;setTimeout(function(){e._justMouseDowned=false},0);c.isIE&&m&&m.srcElement&&m.srcElement.parentNode==null||e._onTouchNode(b||m.target||m.srcElement,"mouse")},f=c.isIE?a.document.documentElement:a.document;if(f)if(c.isIE){a.document.body.attachEvent("onmousedown",d);var g=function(m){m.srcElement.tagName.toLowerCase()!="#document"&&e.isTabNavigable(m.srcElement)?e._onFocusNode(b||m.srcElement):e._onTouchNode(b||m.srcElement)};f.attachEvent("onactivate",
g);var j=function(m){e._onBlurNode(b||m.srcElement)};f.attachEvent("ondeactivate",j);return function(){a.document.detachEvent("onmousedown",d);f.detachEvent("onactivate",g);f.detachEvent("ondeactivate",j);f=null}}else{f.body.addEventListener("mousedown",d,true);var i=function(m){e._onFocusNode(b||m.target)};f.addEventListener("focus",i,true);var k=function(m){e._onBlurNode(b||m.target)};f.addEventListener("blur",k,true);return function(){f.body.removeEventListener("mousedown",d,true);f.removeEventListener("focus",
i,true);f.removeEventListener("blur",k,true);f=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){e._prevFocus=e._curFocus;e._curFocus=null;if(!e._justMouseDowned){e._clearActiveWidgetsTimer&&clearTimeout(e._clearActiveWidgetsTimer);e._clearActiveWidgetsTimer=setTimeout(function(){delete e._clearActiveWidgetsTimer;e._setStack([]);e._prevFocus=null},100)}},_onTouchNode:function(a,b){if(e._clearActiveWidgetsTimer){clearTimeout(e._clearActiveWidgetsTimer);delete e._clearActiveWidgetsTimer}var d=
[];try{for(;a;){var f=c.attr(a,"dijitPopupParent");if(f)a=e.byId(f).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===c.body())break;a=c.window.get(a.ownerDocument).frameElement}else{var g=a.getAttribute&&a.getAttribute("widgetId"),j=g&&e.byId(g);j&&!(b=="mouse"&&j.get("disabled"))&&d.unshift(g);a=a.parentNode}}}catch(i){}e._setStack(d,b)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){e._onTouchNode(a);if(a!=e._curFocus){if(e._curFocus)e._prevFocus=e._curFocus;e._curFocus=a;c.publish("focusNode",
[a])}}},_setStack:function(a,b){var d=e._activeStack;e._activeStack=a;for(var f=0;f<Math.min(d.length,a.length);f++)if(d[f]!=a[f])break;for(var g,j=d.length-1;j>=f;j--)if(g=e.byId(d[j])){g._focused=false;g.set("focused",false);g._hasBeenBlurred=true;g._onBlur&&g._onBlur(b);c.publish("widgetBlur",[g,b])}for(j=f;j<a.length;j++)if(g=e.byId(a[j])){g._focused=true;g.set("focused",true);g._onFocus&&g._onFocus(b);c.publish("widgetFocus",[g,b])}}});c.addOnLoad(function(){var a=e.registerWin(window);c.isIE&&
c.addOnWindowUnload(function(){e.unregisterWin(a);a=null})});return e});
define("dojo/AdapterRegistry",["dojo"],function(c){c.AdapterRegistry=function(e){this.pairs=[];this.returnWrappers=e||false};c.extend(c.AdapterRegistry,{register:function(e,a,b,d,f){this.pairs[f?"unshift":"push"]([e,a,b,d])},match:function(){for(var e=0;e<this.pairs.length;e++){var a=this.pairs[e];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(e){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
e){this.pairs.splice(a,1);return true}return false}});return c.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(c,e){e.getViewport=function(){return c.window.getBox()};e.placeOnScreen=function(a,b,d,f){d=c.map(d,function(g){var j={corner:g,pos:{x:b.x,y:b.y}};if(f){j.pos.x+=g.charAt(1)=="L"?f.x:-f.x;j.pos.y+=g.charAt(0)=="T"?f.y:-f.y}return j});return e._place(a,d)};e._place=function(a,b,d,f){var g=c.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")c.body().appendChild(a);var j=null;
c.some(b,function(k){var m=k.corner,o=k.pos,v=0,t={w:m.charAt(1)=="L"?g.l+g.w-o.x:o.x-g.l,h:m.charAt(1)=="T"?g.t+g.h-o.y:o.y-g.t};if(d){v=d(a,k.aroundCorner,m,t,f);v=typeof v=="undefined"?0:v}var w=a.style,u=w.display,s=w.visibility;w.visibility="hidden";w.display="";var q=c.marginBox(a);w.display=u;w.visibility=s;w=Math.max(g.l,m.charAt(1)=="L"?o.x:o.x-q.w);u=Math.max(g.t,m.charAt(0)=="T"?o.y:o.y-q.h);s=Math.min(g.l+g.w,m.charAt(1)=="L"?w+q.w:o.x);o=Math.min(g.t+g.h,m.charAt(0)=="T"?u+q.h:o.y);s=
s-w;o=o-u;v+=q.w-s+(q.h-o);if(j==null||v<j.overflow)j={corner:m,aroundCorner:k.aroundCorner,x:w,y:u,w:s,h:o,overflow:v,spaceAvailable:t};return!v});j.overflow&&d&&d(a,j.aroundCorner,j.corner,j.spaceAvailable,f);b=c._isBodyLtr();var i=a.style;i.top=j.y+"px";i[b?"left":"right"]=(b?j.x:g.w-j.x-j.w)+"px";return j};e.placeOnScreenAroundNode=function(a,b,d,f){b=c.byId(b);b=c.position(b,true);return e._placeOnScreenAroundRect(a,b.x,b.y,b.w,b.h,d,f)};e.placeOnScreenAroundRectangle=function(a,b,d,f){return e._placeOnScreenAroundRect(a,
b.x,b.y,b.width,b.height,d,f)};e._placeOnScreenAroundRect=function(a,b,d,f,g,j,i){var k=[];for(var m in j)k.push({aroundCorner:m,corner:j[m],pos:{x:b+(m.charAt(1)=="L"?0:f),y:d+(m.charAt(0)=="T"?0:g)}});return e._place(a,k,i,{w:f,h:g})};e.placementRegistry=new c.AdapterRegistry;e.placementRegistry.register("node",function(a,b){return typeof b=="object"&&typeof b.offsetWidth!="undefined"&&typeof b.offsetHeight!="undefined"},e.placeOnScreenAroundNode);e.placementRegistry.register("rect",function(a,
b){return typeof b=="object"&&"x"in b&&"y"in b&&"width"in b&&"height"in b},e.placeOnScreenAroundRectangle);e.placeOnScreenAroundElement=function(){return e.placementRegistry.match.apply(e.placementRegistry,arguments)};e.getPopupAroundAlignment=function(a,b){var d={};c.forEach(a,function(f){switch(f){case "after":d[b?"BR":"BL"]=b?"BL":"BR";break;case "before":d[b?"BL":"BR"]=b?"BR":"BL";break;case "below-alt":b=!b;case "below":d[b?"BL":"BR"]=b?"TL":"TR";d[b?"BR":"BL"]=b?"TR":"TL";break;case "above-alt":b=
!b;case "above":default:d[b?"TL":"TR"]=b?"BL":"BR";d[b?"TR":"TL"]=b?"BR":"BL";break}});return d};return e});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(c,e){e.getDocumentWindow=function(a){return c.window.get(a)};return e});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(c,e){e.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var b=a.declaredClass?a._popupWrapper:a.parentNode&&c.hasClass(a.parentNode,"dijitPopup"),d=a.domNode||a;if(!b){b=c.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},c.body());b.appendChild(d);d=d.style;d.display="";d.visibility="";d.position="";d.top="0px";if(a.declaredClass){a._popupWrapper=
b;c.connect(a,"destroy",function(){c.destroy(b);delete a._popupWrapper})}}return b},moveOffScreen:function(a){a=this._createWrapper(a);c.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);c.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,b=a.length-1;b>0&&a[b].parent===a[b-1].widget;b--);return a[b]},open:function(a){for(var b=this._stack,d=a.popup,f=a.orient||((a.parent?a.parent.isLeftToRight():c._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),g=a.around,j=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;b.length&&(!a.parent||!c.isDescendant(a.parent.domNode,b[b.length-1].widget.domNode));)e.popup.close(b[b.length-1].widget);var i=this._createWrapper(d);c.attr(i,{id:j,style:{zIndex:this._beginZIndex+b.length},"class":"dijitPopup "+(d.baseClass||d["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(c.isIE||c.isMoz)if(!d.bgIframe)d.bgIframe=
new e.BackgroundIframe(i);f=g?e.placeOnScreenAroundElement(i,g,f,d.orient?c.hitch(d,"orient"):null):e.placeOnScreen(i,a,f=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);i.style.display="";i.style.visibility="visible";d.domNode.style.visibility="visible";g=[];g.push(c.connect(i,"onkeypress",this,function(k){if(k.charOrCode==c.keys.ESCAPE&&a.onCancel){c.stopEvent(k);a.onCancel()}else if(k.charOrCode===c.keys.TAB){c.stopEvent(k);(k=this.getTopPopup())&&k.onCancel&&k.onCancel()}}));d.onCancel&&
g.push(c.connect(d,"onCancel",a.onCancel));g.push(c.connect(d,d.onExecute?"onExecute":"onChange",this,function(){var k=this.getTopPopup();k&&k.onExecute&&k.onExecute()}));b.push({widget:d,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:g});d.onOpen&&d.onOpen(f);return f},close:function(a){for(var b=this._stack;a&&c.some(b,function(j){return j.widget==a})||!a&&b.length;){var d=b.pop(),f=d.widget,g=d.onClose;f.onClose&&f.onClose();c.forEach(d.handlers,c.disconnect);
f&&f.domNode&&this.hide(f);g&&g()}}};e._frames=new (function(){var a=[];this.pop=function(){var b;if(a.length){b=a.pop();b.style.display=""}else{if(c.isIE<9){b="<iframe src='"+(c.config.dojoBlankHtmlUrl||c.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";b=c.doc.createElement(b)}else{b=c.create("iframe");b.src='javascript:""';b.className="dijitBackgroundIframe";c.style(b,"opacity",0.1)}b.tabIndex=
-1;e.setWaiRole(b,"presentation")}return b};this.push=function(b){b.style.display="none";a.push(b)}});e.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(c.isIE||c.isMoz){var b=this.iframe=e._frames.pop();a.appendChild(b);if(c.isIE<7||c.isQuirks){this.resize(a);this._conn=c.connect(a,"onresize",this,function(){this.resize(a)})}else c.style(b,{width:"100%",height:"100%"})}};c.extend(e.BackgroundIframe,{resize:function(a){this.iframe&&c.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){c.disconnect(this._conn);this._conn=null}if(this.iframe){e._frames.push(this.iframe);delete this.iframe}}});return e.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(c,e){e.scrollIntoView=function(a,b){c.window.scrollIntoView(a,b)};return e.scrollIntoView});
define("dojo/uacss",["dojo"],function(c){(function(){var e=c.doc.documentElement,a=c.isIE,b=c.isOpera,d=Math.floor,f=c.isFF,g=c.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:d(a)==6,dj_ie7:d(a)==7,dj_ie8:d(a)==8,dj_ie9:d(a)==9,dj_quirks:c.isQuirks,dj_iequirks:a&&c.isQuirks,dj_opera:b,dj_khtml:c.isKhtml,dj_webkit:c.isWebKit,dj_safari:c.isSafari,dj_chrome:c.isChrome,dj_gecko:c.isMozilla,dj_ff3:d(f)==3};a["dj_"+g]=true;var j="";for(var i in a)if(a[i])j+=i+" ";e.className=c.trim(e.className+" "+j);c._loaders.unshift(function(){if(!c._isBodyLtr()){var k=
"dj_rtl dijitRtl "+j.replace(/ /g,"-rtl ");e.className=c.trim(e.className+" "+k)}})})();return c});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(c,e){return e});
define("dijit/_base/typematic",["dojo","dijit"],function(c,e){e.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(c.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,b,d,f,g,j,i,k){if(g!=this._obj){this.stop();
this._initialDelay=i||500;this._subsequentDelay=j||0.9;this._minDelay=k||10;this._obj=g;this._evt=a;this._node=d;this._count=this._currentTimeout=-1;this._callback=c.hitch(b,f);this._fireEventAndReload();this._evt=c.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,b,d,f,g,j,i){if(b.keyCode){b.charOrCode=b.keyCode;c.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(b.charCode){b.charOrCode=String.fromCharCode(b.charCode);c.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[c.connect(a,"onkeypress",this,function(k){if(k.charOrCode==b.charOrCode&&(b.ctrlKey===undefined||b.ctrlKey==k.ctrlKey)&&(b.altKey===undefined||b.altKey==k.altKey)&&(b.metaKey===undefined||b.metaKey==(k.metaKey||false))&&(b.shiftKey===undefined||b.shiftKey==k.shiftKey)){c.stopEvent(k);e.typematic.trigger(k,
d,a,f,b,g,j,i)}else e.typematic._obj==b&&e.typematic.stop()}),c.connect(a,"onkeyup",this,function(){e.typematic._obj==b&&e.typematic.stop()})]},addMouseListener:function(a,b,d,f,g,j){var i=c.connect;return[i(a,"mousedown",this,function(k){c.stopEvent(k);e.typematic.trigger(k,b,a,d,a,f,g,j)}),i(a,"mouseup",this,function(k){c.stopEvent(k);e.typematic.stop()}),i(a,"mouseout",this,function(k){c.stopEvent(k);e.typematic.stop()}),i(a,"mousemove",this,function(k){k.preventDefault()}),i(a,"dblclick",this,
function(k){c.stopEvent(k);if(c.isIE){e.typematic.trigger(k,b,a,d,a,f,g,j);setTimeout(c.hitch(this,e.typematic.stop),50)}})]},addListener:function(a,b,d,f,g,j,i,k){return this.addKeyListener(b,d,f,g,j,i,k).concat(this.addMouseListener(a,f,g,j,i,k))}};return e.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(c,e){e.wai={onload:function(){var a=c.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(c.config.blankGif||c.moduleUrl("dojo","resources/blank.gif"))+'");'}},c.body()),b=c.getComputedStyle(a);if(b){var d=b.backgroundImage;c[b.borderTopColor==b.borderRightColor||d!=null&&(d=="none"||d=="url(invalid-url:)")?"addClass":"removeClass"](c.body(),
"dijit_a11y");if(c.isIE)a.outerHTML="";else c.body().removeChild(a)}}};if(c.isIE||c.isMoz)c._loaders.unshift(e.wai.onload);c.mixin(e,{hasWaiRole:function(a,b){a=this.getWaiRole(a);return b?a.indexOf(b)>-1:a.length>0},getWaiRole:function(a){return c.trim((c.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,b){c.attr(a,"role",b)},removeWaiRole:function(a,b){var d=c.attr(a,"role");if(d)if(b){b=c.trim((" "+d+" ").replace(" "+b+" "," "));c.attr(a,"role",b)}else a.removeAttribute("role")},
hasWaiState:function(a,b){return a.hasAttribute?a.hasAttribute("aria-"+b):!!a.getAttribute("aria-"+b)},getWaiState:function(a,b){return a.getAttribute("aria-"+b)||""},setWaiState:function(a,b,d){a.setAttribute("aria-"+b,d)},removeWaiState:function(a,b){a.removeAttribute("aria-"+b)}});return e});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(c,e){return e._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(c,e){c.connect(c,"_connect",function(a,b){a&&c.isFunction(a._onConnect)&&a._onConnect(b)});e._connectOnUseEventHandler=function(){};e._lastKeyDownNode=null;c.isIE?function(){var a=function(b){e._lastKeyDownNode=b.srcElement};c.doc.attachEvent("onkeydown",a);c.addOnWindowUnload(function(){c.doc.detachEvent("onkeydown",a)})}():c.doc.addEventListener("keydown",function(a){e._lastKeyDownNode=a.target},true);(function(){c.declare("dijit._Widget",
e._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:e._connectOnUseEventHandler,onDblClick:e._connectOnUseEventHandler,onKeyDown:e._connectOnUseEventHandler,onKeyPress:e._connectOnUseEventHandler,onKeyUp:e._connectOnUseEventHandler,onMouseDown:e._connectOnUseEventHandler,onMouseMove:e._connectOnUseEventHandler,onMouseOut:e._connectOnUseEventHandler,
onMouseOver:e._connectOnUseEventHandler,onMouseLeave:e._connectOnUseEventHandler,onMouseEnter:e._connectOnUseEventHandler,onMouseUp:e._connectOnUseEventHandler,create:function(){this._deferredConnects=c.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==e._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&c.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,b){c.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,b)},attr:function(a){if(c.config.isDebug){var b=
arguments.callee._ach||(arguments.callee._ach={}),d=(arguments.callee.caller||"unknown caller").toString();if(!b[d]){c.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+d,"","2.0");b[d]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,b,d){var f=c._connect,g=this.inherited(arguments,[a,b=="ondijitclick"?"onclick":b,d]);if(b=="ondijitclick")if(c.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var j=c.hitch(this,d);g.push(f(a,"onkeydown",this,function(i){if((i.keyCode==c.keys.ENTER||i.keyCode==c.keys.SPACE)&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){e._lastKeyDownNode=i.target;"openDropDown"in this&&a==this._buttonNode||i.preventDefault()}}),f(a,"onkeyup",this,function(i){if((i.keyCode==c.keys.ENTER||i.keyCode==c.keys.SPACE)&&i.target==e._lastKeyDownNode&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){e._lastKeyDownNode=null;return j(i)}}))}return g},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return e._Widget});
define("dojo/string",["dojo"],function(c){c.getObject("string",true,c);c.string.rep=function(e,a){if(a<=0||!e)return"";for(var b=[];;){a&1&&b.push(e);if(!(a>>=1))break;e+=e}return b.join("")};c.string.pad=function(e,a,b,d){b||(b="0");e=String(e);a=c.string.rep(b,Math.ceil((a-e.length)/b.length));return d?e+a:a+e};c.string.substitute=function(e,a,b,d){d=d||c.global;b=b?c.hitch(d,b):function(f){return f};return e.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(f,g,j){f=c.getObject(g,false,
a);if(j)f=c.getObject(j,false,d).call(d,f,g);return b(f,g).toString()})};c.string.trim=String.prototype.trim?c.trim:function(e){e=e.replace(/^\s+/,"");for(var a=e.length-1;a>=0;a--)if(/\S/.test(e.charAt(a))){e=e.substring(0,a+1);break}return e};return c.string});
define("dojo/date/stamp",["dojo"],function(c){c.getObject("date.stamp",true,c);c.date.stamp.fromISOString=function(e,a){if(!c.date.stamp._isoRegExp)c.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var b=c.date.stamp._isoRegExp.exec(e);e=null;if(b){b.shift();b[1]&&b[1]--;if(b[6])b[6]*=1E3;if(a){a=new Date(a);c.forEach(c.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(g){return a["get"+
g]()}),function(g,j){b[j]=b[j]||g})}e=new Date(b[0]||1970,b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0);if(b[0]<100)e.setFullYear(b[0]||1970);var d=0,f=b[7]&&b[7].charAt(0);if(f!="Z"){d=(b[8]||0)*60+(Number(b[9])||0);if(f!="-")d*=-1}if(f)d-=e.getTimezoneOffset();d&&e.setTime(e.getTime()+d*6E4)}return e};c.date.stamp.toISOString=function(e,a){var b=function(j){return j<10?"0"+j:j};a=a||{};var d=[],f=a.zulu?"getUTC":"get",g="";if(a.selector!="time"){g=e[f+"FullYear"]();g=["0000".substr((g+"").length)+
g,b(e[f+"Month"]()+1),b(e[f+"Date"]())].join("-")}d.push(g);if(a.selector!="date"){g=[b(e[f+"Hours"]()),b(e[f+"Minutes"]()),b(e[f+"Seconds"]())].join(":");f=e[f+"Milliseconds"]();if(a.milliseconds)g+="."+(f<100?"0":"")+b(f);if(a.zulu)g+="Z";else if(a.selector!="time"){e=e.getTimezoneOffset();a=Math.abs(e);g+=(e>0?"-":"+")+b(Math.floor(a/60))+":"+b(a%60)}d.push(g)}return d.join("T")};return c.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(c){c.parser=new (function(){function e(i){if(f.isString(i))return"string";if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(f.isFunction(i))return"function";if(f.isArray(i))return"array";if(i instanceof Date)return"date";if(i instanceof f._Url)return"url";return"object"}function a(i,k){switch(k){case "string":return i;case "number":return i.length?Number(i):NaN;case "boolean":return typeof i=="boolean"?i:i.toLowerCase()!=
"false";case "function":if(f.isFunction(i)){i=i.toString();i=f.trim(i.substring(i.indexOf("{")+1,i.length-1))}try{return i===""||i.search(/[^\w\.]+/i)!=-1?new Function(i):f.getObject(i,false)||new Function(i)}catch(m){return new Function}case "array":return i?i.split(/\s*,\s*/):[];case "date":switch(i){case "":return new Date("");case "now":return new Date;default:return f.date.stamp.fromISOString(i)}case "url":return f.baseUrl+i;default:return f.fromJson(i)}}function b(i,k){for(var m in i)if(m.charAt(0)!=
"_")m in g||(k[m]=e(i[m]));return k}function d(i,k){var m=j[i];if(m){if(!k&&!m.params)m.params=b(m.cls.prototype,{})}else{i=f.getObject(i);m=null;if(!i)return null;k||(m=b(i.prototype,{}));m={cls:i,params:m}}return m}var f=c,g={},j={};f.connect(f,"extend",function(){j={}});this._functionFromScript=function(i,k){var m="",o="";(k=i.getAttribute(k+"args")||i.getAttribute("args"))&&f.forEach(k.split(/\s*,\s*/),function(v,t){m+="var "+v+" = arguments["+t+"]; "});(k=i.getAttribute("with"))&&k.length&&f.forEach(k.split(/\s*,\s*/),
function(v){m+="with("+v+"){";o+="}"});return new Function(m+i.innerHTML+o)};this.instantiate=function(i,k,m){var o=[];k=k||{};m=m||{};var v=(m.scope||f._scopeName)+"Type",t="data-"+(m.scope||f._scopeName)+"-";f.forEach(i,function(w){if(w){var u,s,q,x,A,D;if(w.node){u=w.node;s=w.type;D=w.fastpath;x=(q=w.clsInfo||s&&d(s,D))&&q.cls;A=w.scripts}else{u=w;A=(x=(q=(s=v in k?k[v]:u.getAttribute(v))&&d(s))&&q.cls)&&(x._noScript||x.prototype._noScript)?[]:f.query("> script[type^='dojo/']",u)}if(!q)throw new Error("Could not load class '"+
s);var h={};m.defaults&&f._mixin(h,m.defaults);w.inherited&&f._mixin(h,w.inherited);if(D){if((q=u.getAttribute(t+"props"))&&q.length)try{q=f.fromJson.call(m.propsThis,"{"+q+"}");f._mixin(h,q)}catch(l){throw new Error(l.toString()+" in data-dojo-props='"+q+"'");}if(q=u.getAttribute(t+"attach-point"))h.dojoAttachPoint=q;if(q=u.getAttribute(t+"attach-event"))h.dojoAttachEvent=q;c.mixin(h,k)}else{w=u.attributes;for(var n in q.params){s=n in k?{value:k[n],specified:true}:w.getNamedItem(n);if(!(!s||!s.specified&&
(!c.isIE||n.toLowerCase()!="value"))){s=s.value;switch(n){case "class":s="className"in k?k.className:u.className;break;case "style":s="style"in k?k.style:u.style&&u.style.cssText}var p=q.params[n];h[n]=typeof s=="string"?a(s,p):s}}}var r=[],y=[];f.forEach(A,function(z){u.removeChild(z);var E=z.getAttribute(t+"event")||z.getAttribute("event"),G=z.getAttribute("type");z=f.parser._functionFromScript(z,t);if(E)if(G=="dojo/connect")r.push({event:E,func:z});else h[E]=z;else y.push(z)});var B=(A=x.markupFactory||
x.prototype&&x.prototype.markupFactory)?A(h,u,x):new x(h,u);o.push(B);(x=u.getAttribute(t+"id")||u.getAttribute("jsId"))&&f.setObject(x,B);f.forEach(r,function(z){f.connect(B,z.event,null,z.func)});f.forEach(y,function(z){z.call(B)})}});k._started||f.forEach(o,function(w){if(!m.noStart&&w&&c.isFunction(w.startup)&&!w._started&&(!w.getParent||!w.getParent()))w.startup()});return o};this.parse=function(i,k){function m(u,s){var q=c.clone(u.inherited);c.forEach(["dir","lang"],function(n){var p=u.node.getAttribute(n);
if(p)q[n]=p});for(var x=u.clsInfo&&!u.clsInfo.cls.prototype._noScript?u.scripts:null,A=!u.clsInfo||!u.clsInfo.cls.prototype.stopParser||k&&k.template,D=u.node.firstChild;D;D=D.nextSibling)if(D.nodeType==1){var h,l=A&&D.getAttribute(v+"type");h=l?l:A&&D.getAttribute(o);l=l==h;if(h){h={type:h,fastpath:l,clsInfo:d(h,l),node:D,scripts:[],inherited:q};s.push(h);m(h,s)}else if(x&&D.nodeName.toLowerCase()=="script")(h=D.getAttribute("type"))&&/^dojo\/\w/i.test(h)&&x.push(D);else A&&m({node:D,inherited:q},
s)}}if(!k&&i&&i.rootNode){k=i;i=k.rootNode}else i=i;i=i?c.byId(i):c.body();k=k||{};var o=(k.scope||f._scopeName)+"Type",v="data-"+(k.scope||f._scopeName)+"-",t={};if(k&&k.inherited)for(var w in k.inherited)if(k.inherited[w])t[w]=k.inherited[w];w=[];m({node:i,inherited:t},w);return this.instantiate(w,k&&k.template?{template:true}:null,k)}});(function(){var e=function(){c.config.parseOnLoad&&c.parser.parse()};c.getObject("dijit.wai.onload")===c._loaders[0]?c._loaders.splice(1,0,e):c._loaders.unshift(e)})();
return c.parser});
define("dojo/cache",["dojo"],function(c){var e={};c.cache=function(a,b,d){if(typeof a=="string")var f=c.moduleUrl(a,b);else{f=a;d=b}f=f.toString();var g=d;if(d!=undefined&&!c.isString(d))g="value"in d?d.value:undefined;d=d&&d.sanitize?true:false;if(typeof g=="string")g=e[f]=d?c.cache._sanitize(g):g;else if(g===null)delete e[f];else{if(!(f in e)){g=undefined;if(c.isFunction(require)&&c.isString(a))try{var j=(a?a.replace(/\./g,"/")+"/":"")+b;g=require("text!"+j)}catch(i){}if(typeof g==="undefined")g=
c._getText(f);e[f]=d?c.cache._sanitize(g):g}g=e[f]}return g};c.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var b=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(b)a=b[1]}else a="";return a};return c.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(c,e){c.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var b=this.declaredClass,d=this;return c.string.substitute(a,this,function(f,g){if(g.charAt(0)=="!")f=c.getObject(g.substr(1),false,d);if(typeof f==
"undefined")throw new Error(b+" template:"+g);if(f==null)return"";return g.charAt(0)=="!"?f:f.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=e._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),b;if(c.isString(a)){b=c._toDom(this._stringRepl(a));if(b.nodeType!=1)throw new Error("Invalid template: "+a);}else b=a.cloneNode(true);this.domNode=b;this.inherited(arguments);this._attachTemplateNodes(b);if(this.widgetsInTemplate){a=this._startupWidgets=
c.parser.parse(b,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=e.findWidgets(b);this._attachTemplateNodes(a,function(d,f){return d[f]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var b=this.containerNode;if(a&&b)for(;a.hasChildNodes();)b.appendChild(a.firstChild)},_attachTemplateNodes:function(a,b){b=b||function(o,v){return o.getAttribute(v)};for(var d=c.isArray(a)?a:a.all||a.getElementsByTagName("*"),
f=c.isArray(a)?0:-1;f<d.length;f++){var g=f==-1?a:d[f];if(!(this.widgetsInTemplate&&(b(g,"dojoType")||b(g,"data-dojo-type")))){var j=b(g,"dojoAttachPoint")||b(g,"data-dojo-attach-point");if(j)for(var i=j.split(/\s*,\s*/);j=i.shift();){if(c.isArray(this[j]))this[j].push(g);else this[j]=g;this._attachPoints.push(j)}if(j=b(g,"dojoAttachEvent")||b(g,"data-dojo-attach-event")){i=j.split(/\s*,\s*/);for(var k=c.trim;j=i.shift();)if(j){var m=null;if(j.indexOf(":")!=-1){m=j.split(":");j=k(m[0]);m=k(m[1])}else j=
k(j);m||(m=j);this._attachEvents.push(this.connect(g,j,m))}}(j=b(g,"waiRole"))&&e.setWaiRole(g,j);(j=b(g,"waiState"))&&c.forEach(j.split(/\s*,\s*/),function(o){if(o.indexOf("-")!=-1){o=o.split("-");e.setWaiState(g,o[0],o[1])}})}}},startup:function(){c.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){c.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];c.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});e._Templated._templateCache={};e._Templated.getCachedTemplate=function(a,b,d){var f=e._Templated._templateCache,g=b||a,j=f[g];if(j){try{if(!j.ownerDocument||j.ownerDocument==c.doc)return j}catch(i){}c.destroy(j)}b||(b=c.cache(a,{sanitize:true}));b=c.string.trim(b);if(d||b.match(/\$\{([^\}]+)\}/g))return f[g]=b;else{a=c._toDom(b);if(a.nodeType!=1)throw new Error("Invalid template: "+b);return f[g]=a}};c.isIE&&c.addOnWindowUnload(function(){var a=
e._Templated._templateCache;for(var b in a){var d=a[b];typeof d=="object"&&c.destroy(d);delete a[b]}});c.extend(e._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return e._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(c,e){c.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);c.forEach(["onmouseenter","onmouseleave","onmousedown"],function(b){this.connect(this.domNode,b,"_cssMouseEvent")},this);c.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(b){this.watch(b,c.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var b=this.connect(c.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(b)});break}},_setStateClass:function(){function a(i){b=
b.concat(c.map(b,function(k){return k+i}),"dijit"+i)}var b=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var d=this.stateNode||this.domNode,f={};c.forEach(d.className.split(" "),function(i){f[i]=true});"_stateClasses"in this&&c.forEach(this._stateClasses,
function(i){delete f[i]});c.forEach(b,function(i){f[i]=true});var g=[];for(var j in f)g.push(j);d.className=g.join(" ");this._stateClasses=b},_trackMouseState:function(a,b){function d(){var m="disabled"in i&&i.disabled||"readonly"in i&&i.readonly;c.toggleClass(a,b+"Hover",f&&!g&&!m);c.toggleClass(a,b+"Active",g&&!m);c.toggleClass(a,b+"Focused",j&&!m)}var f=false,g=false,j=false,i=this,k=c.hitch(this,"connect",a);k("onmouseenter",function(){f=true;d()});k("onmouseleave",function(){g=f=false;d()});
k("onmousedown",function(){g=true;d()});k("onmouseup",function(){g=false;d()});k("onfocus",function(){j=true;d()});k("onblur",function(){j=false;d()});this.watch("disabled",d);this.watch("readOnly",d)}});return e._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(c,e){c.declare("dijit.form._FormWidget",[e._Widget,e._Templated,e._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:c.delegate(e._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);c.attr(this.focusNode,"disabled",a);this.valueNode&&c.attr(this.valueNode,"disabled",a);e.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
c.forEach(c.isArray(a)?a:[a],function(b){b=this[b];c.isWebKit||e.hasDefaultTabStop(b)?b.setAttribute("tabIndex","-1"):b.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){c.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&c.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&c.style(this.domNode,"display")!="none"},focus:function(){this.disabled||e.focus(this.focusNode)},compare:function(a,b){return typeof a=="number"&&typeof b=="number"?isNaN(a)&&isNaN(b)?0:a-b:a>b?1:a<b?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,b){if(this._lastValueReported==undefined&&(b===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||b||b===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(c.hitch(this,function(){this._onChangeHandle=null;this.onChange(a)}),0)}}},create:function(){this.inherited(arguments);this._onChangeActive=true},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported)}this.inherited(arguments)},
setValue:function(a){c.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){c.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&c.mouseButtons.isLeft(a)&&this.isFocusable())var b=this.connect(c.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(b)})}});c.declare("dijit.form._FormValueWidget",
e.form._FormWidget,{readOnly:false,attributeMap:c.delegate(e.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){c.attr(this.focusNode,"readOnly",a);e.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(c.isIE<9||c.isIE&&c.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,b){this._handleOnChange(a,b)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==c.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var b;if(c.isIE){a.preventDefault();b=document.createEventObject();b.keyCode=c.keys.ESCAPE;b.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
b)}}},_layoutHackIE7:function(){if(c.isIE==7)for(var a=this.domNode,b=a.parentNode,d=a.firstChild||a,f=d.style.filter,g=this;b&&b.clientHeight==0;){(function(){var j=g.connect(b,"onscroll",function(){g.disconnect(j);d.style.filter=(new Date).getMilliseconds();setTimeout(function(){d.style.filter=f},0)})})();b=b.parentNode}}});return e.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(c,e){c.declare("dijit.form.TextBox",e.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:c.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:c.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:c.delegate(e.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==e.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=c.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
b,d){var f;if(a!==undefined){f=this.filter(a);if(typeof d!="string")d=f!==null&&(typeof f!="number"||!isNaN(f))?this.filter(this.format(f,this.constraints)):""}if(d!=null&&d!=undefined&&(typeof d!="number"||!isNaN(d))&&this.textbox.value!=d){this.textbox.value=d;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[f,b])},displayedValue:"",getDisplayedValue:function(){c.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},setDisplayedValue:function(a){c.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_setDisplayedValueAttr:function(a){if(a===null||a===undefined)a="";else if(typeof a!="string")a=String(a);this.textbox.value=a;this._setValueAttr(this.get("value"),undefined);this._set("displayedValue",
this.get("displayedValue"))},format:function(a){return a==null||a==undefined?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},_onInput:function(a){if(a&&a.type&&/key/i.test(a.type)&&a.keyCode)switch(a.keyCode){case c.keys.SHIFT:case c.keys.ALT:case c.keys.CTRL:case c.keys.TAB:return}if(this.intermediateChanges){var b=this;setTimeout(function(){b._handleOnChange(b.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){c.isIE&&setTimeout(c.hitch(this,function(){var a=c.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var b=this.domNode.getElementsByTagName("INPUT");if(b)for(var d=0;d<b.length;d++)b[d].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(c.isMoz||c.isOpera)this.connect(this.textbox,"oninput","_onInput");else{this.connect(this.textbox,"onkeydown","_onInput");this.connect(this.textbox,"onkeyup","_onInput");this.connect(this.textbox,
"onpaste","_onInput");this.connect(this.textbox,"oncut","_onInput")}},_blankValue:"",filter:function(a){if(a===null)return this._blankValue;if(typeof a!="string")return a;if(this.trim)a=c.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(b){return b.substring(0,1).toUpperCase()+b.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&c.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var b;if(c.isIE){b=c.doc.selection.createRange();b=b.parentElement()==this.textbox&&
b.text.length==0}else b=this.textbox.selectionStart==this.textbox.selectionEnd;b&&e.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});e.selectInputText=function(a,b,d){var f=c.global,g=c.doc;a=c.byId(a);if(isNaN(b))b=0;if(isNaN(d))d=a.value?a.value.length:0;e.focus(a);if(g.selection&&c.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",b);a.moveEnd("character",d-b);a.select()}}else f.getSelection&&a.setSelectionRange&&a.setSelectionRange(b,d)};return e.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(c,e){c.declare("dijit._MasterTooltip",[e._Widget,e._Templated],{duration:e.defaultDuration,templateString:c.cache("dijit","templates/Tooltip.html"),postCreate:function(){c.body().appendChild(this.domNode);this.bgIframe=new e.BackgroundIframe(this.domNode);this.fadeIn=c.fadeIn({node:this.domNode,duration:this.duration,onEnd:c.hitch(this,"_onShow")});this.fadeOut=c.fadeOut({node:this.domNode,
duration:this.duration,onEnd:c.hitch(this,"_onHide")})},show:function(a,b,d,f){if(!(this.aroundNode&&this.aroundNode===b)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;e.placeOnScreenAroundElement(this.domNode,b,e.getPopupAroundAlignment(d&&d.length?d:e.Tooltip.defaultPosition,!f),c.hitch(this,"orient"));c.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=b}}},orient:function(a,b,d,
f,g){this.connectorNode.style.top="";var j=f.w-this.connectorNode.offsetWidth;a.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[b+"-"+d];this.domNode.style.width="auto";var i=c.contentBox(this.domNode),k=Math.min(Math.max(j,1),i.w),m=k<i.w;this.domNode.style.width=k+"px";if(m){this.containerNode.style.overflow=
"auto";m=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(m>k){m=m+c.style(this.domNode,"paddingLeft")+c.style(this.domNode,"paddingRight");this.domNode.style.width=m+"px"}}if(d.charAt(0)=="B"&&b.charAt(0)=="B"){a=c.marginBox(a);b=this.connectorNode.offsetHeight;if(a.h>f.h){this.connectorNode.style.top=f.h-g.h/2-b/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(g.h/2-b/2,0),a.h-b)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,i.w-j)},_onShow:function(){if(c.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});e.showTooltip=function(a,b,d,f){if(!e._masterTT)e._masterTT=
new e._MasterTooltip;return e._masterTT.show(a,b,d,f)};e.hideTooltip=function(a){if(!e._masterTT)e._masterTT=new e._MasterTooltip;return e._masterTT.hide(a)};c.declare("dijit.Tooltip",e._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){c.forEach(this._connections||[],function(d){c.forEach(d,c.hitch(this,"disconnect"))},this);var b=c.isArrayLike(a)?a:a?[a]:[];this._connections=c.map(b,function(d){return(d=c.byId(d))?[this.connect(d,"onmouseenter","_onTargetMouseEnter"),
this.connect(d,"onmouseleave","_onTargetMouseLeave"),this.connect(d,"onfocus","_onTargetFocus"),this.connect(d,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=b},addTarget:function(a){a=a.id||a;c.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=c.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
c.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;c.forEach(c.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var b=a.target;this._showTimer=setTimeout(c.hitch(this,function(){this.open(b)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}e.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){e.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});e.Tooltip.defaultPosition=["after","before"];return e.Tooltip});
(function(){function c(b,d,f,g,j,i){if(d[b]){f.push(b);if(d[b]===true||d[b]===1)g.push(j+b+"/"+i)}}function e(b,d,f,g,j){d=g+d+"/"+j;require._fileExists(b.nameToUrl(d,null))&&f.push(d)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(b,d,f,g){g=g||{};var j=a.exec(b),i=j[1],k=j[4],m=j[5],o=k.split("-"),v=[],t={},w,u,s="";if(j[5]){i=j[1];b=i+m}else{b=b;m=j[4];k=g.locale||(g.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());o=k.split("-")}if(g.isBuild){v.push(b);e(d,"root",v,i,m);for(w=0;u=o[w];w++){s+=(s?"-":"")+u;e(d,s,v,i,m)}d(v);f()}else d([b],function(q){var x=[];c("root",q,x,v,i,m);for(w=0;u=o[w];w++){s+=(s?"-":"")+u;c(s,q,x,v,i,m)}d(v,function(){var A,D;for(A=x.length-1;A>-1&&(u=x[A]);A--){D=q[u];if(D===true||D===1)D=d(i+u+"/"+m);require.mixin(t,D)}f(t)})})}})})();
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ValidationTextBox",["dojo","dijit","text!dijit/form/templates/ValidationTextBox.html","dojo/i18n","dijit/form/TextBox","dijit/Tooltip","i18n!dijit/form/nls/validate"],function(c,e){c.declare("dijit.form.ValidationTextBox",e.form.TextBox,{templateString:c.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,b){return(new RegExp("^(?:"+this.regExpGen(b)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,b)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var b="",d=this.disabled||this.isValid(a);if(d)this._maskValidSubsetError=true;var f=this._isEmpty(this.textbox.value),g=!d&&a&&this._isValidSubset();this._set("state",d?"":((!this._hasBeenBlurred||a)&&f||g)&&this._maskValidSubsetError?
"Incomplete":"Error");e.setWaiState(this.focusNode,"invalid",d?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&g;b=this.getErrorMessage(a)}else if(this.state=="Incomplete"){b=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(f)b=this.getPromptMessage(a);this.set("message",b);return d},displayMessage:function(a){e.hideTooltip(this.domNode);a&&this._focused&&e.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var b="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(f){switch(f.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":b+=f;break;case ")":b+="|$)";break;
default:b+="(?:"+f+"|$)";break}});try{"".search(b)}catch(d){b=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+b+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=c.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);e.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});c.declare("dijit.form.MappedTextBox",e.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=c.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});c.declare("dijit.form.RangeBoundTextBox",e.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,b){return("min"in b?this.compare(a,b.min)>=0:true)&&("max"in b?this.compare(a,b.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),b=false,d=false;if("min"in this.constraints){b=this.constraints.min;b=this.compare(a,typeof b=="number"&&b>=0&&a!=0?0:b);b=typeof b=="number"&&b<0}if("max"in this.constraints){d=this.constraints.max;d=this.compare(a,typeof d!="number"||d>0?d:0);d=typeof d=="number"&&d>0}return b||d},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(a){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||
this.isInRange(a))},getErrorMessage:function(a){var b=this.get("value");if(b!==null&&b!==""&&b!==undefined&&(typeof b!="number"||!isNaN(b))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=c.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?e.setWaiState(this.focusNode,"valuemin",this.constraints.min):e.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?e.setWaiState(this.focusNode,"valuemax",this.constraints.max):e.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){e.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return e.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(c,e){function a(q){var x="",A=navigator.platform.indexOf("Mac")!==-1;if(q.mod1)x+=A?"Cmd+":"Ctrl+";if(q.mod2)x+="Shift+";if(q.mod3)x+="Alt+";if(q.mod4&&A)x+="Ctrl+";if(q.alphaKey)return x+q.alphaKey;for(var D in c.keys)if(typeof(c.keys[D]==="number"))if(c.keys[D]===q.keyCode)return x+D;var h;switch(q.keyCode){case 59:h=q.mod2?":":";";break;case 61:h=q.mod2?"+":"=";break;case 188:h=q.mod2?"<":",";break;case 190:h=
q.mod2?">":".";break;case 191:h=q.mod2?"?":"/";break;case 192:h=q.mod2?"~":"`";break;case 219:h=q.mod2?"{":"[";break;case 220:h=q.mod2?"|":"\\";break;case 221:h=q.mod2?"}":"]";break;case 222:h=q.mod2?'"':"'";break}if(h)return x+h;return x+String.fromCharCode(q.keyCode)}function b(q,x){q.startup();if(typeof x==="string"){var A=c.byId(x);if(!A)if(A=e.byId(x))A=A.domNode;x=A?A:null}if(x){x=c.position(x);q._setStyleAttr("left:"+(x.x+16)+"px !important;");q._setStyleAttr("top:"+(x.y+16)+"px !important;")}q.show()}
function d(q,x,A,D,h,l,n,p,r){n=function(B){return function(z){var E=e.byId(q),G=E.get("value");if(B&&z.keyCode===c.keys.ESCAPE){A&&c.style(x,"display","inline");E.destroyRecursive();l&&l()}else if(!(B&&z.keyCode!==c.keys.ENTER)){if(!E.isValid()||!r&&G===D)A&&c.style(x,"display","inline");else h(G);E.destroyRecursive();l&&l()}}};var y=new e.form.ValidationTextBox({id:q,required:true,value:D||""});c.place(y.domNode,x,"after");c.addClass(y.domNode,"userEditBoxPrompt");A&&c.style(x,"display","none");
c.connect(y,"onKeyDown",n(true));c.connect(y,"onBlur",n(false));window.setTimeout(function(){y.focus();if(D){var B=c.byId(q),z=p?D.indexOf(p):-1;z>0?e.selectInputText(B,0,z):B.select()}},0)}function f(q){var x=window.navigator.platform.indexOf("Mac")!==-1;return x&&q.metaKey||!x&&q.ctrlKey}function g(q,x){if(x&&f(x))window.open(q);else window.location=q}function j(q){if(!q)return q;var x=window.location.href.split("#")[0];x=x.substring(0,x.length-window.location.pathname.length);if(q.indexOf(x)===
0)return q.substring(x.length);return q}function i(q){if(!q)return q;var x=window.location.href.split("#")[0];return x.substring(0,x.length-window.location.pathname.length)+q}function k(q){return this.makeRelative(q).indexOf("/workspace")===0}function m(q,x){q.children=x;for(var A in x)x[A].parent=q;q.children.sort(function(D,h){var l=D.Directory;if(l!==h.Directory)return l?-1:1;D=D.Name&&D.Name.toLowerCase();h=h.Name&&h.Name.toLowerCase();if(D<h)return-1;if(D>h)return 1;return 0})}function o(q,x){q.Parents&&
q.Parents.length===0&&x.getService("orion.core.preference").getPreferences("/window/recent").then(function(A){var D=A.get("projects");if(typeof D==="string")D=JSON.parse(D);var h=[];if(D&&D.length&&D.length>0)for(var l=0;l<D.length;l++)D[l].location!==q.ChildrenLocation&&D[l].name!==q.Name&&h.push(D[l]);h.push({name:q.Name,location:q.ChildrenLocation});if(h.length>5)h=h.slice(-5,h.length);A.put("projects",h)})}function v(q){return typeof q.textContent!=="undefined"?q.textContent:q.innerText}function t(q){return v(document.createTextNode(q))}
function w(q,x){if(typeof q.textContent!=="undefined")q.textContent=x;else q.innerText=x}function u(q,x,A,D,h,l,n,p){h=h||x+"heading";l=l||x+"commands";c.place('<div class="toolComposite" id="'+x+'"><div class="layoutLeft" id="'+x+'"><span style: "inline-block;" id="'+h+'">'+A+'</span></div><div class="layoutRight sectionActions" id="'+l+'"></div><div id="'+q.id+'slideContainer" class="layoutBlock slideParameters slideContainer"><span id="'+q.id+'slideOut" class="slide"><span id="'+q.id+'pageCommandParameters" class="parameters"></span><span id="'+
q.id+'pageCommandDismiss" class="parametersDismiss"></span></span></div></div>',q,"last");D?c.addClass(x,"auxpaneHeading"):c.addClass(x,"paneHeading");n&&n.renderCommands(c.byId(l),"dom",p,p,"button");return c.byId(x)}function s(q){if(typeof q==="string")q=c.byId(q);for(;q;){var x=e.byId(q.id);if(x&&typeof x.layout==="function"){x.layout();return}q=q.parentNode}}return{getUserKeyString:a,openDialog:b,getUserText:d,openInNewWindow:f,followLink:g,makeRelative:j,makeFullPath:i,isAtRoot:k,processNavigatorParent:m,
rememberSuccessfulTraversal:o,getText:v,safeText:t,setText:w,createPaneHeading:u,forceLayout:s}});
define("orion/PageUtil",["require","exports","module"],function(){function c(e){e=e||window.location.toString();var a={resource:""},b=e.indexOf("#");if(b!==-1){e=e.substring(b+1);if(e.length!==0){e=e.split(",");a.resource=decodeURIComponent(e[0]);for(b=1;b<e.length;b++){var d=e[b].split("="),f=decodeURIComponent(d[0]);d=d.length===2?decodeURIComponent(d[1]):null;if(d!==null&&f!=="resource")a[f]=d}}}return a}return{matchResourceParameters:c}});define("text!dijit/templates/Menu.html",function(){return'<table class="dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role="menu" tabIndex="${tabIndex}" dojoAttachEvent="onkeypress:_onKeyPress" cellspacing="0">\n\t<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>\n</table>'});
define("dijit/_Container",["dojo","dijit"],function(c,e){c.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,b){var d=this.containerNode;if(b&&typeof b=="number"){var f=this.getChildren();if(f&&f.length>=b){d=f[b-1].domNode;b="after"}}c.place(a.domNode,d,b);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){c.forEach(this.getChildren(),function(b){b.destroyRecursive(a)})},_getSiblingOfChild:function(a,b){a=a.domNode;b=b>0?"nextSibling":"previousSibling";do a=a[b];while(a&&(a.nodeType!=1||!e.byNode(a)));return a&&e.byNode(a)},getIndexOfChild:function(a){return c.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){c.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return e._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(c,e){c.declare("dijit._KeyNavContainer",e._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,b){var d=this._keyNavCodes={},f=c.hitch(this,this.focusPrev),g=c.hitch(this,this.focusNext);c.forEach(a,function(j){d[j]=f});c.forEach(b,function(j){d[j]=g});d[c.keys.HOME]=c.hitch(this,"focusFirstChild");d[c.keys.END]=c.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){c.forEach(this.getChildren(),c.hitch(this,"_startupChild"))},addChild:function(a){e._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,b){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(b?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();c.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&c.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var b=this._keyNavCodes[a.charOrCode];if(b){b();c.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
b){if(a)a=this._getSiblingOfChild(a,b);for(var d=this.getChildren(),f=0;f<d.length;f++){a||(a=d[b>0?0:d.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,b)}return null}});return e._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(c,e){c.declare("dijit._Contained",null,{getParent:function(){var a=e.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var b=this.domNode;do b=b[a+"Sibling"];while(b&&b.nodeType!=1);return b&&e.byNode(b)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return e._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(c,e){c.declare("dijit.MenuItem",[e._Widget,e._Templated,e._Contained,e._CssStateMixin],{templateString:c.cache("dijit","templates/MenuItem.html"),attributeMap:c.delegate(e._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";c.attr(this.containerNode,"id",a);if(this.accelKeyNode){c.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}e.setWaiState(this.domNode,"labelledby",a);c.setSelectable(this.domNode,false)},_onHover:function(){this.getParent().onItemHover(this)},_onUnhover:function(){this.getParent().onItemUnhover(this);
this._set("hovering",false)},_onClick:function(a){this.getParent().onItemClick(this,a);c.stopEvent(a)},onClick:function(){},focus:function(){try{c.isIE==8&&this.containerNode.focus();e.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){c.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){c.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){c.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){e.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;c.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return e.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(c,e){c.declare("dijit.PopupMenuItem",e.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=c.query("*",this.srcNodeRef);e.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=c.query("[widgetId]",this.dropDownContainer)[0];this.popup=e.byNode(a)}c.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&c.style(this.arrowWrapper,"visibility","");e.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return e.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(c,e){c.declare("dijit.CheckedMenuItem",e.MenuItem,{templateString:c.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){c.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);e.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return e.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(c,e){c.declare("dijit.MenuSeparator",[e._Widget,e._Templated,e._Contained],{templateString:c.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);c.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return e.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(c,e){c.declare("dijit._MenuBase",[e._Widget,e._Templated,e._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){c.forEach(this.getChildren(),function(a){a.startup()});this.startupKeyNavChildren();this.inherited(arguments)}},onExecute:function(){},
onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.focusedChild._onClick(a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(false);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup)}},
onItemHover:function(a){if(this.isActive){this.focusChild(a);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer)this.hover_timer=setTimeout(c.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var b=a.popup;if(b){this._stopPendingCloseTimer(b);b._pendingClose_timer=setTimeout(function(){b._pendingClose_timer=null;if(b.parentMenu)b.parentMenu.currentPopup=
null;e.popup.close(b)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,b){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(b)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var b=a.popup;if(!b.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);e.popup.close(this.currentPopup)}b.parentMenu=this;b.from_item=a;var d=this;e.popup.open({parent:this,
popup:b,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){d.focusChild(a);d._cleanUp();a._setSelected(true);d.focusedChild=a},onExecute:c.hitch(this,"_cleanUp")});this.currentPopup=b;b.connect(b.domNode,"onmouseenter",c.hitch(d,"_onPopupHover"));if(b.focus)b._focus_timer=setTimeout(c.hitch(b,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;c.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;c.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){e._curFocus&&c.isDescendant(e._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();e.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});c.declare("dijit.Menu",e._MenuBase,{constructor:function(){this._bindings=[]},templateString:c.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(c.body()):c.forEach(this.targetNodeIds,this.bindDomNode,this);var a=c.keys,b=this.isLeftToRight();this._openSubMenuKey=b?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=b?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
c.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else c.stopEvent(a);break}},_iframeContentWindow:function(a){return c.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&c.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&c.doc.frames[a.name]&&c.doc.frames[a.name].document||
null},bindDomNode:function(a){a=c.byId(a);var b;if(a.tagName.toLowerCase()=="iframe"){var d=a,f=this._iframeContentWindow(d);b=c.withGlobal(f,c.body)}else b=a==c.body()?c.doc.documentElement:a;var g={node:a,iframe:d};c.attr(a,"_dijitMenu"+this.id,this._bindings.push(g));var j=c.hitch(this,function(i){return[c.connect(i,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(k){c.stopEvent(k);this._scheduleOpen(k.target,d,{x:k.pageX,y:k.pageY})}),c.connect(i,"onkeydown",this,function(k){if(k.shiftKey&&
k.keyCode==c.keys.F10){c.stopEvent(k);this._scheduleOpen(k.target,d)}})]});g.connects=b?j(b):[];if(d){g.onloadHandler=c.hitch(this,function(){var i=this._iframeContentWindow(d);b=c.withGlobal(i,c.body);g.connects=j(b)});d.addEventListener?d.addEventListener("load",g.onloadHandler,false):d.attachEvent("onload",g.onloadHandler)}},unBindDomNode:function(a){var b;try{b=c.byId(a)}catch(d){return}a="_dijitMenu"+this.id;if(b&&c.hasAttr(b,a)){var f=c.attr(b,a)-1,g=this._bindings[f];c.forEach(g.connects,c.disconnect);
var j=g.iframe;if(j)j.removeEventListener?j.removeEventListener("load",g.onloadHandler,false):j.detachEvent("onload",g.onloadHandler);c.removeAttr(b,a);delete this._bindings[f]}},_scheduleOpen:function(a,b,d){if(!this._openTimer)this._openTimer=setTimeout(c.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:b,coords:d})}),1)},_openMyself:function(a){function b(){m.refocus&&e.focus(o);e.popup.close(m)}var d=a.target,f=a.iframe;if(a=a.coords){if(f){d=c.position(f,true);var g=
this._iframeContentWindow(f);g=c.withGlobal(g,"_docScroll",c);var j=c.getComputedStyle(f),i=c._toPixelValue,k=(c.isIE&&c.isQuirks?0:i(f,j.paddingLeft))+(c.isIE&&c.isQuirks?i(f,j.borderLeftWidth):0);f=(c.isIE&&c.isQuirks?0:i(f,j.paddingTop))+(c.isIE&&c.isQuirks?i(f,j.borderTopWidth):0);a.x+=d.x+k-g.x;a.y+=d.y+f-g.y}}else{a=c.position(d,true);a.x+=10;a.y+=10}var m=this,o=e.getFocus(this);e.popup.open({popup:this,x:a.x,y:a.y,onExecute:b,onCancel:b,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);e.popup.close(this)}},uninitialize:function(){c.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return e.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(c,e){c.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(a){if(!(this.disabled||this.readOnly)){c.stopEvent(a);this._docHandler=this.connect(c.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var b=this.dropDown,d=false;if(a&&this._opened){var f=c.position(this._buttonNode,true);if(!(a.pageX>=f.x&&a.pageX<=f.x+f.w)||!(a.pageY>=f.y&&a.pageY<=f.y+f.h)){for(f=a.target;f&&!d;)if(c.hasClass(f,"dijitPopup"))d=true;else f=f.parentNode;if(d){f=a.target;if(b.onItemClick){for(var g;f&&!(g=e.byNode(f));)f=f.parentNode;g&&g.onClick&&g.getParent&&g.getParent().onItemClick(g,a)}return}}}this._opened&&b.focus&&b.autoFocus!==false&&window.setTimeout(c.hitch(b,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&c.stopEvent(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";c.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var b=this.dropDown,d=a.target;if(b&&this._opened&&b.handleKey)if(b.handleKey(a)===false){c.stopEvent(a);return}if(b&&this._opened&&a.charOrCode==c.keys.ESCAPE){this.closeDropDown();c.stopEvent(a)}else if(!this._opened&&(a.charOrCode==c.keys.DOWN_ARROW||(a.charOrCode==c.keys.ENTER||a.charOrCode==" ")&&((d.tagName||"").toLowerCase()!=="input"||d.type&&d.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;c.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(c.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(e._curFocus&&this.dropDown&&c.isDescendant(e._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(c.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,b=a.domNode,d=this._aroundNode||this.domNode,f=this;if(!this._preparedNode){this._preparedNode=true;if(b.style.width)this._explicitDDWidth=true;if(b.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var g={display:"",visibility:"hidden"};if(!this._explicitDDWidth)g.width="";if(!this._explicitDDHeight)g.height="";c.style(b,g);g=this.maxHeight;if(g==-1){g=c.window.getBox();var j=c.position(d,false);g=Math.floor(Math.max(j.y,g.h-(j.y+j.h)))}a.startup&&
!a._started&&a.startup();e.popup.moveOffScreen(a);j=c._getMarginSize(b);var i=g&&j.h>g;c.style(b,{overflowX:"hidden",overflowY:i?"auto":"hidden"});if(i){j.h=g;if("w"in j)j.w+=16}else delete j.h;if(this.forceWidth)j.w=d.offsetWidth;else if(this.autoWidth)j.w=Math.max(j.w,d.offsetWidth);else delete j.w;c.isFunction(a.resize)?a.resize(j):c.marginBox(b,j)}a=e.popup.open({parent:this,popup:a,around:d,orient:e.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){f.closeDropDown(true)},onCancel:function(){f.closeDropDown(true)},onClose:function(){c.attr(f._popupStateNode,"popupActive",false);c.removeClass(f._popupStateNode,"dijitHasDropDownOpen");f._opened=false}});c.attr(this._popupStateNode,"popupActive","true");c.addClass(f._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();e.popup.close(this.dropDown);this._opened=false}}});
return e._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(c,e){c.declare("dijit.form.Button",e.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:c.cache("dijit.form","templates/Button.html"),attributeMap:c.delegate(e.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var b=this.domNode;b.parentNode;b=b.parentNode){var d=e.byNode(b);if(d&&typeof d._onSubmit=="function"){d._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);c.setSelectable(this.focusNode,
false)},_fillContent:function(a){if(a&&(!this.params||!("label"in this.params)))this.set("label",a.innerHTML)},_setShowLabelAttr:function(a){this.containerNode&&c.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){c.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},_setLabelAttr:function(a){this._set("label",a);this.containerNode.innerHTML=
a;if(this.showLabel==false&&!this.params.title)this.titleNode.title=c.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){c.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});c.declare("dijit.form.DropDownButton",[e.form.Button,e._Container,e._HasDropDown],{baseClass:"dijitDropDownButton",templateString:c.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
c.query("*",this.srcNodeRef);e.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=c.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=e.byNode(a);delete this.dropDownContainer}this.dropDown&&e.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var b=c.connect(a,"onLoad",this,function(){c.disconnect(b);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});c.declare("dijit.form.ComboButton",e.form.DropDownButton,{templateString:c.cache("dijit.form","templates/ComboButton.html"),attributeMap:c.mixin(c.clone(e.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==c.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){e.focus(this._popupStateNode);c.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==c.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){e.focus(this.titleNode);c.stopEvent(a)}},focus:function(a){this.disabled||e.focus(a=="start"?this.titleNode:this._popupStateNode)}});
c.declare("dijit.form.ToggleButton",e.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:c.mixin(c.clone(e.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,b){this._set("checked",a);c.attr(this.focusNode||this.domNode,"checked",a);e.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,b)},setChecked:function(a){c.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return e.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(c,e){return e.form.DropDownButton});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(c,e){c.declare("dijit.layout._LayoutWidget",[e._Widget,e._Container,e._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);c.addClass(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var a=this.getParent&&this.getParent();if(!(a&&a.isLayoutContainer)){this.resize();this.connect(c.isIE?
this.domNode:c.global,"onresize",function(){this.resize()})}}},resize:function(a,b){var d=this.domNode;if(a){c.marginBox(d,a);if(a.t)d.style.top=a.t+"px";if(a.l)d.style.left=a.l+"px"}b=b||{};c.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=c.mixin(c.marginBox(d),b);a=c.getComputedStyle(d);var f=c._getMarginExtents(d,a),g=c._getBorderExtents(d,a);b=this._borderBox={w:b.w-(f.w+g.w),h:b.h-(f.h+g.h)};f=c._getPadExtents(d,a);this._contentBox={l:c._toPixelValue(d,a.paddingLeft),t:c._toPixelValue(d,a.paddingTop),
w:b.w-f.w,h:b.h-f.h};this.layout()},layout:function(){},_setupChild:function(a){c.addClass(a.domNode,this.baseClass+"-child "+(a.baseClass?this.baseClass+"-"+a.baseClass:""))},addChild:function(a){this.inherited(arguments);this._started&&this._setupChild(a)},removeChild:function(a){c.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});e.layout.marginBox2contentBox=function(a,b){var d=c.getComputedStyle(a),f=c._getMarginExtents(a,
d),g=c._getPadBorderExtents(a,d);return{l:c._toPixelValue(a,d.paddingLeft),t:c._toPixelValue(a,d.paddingTop),w:b.w-(f.w+g.w),h:b.h-(f.h+g.h)}};(function(){var a=function(d){return d.substring(0,1).toUpperCase()+d.substring(1)},b=function(d,f){var g=d.resize?d.resize(f):c.marginBox(d.domNode,f);if(g)c.mixin(d,g);else{c.mixin(d,c.marginBox(d.domNode));c.mixin(d,f)}};e.layout.layoutChildren=function(d,f,g,j,i){f=c.mixin({},f);c.addClass(d,"dijitLayoutContainer");g=c.filter(g,function(k){return k.region!=
"center"&&k.layoutAlign!="client"}).concat(c.filter(g,function(k){return k.region=="center"||k.layoutAlign=="client"}));c.forEach(g,function(k){var m=k.domNode,o=k.region||k.layoutAlign,v=m.style;v.left=f.l+"px";v.top=f.t+"px";v.position="absolute";c.addClass(m,"dijitAlign"+a(o));m={};if(j&&j==k.id)m[k.region=="top"||k.region=="bottom"?"h":"w"]=i;if(o=="top"||o=="bottom"){m.w=f.w;b(k,m);f.h-=k.h;if(o=="top")f.t+=k.h;else v.top=f.t+f.h+"px"}else if(o=="left"||o=="right"){m.h=f.h;b(k,m);f.w-=k.w;if(o==
"left")f.l+=k.w;else v.left=f.l+f.w+"px"}else if(o=="client"||o=="center")b(k,f)})}})();return e.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(c,e){c.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){c.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=e._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(c.isIE?this.domNode:c.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=c.query("> *",this.containerNode).filter(function(f){return f.tagName!=="SCRIPT"}),b=a.filter(function(f){return c.hasAttr(f,"data-dojo-type")||c.hasAttr(f,"dojoType")||c.hasAttr(f,"widgetId")}),d=c.filter(b.map(e.byNode),function(f){return f&&
f.domNode&&f.resize});if(a.length==b.length&&d.length==1)this._singleChild=d[0];else delete this._singleChild;c.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,b){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,b)},_scheduleLayout:function(a,b){if(this._isShown())this._layout(a,b);else{this._needLayout=true;this._changeSize=a;this._resultSize=b}},_layout:function(a,b){a&&c.marginBox(this.domNode,
a);var d=this.containerNode;if(d===this.domNode){b=b||{};c.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=c.mixin(c.marginBox(d),b);this._contentBox=e.layout.marginBox2contentBox(d,b)}else this._contentBox=c.contentBox(d);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||c.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else c.forEach(this.getChildren(),
function(b){b.resize&&b.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,b=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!c.hasClass(a,"dijitHidden")&&b&&b.style&&b.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return e.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(c){c.getObject("html",true,c);(function(){var e=0;c.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};c.html._emptyNode=c.empty;c.html._setNodeContent=function(a,b){c.empty(a);if(b){if(typeof b=="string")b=c._toDom(b,a.ownerDocument);if(!b.nodeType&&c.isArrayLike(b))for(var d=b.length,f=0;f<b.length;f=d==b.length?f+1:0)c.place(b[f],a,"last");else c.place(b,a,"last")}return a};c.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:c._scopeName,startup:true,constructor:function(a,b){c.mixin(this,a||{});b=this.node=c.byId(this.node||b);if(!this.id)this.id=["Setter",b?b.id||b.tagName:"",e++].join("_")},set:function(a,b){if(undefined!==a)this.content=a;b&&this._mixin(b);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=c.html._setNodeContent(a,this.content)}catch(b){var d=this.onContentError(b);try{a.innerHTML=d}catch(f){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+f.message,f)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){c.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}c.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(c.isString(a)){if(this.cleanContent)a=c.html._secureForInnerHtml(a);
if(this.extractContent){var b=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(b)a=b[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var b={},d;for(d in a)d in b||(this[d]=a[d])},_parse:function(){var a=this.node;try{var b={};c.forEach(["dir","lang","textDir"],
function(f){if(this[f])b[f]=this[f]},this);this.parseResults=c.parser.parse({rootNode:a,noStart:!this.startup,inherited:b,scope:this.parserScope})}catch(d){this._onError("Content",d,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,b,d){a=this["on"+a+"Error"].call(this,b);if(d)console.error(d,b);else a&&c.html._setNodeContent(this.node,a,true)}});c.html.set=function(a,b,d){if(undefined==b){console.warn("dojo.html.set: no cont argument provided, using empty string");b=""}return d?(new c.html._ContentSetter(c.mixin(d,
{content:b,node:a}))).set():c.html._setNodeContent(a,b,true)}})();return c.html});define("dijit/nls/loading",{root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/layout/ContentPane",["dojo","dijit","dijit/_Widget","dijit/layout/_ContentPaneResizeMixin","dojo/string","dojo/html","i18n!dijit/nls/loading"],function(c,e){c.declare("dijit.layout.ContentPane",[e._Widget,e.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:c._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",
isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:c.delegate(e._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,b){if((!a||!a.template)&&b&&!("href"in a)&&!("content"in a)){var d=c.doc.createDocumentFragment();for(b=c.byId(b);b.firstChild;)d.appendChild(b.firstChild);a=c.delegate(a,{content:d})}this.inherited(arguments,[a,b])},postMixInProperties:function(){this.inherited(arguments);var a=c.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=c.string.substitute(this.loadingMessage,a);this.errorMessage=c.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";c.attr(this.domNode,"role")||e.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&c.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&c.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){c.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",a)},_setHrefAttr:function(a){this.cancel();this.onLoadDeferred=new c.Deferred(c.hitch(this,"cancel"));this.onLoadDeferred.addCallback(c.hitch(this,"onLoad"));this._set("href",a);if(this.preload||this._created&&this._isShown())this._load();else this._hrefChanged=true;return this.onLoadDeferred},setContent:function(a){c.deprecated("dijit.layout.ContentPane.setContent() is deprecated.  Use set('content', ...) instead.",
"","2.0");this.set("content",a)},_setContentAttr:function(a){this._set("href","");this.cancel();this.onLoadDeferred=new c.Deferred(c.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(c.hitch(this,"onLoad"));this._setContent(a||"");this._isDownloaded=false;return this.onLoadDeferred},_getContentAttr:function(){return this.containerNode.innerHTML},cancel:function(){this._xhrDfd&&this._xhrDfd.fired==-1&&this._xhrDfd.cancel();delete this._xhrDfd;this.onLoadDeferred=null},uninitialize:function(){this._beingDestroyed&&
this.cancel();this.inherited(arguments)},destroyRecursive:function(){this._beingDestroyed||this.inherited(arguments)},_onShow:function(){this.inherited(arguments);if(this.href)if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow))return this.refresh()},refresh:function(){this.cancel();this.onLoadDeferred=new c.Deferred(c.hitch(this,"cancel"));this.onLoadDeferred.addCallback(c.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,b={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};c.isObject(this.ioArgs)&&c.mixin(b,this.ioArgs);var d=this._xhrDfd=(this.ioMethod||c.xhrGet)(b);d.addCallback(function(f){try{a._isDownloaded=true;a._setContent(f,false);a.onDownloadEnd()}catch(g){a._onError("Content",g)}delete a._xhrDfd;return f});d.addErrback(function(f){d.canceled||a._onError("Download",f);delete a._xhrDfd;return f});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(b){console.error("Error "+this.widgetId+" running custom onLoad code: "+b.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;c.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive()});if(a){c.forEach(a.parseResults,
function(b){b.destroyRecursive&&b.domNode&&b.domNode.parentNode==c.body()&&b.destroyRecursive()});delete a.parseResults}c.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,b){this.destroyDescendants();var d=this._contentSetter;if(!(d&&d instanceof c.html._ContentSetter))d=this._contentSetter=new c.html._ContentSetter({node:this.containerNode,_onError:c.hitch(this,this._onError),onContentError:c.hitch(this,function(g){g=this.onContentError(g);try{this.containerNode.innerHTML=
g}catch(j){console.error("Fatal "+this.id+" could not change content due to "+j.message,j)}})});var f=c.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});d.set(c.isObject(a)&&a.domNode?a.domNode:a,f);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!b){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,b,d){this.onLoadDeferred.errback(b);a=this["on"+a+"Error"].call(this,b);if(d)console.error(d,b);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return e.layout.ContentPane});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(c,e){c.declare("dijit.form._FormMixin",null,{state:"",reset:function(){c.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return c.every(c.map(this.getDescendants(),function(b){b._hasBeenBlurred=true;var d=b.disabled||!b.validate||b.validate();if(!d&&!a){c.window.scrollIntoView(b.containerNode||b.domNode);b.focus();a=true}return d}),function(b){return b})},setValues:function(a){c.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var b={};c.forEach(this.getDescendants(),function(j){if(j.name)(b[j.name]||(b[j.name]=[])).push(j)});for(var d in b)if(b.hasOwnProperty(d)){var f=b[d],g=c.getObject(d,false,a);if(g!==undefined){c.isArray(g)||(g=[g]);if(typeof f[0].checked=="boolean")c.forEach(f,function(j){j.set("value",c.indexOf(g,j.value)!=-1)});else f[0].multiple?f[0].set("value",g):c.forEach(f,function(j,
i){j.set("value",g[i])})}}},getValues:function(){c.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};c.forEach(this.getDescendants(),function(b){var d=b.name;if(!(!d||b.disabled)){var f=b.get("value");if(typeof b.checked=="boolean")if(/Radio/.test(b.declaredClass))if(f!==false)c.setObject(d,f,a);else{f=c.getObject(d,false,a);f===undefined&&c.setObject(d,null,a)}else{b=c.getObject(d,false,a);
if(!b){b=[];c.setObject(d,b,a)}f!==false&&b.push(f)}else{b=c.getObject(d,false,a);if(typeof b!="undefined")c.isArray(b)?b.push(f):c.setObject(d,[b,f],a);else c.setObject(d,f,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=c.map(this._descendants,function(b){return b.get("state")||""});return c.indexOf(a,"Error")>=0?"Error":c.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){c.forEach(this._childConnections||
[],c.hitch(this,"disconnect"));c.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var b=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(j,i){b[j]=i}:c.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var d=this._childConnections=[],f=this._childWatches=[];c.forEach(c.filter(this._descendants,function(j){return j.validate}),function(j){c.forEach(["state","disabled"],function(i){f.push(j.watch(i,function(){b.set("state",
b._getState())}))})});var g=function(){b._onChangeDelayTimer&&clearTimeout(b._onChangeDelayTimer);b._onChangeDelayTimer=setTimeout(function(){delete b._onChangeDelayTimer;b._set("value",b.get("value"))},10)};c.forEach(c.filter(this._descendants,function(j){return j.onChange}),function(j){d.push(b.connect(j,"onChange",g));f.push(j.watch("disabled",g))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,b,d){this.onValidStateChange(d=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return e.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(c,e){c.declare("dijit._DialogMixin",null,{attributeMap:e._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=e._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return e._DialogMixin});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(c,e){c.declare("dijit.TooltipDialog",[e.layout.ContentPane,e._Templated,e.form._FormMixin,e._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:c.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=a;
this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,b,d){a="dijitTooltipAB"+(d.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(d.charAt(0)=="T"?"Below":"Above");c.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);e.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var b=a.target,d=c.keys;a.charOrCode===d.TAB&&this._getFocusItems(this.containerNode);var f=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==d.ESCAPE){setTimeout(c.hitch(this,"onCancel"),0);c.stopEvent(a)}else if(b==this._firstFocusItem&&a.shiftKey&&a.charOrCode===d.TAB){f||e.focus(this._lastFocusItem);c.stopEvent(a)}else if(b==this._lastFocusItem&&a.charOrCode===d.TAB&&!a.shiftKey){f||e.focus(this._firstFocusItem);c.stopEvent(a)}else a.charOrCode===
d.TAB&&a.stopPropagation()}});return e.TooltipDialog});
define("orion/commands",["require","dojo","dijit","orion/util","orion/PageUtil","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator","dijit/Tooltip","dijit/TooltipDialog"],function(c,e,a,b,d){function f(s,q,x,A,D){this.commandService=s;this.handler=q;this.items=x;this.userData=A;this.command=D;if(D.parameters)this.parameters=D.parameters.makeCopy();this.id=D.id}function g(s){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups=
{};this._ungrouped={};this._topics={};this._activeBindings={};this._urlBindings={};this._init(s);this._parameterCollector=null}function j(s,q,x){e.addClass(q,"commandImage");var A;if(s.imageClass){A=e.create("span",{},q,"last");e.addClass(A,s.spriteClass);e.addClass(A,s.imageClass)}else{A=new Image;A.alt=s.name;A.name=x;A.id=x;A.src=s.image;e.place(A,q,"last")}return A}function i(s){this._init(s)}function k(s,q,x,A,D){this.keyCode=typeof s==="string"?s.toUpperCase().charCodeAt(0):s;this.mod1=q!==
undefined&&q!==null?q:false;this.mod2=x!==undefined&&x!==null?x:false;this.mod3=A!==undefined&&A!==null?A:false;this.mod4=D!==undefined&&D!==null?D:false}function m(s,q){this.token=s;this.parameterName=q}function o(s,q,x,A){this.name=s;this.type=q;this.label=x;this.value=A}function v(s,q,x){this._storeParameters(s);this.options=q;this.optionsRequested=false;this.getParameters=x}f.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()}};f.prototype.constructor=
f;var t=e.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}}),w=e.declare(a.Tooltip,{constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},_onUnHover:function(){if(this._showTimer){window.clearTimeout(this._showTimer);delete this._showTimer}this.polling=false;this.close()},_onHover:function(){this.inherited(arguments);this.polling=true;this.pollForMissingTarget()},pollForMissingTarget:function(){this.polling&&window.setTimeout(e.hitch(this,
function(){if(this._stillInDocument(this._connectNode))this.pollForMissingTarget();else{this.polling=false;this.close()}}),1E3)},_stillInDocument:function(s){for(;s;){if(s===window.document)return true;s=s.parentNode}return false},postMixInProperties:function(){this.inherited(arguments);this.options.commandParent&&a.byId(this.options.commandParent.id)&&e.connect(this.options.commandParent,"onClose",e.hitch(this,function(){this.close()}))}});g.prototype={_init:function(s){this._registry=s.serviceRegistry;
this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=s.selection;e.connect(window.document,"onkeydown",e.hitch(this,function(q){q=q||window.event;var x=q.target.nodeName.toLowerCase();if(x==="input")switch(q.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(x===
"textarea")return;this._processKey(q)}))},_processKey:function(s){function q(l){if(window.document.all)l.keyCode=0;else{l.preventDefault();l.stopPropagation()}}for(var x in this._activeBindings)if(this._activeBindings[x]&&this._activeBindings[x].keyBinding&&this._activeBindings[x].command)if(this._activeBindings[x].keyBinding.match(s)){var A=this._activeBindings[x],D=A.invocation;if(D){var h=A.command;if(h.hrefCallback){q(s);s=h.hrefCallback.call(D.handler||window,D);s.then?s.then(function(l){window.open(l)}):
window.open(s);return}else if(h.callback){q(s);window.setTimeout(e.hitch(this,function(){D.parameters&&this.collectsParameters()?this._collectParameters(D):h.callback.call(D.handler||window,D)}),0);return}}}},processURL:function(s){for(var q in this._urlBindings)if(this._urlBindings[q]&&this._urlBindings[q].urlBinding&&this._urlBindings[q].command){var x=this._urlBindings[q].urlBinding.match(s);if(x){var A=this._urlBindings[q],D=A.command,h=A.invocation;if(h&&h.parameters&&D.callback){h.parameters.setValue(x.parameterName,
x.parameterValue);window.setTimeout(e.hitch(this,function(){this._collectParameters(h)}),0);return}}}},findCommand:function(s){return this._objectScope[s]||this._domScope[s]||this._globalScope[s]},runCommand:function(s){var q=this._urlBindings[s];q&&q.command&&q.command.callback&&window.setTimeout(e.hitch(this,function(){this._collectParameters(q.invocation)}),0)},getSelectionService:function(){return this._selection},setParameterCollector:function(s){this._parameterCollector=s},openParameterCollector:function(s,
q){if(this._parameterCollector){this._parameterCollector.close();this._parameterCollector.open(s,q)}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_collectParameters:function(s){var q=false;if(this._parameterCollector){s.parameters.updateParameters(s);q=s.parameters.hasParameters()?this._parameterCollector.collectParameters(s):false}if(!q&&s.parameters.hasParameters()){var x=new a.TooltipDialog({onBlur:function(){a.popup.close(x)}}),
A=e.create("div"),D=this._parameterCollector.getFillFunction(s,function(){a.popup.close(x)})(A);x.set("content",A);A=(A=a.byId(s.domParent.id))?e.position(A.eclipseScopeId,true):e.position(s.domNode,true);if(A.x&&A.y&&A.w){a.popup.open({popup:x,x:A.x+A.w-8,y:A.y+8});window.setTimeout(function(){D.focus();D.select()},0);q=true}}if(!q){s.parameters=null;s.command.callback.call(s.handler,s)}},showKeyBindings:function(s){for(var q in this._activeBindings)this._activeBindings[q]&&this._activeBindings[q].keyBinding&&
this._activeBindings[q].command&&e.place('<span role="listitem">'+b.getUserKeyString(this._activeBindings[q].keyBinding)+" = "+this._activeBindings[q].command.name+"<br></span>",s,"last")},addCommand:function(s,q){switch(q){case "dom":this._domScope[s.id]=s;break;case "object":this._objectScope[s.id]=s;break;case "global":this._globalScope[s.id]=s;break;default:throw"unrecognized command scope "+q;}},addCommandGroup:function(s,q,x,A,D){var h=this._namedGroups;if(A)h=this._createEntryForPath(A);if(h[s]){if(x)h[s].title=
x;if(q)h[s].position=q;if(D)h[s].scopeId=D}else{h[s]={title:x,position:q,children:{},scopeId:D};h.sortedCommands=null}},_createEntryForPath:function(s){var q=this._namedGroups;if(s){s=s.split("/");for(var x=0;x<s.length;x++)if(s[x].length>1){q[s[x]]||(q[s[x]]={position:0,children:{}});q=q[s[x]].children}}return q},registerCommandContribution:function(s,q,x,A,D,h,l){A=!x&&!A?this._ungrouped:this._createEntryForPath(A);A[s]={scopeId:x,position:q};if(h)if(q=this._domScope[s]||this._globalScope[s])this._activeBindings[s]=
{command:q,keyBinding:h,bindingOnly:D};if(l)if(q=this._domScope[s]||this._globalScope[s])this._urlBindings[s]={command:q,urlBinding:l,bindingOnly:D};A.sortedCommands=null},_isLastChildSeparator:function(s,q){if(q==="tool"||q==="button")return s.childNodes.length>0&&e.hasClass(s.childNodes[s.childNodes.length-1],"commandSeparator");if(q==="menu"){s=s.getChildren();return s.length>0&&s[s.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(s,q,x,A,D,h,l,n,p){if(typeof s==="string")s=
e.byId(s);if(s){if(!s.id||s.id==="")window.console.log("renderCommands: "+q+","+D+">> WARNING: command parent must have an id")}else throw"no parent";if(x){var r;if(q==="object"){r=this._objectScope;this._render(this._ungrouped,s,q,x,A,D,h,l,r,n,p)}else if(q==="dom")r=this._domScope;else if(q==="global")r=this._globalScope;else throw"Unrecognized command scope "+q;this._render(this._namedGroups,s,q,x,A,D,h,l,r,n,p);if(D==="tool"||D==="button")this._isLastChildSeparator(s,D)&&s.removeChild(s.childNodes[s.childNodes.length-
1]);else if(D==="menu")if(this._isLastChildSeparator(s,D)){x=s.getChildren()[s.getChildren().length-1];s.removeChild(x);x.destroy()}if(q==="dom"||q==="global")b.forceLayout(s)}else{var y=this;this._selection&&this._selection.getSelections(function(B){y.renderCommands(s,q,B,A,D,h,l,n,p)})}},_render:function(s,q,x,A,D,h,l,n,p,r,y){var B=s.sortedCommands;if(!B){B=[];for(var z in s){var E=s[z];if(E&&typeof E.position==="number"){E.id=z;B.push(E)}}B.sort(function(T,C){return T.position-C.position});s.sortedCommands=
B}for(s=0;s<B.length;s++){var G,M;if(B[s].children){z=B[s];if(!(z.scopeId&&q.id!==z.scopeId)){var H;if(h==="tool"||h==="button")if(z.title){G=new a.Menu({style:"display: none;"});G.eclipseScopeId=q.eclipseScopeId||q.id;this._render(B[s].children,G,x,A,D,"menu",l,n,p,r);H=G.getChildren();if(this._isLastChildSeparator(G,"menu")){E=H[H.length-1];G.removeChild(E);E.destroy();H=G.getChildren()}if(H.length>0){E=H[0].eclipseCommand;if(H.length>1){G=new a.form.DropDownButton({label:z.title==="*"?"Actions":
z.title,showLabel:z.title!=="*",dropDown:G});e.addClass(G.domNode,"commandMenu");e.destroy(G.valueNode);if(z.title==="*"){e.addClass(G.domNode,"textless");new w({connectId:[G.domNode],label:"Actions menu",position:["above","left","right","below"],commandParent:q,commandService:this})}E._setupActivateVisuals(G.domNode,G.focusNode,r,y);e.place(G.domNode,q,"last")}else{G=h+E.id+s;M=new f(this,D,A,n,E);h==="button"?E._addButton(q,l,G,M,r,y):E._addTool(q,l,G,M,r,y)}}}else{var N;if(q.childNodes.length>
0&&!this._isLastChildSeparator(q,h))N=this.generateSeparatorImage(q);this._render(B[s].children,q,x,A,D,h,l,n,p,r,y);if(q.childNodes.length>0)if(q.childNodes[q.childNodes.length-1]!==N)N=this.generateSeparatorImage(q)}else if(z.title){E=new a.Menu;this._render(B[s].children,E,x,A,D,h,l,n,p,r,y);E.getChildren().length>0&&q.addChild(new a.PopupMenuItem({label:z.title,popup:E}))}else{var L;if(q.getChildren().length>0&&!this._isLastChildSeparator(q,h)){L=new a.MenuSeparator;q.addChild(L)}this._render(B[s].children,
q,x,A,D,h,l,n,p,r,y);z=q.getChildren();if(z[z.length-1]!==L){L=new a.MenuSeparator;q.addChild(L)}}}}else{E=(z=p[B[s].id])?true:false;H=H=null;if(z){if(x==="dom"||x==="global")E=h==="tool"||h==="button"?q.id===B[s].scopeId:h==="menu"?q.eclipseScopeId===B[s].scopeId:false;else if(x==="object")E=!B[s].scopeId;var R=E&&(x==="global"||x==="dom");M=new f(this,D,A,n,z);M.domParent=q;G=E&&(z.visibleWhen?z.visibleWhen(A):true);if(R&&this._activeBindings[z.id]&&this._activeBindings[z.id].keyBinding){H=this._activeBindings[z.id];
H.invocation=G?M:null;if(H.bindingOnly)E=false}if(R&&this._urlBindings[z.id]&&this._urlBindings[z.id].urlBinding){H=this._urlBindings[z.id];H.invocation=G?M:null;if(H.bindingOnly)E=false}E=E&&G}if(E)if(z.choiceCallback){E=new a.Menu({style:"display: none;"});if(h==="tool"||h==="button"){G=new a.form.DropDownButton({label:z.name,dropDown:E});if(z.image){e.addClass(G.iconNode,"commandImage");G.iconNode.src=z.image}e.place(G.domNode,q,"last");G.eclipseCommand=z;G.eclipseChoices=E;e.connect(G,"onClick",
G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,A,D,n)})}else if(h==="menu"){G=new a.PopupMenuItem({label:z.name,popup:E});q.addChild(G);G.eclipseCommand=z;G.eclipseChoices=E;e.connect(q,"_openPopup",G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,A,D,n)})}}else if(h==="tool"){G="tool"+z.id+s;z._addTool(q,l,G,M,r,y)}else if(h==="button"){G="button"+z.id+s;z._addButton(q,l,G,M,r,y)}else h==="menu"&&z._addMenuItem(q,M,r,y)}}},whenHidden:function(s,q){s=
typeof s==="string"?s:s.id;if(!this.hidden)this.hidden={};if(this.hidden[s])this.hidden[s].push(q);else this.hidden[s]=[q]},generateSeparatorImage:function(s){s=e.create("span",null,s,"last");e.addClass(s,"core-sprite-sep");e.addClass(s,"imageSprite");e.addClass(s,"commandSeparator");return s}};g.prototype.constructor=g;i.prototype={_init:function(s){this.id=s.id;this.name=s.name;this.tooltip=s.tooltip||s.name;this.callback=s.callback;this.hrefCallback=s.hrefCallback;this.choiceCallback=s.choiceCallback;
this.image=s.image||c.toUrl("images/none.png");this.imageClass=s.imageClass;this.spriteClass=s.spriteClass||"commandSprite";this.visibleWhen=s.visibleWhen;this.parameters=s.parameters},_addTool:function(s,q,x,A,D,h){A.handler=A.handler||this;var l,n;if(this.hrefCallback){l=this._makeLink(A);if(!l)return}else{l=e.create("span",{tabindex:"0",role:"button"});if(q||!this.hasImage()){q=window.document.createTextNode(this.name);e.place(q,l,"last");e.addClass(l,"commandMissingImageButton commandButton")}else{n=
j(this,l,x);this._addAccessibleLabel(l)}this._hookCallback(l,A);this._setupActivateVisuals(l,l,D,h,n?"commandImageOver":"commandButtonOver")}A.domNode=l;A.domParent=s;this.tooltip&&new w({connectId:[l],label:this.tooltip,position:["above","left","right","below"],commandParent:s,commandService:A.commandService});e.place(l,s,"last")},_addButton:function(s,q,x,A,D,h){A.handler=A.handler||this;if(this.hrefCallback){q=this._makeLink(A);if(!q)return}else{q=e.create("span",{tabindex:"0",role:"button"});
this._hookCallback(q,A);var l;if(this.name){e.place(window.document.createTextNode(this.name),q,"last");e.addClass(q,"commandButton");l="commandButtonOver"}else{j(this,q,x);l="commandImageOver";this._addAccessibleLabel(q)}this._setupActivateVisuals(q,q,D,h,l)}q.id=x;this.tooltip&&new w({connectId:[q],label:this.tooltip,position:["above","left","right","below"],commandParent:s,commandService:A.commandService});A.domParent=s;A.domNode=q;e.place(q,s,"last")},_addMenuItem:function(s,q){q.domParent=s.domNode;
var x=new t({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new w({connectId:[x.domNode],label:this.tooltip,commandParent:s,commandService:q.commandService});if(this.hrefCallback){var A=this.hrefCallback.call(q.handler,q);if(A)if(A.then)A.then(e.hitch(this,function(D){x.set("label","<a href='"+D+"'>"+this.name+"</a>")}));else if(A)x.set("label","<a href='"+A+"'>"+this.name+"</a>");else return}else if(this.callback)x.onClick=
this.parameters&&q.collectsParameters()?e.hitch(this,function(){q.commandService._collectParameters(q)}):e.hitch(this,function(){this.callback.call(q.handler,q)});x.eclipseCommand=this;s.addChild(x);if(this.imageClass)e.addClass(x.iconNode,this.spriteClass);else if(this.image){e.addClass(x.iconNode,"commandMenuItem");x.iconNode.src=this.image}q.domNode=x.domNode},_makeLink:function(s){var q=e.create("a",{tabindex:"0"});e.addClass(q,"commandLink");e.place(window.document.createTextNode(this.name),
q,"last");s=this.hrefCallback.call(s.handler,s);if(s.then)s.then(function(x){q.href=x});else if(s)q.href=s;else return null;return q},_hookCallback:function(s,q){e.connect(s,"onclick",this,function(){if(this.parameters&&q.collectsParameters())q.commandService._collectParameters(q);else this.callback&&this.callback.call(q.handler,q)});e.connect(s,"onkeypress",this,function(x){if(x.keyCode===e.keys.ENTER||x.keyCode===e.keys.SPACE)if(this.parameters&&q.collectsParameters())q.commandService._collectParameters(q);
else this.callback&&this.callback.call(q.handler,q)})},_addAccessibleLabel:function(s){var q=this.name||this.tooltip;q&&e.attr(s,"aria-label",q)},_setupActivateVisuals:function(s,q,x,A,D){A&&e.addClass(s,A);var h=function(){D&&e.addClass(this,D);x&&e.addClass(this,x);A&&e.removeClass(this,A)},l=function(){D&&e.removeClass(this,D);x&&e.removeClass(this,x);A&&e.addClass(this,A)};e.connect(s,"onmouseover",s,h);e.connect(q,"onfocus",s,h);e.connect(s,"onmouseout",s,l);e.connect(q,"onblur",s,l)},populateChoicesMenu:function(s,
q,x,A){s.focusedChild=null;e.forEach(s.getChildren(),function(l){s.removeChild(l);l.destroy()});x=this.getChoices(q,x,A);for(A=0;A<x.length;A++){var D=x[A],h;if(D.name){h=new a.MenuItem({label:D.name,iconClass:D.imageClass,onClick:this.makeChoiceCallback(D,q)});if(D.imageClass)e.addClass(h.iconNode,D.spriteClass||"commandSprite");else if(D.image){e.addClass(h.iconNode,"commandImage");h.iconNode.src=D.image}}else h=new a.MenuSeparator;s.addChild(h)}},getChoices:function(s,q,x){if(this.choiceCallback)return this.choiceCallback.call(q,
s,x);return null},makeChoiceCallback:function(s,q){return function(x){s.callback&&s.callback.call(s,q,x)}},hasImage:function(){return this.imageClass||this.image!==c.toUrl("images/none.png")}};i.prototype.constructor=i;var u=window.navigator.platform.indexOf("Mac")!==-1;k.prototype={match:function(s){if(this.keyCode===s.keyCode){if(this.mod1!==(u?s.metaKey:s.ctrlKey))return false;if(this.mod2!==s.shiftKey)return false;if(this.mod3!==s.altKey)return false;if(u&&this.mod4!==s.ctrlKey)return false;return true}return false},
equals:function(s){if(!s)return false;if(this.keyCode!==s.keyCode)return false;if(this.mod1!==s.mod1)return false;if(this.mod2!==s.mod2)return false;if(this.mod3!==s.mod3)return false;if(this.mod4!==s.mod4)return false;return true}};k.prototype.constructor=k;m.prototype={match:function(s){s=d.matchResourceParameters(s);if(typeof s[this.token]!=="undefined"){this.parameterValue=s[this.token];return this}return null}};m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};
o.prototype.constructor=o;v.prototype={_storeParameters:function(s){this.parameterTable=null;if(s){this.parameterTable={};for(var q=0;q<s.length;q++)this.parameterTable[s[q].name]=s[q]}},updateParameters:function(s){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(s))},hasParameters:function(){return this.parameterTable!==null},parameterNamed:function(s){return this.parameterTable[s]},valueFor:function(s){if(s=this.parameterTable[s])return s.value;return null},setValue:function(s,
q){if(s=this.parameterTable[s])s.value=q},forEach:function(s){for(var q in this.parameterTable)this.parameterTable[q].type&&this.parameterTable[q].name&&s(this.parameterTable[q])},makeCopy:function(){var s=[];this.forEach(function(q){q=new o(q.name,q.type,q.label,q.value);s.push(q)});return new v(s,this.options,this.getParameters)}};v.prototype.constructor=v;return{CommandService:g,CommandKeyBinding:k,Command:i,CommandInvocation:f,CommandMenuItem:t,URLBinding:m,ParametersDescription:v,CommandParameter:o,
CommandTooltip:w}});
define("orion/parameterCollectors",["require","dojo","dijit","orion/commands","orion/util","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(c,e,a,b,d){function f(){this._activeContainer=null}f.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&e.empty(this._activeElements.parameterArea);if(this._activeElements.parameterContainer){e.removeClass(this._activeElements.parameterContainer,"slideActive");e.removeClass(this._activeElements.slideContainer,"slideContainerActive")}this._activeElements.dismissArea&&
e.empty(this._activeElements.dismissArea);this._activeElements.commandNode&&e.removeClass(this._activeElements.commandNode,"activeCommand");d.forceLayout(this._activeElements.parameterContainer);if(this._oldFocusNode){this._oldFocusNode.focus();this._oldFocusNode=null}}this._activeElements=null},_findParameterElements:function(g){var j={},i=null;if(typeof g==="string")g=e.byId(g);for(var k=g;k;){if(e.hasClass(k,"toolComposite")){i=k;break}k=k.parentNode}if(e.hasClass(g,"commandMarker"))j.commandNode=
g;if(i){j.slideContainer=e.query(".slideParameters",i)[0];j.parameterContainer=e.query(".slide",i)[0];j.parameterArea=e.query(".parameters",i)[0];j.dismissArea=e.query(".parametersDismiss",i)[0]}return j},open:function(g,j){if(typeof g==="string")g=e.byId(g);this.close();this._activeElements=null;if((this._activeElements=this._findParameterElements(g))&&this._activeElements.parameterArea&&this._activeElements.slideContainer&&this._activeElements.parameterContainer){var i=j(this._activeElements.parameterArea);
g=e.query("#closebox",this._activeElements.parameterArea);if(g.length===0){g=e.create("span",{id:"closebox",role:"button",tabindex:"0"},this._activeElements.dismissArea||this._activeElements.parameterArea,"last");e.addClass(g,"imageSprite");e.addClass(g,"core-sprite-close");e.addClass(g,"dismiss");g.title="Close";e.connect(g,"onclick",e.hitch(this,function(){this.close(this._activeElements)}));e.connect(g,"onkeypress",e.hitch(this,function(k){k.keyCode===e.keys.ENTER&&this.close(this._activeElements)}))}e.addClass(this._activeElements.slideContainer,
"slideContainerActive");e.addClass(this._activeElements.parameterContainer,"slideActive");d.forceLayout(this._activeElements.parameterContainer);if(i){this._oldFocusNode=window.document.activeElement;window.setTimeout(function(){i.focus();i.select()},0)}this._activeElements.commandNode&&e.addClass(this._activeElements.commandNode,"activeCommand");return true}return false},_collectAndCall:function(g,j){e.query("input",j).forEach(function(i){i.type!=="button"&&g.parameters.setValue(i.parameterName,
i.value)});g.command.callback&&g.command.callback.call(g.handler,g)},collectParameters:function(g){if(g.parameters){g.domNode&&e.addClass(g.domNode,"commandMarker");return this.open(g.domNode||g.domParent,this.getFillFunction(g))}return false},getFillFunction:function(g,j){return e.hitch(this,function(i){var k=null,m=e.hitch(this,function(){j?j():this.close(g.domNode)}),o=e.hitch(this,function(w){w.keyCode===e.keys.ENTER&&this._collectAndCall(g,i);if(w.keyCode===e.keys.ESCAPE||w.keyCode===e.keys.ENTER){m();
e.stopEvent(w)}});g.parameters.forEach(function(w){w.label&&e.place(document.createTextNode(w.label),i,"last");var u=e.create("input",{type:w.type},i,"last");e.addClass(u,"parameterInput");e.addClass(u,"parameterInput"+w.type);u.setAttribute("speech","speech");u.setAttribute("x-webkit-speech","x-webkit-speech");u.parameterName=w.name;k||(k=u);if(w.value)u.value=w.value;e.connect(u,"onkeypress",o)});var v=function(w){w._collectAndCall(g,i);m()};if(g.parameters.options){g.parameters.optionsRequested=
false;var t=e.create("span",{role:"button",tabindex:"0"},i,"last");e.place(window.document.createTextNode("More"),t,"last");e.addClass(t,"dismiss");e.connect(t,"onclick",e.hitch(this,function(){g.parameters.optionsRequested=true;v(this)}));e.connect(t,"onkeypress",e.hitch(this,function(w){if(w.keyCode===e.keys.ENTER){g.parameters.optionsRequested=true;v(this)}}))}spacer=e.create("span",null,i,"last");e.addClass(spacer,"dismiss");t=e.create("span",{role:"button",tabindex:"0"},i,"last");e.place(window.document.createTextNode("Submit"),
t,"last");e.addClass(t,"dismiss");e.connect(t,"onclick",e.hitch(this,function(){v(this)}));e.connect(t,"onkeypress",e.hitch(this,function(w){w.keyCode===e.keys.ENTER&&v(this)}));spacer=e.create("span",null,i,"last");e.addClass(spacer,"dismiss");t=e.create("span",{id:"closebox",role:"button",tabindex:"0"},i,"last");e.addClass(t,"imageSprite");e.addClass(t,"core-sprite-close");e.addClass(t,"dismiss");t.title="Close";e.connect(t,"onclick",e.hitch(this,function(){m()}));e.connect(t,"onkeypress",e.hitch(this,
function(w){w.keyCode===e.keys.ENTER&&m()}));return k})}};f.prototype.constructor=f;return{CommandParameterCollector:f}});define("orion/editor/regex",[],function(){function c(a){return a.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function e(a){if(a=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(a))return{pattern:a[1],flags:a[2]};return null}return{escape:c,parse:e}});
define("orion/contentTypes",[],function(){function c(a){function b(k,m,o,v){o=m.filename.indexOf(o)>=0;var t=m.extension.indexOf(v)>=0;if(o||t)if(!k||o&&k.extension.indexOf(v)>=0)return m;return k}for(var d=a&&a.split(".").pop(),f=this.getContentTypes(),g=null,j=0;j<f.length;j++){var i=f[j];if(b(g,i,a,d)===i)g=i}return g}function e(a){function b(d){function f(o){if(o===null||typeof o==="undefined")return[];return o instanceof Array?o:[o]}d=d.getServiceReferences("orion.file.contenttype");for(var g=
{},j=0;j<d.length;j++)for(var i=f(d[j].getProperty("contentTypes")),k=0;k<i.length;k++){var m=i[k];g[m.id]||(g[m.id]={id:m.id,name:m.name,image:m.image,"extends":m["extends"],extension:f(m.extension),filename:f(m.filename)})}return g}this.serviceRegistry=a;this.map=b(a);a.registerService("orion.file.contenttypes",this)}e.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[];for(var d in a)a.hasOwnProperty(d)&&b.push(a[d]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return c.call(this,a.Name)},getFilenameContentType:function(a){return c.call(this,a)},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a=typeof a==="string"?this.getContentType(a):a;b=typeof b==="string"?this.getContentType(b):b;if(!a||!b)return false;if(a.id===b.id)return true;else{a=a;for(var d={};a&&(a=this.getContentType(a["extends"]));){if(a.id===b.id)return true;if(d[a.id])throw new Error("Cycle: "+a.id);d[a.id]=true}}return false},
isSomeExtensionOf:function(a,b){for(var d=0;d<b.length;d++)if(this.isExtensionOf(a,b[d]))return true;return false}};return{ContentTypeService:e}});
define("orion/URITemplate",["require","exports","module"],function(){function c(m){this._text=m}function e(m,o){if(o==="U")return encodeURIComponent(m).replace(/[!'()*]/g,function(v){return"%"+v.charCodeAt(0).toString(16).toUpperCase()});if(o==="U+R")return encodeURI(m).replace(/%5B/g,"[").replace(/%5D/g,"]");if(o==="U+R-,")return encodeURI(m).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+o);}function a(m,o,v){for(var t=[],w=0;w<m.length;w++)typeof m[w]!==
"undefined"&&t.push(e(m[w],o));return t.join(v)}function b(m,o,v,t){for(var w=Object.keys(m),u=[],s=0;s<w.length;s++)typeof m[w[s]]!=="undefined"&&u.push(e(w[s],o)+v+e(m[w[s]],o));return u.join(t)}function d(m){for(var o=[],v=m.split(","),t=0;t<v.length;t++){var w=v[t].match(k);if(w===null)throw new Error("Bad VarSpec: "+m);o.push({name:w[1],explode:!!w[2],prefix:w[3]?parseInt(w[3],10):-1})}return o}function f(m){if(m.length===0)throw new Error("Invalid Expression: 0 length expression");if(this._operator=
i[m[0]])m=m.substring(1);else this._operator=i.NUL;this._varSpecList=d(m)}function g(m){for(var o=[],v=0,t=m.indexOf("{",v);t!==-1;){o.push(new c(m.substring(v,t)));v=m.indexOf("}",t+1);if(v===-1)throw new Error("Invalid template: "+m);o.push(new f(m.substring(t+1,v)));v=v+1;t=m.indexOf("{",v)}o.push(new c(m.substring(v)));return o}function j(m){this._templateComponents=g(m)}var i={NUL:{first:"",sep:",",named:false,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:false,ifemp:"",allow:"U+R"},".":{first:".",
sep:",",named:false,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:false,ifemp:"",allow:"U"},";":{first:";",sep:";",named:true,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:true,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:true,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:false,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:false,ifemp:"",allow:"U+R-,"}},k=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;c.prototype=
{expand:function(){return encodeURI(this._text)}};f.prototype={expand:function(m){for(var o=[],v=0;v<this._varSpecList.length;v++){var t=this._varSpecList[v],w=t.name,u=m[w],s=typeof u;if(s!=="undefined"&&u!==null){var q=o.length===0?this._operator.first:this._operator.sep;if(s==="string"){if(this._operator.named){q+=e(w,"U+R");q+=u.length===0?this._operator.ifemp:"="}if(t.prefix!==-1&&t.prefix<u.length)u=u.substring(0,t.prefix);q+=e(u,this._operator.allow)}else if(Array.isArray(u))if(t.explode)q+=
a(u,this._operator.allow,this._operator.sep);else{if(this._operator.named){q+=e(w,"U+R");q+=u.length===0?this._operator.ifemp:"="}q+=a(u,this._operator.allow,",")}else if(s==="object")if(t.explode)q+=b(u,this._operator.allow,"=",this._operator.sep);else{if(this._operator.named){q+=e(w,"U+R");q+=Object.keys(u).length===0?this._operator.ifemp:"="}q+=b(u,this._operator.allow,",",",")}else throw new Error("bad param type: "+w+" : "+s);o.push(q)}}return o.join("")}};j.prototype={expand:function(m){for(var o=
[],v=0;v<this._templateComponents.length;v++)o.push(this._templateComponents[v].expand(m));return o.join("")}};return j});define("text!dijit/templates/Dialog.html",function(){return'<div class="dijitDialog" role="dialog" aria-labelledby="${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="ondijitclick: onCancel" title="${buttonCancel}" role="button" tabIndex="-1">\n\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div>\n</div>'});
define("dojo/dnd/common",["dojo"],function(c){c.getObject("dnd",true,c);c.dnd.getCopyKeyState=c.isCopyKey;c.dnd._uniqueId=0;c.dnd.getUniqueId=function(){var e;do e=c._scopeName+"Unique"+ ++c.dnd._uniqueId;while(c.byId(e));return e};c.dnd._empty={};c.dnd.isFormElement=function(e){e=e.target;if(e.nodeType==3)e=e.parentNode;return" button textarea input select option ".indexOf(" "+e.tagName.toLowerCase()+" ")>=0};return c.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(c){c.getObject("dnd",true,c);c.dnd.getViewport=c.window.getBox;c.dnd.V_TRIGGER_AUTOSCROLL=32;c.dnd.H_TRIGGER_AUTOSCROLL=32;c.dnd.V_AUTOSCROLL_VALUE=16;c.dnd.H_AUTOSCROLL_VALUE=16;c.dnd.autoScroll=function(e){var a=c.window.getBox(),b=0,d=0;if(e.clientX<c.dnd.H_TRIGGER_AUTOSCROLL)b=-c.dnd.H_AUTOSCROLL_VALUE;else if(e.clientX>a.w-c.dnd.H_TRIGGER_AUTOSCROLL)b=c.dnd.H_AUTOSCROLL_VALUE;if(e.clientY<c.dnd.V_TRIGGER_AUTOSCROLL)d=-c.dnd.V_AUTOSCROLL_VALUE;
else if(e.clientY>a.h-c.dnd.V_TRIGGER_AUTOSCROLL)d=c.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(b,d)};c.dnd._validNodes={div:1,p:1,td:1};c.dnd._validOverflow={auto:1,scroll:1};c.dnd.autoScrollNodes=function(e){for(var a=e.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in c.dnd._validNodes){var b=c.getComputedStyle(a);if(b.overflow.toLowerCase()in c.dnd._validOverflow){var d=c._getContentBox(a,b);b=c.position(a,true);var f=Math.min(c.dnd.H_TRIGGER_AUTOSCROLL,d.w/2),g=Math.min(c.dnd.V_TRIGGER_AUTOSCROLL,
d.h/2),j=e.pageX-b.x,i=e.pageY-b.y,k=b=0;if(c.isWebKit||c.isOpera){j+=c.body().scrollLeft;i+=c.body().scrollTop}if(j>0&&j<d.w)if(j<f)b=-f;else if(j>d.w-f)b=f;if(i>0&&i<d.h)if(i<g)k=-g;else if(i>d.h-g)k=g;d=a.scrollLeft;f=a.scrollTop;a.scrollLeft+=b;a.scrollTop+=k;if(d!=a.scrollLeft||f!=a.scrollTop)return}}try{a=a.parentNode}catch(m){a=null}}c.dnd.autoScroll(e)};return c.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(c){c.declare("dojo.dnd.Mover",null,{constructor:function(e,a,b){this.node=c.byId(e);var d=a.touches?a.touches[0]:a;this.marginBox={l:d.pageX,t:d.pageY};this.mouseButton=a.button;a=this.host=b;e=e.ownerDocument;this.events=[c.connect(e,"onmousemove",this,"onFirstMove"),c.connect(e,"ontouchmove",this,"onFirstMove"),c.connect(e,"onmousemove",this,"onMouseMove"),c.connect(e,"ontouchmove",this,"onMouseMove"),c.connect(e,
"onmouseup",this,"onMouseUp"),c.connect(e,"ontouchend",this,"onMouseUp"),c.connect(e,"ondragstart",c.stopEvent),c.connect(e.body,"onselectstart",c.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(e){c.dnd.autoScroll(e);var a=this.marginBox,b=e.touches?e.touches[0]:e;this.host.onMove(this,{l:a.l+b.pageX,t:a.t+b.pageY},e);c.stopEvent(e)},onMouseUp:function(e){if(c.isWebKit&&c.isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button)this.destroy();c.stopEvent(e)},onFirstMove:function(e){var a=
this.node.style,b,d=this.host;switch(a.position){case "relative":case "absolute":b=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=c.marginBox(this.node);b=c.doc.body;var f=c.getComputedStyle(b),g=c._getMarginBox(b,f);f=c._getContentBox(b,f);b=a.l-(f.l-g.l);a=a.t-(f.t-g.t);break}this.marginBox.l=b-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;d&&d.onFirstMove&&d.onFirstMove(this,e);c.disconnect(this.events.shift());c.disconnect(this.events.shift())},
destroy:function(){c.forEach(this.events,c.disconnect);var e=this.host;e&&e.onMoveStop&&e.onMoveStop(this);this.events=this.node=this.host=null}});return c.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(c){c.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(e,a){this.node=c.byId(e);a||(a={});this.handle=a.handle?c.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.delay=a.delay>0?a.delay:0;this.skip=a.skip;this.mover=a.mover?a.mover:c.dnd.Mover;this.events=[c.connect(this.handle,"onmousedown",this,"onMouseDown"),c.connect(this.handle,"ontouchstart",this,"onMouseDown"),c.connect(this.handle,
"ondragstart",this,"onSelectStart"),c.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(e,a){return new c.dnd.Moveable(a,e)},destroy:function(){c.forEach(this.events,c.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(e){if(!(this.skip&&c.dnd.isFormElement(e))){if(this.delay){this.events.push(c.connect(this.handle,"onmousemove",this,"onMouseMove"),c.connect(this.handle,"ontouchmove",this,"onMouseMove"),c.connect(this.handle,"onmouseup",this,
"onMouseUp"),c.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=e.touches?e.touches[0]:e;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(e);c.stopEvent(e)}},onMouseMove:function(e){var a=e.touches?e.touches[0]:e;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e)}c.stopEvent(e)},onMouseUp:function(e){for(var a=0;a<2;++a)c.disconnect(this.events.pop());c.stopEvent(e)},onSelectStart:function(e){if(!this.skip||
!c.dnd.isFormElement(e))c.stopEvent(e)},onDragDetected:function(e){new this.mover(this.node,e,this)},onMoveStart:function(e){c.publish("/dnd/move/start",[e]);c.addClass(c.body(),"dojoMove");c.addClass(this.node,"dojoMoveItem")},onMoveStop:function(e){c.publish("/dnd/move/stop",[e]);c.removeClass(c.body(),"dojoMove");c.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(e,a){this.onMoving(e,a);var b=e.node.style;b.left=a.l+"px";b.top=a.t+"px";this.onMoved(e,a)},onMoving:function(){},
onMoved:function(){}});return c.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(c){c.declare("dojo.dnd.move.constrainedMoveable",c.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(e,a){return new c.dnd.move.constrainedMoveable(a,e)},constructor:function(e,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(e){var a=this.constraintBox=this.constraints.call(this,e);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){e=c._getMarginSize(e.node);a.r-=e.w;
a.b-=e.h}},onMove:function(e,a){var b=this.constraintBox,d=e.node.style;this.onMoving(e,a);a.l=a.l<b.l?b.l:b.r<a.l?b.r:a.l;a.t=a.t<b.t?b.t:b.b<a.t?b.b:a.t;d.left=a.l+"px";d.top=a.t+"px";this.onMoved(e,a)}});c.declare("dojo.dnd.move.boxConstrainedMoveable",c.dnd.move.constrainedMoveable,{box:{},markupFactory:function(e,a){return new c.dnd.move.boxConstrainedMoveable(a,e)},constructor:function(e,a){var b=a&&a.box;this.constraints=function(){return b}}});c.declare("dojo.dnd.move.parentConstrainedMoveable",
c.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(e,a){return new c.dnd.move.parentConstrainedMoveable(a,e)},constructor:function(e,a){var b=a&&a.area;this.constraints=function(){var d=this.node.parentNode,f=c.getComputedStyle(d),g=c._getMarginBox(d,f);if(b=="margin")return g;var j=c._getMarginExtents(d,f);g.l+=j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;if(b=="border")return g;j=c._getBorderExtents(d,f);g.l+=j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;if(b=="padding")return g;j=c._getPadExtents(d,f);g.l+=
j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;return g}}});c.dnd.constrainedMover=c.dnd.move.constrainedMover;c.dnd.boxConstrainedMover=c.dnd.move.boxConstrainedMover;c.dnd.parentConstrainedMover=c.dnd.move.parentConstrainedMover;return c.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(c){(function(){var e=c.dnd.Moveable.prototype.onMove;c.declare("dojo.dnd.TimedMoveable",c.dnd.Moveable,{timeout:40,constructor:function(a,b){b||(b={});if(b.timeout&&typeof b.timeout=="number"&&b.timeout>=0)this.timeout=b.timeout},markupFactory:function(a,b){return new c.dnd.TimedMoveable(b,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);e.call(this,a,a._leftTop)}c.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,b){a._leftTop=b;if(!a._timer){var d=this;a._timer=setTimeout(function(){a._timer=null;e.call(d,a,a._leftTop)},this.timeout)}}})})();return c.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(c){c.declare("dojo.fx.Toggler",null,{node:null,showFunc:c.fadeIn,hideFunc:c.fadeOut,showDuration:200,hideDuration:200,constructor:function(e){var a=this;c.mixin(a,e);a.node=e.node;a._showArgs=c.mixin({},e);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=c.mixin({},e);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);c.connect(a.showAnim,"beforeBegin",c.hitch(a.hideAnim,
"stop",true));c.connect(a.hideAnim,"beforeBegin",c.hitch(a.showAnim,"stop",true))},show:function(e){return this.showAnim.play(e||0)},hide:function(e){return this.hideAnim.play(e||0)}});return c.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(c){(function(){var e={_fire:function(d,f){if(this[d])this[d].apply(this,f||[]);return this}},a=function(d){this._index=-1;this._animations=d||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;c.forEach(this._animations,function(f){this.duration+=f.duration;if(f.delay)this.duration+=f.delay},this)};c.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){c.disconnect(this._onAnimateCtx);c.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length)this._fire("onEnd");else{this._current=this._animations[++this._index];this._onAnimateCtx=c.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=c.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(d,f){if(!this._current)this._current=this._animations[this._index=0];if(!f&&this._current.status()=="playing")return this;var g=c.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),j=c.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),i=c.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);c.disconnect(g);c.disconnect(j);c.disconnect(i)});this._onAnimateCtx&&c.disconnect(this._onAnimateCtx);this._onAnimateCtx=c.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&c.disconnect(this._onEndCtx);this._onEndCtx=c.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var d=c.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);c.disconnect(d)});this._current.pause()}return this},gotoPercent:function(d,f){this.pause();var g=this.duration*d;this._current=null;c.some(this._animations,function(j){if(j.duration<=g){this._current=j;return true}g-=j.duration;return false});this._current&&this._current.gotoPercent(g/this._current.duration,f);return this},stop:function(d){if(this._current){if(d){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var f=c.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);c.disconnect(f)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&c.disconnect(this._onAnimateCtx);this._onEndCtx&&c.disconnect(this._onEndCtx)}});c.extend(a,e);c.fx.chain=function(d){return new a(d)};
var b=function(d){this._animations=d||[];this._connects=[];this.duration=this._finished=0;c.forEach(d,function(g){var j=g.duration;if(g.delay)j+=g.delay;if(this.duration<j)this.duration=j;this._connects.push(c.connect(g,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new c.Animation({curve:[0,1],duration:this.duration});var f=this;c.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(g){f._connects.push(c.connect(f._pseudoAnimation,g,function(){f._fire(g,
arguments)}))})};c.extend(b,{_doAction:function(d,f){c.forEach(this._animations,function(g){g[d].apply(g,f)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(d,f){var g=this._pseudoAnimation;g[d].apply(g,f)},play:function(){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(d,f){var g=
this.duration*d;c.forEach(this._animations,function(j){j.gotoPercent(j.duration<g?1:g/j.duration,f)});this._call("gotoPercent",arguments);return this},stop:function(){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){c.forEach(this._connects,c.disconnect)}});c.extend(b,e);c.fx.combine=function(d){return new b(d)};c.fx.wipeIn=function(d){var f=d.node=c.byId(d.node),g=f.style,j;d=c.animateProperty(c.mixin({properties:{height:{start:function(){j=
g.overflow;g.overflow="hidden";if(g.visibility=="hidden"||g.display=="none"){g.height="1px";g.display="";g.visibility="";return 1}else{var i=c.style(f,"height");return Math.max(i,1)}},end:function(){return f.scrollHeight}}}},d));c.connect(d,"onEnd",function(){g.height="auto";g.overflow=j});return d};c.fx.wipeOut=function(d){var f=(d.node=c.byId(d.node)).style,g;d=c.animateProperty(c.mixin({properties:{height:{end:1}}},d));c.connect(d,"beforeBegin",function(){g=f.overflow;f.overflow="hidden";f.display=
""});c.connect(d,"onEnd",function(){f.overflow=g;f.height="auto";f.display="none"});return d};c.fx.slideTo=function(d){var f=null,g=null,j=function(i){return function(){var k=c.getComputedStyle(i),m=k.position;f=m=="absolute"?i.offsetTop:parseInt(k.top)||0;g=m=="absolute"?i.offsetLeft:parseInt(k.left)||0;if(m!="absolute"&&m!="relative"){k=c.position(i,true);f=k.y;g=k.x;i.style.position="absolute";i.style.top=f+"px";i.style.left=g+"px"}}}(d.node=c.byId(d.node));j();d=c.animateProperty(c.mixin({properties:{top:d.top||
0,left:d.left||0}},d));c.connect(d,"beforeBegin",d,j);return d}})();return c.fx});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(c,e){c.declare("dijit.DialogUnderlay",[e._Widget,e._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){c.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){c.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,b=this.domNode.style;b.display="none";var d=c.window.getBox();b.top=d.t+"px";b.left=d.l+"px";a.width=d.w+"px";a.height=d.h+"px";b.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new e.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return e.DialogUnderlay});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(c,e){c.declare("dijit._DialogBase",[e._Templated,e.form._FormMixin,e._DialogMixin,e._CssStateMixin],{templateString:c.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:c.delegate(e._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:e.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=c.i18n.getLocalization("dijit","common");c.mixin(this,a);this.inherited(arguments)},
postCreate:function(){c.style(this.domNode,{display:"none",position:"absolute"});c.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&e._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);e.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
c.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=c.isIE==6?new c.dnd.TimedMoveable(a,{handle:this.titleBar}):new c.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=c.subscribe("/dnd/move/stop",this,"_endDrag")}else c.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":c.map(this["class"].split(/\s/),function(b){return b+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else c.style(this.containerNode,{width:"auto",height:"auto"});var a=c._getMarginSize(this.domNode),b=c.window.getBox();if(a.w>=b.w||a.h>=b.h){var d=Math.min(a.w,Math.floor(b.w*0.75));a=Math.min(a.h,Math.floor(b.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:d,h:a})}else c.style(this.containerNode,{width:d+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!c.hasClass(c.body(),"dojoMove")){var a=this.domNode,b=c.window.getBox(),d=this._relativePosition,f=d?null:c._getBorderBox(a),g=Math.floor(b.l+(d?d.x:(b.w-f.w)/2));b=Math.floor(b.t+(d?d.y:(b.h-f.h)/2));c.style(a,{left:g+"px",top:b+"px"})}},_onKey:function(a){if(a.charOrCode){var b=c.keys,d=a.target;a.charOrCode===b.TAB&&this._getFocusItems(this.domNode);var f=
this._firstFocusItem==this._lastFocusItem;if(d==this._firstFocusItem&&a.shiftKey&&a.charOrCode===b.TAB){f||e.focus(this._lastFocusItem);c.stopEvent(a)}else if(d==this._lastFocusItem&&a.charOrCode===b.TAB&&!a.shiftKey){f||e.focus(this._firstFocusItem);c.stopEvent(a)}else{for(;d;){if(d==this.domNode||c.hasClass(d,"dijitPopup"))if(a.charOrCode==b.ESCAPE)this.onCancel();else return;d=d.parentNode}if(a.charOrCode!==b.TAB)c.stopEvent(a);else if(!c.isOpera)try{this._firstFocusItem.focus()}catch(g){}}}},
show:function(){if(!this.open){this._started||this.startup();if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true}this._fadeOutDeferred&&this._fadeOutDeferred.cancel();this._modalconnects.push(c.connect(window,"onscroll",this,"layout"));this._modalconnects.push(c.connect(window,"onresize",this,function(){var b=c.window.getBox();if(!this._oldViewport||b.h!=this._oldViewport.h||b.w!=this._oldViewport.w){this.layout();this._oldViewport=b}}));this._modalconnects.push(c.connect(this.domNode,
"onkeypress",this,"_onKey"));c.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new c.Deferred(c.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=c.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:c.hitch(this,function(){e._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:c.hitch(this,function(){if(this.autofocus&&e._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
e.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new c.Deferred(c.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=c.fadeOut({node:this.domNode,duration:this.duration,onEnd:c.hitch(this,function(){this.domNode.style.display="none";e._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;c.forEach(this._modalconnects,c.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){e._underlay&&e._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&c.unsubscribe(this._dndListener);c.forEach(this._modalconnects,c.disconnect);e._DialogLevelManager.hide(this);this.inherited(arguments)}});c.declare("dijit.Dialog",[e.layout.ContentPane,e._DialogBase],{});e._DialogLevelManager={show:function(a,b){var d=e._dialogStack;d[d.length-1].focus=e.getFocus(a);var f=e._underlay;if(!f||f._destroyed)f=e._underlay=new e.DialogUnderlay(b);else f.set(a.underlayAttrs);var g=
d[d.length-1].dialog?d[d.length-1].zIndex+2:950;d.length==1&&f.show();c.style(e._underlay.domNode,"zIndex",g-1);c.style(a.domNode,"zIndex",g);d.push({dialog:a,underlayAttrs:b,zIndex:g})},hide:function(a){var b=e._dialogStack;if(b[b.length-1].dialog==a){b.pop();var d=b[b.length-1];if(b.length==1)e._underlay._destroyed||e._underlay.hide();else{c.style(e._underlay.domNode,"zIndex",d.zIndex-1);e._underlay.set(d.underlayAttrs)}if(a.refocus){b=d.focus;if(!b||d.dialog&&!c.isDescendant(b.node,d.dialog.domNode)){d.dialog._getFocusItems(d.dialog.domNode);
b=d.dialog._firstFocusItem}try{e.focus(b)}catch(f){}}}else{d=c.indexOf(c.map(b,function(g){return g.dialog}),a);d!=-1&&b.splice(d,1)}},isTop:function(a){var b=e._dialogStack;return b[b.length-1].dialog==a}};e._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return e.Dialog});define("text!dijit/form/templates/CheckBox.html",function(){return'<div class="dijit dijitReset dijitInline" role="presentation"\n\t><input\n\t \t${!nameAttrSetting} type="${type}" ${checkedAttrSetting}\n\t\tclass="dijitReset dijitCheckBoxInput"\n\t\tdojoAttachPoint="focusNode"\n\t \tdojoAttachEvent="onclick:_onClick"\n/></div>'});
define("dijit/form/ToggleButton",["dojo","dijit","dijit/form/Button"],function(c,e){return e.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(c,e){c.declare("dijit.form.CheckBox",e.form.ToggleButton,{templateString:c.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:c.delegate(e.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);c.attr(this.focusNode,"readOnly",a);e.setWaiState(this.focusNode,
"readonly",a)},_setValueAttr:function(a,b){if(typeof a=="string"){this._set("value",a);c.attr(this.focusNode,"value",a);a=true}this._created&&this.set("checked",a,b)},_getValueAttr:function(){return this.checked?this.value:false},_setLabelAttr:undefined,postMixInProperties:function(){if(this.value=="")this.value="on";this.checkedAttrSetting=this.checked?"checked":"";this.inherited(arguments)},_fillContent:function(){},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||
false);this._set("value",this.params.value||"on");c.attr(this.focusNode,"value",this.value)},_onFocus:function(){this.id&&c.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");this.inherited(arguments)},_onBlur:function(){this.id&&c.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");this.inherited(arguments)},_onClick:function(a){if(this.readOnly){c.stopEvent(a);return false}return this.inherited(arguments)}});c.declare("dijit.form.RadioButton",e.form.CheckBox,{type:"radio",
baseClass:"dijitRadio",_setCheckedAttr:function(a){this.inherited(arguments);if(this._created)if(a){var b=this;c.query("INPUT[type=radio]",this.focusNode.form||c.doc).forEach(function(d){if(d.name==b.name&&d!=b.focusNode&&d.form==b.focusNode.form)(d=e.getEnclosingWidget(d))&&d.checked&&d.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return e.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(c,e){c.declare("dijit.form.Form",[e._Widget,e._Templated,e.form._FormMixin,e.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:c.delegate(e._Widget.prototype.attributeMap,
{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),postMixInProperties:function(){this.nameAttrSetting=this.name?"name='"+this.name+"'":"";this.inherited(arguments)},execute:function(){},onExecute:function(){},_setEncTypeAttr:function(a){this.encType=a;c.attr(this.domNode,"encType",a);if(c.isIE)this.domNode.encoding=a},postCreate:function(){if(c.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){var a=this.srcNodeRef.attributes.getNamedItem("encType");a&&!a.specified&&typeof a.value==
"string"&&this.set("encType",a.value)}this.inherited(arguments)},reset:function(a){var b={returnValue:true,preventDefault:function(){this.returnValue=false},stopPropagation:function(){},currentTarget:a?a.target:this.domNode,target:a?a.target:this.domNode};this.onReset(b)!==false&&b.returnValue&&this.inherited(arguments,[])},onReset:function(){return true},_onReset:function(a){this.reset(a);c.stopEvent(a);return false},_onSubmit:function(a){var b=e.form.Form.prototype;if(this.execute!=b.execute||this.onExecute!=
b.onExecute){c.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues())}this.onSubmit(a)===false&&c.stopEvent(a)},onSubmit:function(){return this.isValid()},submit:function(){this.onSubmit()!==false&&this.containerNode.submit()}});return e.form.Form});
define("dojo/data/util/filter",["dojo"],function(c){c.getObject("data.util.filter",true,c);c.data.util.filter.patternToRegExp=function(e,a){for(var b="^",d=null,f=0;f<e.length;f++){d=e.charAt(f);switch(d){case "\\":b+=d;f++;b+=e.charAt(f);break;case "*":b+=".*";break;case "?":b+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":b+="\\";default:b+=d}}b+="$";return a?new RegExp(b,"mi"):new RegExp(b,"m")};return c.data.util.filter});
define("dojo/data/util/sorter",["dojo"],function(c){c.getObject("data.util.sorter",true,c);c.data.util.sorter.basicComparator=function(e,a){var b=-1;if(e===null)e=undefined;if(a===null)a=undefined;if(e==a)b=0;else if(e>a||e==null)b=1;return b};c.data.util.sorter.createSortFunction=function(e,a){function b(o,v,t,w){return function(u,s){u=w.getValue(u,o);s=w.getValue(s,o);return v*t(u,s)}}for(var d=[],f,g=a.comparatorMap,j=c.data.util.sorter.basicComparator,i=0;i<e.length;i++){f=e[i];var k=f.attribute;
if(k){f=f.descending?-1:1;var m=j;if(g){if(typeof k!=="string"&&"toString"in k)k=k.toString();m=g[k]||j}d.push(b(k,f,m,a))}}return function(o,v){for(var t=0;t<d.length;){var w=d[t++](o,v);if(w!==0)return w}return 0}};return c.data.util.sorter});
define("dojo/data/util/simpleFetch",["dojo","dojo/data/util/sorter"],function(c){c.getObject("data.util.simpleFetch",true,c);c.data.util.simpleFetch.fetch=function(e){e=e||{};if(!e.store)e.store=this;var a=this,b=function(f,g){if(g.onError)g.onError.call(g.scope||c.global,f,g)},d=function(f,g){var j=g.abort||null,i=false,k=g.start?g.start:0,m=g.count&&g.count!==Infinity?k+g.count:f.length;g.abort=function(){i=true;j&&j.call(g)};var o=g.scope||c.global;if(!g.store)g.store=a;g.onBegin&&g.onBegin.call(o,
f.length,g);g.sort&&f.sort(c.data.util.sorter.createSortFunction(g.sort,a));if(g.onItem)for(var v=k;v<f.length&&v<m;++v){var t=f[v];i||g.onItem.call(o,t,g)}if(g.onComplete&&!i){v=null;g.onItem||(v=f.slice(k,m));g.onComplete.call(o,v,g)}};this._fetchItems(e,d,b);return e};return c.data.util.simpleFetch});
define("dojo/data/ItemFileReadStore",["dojo","dojo/data/util/filter","dojo/data/util/simpleFetch","dojo/date/stamp"],function(c){c.declare("dojo.data.ItemFileReadStore",null,{constructor:function(e){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=e.url;this._jsonData=e.data;this.data=null;this._datatypeMap=e.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return c.date.stamp.fromISOString(a)}});
this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(e.urlPreventCache!==undefined)this.urlPreventCache=e.urlPreventCache?true:false;if(e.hierarchical!==undefined)this.hierarchical=e.hierarchical?true:false;if(e.clearOnClose)this.clearOnClose=true;if("failOk"in e)this.failOk=e.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(e){if(!this.isItem(e))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(e){if(typeof e!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(e,a,b){e=this.getValues(e,a);return e.length>0?e[0]:b},getValues:function(e,a){this._assertIsItem(e);this._assertIsAttribute(a);
return(e[a]||[]).slice(0)},getAttributes:function(e){this._assertIsItem(e);var a=[];for(var b in e)b!==this._storeRefPropName&&b!==this._itemNumPropName&&b!==this._rootItemPropName&&b!==this._reverseRefMap&&a.push(b);return a},hasAttribute:function(e,a){this._assertIsItem(e);this._assertIsAttribute(a);return a in e},containsValue:function(e,a,b){var d=undefined;if(typeof b==="string")d=c.data.util.filter.patternToRegExp(b,false);return this._containsValue(e,a,b,d)},_containsValue:function(e,a,b,d){return c.some(this.getValues(e,
a),function(f){if(f!==null&&!c.isObject(f)&&d){if(f.toString().match(d))return true}else if(b===f)return true})},isItem:function(e){if(e&&e[this._storeRefPropName]===this)if(this._arrayOfAllItems[e[this._itemNumPropName]]===e)return true;return false},isItemLoaded:function(e){return this.isItem(e)},loadItem:function(e){this._assertIsItem(e.item)},getFeatures:function(){return this._features},getLabel:function(e){if(this._labelAttr&&this.isItem(e))return this.getValue(e,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(e,a,b){var d=this,f=function(k,m){var o=[],v,t;if(k.query){var w;v=k.queryOptions?k.queryOptions.ignoreCase:false;var u={};for(t in k.query){w=k.query[t];if(typeof w==="string")u[t]=c.data.util.filter.patternToRegExp(w,v);else if(w instanceof RegExp)u[t]=w}for(v=0;v<m.length;++v){var s=true,q=m[v];if(q===null)s=false;else for(t in k.query){w=k.query[t];d._containsValue(q,t,w,u[t])||(s=false)}s&&o.push(q)}}else for(v=0;v<m.length;++v){t=m[v];t!==null&&o.push(t)}a(o,
k)};if(this._loadFinished)f(e,this._getItemsArray(e.queryOptions));else{if(this._jsonFileUrl!==this._ccUrl){c.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e,
filter:f});else{this._loadInProgress=true;var g=c.xhrGet({url:d._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});g.addCallback(function(k){try{d._getItemsFromLoadedData(k);d._loadFinished=true;d._loadInProgress=false;f(e,d._getItemsArray(e.queryOptions));d._handleQueuedFetches()}catch(m){d._loadFinished=true;d._loadInProgress=false;b(m,e)}});g.addErrback(function(k){d._loadInProgress=false;b(k,e)});var j=null;if(e.abort)j=e.abort;e.abort=function(){g&&
g.fired===-1&&g.cancel();j&&j.call(e)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;f(e,this._getItemsArray(e.queryOptions))}catch(i){b(i,e)}else b(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),e)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var e=0;e<this._queuedFetches.length;e++){var a=this._queuedFetches[e],b=a.args;(a=a.filter)?
a(b,this._getItemsArray(b.queryOptions)):this.fetchItemByIdentity(b)}this._queuedFetches=[]}},_getItemsArray:function(e){if(e&&e.deep)return this._arrayOfAllItems;return this._arrayOfTopLevelItems},close:function(){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null)&&this.data==null)console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch");
this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[]}},_getItemsFromLoadedData:function(e){function a(u){return u!==null&&typeof u==="object"&&(!c.isArray(u)||d)&&!c.isFunction(u)&&(u.constructor==Object||c.isArray(u))&&typeof u._reference==="undefined"&&typeof u._type==="undefined"&&typeof u._value==="undefined"&&f.hierarchical}function b(u){f._arrayOfAllItems.push(u);for(var s in u){var q=u[s];
if(q)if(c.isArray(q))for(var x=0;x<q.length;++x){var A=q[x];a(A)&&b(A)}else a(q)&&b(q)}}var d=false,f=this;this._labelAttr=e.label;var g,j;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=e.items;for(g=0;g<this._arrayOfTopLevelItems.length;++g){j=this._arrayOfTopLevelItems[g];if(c.isArray(j))d=true;b(j);j[this._rootItemPropName]=true}var i={},k;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];for(k in j){if(k!==this._rootItemPropName){var m=j[k];if(m!==null)c.isArray(m)||
(j[k]=[m]);else j[k]=[null]}i[k]=k}}for(;i[this._storeRefPropName];)this._storeRefPropName+="_";for(;i[this._itemNumPropName];)this._itemNumPropName+="_";for(;i[this._reverseRefMap];)this._reverseRefMap+="_";if(i=e.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=i;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];e=j[i];e=e[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,e))if(this._jsonFileUrl)throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+
this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+i+"].  Value collided: ["+e+"]");else{if(this._jsonData)throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+i+"].  Value collided: ["+e+"]");}else this._itemsByIdentity[e]=j}}else this._features["dojo.data.api.Identity"]=Number;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];j[this._storeRefPropName]=
this;j[this._itemNumPropName]=g}for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];for(k in j){e=j[k];for(i=0;i<e.length;++i){m=e[i];if(m!==null&&typeof m=="object"){if("_type"in m&&"_value"in m){var o=m._type,v=this._datatypeMap[o];if(v)if(c.isFunction(v))e[i]=new v(m._value);else if(c.isFunction(v.deserialize))e[i]=v.deserialize(m._value);else throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
else throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+o+"'");}if(m._reference){m=m._reference;if(c.isObject(m))for(o=0;o<this._arrayOfAllItems.length;++o){v=this._arrayOfAllItems[o];var t=true;for(var w in m)if(v[w]!=m[w])t=false;if(t)e[i]=v}else e[i]=this._getItemByIdentity(m);if(this.referenceIntegrity){m=e[i];this.isItem(m)&&this._addReferenceToMap(m,j,k)}}else this.isItem(m)&&this.referenceIntegrity&&this._addReferenceToMap(m,
j,k)}}}}},_addReferenceToMap:function(){},getIdentity:function(e){var a=this._features["dojo.data.api.Identity"];if(a===Number)return e[this._itemNumPropName];else if(e=e[a])return e[0];return null},fetchItemByIdentity:function(e){var a,b;if(this._loadFinished){a=this._getItemByIdentity(e.identity);if(e.onItem){b=e.scope?e.scope:c.global;e.onItem.call(b,a)}}else{var d=this;if(this._jsonFileUrl!==this._ccUrl){c.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e});else{this._loadInProgress=true;b=c.xhrGet({url:d._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});b.addCallback(function(f){var g=e.scope?e.scope:c.global;try{d._getItemsFromLoadedData(f);
d._loadFinished=true;d._loadInProgress=false;a=d._getItemByIdentity(e.identity);e.onItem&&e.onItem.call(g,a);d._handleQueuedFetches()}catch(j){d._loadInProgress=false;e.onError&&e.onError.call(g,j)}});b.addErrback(function(f){d._loadInProgress=false;if(e.onError)e.onError.call(e.scope?e.scope:c.global,f)})}else if(this._jsonData){d._getItemsFromLoadedData(d._jsonData);d._jsonData=null;d._loadFinished=true;a=d._getItemByIdentity(e.identity);if(e.onItem){b=e.scope?e.scope:c.global;e.onItem.call(b,a)}}}},
_getItemByIdentity:function(e){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,e))a=this._itemsByIdentity[e];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,e))a=this._arrayOfAllItems[e];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var e=this._features["dojo.data.api.Identity"];return e===Number?null:[e]},_forceLoad:function(){var e=this;if(this._jsonFileUrl!==this._ccUrl){c.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl){var a=c.xhrGet({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true});a.addCallback(function(b){try{if(e._loadInProgress!==true&&!e._loadFinished){e._getItemsFromLoadedData(b);e._loadFinished=true}else if(e._loadInProgress)throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");
}catch(d){console.log(d);throw d;}});a.addErrback(function(b){throw b;})}else if(this._jsonData){e._getItemsFromLoadedData(e._jsonData);e._jsonData=null;e._loadFinished=true}}});c.extend(c.data.ItemFileReadStore,c.data.util.simpleFetch);return c.data.ItemFileReadStore});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(c,e){c.declare("orion.widgets._OrionDialogMixin",null,{postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Information Needed";this.buttonCancel="Cancel"},postCreate:function(){this.inherited(arguments);c.connect(this,"onKeyPress",c.hitch(this,function(a){a.keyCode===c.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(c.hitch(this,function(){if(c.isDescendant(e._curFocus,
this.domNode))e._curFocus=null;if(c.isDescendant(e._prevFocus,this.domNode))e._prevFocus=null;this.destroyRecursive()}),this.duration)}})});define("text!orion/widgets/templates/NewItemDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemNameLabel" for="${id}_itemName" style="padding-right: 10">${itemNameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 30em; text-align: left;">\n\t\t\t\t\t<input dojoType="dijit.form.ValidationTextBox" dojoAttachPoint="itemName" id="${id}_itemName" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemURLLabel" for="itemURL" style="padding-right: 10">Server Path:</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; width: 40em; text-align: left; padding:5;">\n\t\t\t\t\t<input dojoAttachPoint="itemURL" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo1">\n\t\t\t\t<div style="display: table-cell;"></div>\n\t\t\t\t<div style="display: table-cell;">\n\t\t\t\t\t<input dojoAttachPoint="createCheckbox" id="${id}_createCheckbox" dojoType="dijit.form.CheckBox" checked="checked" value="on" type="checkbox">\n\t\t\t\t\t<label dojoAttachPoint="createCheckboxLabel" for="${id}_createCheckbox">Create if doesn\'t exist</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="newItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/NewItemDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/CheckBox","dijit/form/Form","dijit/form/ValidationTextBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/NewItemDialog.html"],function(c,e){c.declare("orion.widgets.NewItemDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/NewItemDialog.html"),constructor:function(a){this.options=
a||{};this.options.advanced=this.options.advanced||false},postMixInProperties:function(){this.inherited(arguments);this.itemNameLabelText=this.options.label||"Name:"},postCreate:function(){this.inherited(arguments);if(this.options.advanced){this.itemAdvancedInfo.style.display="table-row";this.itemAdvancedInfo1.style.display="table-row";c.connect(this.itemURL,"onkeyup",null,c.hitch(this,this.onURLChange))}else{this.itemAdvancedInfo.style.display="none";this.itemAdvancedInfo1.style.display="none"}},
execute:function(){var a,b;this.newItemButton.focus();if(this.options.advanced){a=this.itemURL.value.replace(/^\s+|\s+$/g,"");b=this.createCheckbox.get("disabled")?false:this.createCheckbox.get("checked")}this.options.func(this.itemName.value,a&&a!==""?a:undefined,b)},onURLChange:function(){var a=this.itemURL.value;if(a.match(/^file:\/\//))this.createCheckbox.set("disabled",false);else a.match(/^[a-zA-Z][a-zA-Z]+:\/\/.+/)?this.createCheckbox.set("disabled",true):this.createCheckbox.set("disabled",
false)}})});define("text!dijit/templates/TreeNode.html",function(){return'<div class="dijitTreeNode" role="presentation"\n\t><div dojoAttachPoint="rowNode" class="dijitTreeRow" role="presentation" dojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick"\n\t\t><img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" role="presentation"\n\t\t/><span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" role="presentation"\n\t\t></span\n\t\t><span dojoAttachPoint="contentNode"\n\t\t\tclass="dijitTreeContent" role="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" role="presentation"\n\t\t\t/><span dojoAttachPoint="labelNode" class="dijitTreeLabel" role="treeitem" tabindex="-1" aria-selected="false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t</span\n\t></div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer" role="presentation" style="display: none;"></div>\n</div>'});
define("text!dijit/templates/Tree.html",function(){return'<div class="dijitTree dijitTreeContainer" role="tree"\n\tdojoAttachEvent="onkeypress:_onKeyPress">\n\t<div class="dijitInline dijitTreeIndent" style="position: absolute; top: -9999px" dojoAttachPoint="indentDetector"></div>\n</div>'});
define("dojo/DeferredList",["dojo"],function(c){c.DeferredList=function(e,a,b,d){var f=[];c.Deferred.call(this);var g=this;e.length===0&&!a&&this.resolve([0,[]]);var j=0;c.forEach(e,function(i,k){function m(o,v){f[k]=[o,v];j++;j===e.length&&g.resolve(f)}i.then(function(o){a?g.resolve([k,o]):m(true,o)},function(o){b?g.reject(o):m(false,o);if(d)return null;throw o;})})};c.DeferredList.prototype=new c.Deferred;c.DeferredList.prototype.gatherResults=function(e){e=new c.DeferredList(e,false,true,false);
e.addCallback(function(a){var b=[];c.forEach(a,function(d){b.push(d[1])});return b});return e};return c.DeferredList});
define("dojo/regexp",["dojo"],function(c){c.getObject("regexp",true,c);c.regexp.escapeString=function(e,a){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(b){if(a&&a.indexOf(b)!=-1)return b;return"\\"+b})};c.regexp.buildGroupRE=function(e,a,b){if(!(e instanceof Array))return a(e);for(var d=[],f=0;f<e.length;f++)d.push(a(e[f]));return c.regexp.group(d.join("|"),b)};c.regexp.group=function(e,a){return"("+(a?"?:":"")+e+")"};return c.regexp});
define("dojo/cookie",["dojo","dojo/regexp"],function(c){c.cookie=function(e,a,b){var d=document.cookie;if(arguments.length==1){var f=d.match(new RegExp("(?:^|; )"+c.regexp.escapeString(e)+"=([^;]*)"));return f?decodeURIComponent(f[1]):undefined}else{b=b||{};d=b.expires;if(typeof d=="number"){var g=new Date;g.setTime(g.getTime()+d*24*60*60*1E3);d=b.expires=g}if(d&&d.toUTCString)b.expires=d.toUTCString();a=encodeURIComponent(a);d=e+"="+a;for(f in b){d+="; "+f;g=b[f];if(g!==true)d+="="+g}document.cookie=
d}};c.cookie.isSupported=function(){if(!("cookieEnabled"in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&this("__djCookieTest__","",{expires:-1})}return navigator.cookieEnabled};return c.cookie});
define("dijit/tree/TreeStoreModel",["dojo","dijit"],function(c,e){c.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(a){c.mixin(this,a);this.connects=[];a=this.store;if(!a.getFeatures()["dojo.data.api.Identity"])throw new Error("dijit.Tree: store must support dojo.data.Identity");if(a.getFeatures()["dojo.data.api.Notification"])this.connects=this.connects.concat([c.connect(a,
"onNew",this,"onNewItem"),c.connect(a,"onDelete",this,"onDeleteItem"),c.connect(a,"onSet",this,"onSetItem")])},destroy:function(){c.forEach(this.connects,c.disconnect)},getRoot:function(a,b){this.root?a(this.root):this.store.fetch({query:this.query,onComplete:c.hitch(this,function(d){if(d.length!=1)throw new Error(this.declaredClass+": query "+c.toJson(this.query)+" returned "+d.length+" items, but must return exactly one item");this.root=d[0];a(this.root)}),onError:b})},mayHaveChildren:function(a){return c.some(this.childrenAttrs,
function(b){return this.store.hasAttribute(a,b)},this)},getChildren:function(a,b,d){var f=this.store;if(f.isItemLoaded(a)){for(var g=[],j=0;j<this.childrenAttrs.length;j++){var i=f.getValues(a,this.childrenAttrs[j]);g=g.concat(i)}var k=0;this.deferItemLoadingUntilExpand||c.forEach(g,function(o){f.isItemLoaded(o)||k++});k==0?b(g):c.forEach(g,function(o,v){f.isItemLoaded(o)||f.loadItem({item:o,onItem:function(t){g[v]=t;--k==0&&b(g)},onError:d})})}else{var m=c.hitch(this,arguments.callee);f.loadItem({item:a,
onItem:function(o){m(o,b,d)},onError:d})}},isItem:function(a){return this.store.isItem(a)},fetchItemByIdentity:function(a){this.store.fetchItemByIdentity(a)},getIdentity:function(a){return this.store.getIdentity(a)},getLabel:function(a){return this.labelAttr?this.store.getValue(a,this.labelAttr):this.store.getLabel(a)},newItem:function(a,b,d){var f={parent:b,attribute:this.childrenAttrs[0]},g;if(this.newItemIdAttr&&a[this.newItemIdAttr])this.fetchItemByIdentity({identity:a[this.newItemIdAttr],scope:this,
onItem:function(j){if(j)this.pasteItem(j,null,b,true,d);else(g=this.store.newItem(a,f))&&d!=undefined&&this.pasteItem(g,b,b,false,d)}});else(g=this.store.newItem(a,f))&&d!=undefined&&this.pasteItem(g,b,b,false,d)},pasteItem:function(a,b,d,f,g){var j=this.store,i=this.childrenAttrs[0];b&&c.forEach(this.childrenAttrs,function(m){if(j.containsValue(b,m,a)){if(!f){var o=c.filter(j.getValues(b,m),function(v){return v!=a});j.setValues(b,m,o)}i=m}});if(d)if(typeof g=="number"){var k=j.getValues(d,i).slice();
k.splice(g,0,a);j.setValues(d,i,k)}else j.setValues(d,i,j.getValues(d,i).concat(a))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(a,b){b&&this.getChildren(b.item,c.hitch(this,function(d){this.onChildrenChange(b.item,d)}))},onDeleteItem:function(a){this.onDelete(a)},onSetItem:function(a,b){c.indexOf(this.childrenAttrs,b)!=-1?this.getChildren(a,c.hitch(this,function(d){this.onChildrenChange(a,d)})):this.onChange(a)}});return e.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(c,e){c.declare("dijit.tree.ForestStoreModel",e.tree.TreeStoreModel,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(a){this.root={store:this,root:true,id:a.rootId,label:a.rootLabel,children:a.rootChildren}},mayHaveChildren:function(a){return a===this.root||this.inherited(arguments)},getChildren:function(a,b,d){if(a===this.root)this.root.children?b(this.root.children):this.store.fetch({query:this.query,
onComplete:c.hitch(this,function(f){this.root.children=f;b(f)}),onError:d});else this.inherited(arguments)},isItem:function(a){return a===this.root?true:this.inherited(arguments)},fetchItemByIdentity:function(a){if(a.identity==this.root.id){var b=a.scope?a.scope:c.global;a.onItem&&a.onItem.call(b,this.root)}else this.inherited(arguments)},getIdentity:function(a){return a===this.root?this.root.id:this.inherited(arguments)},getLabel:function(a){return a===this.root?this.root.label:this.inherited(arguments)},
newItem:function(a,b){if(b===this.root){this.onNewRootItem(a);return this.store.newItem(a)}else return this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(a,b,d,f,g){if(b===this.root)f||this.onLeaveRoot(a);e.tree.TreeStoreModel.prototype.pasteItem.call(this,a,b===this.root?null:b,d===this.root?null:d,f,g);d===this.root&&this.onAddToRoot(a)},onAddToRoot:function(a){console.log(this,": item ",a," added to root")},onLeaveRoot:function(a){console.log(this,": item ",a," removed from root")},
_requeryTop:function(){var a=this.root.children||[];this.store.fetch({query:this.query,onComplete:c.hitch(this,function(b){this.root.children=b;if(a.length!=b.length||c.some(a,function(d,f){return b[f]!=d}))this.onChildrenChange(this.root,b)})})},onNewItem:function(){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(a){c.indexOf(this.root.children,a)!=-1&&this._requeryTop();this.inherited(arguments)},onSetItem:function(){this._requeryTop();this.inherited(arguments)}});return e.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(c){c.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(e,a){this.node=c.byId(e);a||(a={});this.creator=a.creator||null;this.skipForm=a.skipForm;this.parent=a.dropParent&&c.byId(a.dropParent);this.map={};this.current=null;this.containerState="";c.addClass(this.node,"dojoDndContainer");a&&a._skipStartup||this.startup();this.events=[c.connect(this.node,"onmouseover",this,"onMouseOver"),c.connect(this.node,
"onmouseout",this,"onMouseOut"),c.connect(this.node,"ondragstart",this,"onSelectStart"),c.connect(this.node,"onselectstart",this,"onSelectStart")]},creator:function(){},getItem:function(e){return this.map[e]},setItem:function(e,a){this.map[e]=a},delItem:function(e){delete this.map[e]},forInItems:function(e,a){a=a||c.global;var b=this.map,d=c.dnd._empty;for(var f in b)f in d||e.call(a,b[f],f,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return c.query("> .dojoDndItem",this.parent)},
sync:function(){var e={};this.getAllNodes().forEach(function(a){if(a.id){var b=this.getItem(a.id);if(b){e[a.id]=b;return}}else a.id=c.dnd.getUniqueId();b=a.getAttribute("dndType");var d=a.getAttribute("dndData");e[a.id]={data:d||a.innerHTML,type:b?b.split(/\s*,\s*/):["text"]}},this);this.map=e;return this},insertNodes:function(e,a,b){if(this.parent.firstChild)if(a){if(!b)b=this.parent.firstChild}else{if(b)b=b.nextSibling}else b=null;if(b)for(a=0;a<e.length;++a){var d=this._normalizedCreator(e[a]);
this.setItem(d.node.id,{data:d.data,type:d.type});this.parent.insertBefore(d.node,b)}else for(a=0;a<e.length;++a){d=this._normalizedCreator(e[a]);this.setItem(d.node.id,{data:d.data,type:d.type});this.parent.appendChild(d.node)}return this},destroy:function(){c.forEach(this.events,c.disconnect);this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(e,a){e._skipStartup=true;return new c.dnd.Container(a,e)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var e=this.parent.getElementsByTagName("tbody");if(e&&e.length)this.parent=e[0]}}this.defaultCreator=c.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(e){for(var a=e.relatedTarget;a;){if(a==this.node)break;try{a=a.parentNode}catch(b){a=null}}if(!a){this._changeState("Container","Over");this.onOverEvent()}a=this._getChildByEvent(e);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(e){for(e=
e.relatedTarget;e;){if(e==this.node)return;try{e=e.parentNode}catch(a){e=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(e){if(!this.skipForm||!c.dnd.isFormElement(e))c.stopEvent(e)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(e,a){var b="dojoDnd"+e;e=e.toLowerCase()+"State";c.replaceClass(this.node,b+a,b+this[e]);this[e]=a},_addItemClass:function(e,a){c.addClass(e,
"dojoDndItem"+a)},_removeItemClass:function(e,a){c.removeClass(e,"dojoDndItem"+a)},_getChildByEvent:function(e){if(e=e.target)for(var a=e.parentNode;a;e=a,a=e.parentNode)if(a==this.parent&&c.hasClass(e,"dojoDndItem"))return e;return null},_normalizedCreator:function(e,a){e=(this.creator||this.defaultCreator).call(this,e,a);if(!c.isArray(e.type))e.type=["text"];if(!e.node.id)e.node.id=c.dnd.getUniqueId();c.addClass(e.node,"dojoDndItem");return e}});c.dnd._createNode=function(e){if(!e)return c.dnd._createSpan;
return function(a){return c.create(e,{innerHTML:a})}};c.dnd._createTrTd=function(e){var a=c.create("tr");c.create("td",{innerHTML:e},a);return a};c.dnd._createSpan=function(e){return c.create("span",{innerHTML:e})};c.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};c.dnd._defaultCreator=function(e){e=e.tagName.toLowerCase();var a=e=="tbody"||e=="thead"?c.dnd._createTrTd:c.dnd._createNode(c.dnd._defaultCreatorNodes[e]);return function(b,d){var f=b&&c.isObject(b),g;if(f&&b.tagName&&b.nodeType&&
b.getAttribute){g=b.getAttribute("dndData")||b.innerHTML;f=(f=b.getAttribute("dndType"))?f.split(/\s*,\s*/):["text"];b=b}else{g=f&&b.data?b.data:b;f=f&&b.type?b.type:["text"];b=(d=="avatar"?c.dnd._createSpan:a)(String(g))}if(!b.id)b.id=c.dnd.getUniqueId();return{node:b,data:g,type:f}}};return c.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(c,e){c.getObject("tree",true,c);e.tree._compareNodes=function(a,b){if(a===b)return 0;if("sourceIndex"in document.documentElement)return a.sourceIndex-b.sourceIndex;else if("compareDocumentPosition"in document.documentElement)return a.compareDocumentPosition(b)&2?1:-1;else if(document.createRange){var d=doc.createRange();d.setStartBefore(a);a=doc.createRange();a.setStartBefore(b);return d.compareBoundaryPoints(d.END_TO_END,
a)}else throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");};c.declare("dijit.tree._dndContainer",null,{constructor:function(a,b){this.tree=a;this.node=a.domNode;c.mixin(this,b);this.map={};this.current=null;this.containerState="";c.addClass(this.node,"dojoDndContainer");this.events=[c.connect(this.node,"onmouseenter",this,"onOverEvent"),c.connect(this.node,"onmouseleave",this,"onOutEvent"),c.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),
c.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),c.connect(this.node,"ondragstart",c,"stopEvent"),c.connect(this.node,"onselectstart",c,"stopEvent")]},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},destroy:function(){c.forEach(this.events,c.disconnect);this.node=this.parent=null},onMouseOver:function(a){this.current=a},onMouseOut:function(){this.current=null},_changeState:function(a,b){var d="dojoDnd"+a;a=a.toLowerCase()+"State";c.replaceClass(this.node,d+b,d+this[a]);
this[a]=b},_addItemClass:function(a,b){c.addClass(a,"dojoDndItem"+b)},_removeItemClass:function(a,b){c.removeClass(a,"dojoDndItem"+b)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}});return e.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(c,e){c.declare("dijit.tree._dndSelector",e.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;e.setWaiState(this.tree.domNode,"multiselect",!this.singular);this.events.push(c.connect(this.tree.domNode,"onmousedown",this,"onMouseDown"),c.connect(this.tree.domNode,"onmouseup",this,"onMouseUp"),c.connect(this.tree.domNode,"onmousemove",this,"onMouseMove"))},singular:false,
getSelectedTreeNodes:function(){var a=[],b=this.selection;for(var d in b)a.push(b[d]);return a},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(a,b){this.setSelection(this.getSelectedTreeNodes().concat([a]));if(b)this.anchor=a;return a},removeTreeNode:function(a){this.setSelection(this._setDifference(this.getSelectedTreeNodes(),[a]));return a},isTreeNodeSelected:function(a){return a.id&&!!this.selection[a.id]},
setSelection:function(a){var b=this.getSelectedTreeNodes();c.forEach(this._setDifference(b,a),c.hitch(this,function(d){d.setSelected(false);this.anchor==d&&delete this.anchor;delete this.selection[d.id]}));c.forEach(this._setDifference(a,b),c.hitch(this,function(d){d.setSelected(true);this.selection[d.id]=d}));this._updateSelectionProperties()},_setDifference:function(a,b){c.forEach(b,function(d){d.__exclude__=true});a=c.filter(a,function(d){return!d.__exclude__});c.forEach(b,function(d){delete d.__exclude__});
return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),b=[],d=[];c.forEach(a,function(f){d.push(f);b.push(f.getTreePath())});a=c.map(d,function(f){return f.item});this.tree._set("paths",b);this.tree._set("path",b[0]||[]);this.tree._set("selectedNodes",d);this.tree._set("selectedNode",d[0]||null);this.tree._set("selectedItems",a);this.tree._set("selectedItem",a[0]||null)},onMouseDown:function(a){if(!(!this.current||this.tree.isExpandoNode(a.target,this.current)))if(a.button!=
c.mouseButtons.RIGHT){c.stopEvent(a);var b=this.current,d=c.isCopyKey(a),f=b.id;if(!this.singular&&!a.shiftKey&&this.selection[f])this._doDeselect=true;else{this._doDeselect=false;this.userSelect(b,d,a.shiftKey)}}},onMouseUp:function(a){if(this._doDeselect){this._doDeselect=false;this.userSelect(this.current,c.isCopyKey(a),a.shiftKey)}},onMouseMove:function(){this._doDeselect=false},userSelect:function(a,b,d){if(this.singular)if(this.anchor==a&&b)this.selectNone();else{this.setSelection([a]);this.anchor=
a}else if(d&&this.anchor){d=this.anchor;if(e.tree._compareNodes(this.anchor.rowNode,a.rowNode)<0){b=d;a=a}else{b=a;a=d}for(nodes=[];b!=a;){nodes.push(b);b=this.tree._getNextNode(b)}nodes.push(a);this.setSelection(nodes)}else if(this.selection[a.id]&&b)this.removeTreeNode(a);else if(b)this.addTreeNode(a,true);else{this.setSelection([a]);this.anchor=a}},forInSelectedItems:function(a,b){b=b||c.global;for(var d in this.selection)a.call(b,this.getItem(d),d,this)}});return e.tree._dndSelector});
define("dijit/Tree",["dojo","dijit","text!dijit/templates/TreeNode.html","text!dijit/templates/Tree.html","dojo/fx","dojo/DeferredList","dijit/_Widget","dijit/_Templated","dijit/_Container","dijit/_Contained","dijit/_CssStateMixin","dojo/cookie","dijit/tree/TreeStoreModel","dijit/tree/ForestStoreModel","dijit/tree/_dndSelector"],function(c,e){c.declare("dijit._TreeNode",[e._Widget,e._Templated,e._Container,e._Contained,e._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,
state:"UNCHECKED",templateString:c.cache("dijit","templates/TreeNode.html"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:c.delegate(e._Widget.prototype.attributeMap,{label:{node:"labelNode",type:"innerText"},tooltip:{node:"rowNode",type:"attribute",attribute:"title"}}),buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&e.setWaiState(this.labelNode,"expanded",this.isExpanded);
this.setSelected(false)},_setIndentAttr:function(a){var b=Math.max(a,0)*this.tree._nodePixelIndent+"px";c.style(this.domNode,"backgroundPosition",b+" 0px");c.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",b);c.forEach(this.getChildren(),function(d){d.set("indent",a+1)});this._set("indent",a)},markProcessing:function(){this.state="LOADING";this._setExpando(true)},unmarkProcessing:function(){this._setExpando(false)},_updateItemClasses:function(a){var b=this.tree,d=b.model;if(b._v10Compat&&
a===d.root)a=null;this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,"row","Row")},_applyClassAndStyle:function(a,b,d){var f="_"+b+"Class";b=b+"Node";var g=this[f];this[f]=this.tree["get"+d+"Class"](a,this.isExpanded);c.replaceClass(this[b],this[f]||"",g||"");c.style(this[b],this.tree["get"+d+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();!a||a.rowNode.style.display=="none"?c.addClass(this.domNode,"dijitTreeIsRoot"):
c.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling())},_setExpando:function(a){var b=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],d=["*","-","+","*"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;c.replaceClass(this.expandoNode,b[a],b);this.expandoNodeText.innerHTML=d[a]},expand:function(){if(this._expandDeferred)return this._expandDeferred;this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;e.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)e.setWaiRole(this.containerNode,"group");c.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&e.setWaiState(this.tree.domNode,"expanded","true");var a,b=c.fx.wipeIn({node:this.containerNode,duration:e.defaultDuration,onEnd:function(){a.callback(true)}});a=this._expandDeferred=new c.Deferred(function(){b.stop()});b.play();return a},collapse:function(){if(this.isExpanded){if(this._expandDeferred){this._expandDeferred.cancel();
delete this._expandDeferred}this.isExpanded=false;e.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&e.setWaiState(this.tree.domNode,"expanded","false");c.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut)this._wipeOut=c.fx.wipeOut({node:this.containerNode,duration:e.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var b=this.tree,d=b.model,f=[];c.forEach(this.getChildren(),
function(g){e._Container.prototype.removeChild.call(this,g)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;c.forEach(a,function(g){var j=d.getIdentity(g),i=b._itemNodesMap[j],k;if(i)for(var m=0;m<i.length;m++)if(i[m]&&!i[m].getParent()){k=i[m];k.set("indent",this.indent+1);break}if(!k){k=this.tree._createTreeNode({item:g,tree:b,isExpandable:d.mayHaveChildren(g),label:b.getLabel(g),tooltip:b.getTooltip(g),dir:b.dir,lang:b.lang,indent:this.indent+1});if(i)i.push(k);else b._itemNodesMap[j]=
[k]}this.addChild(k);if(this.tree.autoExpand||this.tree._state(g))f.push(b._expandNode(k))},this);c.forEach(this.getChildren(),function(g){g._updateLayout()})}else this.isExpandable=false;this._setExpando&&this._setExpando(false);this._updateItemClasses(this.item);if(this==b.rootNode)if(a=this.tree.showRoot?this:this.getChildren()[0]){a.setFocusable(true);b.lastFocused=a}else b.domNode.setAttribute("tabIndex","0");return new c.DeferredList(f)},getTreePath:function(){for(var a=this,b=[];a&&a!==this.tree.rootNode;){b.unshift(a.item);
a=a.getParent()}b.unshift(this.tree.rootNode.item);return b},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(){this.inherited(arguments);var a=this.getChildren();if(a.length==0){this.isExpandable=false;this.collapse()}c.forEach(a,function(b){b._updateLayout()})},makeExpandable:function(){this.isExpandable=true;this._setExpando(false)},_onLabelFocus:function(){this.tree._onNodeFocus(this)},setSelected:function(a){e.setWaiState(this.labelNode,"selected",a);
c.toggleClass(this.rowNode,"dijitTreeRowSelected",a)},setFocusable:function(a){this.labelNode.setAttribute("tabIndex",a?"0":"-1")},_onClick:function(a){this.tree._onClick(this,a)},_onDblClick:function(a){this.tree._onDblClick(this,a)},_onMouseEnter:function(a){this.tree._onNodeMouseEnter(this,a)},_onMouseLeave:function(a){this.tree._onNodeMouseLeave(this,a)}});c.declare("dijit.Tree",[e._Widget,e._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],paths:[],
path:[],selectedItems:null,selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:c.cache("dijit","templates/Tree.html"),persist:true,autoExpand:false,dndController:"dijit.tree._dndSelector",dndParams:["onDndDrop","itemCreator","onDndCancel","checkAcceptance","checkItemAcceptance","dragThreshold","betweenThreshold"],onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(a,
b){c.publish(this.id,[c.mixin({tree:this,event:a},b||{})])},postMixInProperties:function(){this.tree=this;if(this.autoExpand)this.persist=false;this._itemNodesMap={};if(!this.cookieName)this.cookieName=this.id+"SaveStateCookie";this._loadDeferred=new c.Deferred;this.inherited(arguments)},postCreate:function(){this._initState();this.model||this._store2model();this.connect(this.model,"onChange","_onItemChange");this.connect(this.model,"onChildrenChange","_onItemChildrenChange");this.connect(this.model,
"onDelete","_onItemDelete");this._load();this.inherited(arguments);if(this.dndController){if(c.isString(this.dndController))this.dndController=c.getObject(this.dndController);for(var a={},b=0;b<this.dndParams.length;b++)if(this[this.dndParams[b]])a[this.dndParams[b]]=this[this.dndParams[b]];this.dndController=new this.dndController(this,a)}},_store2model:function(){this._v10Compat=true;c.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var a={id:this.id+
"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};if(this.params.mayHaveChildren)a.mayHaveChildren=c.hitch(this,"mayHaveChildren");if(this.params.getItemChildren)a.getChildren=c.hitch(this,function(b,d,f){this.getItemChildren(this._v10Compat&&b===this.model.root?null:b,d,f)});this.model=new e.tree.ForestStoreModel(a);this.showRoot=Boolean(this.label)},onLoad:function(){},_load:function(){this.model.getRoot(c.hitch(this,function(a){var b=this.rootNode=this.tree._createTreeNode({item:a,
tree:this,isExpandable:true,label:this.label||this.getLabel(a),indent:this.showRoot?0:-1});if(!this.showRoot){b.rowNode.style.display="none";e.setWaiRole(this.domNode,"presentation");e.setWaiRole(b.labelNode,"presentation");e.setWaiRole(b.containerNode,"tree")}this.domNode.appendChild(b.domNode);a=this.model.getIdentity(a);if(this._itemNodesMap[a])this._itemNodesMap[a].push(b);else this._itemNodesMap[a]=[b];b._updateLayout();this._expandNode(b).addCallback(c.hitch(this,function(){this._loadDeferred.callback(true);
this.onLoad()}))}),function(a){console.error(this,": error loading root: ",a)})},getNodesByItem:function(a){if(!a)return[];return[].concat(this._itemNodesMap[c.isString(a)?a:this.model.getIdentity(a)])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var b=this;this._loadDeferred.addCallback(c.hitch(this,function(){var d=c.map(a,function(g){return!g||c.isString(g)?g:b.model.getIdentity(g)}),f=[];c.forEach(d,function(g){f=f.concat(b._itemNodesMap[g]||
[])});this.set("selectedNodes",f)}))},_setPathAttr:function(a){return a.length?this.set("paths",[a]):this.set("paths",[])},_setPathsAttr:function(a){function b(g,j,i){var k=g.shift(),m=c.filter(j,function(o){return o.getIdentity()==k})[0];if(m)g.length?f._expandNode(m).addCallback(function(){b(g,m.getChildren(),i)}):i.callback(m);else i.errback("Could not expand path at "+k)}function d(g){f.set("selectedNodes",c.map(c.filter(g,function(j){return j[0]}),function(j){return j[1]}))}var f=this;return(new c.DeferredList(c.map(a,
function(g){var j=new c.Deferred;g=c.map(g,function(i){return c.isString(i)?i:f.model.getIdentity(i)});g.length?f._loadDeferred.addCallback(function(){b(g,[f.rootNode],j)}):j.errback("Empty path");return j}))).addCallback(d)},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this._loadDeferred.addCallback(c.hitch(this,function(){this.dndController.setSelection(a)}))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(a){return this.model.getLabel(a)},
getIconClass:function(a,b){return!a||this.model.mayHaveChildren(a)?b?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onKeyPress:function(a){if(!a.altKey){var b=c.keys,d=e.getEnclosingWidget(a.target);if(d){var f=a.charOrCode;if(typeof f=="string"&&f!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:d,
key:f.toLowerCase()});c.stopEvent(a)}}else{if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}var g=this._keyHandlerMap;if(!g){g={};g[b.ENTER]="_onEnterKey";g[b.SPACE]=g[" "]="_onEnterKey";g[this.isLeftToRight()?b.LEFT_ARROW:b.RIGHT_ARROW]="_onLeftArrow";g[this.isLeftToRight()?b.RIGHT_ARROW:b.LEFT_ARROW]="_onRightArrow";g[b.UP_ARROW]="_onUpArrow";g[b.DOWN_ARROW]="_onDownArrow";g[b.HOME]="_onHomeKey";g[b.END]="_onEndKey";this._keyHandlerMap=g}if(this._keyHandlerMap[f]){this[this._keyHandlerMap[f]]({node:d,
item:d.item,evt:a});c.stopEvent(a)}}}}},_onEnterKey:function(a){this._publish("execute",{item:a.item,node:a.node});this.dndController.userSelect(a.node,c.isCopyKey(a.evt),a.evt.shiftKey);this.onClick(a.item,a.node,a.evt)},_onDownArrow:function(a){(a=this._getNextNode(a.node))&&a.isTreeNode&&this.focusNode(a)},_onUpArrow:function(a){a=a.node;var b=a.getPreviousSibling();if(b)for(a=b;a.isExpandable&&a.isExpanded&&a.hasChildren();){a=a.getChildren();a=a[a.length-1]}else{b=a.getParent();!this.showRoot&&
b===this.rootNode||(a=b)}a&&a.isTreeNode&&this.focusNode(a)},_onRightArrow:function(a){a=a.node;if(a.isExpandable&&!a.isExpanded)this._expandNode(a);else if(a.hasChildren())(a=a.getChildren()[0])&&a.isTreeNode&&this.focusNode(a)},_onLeftArrow:function(a){a=a.node;if(a.isExpandable&&a.isExpanded)this._collapseNode(a);else(a=a.getParent())&&a.isTreeNode&&!(!this.showRoot&&a===this.rootNode)&&this.focusNode(a)},_onHomeKey:function(){var a=this._getRootOrFirstNode();a&&this.focusNode(a)},_onEndKey:function(){for(var a=
this.rootNode;a.isExpanded;){a=a.getChildren();a=a[a.length-1]}a&&a.isTreeNode&&this.focusNode(a)},multiCharSearchDuration:250,_onLetterKeyNav:function(a){var b=this._curSearch;if(b){b.pattern+=a.key;clearTimeout(b.timer)}else b=this._curSearch={pattern:a.key,startNode:a.node};var d=this;b.timer=setTimeout(function(){delete d._curSearch},this.multiCharSearchDuration);a=b.startNode;do(a=this._getNextNode(a))||(a=this._getRootOrFirstNode());while(a!==b.startNode&&a.label.toLowerCase().substr(0,b.pattern.length)!=
b.pattern);a&&a.isTreeNode&&a!==b.startNode&&this.focusNode(a)},isExpandoNode:function(a,b){return c.isDescendant(a,b.expandoNode)},_onClick:function(a,b){var d=this.isExpandoNode(b.target,a);if(this.openOnClick&&a.isExpandable||d)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:b});this.onClick(a.item,a,b);this.focusNode(a)}c.stopEvent(b)},_onDblClick:function(a,b){var d=b.target;d=d==a.expandoNode||d==a.expandoNodeText;if(this.openOnDblClick&&a.isExpandable||
d)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:b});this.onDblClick(a.item,a,b);this.focusNode(a)}c.stopEvent(b)},_onExpandoClick:function(a){a=a.node;this.focusNode(a);a.isExpanded?this._collapseNode(a):this._expandNode(a)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(a){if(a.isExpandable&&a.isExpanded&&a.hasChildren())return a.getChildren()[0];else{for(;a&&a.isTreeNode;){var b=a.getNextSibling();
if(b)return b;a=a.getParent()}return null}},_getRootOrFirstNode:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_collapseNode:function(a){a._expandNodeDeferred&&delete a._expandNodeDeferred;if(a.isExpandable)if(a.state!="LOADING"){a.collapse();this.onClose(a.item,a);if(a.item){this._state(a.item,false);this._saveState()}}},_expandNode:function(a,b){if(a._expandNodeDeferred&&!b)return a._expandNodeDeferred;b=this.model;var d=a.item,f=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var g=a._expandNodeDeferred=new c.Deferred;b.getChildren(d,function(j){a.unmarkProcessing();j=a.setChildItems(j);var i=f._expandNode(a,true);j.addCallback(function(){i.addCallback(function(){g.callback()})})},function(j){console.error(f,": error loading root children: ",j)});break;default:g=a._expandNodeDeferred=a.expand();this.onOpen(a.item,a);if(d){this._state(d,true);this._saveState()}}return g},focusNode:function(a){e.focus(a.labelNode)},_onNodeFocus:function(a){if(a&&a!=this.lastFocused){this.lastFocused&&
!this.lastFocused._destroyed&&this.lastFocused.setFocusable(false);a.setFocusable(true);this.lastFocused=a}},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(a){var b=this._itemNodesMap[this.model.getIdentity(a)];if(b){var d=this.getLabel(a),f=this.getTooltip(a);c.forEach(b,function(g){g.set({item:a,label:d,tooltip:f});g._updateItemClasses(a)})}},_onItemChildrenChange:function(a,b){(a=this._itemNodesMap[this.model.getIdentity(a)])&&c.forEach(a,function(d){d.setChildItems(b)})},
_onItemDelete:function(a){a=this.model.getIdentity(a);var b=this._itemNodesMap[a];if(b){c.forEach(b,function(d){this.dndController.removeTreeNode(d);var f=d.getParent();f&&f.removeChild(d);d.destroyRecursive()},this);delete this._itemNodesMap[a]}},_initState:function(){if(this.persist){var a=c.cookie(this.cookieName);this._openedItemIds={};a&&c.forEach(a.split(","),function(b){this._openedItemIds[b]=true},this)}},_state:function(a,b){if(!this.persist)return false;var d=this.model.getIdentity(a);if(arguments.length===
1)return this._openedItemIds[d];if(b)this._openedItemIds[d]=true;else delete this._openedItemIds[d]},_saveState:function(){if(this.persist){var a=[];for(var b in this._openedItemIds)a.push(b);c.cookie(this.cookieName,a.join(","),{expires:365})}},destroy:function(){if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!c.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},
destroyRecursive:function(){this.destroy()},resize:function(a){a&&c.marginBox(this.domNode,a);this._nodePixelIndent=c._getMarginSize(this.tree.indentDetector).w;if(this.tree.rootNode)this.tree.rootNode.set("indent",this.showRoot?0:-1)},_createTreeNode:function(a){return new e._TreeNode(a)}});return e.Tree});define("text!orion/widgets/templates/_ExplorerTreeNode.html",function(){return'<div class="dijitTreeNode" waiRole="presentation">\n\t<div dojoAttachPoint="rowNode" class="dijitTreeRow"\n\t\twaiRole="presentation"\n\t\tdojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick">\n\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" waiRole="presentation" />\n\t\t<span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" waiRole="presentation"></span>\n\t\t<span dojoAttachPoint="contentNode" class="dijitTreeContent" waiRole="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" waiRole="presentation" />\n\t\t\t<!-- labelNode\'s innerText will be label string --\>\n\t\t\t<span dojoAttachPoint="labelNode" class="dijitTreeLabel" wairole="treeitem" tabindex="-1" waiState="selected-false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t\t<a href="" dojoAttachPoint="followLink"><img src="${_blankGif}" alt="" dojoAttachPoint="followNode" class="dijitIcon dijitTreeIcon follow" waiRole="link"></a>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer"\n\t\twaiRole="presentation" style="display: none;">\n\t</div>\n</div>'});
define("orion/widgets/ExplorerTree",["dojo","dijit","dijit/Tree","text!orion/widgets/templates/_ExplorerTreeNode.html"],function(c,e){c.declare("orion.widgets._ExplorerTreeNode",[e._TreeNode],{templateString:c.cache("orion","widgets/templates/_ExplorerTreeNode.html"),_updateItemClasses:function(a){this.inherited(arguments);this._applyClassAndStyle(a,"follow","Follow");typeof this.tree.updateFollowLink==="function"&&this.tree.updateFollowLink(a,this.followLink)}});c.declare("orion.widgets.ExplorerTree",
[e.Tree],{selectedNodes:{},postCreate:function(){c.connect(this,"onMouseDown",this._eatSelectionEvent);c.connect(this.domNode,"onselectstart",this._eatSelectionEvent);this.inherited(arguments)},getFollowClass:function(){},getFollowStyle:function(){},updateFollowLink:function(){},onFollowClick:function(){},getSelectedItems:function(){var a=[];this._forEachSelectedNode(function(b,d){a.push(d.item)});return a},_getSelectedNodes:function(){var a=[];this._forEachSelectedNode(function(b,d){a.push(d)});
return a},_forEachSelectedNode:function(a){var b=this.selectedNodes;for(var d in b)b.hasOwnProperty(d)&&a(d,b[d])},_createTreeNode:function(a){return new orion.widgets._ExplorerTreeNode(a)},_eatSelectionEvent:function(a){if(c.isCopyKey(a)||a.shiftKey)c.stopEvent(a)},_onClick:function(a,b){var d=b.target,f=d===a.expandoNode||d===a.expandoNodeText;d=d===a.followNode;if(c.isCopyKey(b)){this._toggleSelectNode(a);this.focusNode(a)}else if(b.shiftKey){if(this.selectedNode){this._selectRange(this.selectedNode,
a);this.focusNode(a)}}else{if(d)this.onFollowClick(a.item,a,b);else if(this.openOnClick&&a.isExpandable||f)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:b});this.onClick(a.item,a,b);this.focusNode(a)}!f&&!d&&this._selectNode(a)}d||c.stopEvent(b)},_onItemDelete:function(a){var b=this._itemNodesMap[this.model.getIdentity(a)];if(b){var d=this;c.forEach(b,function(f){d._removeFromSelection(f)})}this.inherited(arguments)},_getVisibleAncestor:function(a){if(!a)return null;
for(var b=a.getParent();b&&!(b.isExpandable&&b.isExpanded);){a=b;b=b.getParent()}return a},_toggleSelectNode:function(a){if(this.selectedNodes[a.get("id")]){a.setSelected(false);this._removeFromSelection(a)}else{a.setSelected(true);this._addToSelection(a)}},_addToSelection:function(a){this.selectedNodes[a.get("id")]=a},_removeFromSelection:function(a){delete this.selectedNodes[a.get("id")]},_selectRange:function(a,b){function d(j,i){var k=[];j=j;do{k.push(j);j=f._getNextNode(j)}while(j&&j!==i);if(j===
i){k.push(i);return k}return null}a=this._getVisibleAncestor(a);b=this._getVisibleAncestor(b);if(a&&b)if(a===b)this._selectNode(a);else{var f=this,g=d(a,b);if(g)this._selectNodes(g.reverse(),true);else(g=d(b,a))?this._selectNodes(g,true):console.debug("Warning: couldn't select range from "+a.label+" to "+b.label)}},_selectNode:function(a){this._selectNodes(a?[a]:null)},_selectNodes:function(a){this._forEachSelectedNode(function(f,g){g._destroyed||g.setSelected(false)});this.selectedNodes={};if(a)for(var b=
0;b<a.length;b++){var d=a[b];d.setSelected(true);this._addToSelection(d);this.selectedNode=d}}})});define("text!orion/widgets/templates/DirectoryPrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="messageCell">\n\t\t\t\t\t<div style="display: table-cell;"><div style="width: 25em; padding-bottom: 5px;">${message}</div></div>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseDirectoryExplorerTree" class="explorerTreeClass" id="${id}_browseDirectoryExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div> \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="directoryBrowserButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/widgets/DirectoryPrompterDialog",["dojo","dijit","orion/util","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/DirectoryPrompterDialog.html"],function(c,e,a){c.declare("orion.widgets.DirectoryPrompterDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/DirectoryPrompterDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.buttonOk="OK";this.message=this.options.message||""},postCreate:function(){this.inherited(arguments);this.loadFolderList("/");this.message||c.style(this.messageCell,{display:"none"})},loadFolderList:function(b){b=a.makeRelative(b);this.treeRoot.Location=b;this.options.fileClient.loadWorkspace(b).then(c.hitch(this,function(d){for(var f in d)this.treeRoot[f]=
d[f];a.processNavigatorParent(this.treeRoot,d.Children);this.createTree()}))},createTree:function(){var b=new orion.widgets.DirectoryTreeModel(this.options.serviceRegistry,this.treeRoot,this.options.fileClient);this.treeWidget=new orion.widgets.ExplorerTree({id:"treeWidget",style:"width:100%; height:100%",model:b,showRoot:false,persist:true,openOnClick:false,getLabel:function(d){return d.Name},getIconClass:function(){return"folderItem"}});this.treeWidget.startup();c.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
execute:function(){var b=this.treeWidget.getSelectedItems();this.onHide();this.options.func(b[0])}});orion.widgets.DirectoryTreeModel=function(){function b(d,f,g){this.registry=d;this.root=f;this.fileClient=g}b.prototype={destroy:function(){},getRoot:function(d){d(this.root)},mayHaveChildren:function(){return true},getChildren:function(d,f){if(d.children)f(d.children);else if(d.Directory!==undefined&&d.Directory===false)f([]);else d.Location?this.fileClient.fetchChildren(d.ChildrenLocation).then(c.hitch(this,
function(g){for(var j=[],i=0;i<g.length;i++)g[i].Directory&&j.push(g[i]);a.processNavigatorParent(d,j);f(j)})):f([])},getIdentity:function(d){return d.Name?d.Location:"ROOT"},getLabel:function(d){return d.Name},onChildrenChange:function(){}};return b}()});define("dojox",["dojo"],function(c){return dojox=c._dojox||{}});
define("dojox/form/uploader/Base",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(c,e){c.declare("dojox.form.uploader.Base",[e._Widget,e._Templated],{getForm:function(){if(!this.form)for(var a=this.domNode;a&&a.tagName&&a!==document.body;){if(a.tagName.toLowerCase()=="form"){this.form=a;break}a=a.parentNode}return this.form},getUrl:function(){if(this.uploadUrl)this.url=this.uploadUrl;if(this.url)return this.url;if(this.getForm())this.url=this.form.action;
return this.url},connectForm:function(){this.url=this.getUrl();if(!this._fcon&&this.getForm()){this._fcon=true;this.connect(this.form,"onsubmit",function(a){c.stopEvent(a);this.submit(c.formToObject(this.form))})}},supports:function(a){if(!this._hascache){this._hascache={testDiv:c.create("div"),testInput:c.create("input",{type:"file"}),xhr:window.XMLHttpRequest?new XMLHttpRequest:{}};c.style(this._hascache.testDiv,"opacity",0.7)}switch(a){case "FormData":return!!window.FormData;case "sendAsBinary":return!!this._hascache.xhr.sendAsBinary;
case "opacity":return c.style(this._hascache.testDiv,"opacity")==0.7;case "multiple":if(this.force=="flash"||this.force=="iframe")return false;a=c.attr(this._hascache.testInput,"multiple");return a===true||a===false}return false},getMimeType:function(){return"application/octet-stream"},getFileType:function(a){return a.substring(a.lastIndexOf(".")+1).toUpperCase()},convertBytes:function(a){var b=Math.round(a/1024*1E5)/1E5,d=Math.round(a/1048576*1E5)/1E5,f=Math.round(a/1073741824*1E5)/1E5,g=a;if(b>
1)g=b.toFixed(1)+" kb";if(d>1)g=d.toFixed(1)+" mb";if(f>1)g=f.toFixed(1)+" gb";return{kb:b,mb:d,gb:f,bytes:a,value:g}}})});
define("dojox/form/Uploader",["dojo","dijit","dojox","dojox/form/uploader/Base"],function(c,e,a){c.declare("dojox.form.Uploader",[a.form.uploader.Base],{uploadOnSelect:false,tabIndex:0,multiple:false,label:"Upload...",url:"",name:"uploadedfile",flashFieldName:"",uploadType:"form",_nameIndex:0,widgetsInTemplate:true,templateString:'<div class="dojoxFileInput"><div dojoType="dijit.form.Button" dojoAttachPoint="button">${label}</div></div>',postMixInProperties:function(){this._inputs=[];this._getButtonStyle(this.srcNodeRef);
this.inherited(arguments)},postCreate:function(){var b=false,d=this._getNodePosition(this.domNode);if(!this.btnSize.w||!this.btnSize.h){c.body().appendChild(this.domNode);this._getButtonStyle(this.domNode);b=true}this._setButtonStyle();b&&c.place(this.domNode,d.node,d.pos);this.inherited(arguments)},onChange:function(){},onBegin:function(){},onProgress:function(){},onComplete:function(){this.reset()},onCancel:function(){},onAbort:function(){},onError:function(){},upload:function(){},submit:function(){},
reset:function(){this._disconnectButton();c.forEach(this._inputs,c.destroy,c);this._inputs=[];this._nameIndex=0;this._createInput()},getFileList:function(){var b=[];this.supports("multiple")?c.forEach(this.inputNode.files,function(d,f){b.push({index:f,name:d.name,size:d.size,type:d.type})},this):c.forEach(this._inputs,function(d,f){b.push({index:f,name:d.value.substring(d.value.lastIndexOf("\\")+1),size:0,type:d.value.substring(d.value.lastIndexOf(".")+1)})},this);return b},_getValueAttr:function(){return this.getFileList()},
_setValueAttr:function(){console.error("Uploader value is read only")},_getDisabledAttr:function(){return this._disabled},_setDisabledAttr:function(b){if(this._disabled!=b){this.button.set("disabled",b);c.style(this.inputNode,"display",b?"none":"block")}},_getNodePosition:function(b){if(b.previousSibling)return{node:b.previousSibling,pos:"after"};return{node:b.nextSibling,pos:"before"}},_getButtonStyle:function(b){this.btnSize=b?c.marginBox(b):{w:80,h:25}},_setButtonStyle:function(){var b=true;if(!this.domNode.parentNode||
!this.domNode.parentNode.tagName){document.body.appendChild(this.domNode);b=false}c.style(this.domNode,{width:this.btnSize.w+"px",height:this.btnSize.h+4+"px",overflow:"hidden",position:"relative"});this.inputNodeFontSize=Math.max(2,Math.max(Math.ceil(this.btnSize.w/60),Math.ceil(this.btnSize.h/15)));this._createInput();c.style(this.button.domNode,{margin:"0px",display:"block",verticalAlign:"top"});c.style(this.button.domNode.firstChild,{margin:"0px",display:"block"});b||document.body.removeChild(this.domNode)},
_createInput:function(){if(this._inputs.length){c.style(this.inputNode,{top:"500px"});this._disconnectButton();this._nameIndex++}var b;b=this.supports("multiple")?this.name+"s[]":this.name+(this.multiple?this._nameIndex:"");this.inputNode=c.create("input",{type:"file",name:b,className:"dojoxInputNode"},this.domNode,"first");this.supports("multiple")&&this.multiple&&c.attr(this.inputNode,"multiple",true);this._inputs.push(this.inputNode);c.style(this.inputNode,{fontSize:this.inputNodeFontSize+"em"});
b=c.marginBox(this.inputNode);c.style(this.inputNode,{position:"absolute",top:"-2px",left:"-"+(b.w-this.btnSize.w-2)+"px",opacity:0});this._connectButton()},_connectButton:function(){this._cons=[];var b=c.hitch(this,function(f){this._cons.push(c.connect(this.inputNode,f,this,function(){this.button._cssMouseEvent({type:f})}))});b("mouseover");b("mouseout");b("mousedown");this._cons.push(c.connect(this.inputNode,"change",this,function(f){this.onChange(this.getFileList(f));!this.supports("multiple")&&
this.multiple&&this._createInput()}));this.button.set("tabIndex",-1);if(this.tabIndex>-1){this.inputNode.tabIndex=this.tabIndex;var d=c.style(this.button.domNode.firstChild,"border");this._cons.push(c.connect(this.inputNode,"focus",this,function(){c.style(this.button.domNode.firstChild,"border","1px dashed #ccc")}));this._cons.push(c.connect(this.inputNode,"blur",this,function(){c.style(this.button.domNode.firstChild,"border",d)}))}},_disconnectButton:function(){c.forEach(this._cons,c.disconnect,
c)}});(function(){a.form.UploaderOrg=a.form.Uploader;var b=[a.form.UploaderOrg];a.form.addUploaderPlugin=function(d){b.push(d);c.declare("dojox.form.Uploader",b,{})}})()});
define("dojox/form/uploader/FileList",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(c,e,a){c.declare("dojox.form.uploader.FileList",[a.form.uploader.Base],{uploaderId:"",uploader:null,headerIndex:"#",headerType:"Type",headerFilename:"File Name",headerFilesize:"Size",_upCheckCnt:0,rowAmt:0,templateString:'<div class="dojoxUploaderFileList"><div dojoAttachPoint="progressNode" class="dojoxUploaderFileListProgress"><div dojoAttachPoint="percentBarNode" class="dojoxUploaderFileListProgressBar"></div><div dojoAttachPoint="percentTextNode" class="dojoxUploaderFileListPercentText">0%</div></div><table class="dojoxUploaderFileListTable"><tr class="dojoxUploaderFileListHeader"><th class="dojoxUploaderIndex">${headerIndex}</th><th class="dojoxUploaderIcon">${headerType}</th><th class="dojoxUploaderFileName">${headerFilename}</th><th class="dojoxUploaderFileSize">${headerFilesize}</th></tr><tr ><td colSpan="4" class="dojoxUploaderFileListContainer" dojoAttachPoint="containerNode"><table class="dojoxUploaderFileListContent" dojoAttachPoint="listNode"></table></td><tr></table><div>',
postCreate:function(){this.setUploader();this.hideProgress()},reset:function(){for(var b=0;b<this.rowAmt;b++)this.listNode.deleteRow(0);this.rowAmt=0},setUploader:function(){if(!this.uploaderId&&!this.uploader)console.warn("uploaderId not passed to UploaderFileList");else if(this.uploaderId&&!this.uploader)this.uploader=e.byId(this.uploaderId);else if(this._upCheckCnt>4){console.warn("uploader not found for ID ",this.uploaderId);return}if(this.uploader){this.connect(this.uploader,"onChange","_onUploaderChange");
this.connect(this.uploader,"reset","reset");this.connect(this.uploader,"onBegin",function(){this.showProgress(true)});this.connect(this.uploader,"onProgress","_progress");this.connect(this.uploader,"onComplete",function(){setTimeout(c.hitch(this,function(){this.hideProgress(true)}),1250)})}else{this._upCheckCnt++;setTimeout(c.hitch(this,"setUploader"),250)}},hideProgress:function(b){this._hideShowProgress(b?{ani:true,endDisp:"none",beg:15,end:0}:{endDisp:"none",ani:false})},showProgress:function(b){this._hideShowProgress(b?
{ani:true,endDisp:"block",beg:0,end:15}:{endDisp:"block",ani:false})},_progress:function(b){this.percentTextNode.innerHTML=b.percent;c.style(this.percentBarNode,"width",b.percent)},_hideShowProgress:function(b){var d=this.progressNode,f=function(){c.style(d,"display",b.endDisp)};if(b.ani){c.style(d,"display","block");c.animateProperty({node:d,properties:{height:{start:b.beg,end:b.end,units:"px"}},onEnd:f}).play()}else f()},_onUploaderChange:function(b){this.reset();c.forEach(b,function(d,f){this._addRow(f+
1,this.getFileType(d.name),d.name,d.size)},this)},_addRow:function(b,d,f,g){var j,i=this.listNode.insertRow(-1);j=i.insertCell(-1);c.addClass(j,"dojoxUploaderIndex");j.innerHTML=b;j=i.insertCell(-1);c.addClass(j,"dojoxUploaderIcon");j.innerHTML=d;j=i.insertCell(-1);c.addClass(j,"dojoxUploaderFileName");j.innerHTML=f;j=i.insertCell(-1);c.addClass(j,"dojoxUploaderSize");j.innerHTML=this.convertBytes(g).value;this.rowAmt++}})});
define("dojo/io/iframe",["dojo"],function(c){c.getObject("io",true,c);c.io.iframe={create:function(e,a,b){if(window[e])return window[e];if(window.frames[e])return window.frames[e];var d=null;b=b;if(!b){c.config.useXDomain&&!c.config.dojoBlankHtmlUrl&&console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");b=c.config.dojoBlankHtmlUrl||c.moduleUrl("dojo",
"resources/blank.html")}d=c.place('<iframe id="'+e+'" name="'+e+'" src="'+b+'" onload="'+a+'" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',c.body());return window[e]=d},setSrc:function(e,a,b){try{if(b){var d;if(d=c.isIE||c.isWebKit?e.contentWindow.document:e.contentWindow)d.location.replace(a);else e.location=a}else if(c.isWebKit)e.location=a;else frames[e.name].location=a}catch(f){console.log("dojo.io.iframe.setSrc: ",f)}},doc:function(e){return e.contentDocument||
e.name&&e.document&&c.doc.getElementsByTagName("iframe")[e.name].contentWindow&&c.doc.getElementsByTagName("iframe")[e.name].contentWindow.document||e.name&&c.doc.frames[e.name]&&c.doc.frames[e.name].document||null},send:function(e){if(!this._frame)this._frame=this.create(this._iframeName,c._scopeName+".io.iframe._iframeOnload();");e=c._ioSetArgs(e,function(a){a.canceled=true;a.ioArgs._callNext()},function(a){var b=null;try{var d=a.ioArgs,f=c.io.iframe,g=f.doc(f._frame),j=d.handleAs;b=g;if(j!="html")if(j==
"xml"){if(c.isIE<9||c.isIE&&c.isQuirks){c.query("a",f._frame.contentWindow.document.documentElement).orphan();var i=f._frame.contentWindow.document.documentElement.innerText;i=i.replace(/>\s+</g,"><");i=c.trim(i);b=c._contentHandlers.xml({responseText:i})}}else{b=g.getElementsByTagName("textarea")[0].value;if(j=="json")b=c.fromJson(b);else if(j=="javascript")b=c.eval(b)}}catch(k){b=k}finally{d._callNext()}return b},function(a,b){b.ioArgs._hasError=true;b.ioArgs._callNext();return a});e.ioArgs._callNext=
function(){if(!this._calledNext){this._calledNext=true;c.io.iframe._currentDfd=null;c.io.iframe._fireNextRequest()}};this._dfdQueue.push(e);this._fireNextRequest();c._ioWatch(e,function(a){return!a.ioArgs._hasError},function(a){return!!a.ioArgs._finished},function(a){a.ioArgs._finished?a.callback(a):a.errback(new Error("Invalid dojo.io.iframe request state"))});return e},_currentDfd:null,_dfdQueue:[],_iframeName:c._scopeName+"IoIframe",_fireNextRequest:function(){try{if(!(this._currentDfd||this._dfdQueue.length==
0)){do var e=this._currentDfd=this._dfdQueue.shift();while(e&&e.canceled&&this._dfdQueue.length);if(!e||e.canceled)this._currentDfd=null;else{var a=e.ioArgs,b=a.args;a._contentToClean=[];var d=c.byId(b.form),f=b.content||{};if(d){if(f){var g=function(w,u){c.create("input",{type:"hidden",name:w,value:u},d);a._contentToClean.push(w)};for(var j in f){var i=f[j];if(c.isArray(i)&&i.length>1){var k;for(k=0;k<i.length;k++)g(j,i[k])}else if(d[j])d[j].value=i;else g(j,i)}}var m=d.getAttributeNode("action"),
o=d.getAttributeNode("method"),v=d.getAttributeNode("target");if(b.url){a._originalAction=m?m.value:null;if(m)m.value=b.url;else d.setAttribute("action",b.url)}if(!o||!o.value)if(o)o.value=b.method?b.method:"post";else d.setAttribute("method",b.method?b.method:"post");a._originalTarget=v?v.value:null;if(v)v.value=this._iframeName;else d.setAttribute("target",this._iframeName);d.target=this._iframeName;c._ioNotifyStart(e);d.submit()}else{g=b.url+(b.url.indexOf("?")>-1?"&":"?")+a.query;c._ioNotifyStart(e);
this.setSrc(this._frame,g,true)}}}}catch(t){e.errback(t)}},_iframeOnload:function(){var e=this._currentDfd;if(e){e=e.ioArgs;var a=c.byId(e.args.form);if(a){for(var b=e._contentToClean,d=0;d<b.length;d++)for(var f=b[d],g=0;g<a.childNodes.length;g++){var j=a.childNodes[g];if(j.name==f){c.destroy(j);break}}e._originalAction&&a.setAttribute("action",e._originalAction);if(e._originalTarget){a.setAttribute("target",e._originalTarget);a.target=e._originalTarget}}e._finished=true}else this._fireNextRequest()}};
return c.io.iframe});
define("dojox/form/uploader/plugins/HTML5",["dojo","dijit","dojox","dojox/form/Uploader"],function(c,e,a){c.declare("dojox.form.uploader.plugins.HTML5",[],{errMsg:"Error uploading files. Try checking permissions",uploadType:"html5",postCreate:function(){this.connectForm();this.inherited(arguments);this.uploadOnSelect&&this.connect(this,"onChange","upload")},upload:function(b){this.onBegin(this.getFileList());if(this.supports("FormData"))this.uploadWithFormData(b);else this.supports("sendAsBinary")&&this.sendAsBinary(b)},
submit:function(b){b=b?b.tagName?b:this.getForm():this.getForm();b=c.formToObject(b);console.log("form data:",b);this.upload(b)},sendAsBinary:function(b){if(this.getUrl()){var d="---------------------------"+(new Date).getTime(),f=this.createXhr();f.setRequestHeader("Content-Type","multipart/form-data; boundary="+d);(b=this._buildRequestBody(b,d))?f.sendAsBinary(b):this.onError(this.errMsg)}else console.error("No upload url found.",this)},uploadWithFormData:function(b){if(this.getUrl()){var d=new FormData;
c.forEach(this.inputNode.files,function(g){d.append(this.name+"s[]",g)},this);if(b)for(var f in b)d.append(f,b[f]);this.createXhr().send(d)}else console.error("No upload url found.",this)},_xhrProgress:function(b){if(b.lengthComputable){var d={bytesLoaded:b.loaded,bytesTotal:b.total,type:b.type,timeStamp:b.timeStamp};if(b.type=="load"){d.percent="100%";d.decimal=1}else{d.decimal=b.loaded/b.total;d.percent=Math.ceil(b.loaded/b.total*100)+"%"}this.onProgress(d)}},createXhr:function(){var b=new XMLHttpRequest,
d;b.upload.addEventListener("progress",c.hitch(this,"_xhrProgress"),false);b.addEventListener("load",c.hitch(this,"_xhrProgress"),false);b.addEventListener("error",c.hitch(this,function(f){this.onError(f);clearInterval(d)}),false);b.addEventListener("abort",c.hitch(this,function(f){this.onAbort(f);clearInterval(d)}),false);b.onreadystatechange=c.hitch(this,function(){if(b.readyState===4){console.info("COMPLETE");clearInterval(d);this.onComplete(c.eval(b.responseText))}});b.open("POST",this.getUrl());
d=setInterval(c.hitch(this,function(){}),250);return b},_buildRequestBody:function(b,d){var f="";d="--"+d;var g=[];c.forEach(this.inputNode.files,function(i,k){i=this.name+"s[]";var m=this.inputNode.files[k].fileName,o;try{o=this.inputNode.files[k].getAsBinary()+"\r\n";f+=d+"\r\n";f+="Content-Disposition: form-data; ";f+='name="'+i+'"; ';f+='filename="'+m+'"\r\n';f+="Content-Type: "+this.getMimeType()+"\r\n\r\n";f+=o}catch(v){g.push({index:k,name:m})}},this);if(g.length)if(g.length>=this.inputNode.files.length){this.onError({message:this.errMsg,
filesInError:g});f=false}if(!f)return false;if(b)for(var j in b){f+=d+"\r\n";f+="Content-Disposition: form-data; ";f+='name="'+j+'"\r\n\r\n';f+=b[j]+"\r\n"}f+=d+"--\r\n";return f}});a.form.addUploaderPlugin(a.form.uploader.plugins.HTML5)});
define("dojox/form/uploader/plugins/IFrame",["dojo","dijit","dojox","dojo/io/iframe","dojox/form/uploader/plugins/HTML5","dojox/form/Uploader"],function(c,e,a){c.declare("dojox.form.uploader.plugins.IFrame",[],{force:"",postMixInProperties:function(){this.inherited(arguments);if(!this.supports("multiple"))this.uploadType="iframe"},upload:function(b){if(!this.supports("multiple")||this.force=="iframe"){this.uploadIFrame(b);c.stopEvent(b)}},uploadIFrame:function(){this.getUrl();c.io.iframe.send({url:this.getUrl(),
form:this.form,handleAs:"json",error:c.hitch(this,function(b){console.error("HTML Upload Error:"+b.message)}),load:c.hitch(this,function(b){this.onComplete(b)})})}});a.form.addUploaderPlugin(a.form.uploader.plugins.IFrame)});define("text!dijit/templates/ProgressBar.html",function(){return'<div class="dijitProgressBar dijitProgressBarEmpty" role="progressbar"\n\t><div  dojoAttachPoint="internalProgress" class="dijitProgressBarFull"\n\t\t><div class="dijitProgressBarTile" role="presentation"></div\n\t\t><span style="visibility:hidden">&nbsp;</span\n\t></div\n\t><div dojoAttachPoint="labelNode" class="dijitProgressBarLabel" id="${id}_label"></div\n\t><img dojoAttachPoint="indeterminateHighContrastImage" class="dijitProgressBarIndeterminateHighContrastImage" alt=""\n/></div>'});
define("dojo/cldr/nls/number",{root:{scientificFormat:"#E0","currencySpacing-afterCurrency-currencyMatch":"[:letter:]",infinity:"\u221e",list:";",percentSign:"%",minusSign:"-","currencySpacing-beforeCurrency-surroundingMatch":"[:digit:]","decimalFormat-short":"000T","currencySpacing-afterCurrency-insertBetween":"\u00a0",nan:"NaN",nativeZeroDigit:"0",plusSign:"+","currencySpacing-afterCurrency-surroundingMatch":"[:digit:]","currencySpacing-beforeCurrency-currencyMatch":"[:letter:]",currencyFormat:"\u00a4\u00a0#,##0.00",
perMille:"\u2030",group:",",percentFormat:"#,##0%",decimalFormat:"#,##0.###",decimal:".",patternDigit:"#","currencySpacing-beforeCurrency-insertBetween":"\u00a0",exponential:"E"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true});
define("dojo/cldr/nls/en/number",{group:",",percentSign:"%",exponential:"E",scientificFormat:"#E0",percentFormat:"#,##0%",list:";",infinity:"\u221e",patternDigit:"#",minusSign:"-",decimal:".",nan:"NaN",nativeZeroDigit:"0",perMille:"\u2030",decimalFormat:"#,##0.###",currencyFormat:"\u00a4#,##0.00;(\u00a4#,##0.00)",plusSign:"+","decimalFormat-short":"000T"});
define("dojo/number",["dojo","dojo/i18n","i18n!dojo/cldr/nls/number","dojo/string","dojo/regexp"],function(c){c.getObject("number",true,c);c.number.format=function(e,a){a=c.mixin({},a||{});var b=c.i18n.normalizeLocale(a.locale);b=c.i18n.getLocalization("dojo.cldr","number",b);a.customs=b;b=a.pattern||b[(a.type||"decimal")+"Format"];if(isNaN(e)||Math.abs(e)==Infinity)return null;return c.number._applyPattern(e,b,a)};c.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;c.number._applyPattern=function(e,
a,b){b=b||{};var d=b.customs.group,f=b.customs.decimal;a=a.split(";");var g=a[0];a=a[e<0?1:0]||"-"+g;if(a.indexOf("%")!=-1)e*=100;else if(a.indexOf("\u2030")!=-1)e*=1E3;else if(a.indexOf("\u00a4")!=-1){d=b.customs.currencyGroup||d;f=b.customs.currencyDecimal||f;a=a.replace(/\u00a4{1,3}/,function(i){return b[["symbol","currency","displayName"][i.length-1]]||b.currency||""})}else if(a.indexOf("E")!=-1)throw new Error("exponential notation not supported");var j=c.number._numberPatternRE;g=g.match(j);
if(!g)throw new Error("unable to find a number expression in pattern: "+a);if(b.fractional===false)b.places=0;return a.replace(j,c.number._formatAbsolute(e,g[0],{decimal:f,group:d,places:b.places,round:b.round}))};c.number.round=function(e,a,b){b=10/(b||10);return(b*+e).toFixed(a)/b};(0.9).toFixed()==0&&function(){var e=c.number.round;c.number.round=function(a,b,d){var f=Math.pow(10,-b||0),g=Math.abs(a);if(!a||g>=f||g*Math.pow(10,b+1)<5)f=0;return e(a,b,d)+(a>0?f:-f)}}();c.number._formatAbsolute=
function(e,a,b){b=b||{};if(b.places===true)b.places=0;if(b.places===Infinity)b.places=6;a=a.split(".");var d=typeof b.places=="string"&&b.places.indexOf(","),f=b.places;if(d)f=b.places.substring(d+1);else if(!(f>=0))f=(a[1]||[]).length;b.round<0||(e=c.number.round(e,f,b.round));e=String(Math.abs(e)).split(".");var g=e[1]||"";if(a[1]||b.places){if(d)b.places=b.places.substring(0,d);d=b.places!==undefined?b.places:a[1]&&a[1].lastIndexOf("0")+1;if(d>g.length)e[1]=c.string.pad(g,d,"0",true);if(f<g.length)e[1]=
g.substr(0,f)}else e[1]&&e.pop();f=a[0].replace(",","");d=f.indexOf("0");if(d!=-1){d=f.length-d;if(d>e[0].length)e[0]=c.string.pad(e[0],d);if(f.indexOf("#")==-1)e[0]=e[0].substr(e[0].length-d)}f=a[0].lastIndexOf(",");var j,i;if(f!=-1){j=a[0].length-f-1;a=a[0].substr(0,f);f=a.lastIndexOf(",");if(f!=-1)i=a.length-f-1}a=[];for(f=e[0];f;){d=f.length-j;a.push(d>0?f.substr(d):f);f=d>0?f.slice(0,d):"";if(i){j=i;delete i}}e[0]=a.reverse().join(b.group||",");return e.join(b.decimal||".")};c.number.regexp=
function(e){return c.number._parseInfo(e).regexp};c.number._parseInfo=function(e){e=e||{};var a=c.i18n.normalizeLocale(e.locale);a=c.i18n.getLocalization("dojo.cldr","number",a);var b=e.pattern||a[(e.type||"decimal")+"Format"],d=a.group,f=a.decimal,g=1;if(b.indexOf("%")!=-1)g/=100;else if(b.indexOf("\u2030")!=-1)g/=1E3;else{var j=b.indexOf("\u00a4")!=-1;if(j){d=a.currencyGroup||d;f=a.currencyDecimal||f}}a=b.split(";");a.length==1&&a.push("-"+a[0]);a=c.regexp.buildGroupRE(a,function(i){i="(?:"+c.regexp.escapeString(i,
".")+")";return i.replace(c.number._numberPatternRE,function(k){var m={signed:false,separator:e.strict?d:[d,""],fractional:e.fractional,decimal:f,exponent:false};k=k.split(".");var o=e.places;if(k.length==1&&g!=1)k[1]="###";if(k.length==1||o===0)m.fractional=false;else{if(o===undefined)o=e.pattern?k[1].lastIndexOf("0")+1:Infinity;if(o&&e.fractional==undefined)m.fractional=true;if(!e.places&&o<k[1].length)o+=","+k[1].length;m.places=o}k=k[0].split(",");if(k.length>1){m.groupSize=k.pop().length;if(k.length>
1)m.groupSize2=k.pop().length}return"("+c.number._realNumberRegexp(m)+")"})},true);if(j)a=a.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g,function(i,k,m,o){i=c.regexp.escapeString(e[["symbol","currency","displayName"][m.length-1]]||e.currency||"");k=k?"[\\s\\xa0]":"";o=o?"[\\s\\xa0]":"";if(!e.strict){if(k)k+="*";if(o)o+="*";return"(?:"+k+i+o+")?"}return k+i+o});return{regexp:a.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:d,decimal:f,factor:g}};c.number.parse=function(e,a){a=c.number._parseInfo(a);e=(new RegExp("^"+
a.regexp+"$")).exec(e);if(!e)return NaN;var b=e[1];if(!e[1]){if(!e[2])return NaN;b=e[2];a.factor*=-1}b=b.replace(new RegExp("["+a.group+"\\s\\xa0]","g"),"").replace(a.decimal,".");return b*a.factor};c.number._realNumberRegexp=function(e){e=e||{};if(!("places"in e))e.places=Infinity;if(typeof e.decimal!="string")e.decimal=".";if(!("fractional"in e)||/^0/.test(e.places))e.fractional=[true,false];if(!("exponent"in e))e.exponent=[true,false];if(!("eSigned"in e))e.eSigned=[true,false];var a=c.number._integerRegexp(e),
b=c.regexp.buildGroupRE(e.fractional,function(f){var g="";if(f&&e.places!==0){g="\\"+e.decimal;if(e.places==Infinity)g="(?:"+g+"\\d+)?";else g+="\\d{"+e.places+"}"}return g},true),d=c.regexp.buildGroupRE(e.exponent,function(f){if(f)return"([eE]"+c.number._integerRegexp({signed:e.eSigned})+")";return""});a=a+b;if(b)a="(?:(?:"+a+")|(?:"+b+"))";return a+d};c.number._integerRegexp=function(e){e=e||{};if(!("signed"in e))e.signed=[true,false];if("separator"in e){if(!("groupSize"in e))e.groupSize=3}else e.separator=
"";var a=c.regexp.buildGroupRE(e.signed,function(d){return d?"[-+]":""},true),b=c.regexp.buildGroupRE(e.separator,function(d){if(!d)return"(?:\\d+)";d=c.regexp.escapeString(d);if(d==" ")d="\\s";else if(d=="\u00a0")d="\\s\\xa0";var f=e.groupSize,g=e.groupSize2;if(g){d="(?:0|[1-9]\\d{0,"+(g-1)+"}(?:["+d+"]\\d{"+g+"})*["+d+"]\\d{"+f+"})";return f-g>0?"(?:"+d+"|(?:0|[1-9]\\d{0,"+(f-1)+"}))":d}return"(?:0|[1-9]\\d{0,"+(f-1)+"}(?:["+d+"]\\d{"+f+"})*)"},true);return a+b};return c.number});
define("dijit/ProgressBar",["dojo","dijit","text!dijit/templates/ProgressBar.html","dojo/fx","dojo/number","dijit/_Widget","dijit/_Templated"],function(c,e){c.declare("dijit.ProgressBar",[e._Widget,e._Templated],{progress:"0",value:"",maximum:100,places:0,indeterminate:false,label:"",name:"",templateString:c.cache("dijit","templates/ProgressBar.html"),_indeterminateHighContrastImagePath:c.moduleUrl("dijit","themes/a11y/indeterminate_progress.gif"),postMixInProperties:function(){this.inherited(arguments);
if(!("value"in this.params))this.value=this.indeterminate?Infinity:this.progress},buildRendering:function(){this.inherited(arguments);this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString());this.update()},update:function(a){c.mixin(this,a||{});a=this.internalProgress;var b=this.domNode,d=1;if(this.indeterminate){e.removeWaiState(b,"valuenow");e.removeWaiState(b,"valuemin");e.removeWaiState(b,"valuemax")}else{if(String(this.progress).indexOf("%")!=
-1){d=Math.min(parseFloat(this.progress)/100,1);this.progress=d*this.maximum}else{this.progress=Math.min(this.progress,this.maximum);d=this.progress/this.maximum}e.setWaiState(b,"describedby",this.labelNode.id);e.setWaiState(b,"valuenow",this.progress);e.setWaiState(b,"valuemin",0);e.setWaiState(b,"valuemax",this.maximum)}this.labelNode.innerHTML=this.report(d);c.toggleClass(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);a.style.width=d*100+"%";this.onChange()},_setValueAttr:function(a){this._set("value",
a);a==Infinity?this.update({indeterminate:true}):this.update({indeterminate:false,progress:a})},_setLabelAttr:function(a){this._set("label",a);this.update()},_setIndeterminateAttr:function(a){this.indeterminate=a;this.update()},report:function(a){return this.label?this.label:this.indeterminate?"&nbsp;":c.number.format(a,{type:"percent",places:this.places,locale:this.lang})},onChange:function(){}});return e.ProgressBar});define("text!orion/widgets/templates/ImportDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\n\t\t<form method="post" id="importDialog.myForm"\n\t\t\tenctype="multipart/form-data" >\n\t\t\t<fieldset>\n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\tFile:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: top;">\n\t\t\t\t\t\t\t<div id="files" dojoType="dojox.form.uploader.FileList" uploaderId="importDialog.uploader"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input name="uploadedfile" multiple="false" type="file" id="importDialog.uploader" force="iframe"\n\t\t\t\t\t\t\t\tdojoType="dojox.form.Uploader" style="height: 20px" label="Browse..." >\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="submit" label="Finish" value="OK" dojoType="dijit.form.Button"\n\t\t\t\t\t\t\t\tstyle="padding: 20 0 10 0; float: right; clear: both;"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\t\n\t\t\t</fieldset>\n\t\t</form>\n\t</div>\n</div>'});
define("orion/widgets/ImportDialog",["dojo","dijit","dojox","dijit/Dialog","dojo/data/ItemFileReadStore","dojox/form/Uploader","dojox/form/uploader/FileList","dojox/form/uploader/plugins/IFrame","dijit/form/Button","dijit/ProgressBar","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/ImportDialog.html"],function(c,e){c.declare("orion.widgets.ImportDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/ImportDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="Import from zip"},postCreate:function(){this.inherited(arguments);c.byId("importDialog.myForm").action=this.options.importLocation;c.byId("importDialog.uploader").url=this.options.importLocation;c.connect(e.byId("importDialog.uploader"),"onError",c.hitch(this,function(){setTimeout(c.hitch(this,function(){this.hide()}),2E3)}));c.connect(e.byId("importDialog.uploader"),
"onComplete",c.hitch(this,function(){setTimeout(c.hitch(this,function(){this.hide();this.options.func()}),2E3)}))}})});define("text!dijit/form/templates/DropDownBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}"\n\trole="combobox"\n\t><div class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer\'\n\t\tdojoAttachPoint="_buttonNode, _popupStateNode" role="presentation"\n\t\t><input class="dijitReset dijitInputField dijitArrowButtonInner" value="&#9660; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class=\'dijitReset dijitInputInner\' ${!nameAttrSetting} type="text" autocomplete="off"\n\t\t\tdojoAttachPoint="textbox,focusNode" role="textbox" aria-haspopup="true"\n\t/></div\n></div>'});
define("dijit/form/nls/ComboBox",{root:{previousMessage:"Previous choices",nextMessage:"More choices"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ComboBox",["dojo","dijit","text!dijit/form/templates/DropDownBox.html","dojo/window","dojo/regexp","dojo/data/util/simpleFetch","dojo/data/util/filter","dijit/_CssStateMixin","dijit/form/_FormWidget","dijit/form/ValidationTextBox","dijit/_HasDropDown","i18n!dijit/form/nls/ComboBox"],function(c,e){c.declare("dijit.form.ComboBoxMixin",e._HasDropDown,{item:null,pageSize:Infinity,store:null,fetchProperties:{},query:{},autoComplete:true,highlightMatch:"first",searchDelay:100,searchAttr:"name",
labelAttr:"",labelType:"text",queryExpr:"${0}*",ignoreCase:true,hasDownArrow:true,templateString:c.cache("dijit.form","templates/DropDownBox.html"),baseClass:"dijitTextBox dijitComboBox",dropDownClass:"dijit.form._ComboBoxMenu",cssStateNodes:{_buttonNode:"dijitDownArrowButton"},maxHeight:-1,_stopClickEvents:false,_getCaretPos:function(a){var b=0;if(typeof a.selectionStart=="number")b=a.selectionStart;else if(c.isIE){var d=c.doc.selection.createRange().duplicate();a=a.createTextRange();d.move("character",
0);a.move("character",0);try{a.setEndPoint("EndToEnd",d);b=String(a.text).replace(/\r/g,"").length}catch(f){}}return b},_setCaretPos:function(a,b){b=parseInt(b);e.selectInputText(a,b,b)},_setDisabledAttr:function(a){this.inherited(arguments);e.setWaiState(this.domNode,"disabled",a)},_abortQuery:function(){if(this.searchTimer){clearTimeout(this.searchTimer);this.searchTimer=null}if(this._fetchHandle){this._fetchHandle.abort&&this._fetchHandle.abort();this._fetchHandle=null}},_onInput:function(a){if(!this.searchTimer&&
(a.type=="paste"||a.type=="input")&&this._lastInput!=this.textbox.value)this.searchTimer=setTimeout(c.hitch(this,function(){this._onKey({charOrCode:229})}),100);this.inherited(arguments)},_onKey:function(a){var b=a.charOrCode;if(!(a.altKey||(a.ctrlKey||a.metaKey)&&b!="x"&&b!="v"||b==c.keys.SHIFT)){var d=false,f=this.dropDown,g=c.keys,j=null;this._prev_key_backspace=false;this._abortQuery();this.inherited(arguments);if(this._opened)j=f.getHighlightedOption();switch(b){case g.PAGE_DOWN:case g.DOWN_ARROW:case g.PAGE_UP:case g.UP_ARROW:this._opened&&
this._announceOption(j);c.stopEvent(a);break;case g.ENTER:if(j)if(j==f.nextButton){this._nextSearch(1);c.stopEvent(a);break}else{if(j==f.previousButton){this._nextSearch(-1);c.stopEvent(a);break}}else{this._setBlurValue();this._setCaretPos(this.focusNode,this.focusNode.value.length)}if(this._opened||this._fetchHandle)a.preventDefault();case g.TAB:b=this.get("displayedValue");if(f&&(b==f._messages.previousMessage||b==f._messages.nextMessage))break;j&&this._selectOption();if(this._opened){this._lastQuery=
null;this.closeDropDown()}break;case " ":if(j){c.stopEvent(a);this._selectOption();this.closeDropDown()}else d=true;break;case g.DELETE:case g.BACKSPACE:d=this._prev_key_backspace=true;break;default:d=typeof b=="string"||b==229}if(d){this.item=undefined;this.searchTimer=setTimeout(c.hitch(this,"_startSearchFromInput"),1)}}},_autoCompleteText:function(a){var b=this.focusNode;e.selectInputText(b,b.value.length);var d=this.ignoreCase?"toLowerCase":"substr";if(a[d](0).indexOf(this.focusNode.value[d](0))==
0){d=this._getCaretPos(b);if(d+1>b.value.length){b.value=a;e.selectInputText(b,d)}}else{b.value=a;e.selectInputText(b)}},_openResultList:function(a,b){this._fetchHandle=null;if(!(this.disabled||this.readOnly||b.query[this.searchAttr]!=this._lastQuery)){var d=this.dropDown._highlighted_option&&c.hasClass(this.dropDown._highlighted_option,"dijitMenuItemSelected");this.dropDown.clearResultList();if(!a.length&&!this._maxOptions)this.closeDropDown();else{b._maxOptions=this._maxOptions;a=this.dropDown.createOptions(a,
b,c.hitch(this,"_getMenuLabelFromItem"));this._showResultList();if(b.direction){if(1==b.direction)this.dropDown.highlightFirstOption();else-1==b.direction&&this.dropDown.highlightLastOption();d&&this._announceOption(this.dropDown.getHighlightedOption())}else this.autoComplete&&!this._prev_key_backspace&&!/^[*]+$/.test(b.query[this.searchAttr])&&this._announceOption(a[1])}}},_showResultList:function(){this.closeDropDown(true);this.displayMessage("");this.openDropDown();e.setWaiState(this.domNode,"expanded",
"true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return false},closeDropDown:function(){this._abortQuery();if(this._opened){this.inherited(arguments);e.setWaiState(this.domNode,"expanded","false");e.removeWaiState(this.focusNode,"activedescendant")}},_setBlurValue:function(){var a=this.get("displayedValue"),b=this.dropDown;if(b&&(a==b._messages.previousMessage||a==b._messages.nextMessage))this._setValueAttr(this._lastValueReported,true);else if(typeof this.item=="undefined"){this.item=
null;this.set("displayedValue",a)}else{this.value!=this._lastValueReported&&e.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true);this._refreshState()}},_onBlur:function(){this.closeDropDown();this.inherited(arguments)},_setItemAttr:function(a,b,d){d||(d=this.store.getValue(a,this.searchAttr));var f=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):d;this._set("item",a);e.form.ComboBox.superclass._setValueAttr.call(this,f,b,d)},_announceOption:function(a){if(a){var b;
if(a==this.dropDown.nextButton||a==this.dropDown.previousButton){b=a.innerHTML;this.item=undefined;this.value=""}else{b=this.store.getValue(a.item,this.searchAttr).toString();this.set("item",a.item,false,b)}this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);e.setWaiState(this.focusNode,"activedescendant",c.attr(a,"id"));this._autoCompleteText(b)}},_selectOption:function(a){a&&this._announceOption(a.target);this.closeDropDown();this._setCaretPos(this.focusNode,this.focusNode.value.length);
e.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true)},_startSearchAll:function(){this._startSearch("")},_startSearchFromInput:function(){this._startSearch(this.focusNode.value.replace(/([\\\*\?])/g,"\\$1"))},_getQueryString:function(a){return c.string.substitute(this.queryExpr,[a])},_startSearch:function(a){if(!this.dropDown){var b=this.id+"_popup";this.dropDown=new (c.getObject(this.dropDownClass,false))({onChange:c.hitch(this,this._selectOption),id:b,dir:this.dir});e.removeWaiState(this.focusNode,
"activedescendant");e.setWaiState(this.textbox,"owns",b)}b=c.clone(this.query);this._lastInput=a;this._lastQuery=b[this.searchAttr]=this._getQueryString(a);this.searchTimer=setTimeout(c.hitch(this,function(d,f){this.searchTimer=null;d={queryOptions:{ignoreCase:this.ignoreCase,deep:true},query:d,onBegin:c.hitch(this,"_setMaxOptions"),onComplete:c.hitch(this,"_openResultList"),onError:function(g){f._fetchHandle=null;console.error("dijit.form.ComboBox: "+g);f.closeDropDown()},start:0,count:this.pageSize};
c.mixin(d,f.fetchProperties);this._fetchHandle=f.store.fetch(d);this._nextSearch=this.dropDown.onPage=c.hitch(this,function(g,j){g.start+=g.count*j;g.direction=j;this._fetchHandle=this.store.fetch(g);this.focus()},this._fetchHandle)},b,this),this.searchDelay)},_setMaxOptions:function(a){this._maxOptions=a},_getValueField:function(){return this.searchAttr},constructor:function(){this.query={};this.fetchProperties={}},postMixInProperties:function(){if(!this.store){this.store=new e.form._ComboBoxDataStore(this.srcNodeRef);
if(!("value"in this.params)){var a=this.item=this.store.fetchSelectedItem();if(a){var b=this._getValueField();this.value=this.store.getValue(a,b)}}}this.inherited(arguments)},postCreate:function(){var a=c.query('label[for="'+this.id+'"]');if(a.length){a[0].id=this.id+"_label";e.setWaiState(this.domNode,"labelledby",a[0].id)}this.inherited(arguments)},_setHasDownArrowAttr:function(a){this.hasDownArrow=a;this._buttonNode.style.display=a?"":"none"},_getMenuLabelFromItem:function(a){a=this.labelFunc(a,
this.store);var b=this.labelType;if(this.highlightMatch!="none"&&this.labelType=="text"&&this._lastInput){a=this.doHighlight(a,this._escapeHtml(this._lastInput));b="html"}return{html:b=="html",label:a}},doHighlight:function(a,b){var d=(this.ignoreCase?"i":"")+(this.highlightMatch=="all"?"g":""),f=this.queryExpr.indexOf("${0}");b=c.regexp.escapeString(b);return this._escapeHtml(a).replace(new RegExp((f==0?"^":"")+"("+b+")"+(f==this.queryExpr.length-4?"$":""),d),'<span class="dijitComboBoxHighlightMatch">$1</span>')},
_escapeHtml:function(a){return a=String(a).replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;")},reset:function(){this.item=null;this.inherited(arguments)},labelFunc:function(a,b){return b.getValue(a,this.labelAttr||this.searchAttr).toString()}});c.declare("dijit.form._ComboBoxMenu",[e._Widget,e._Templated,e._CssStateMixin],{templateString:"<ul class='dijitReset dijitMenu' dojoAttachEvent='onmousedown:_onMouseDown,onmouseup:_onMouseUp,onmouseover:_onMouseOver,onmouseout:_onMouseOut' style='overflow: \"auto\"; overflow-x: \"hidden\";'><li class='dijitMenuItem dijitMenuPreviousButton' dojoAttachPoint='previousButton' role='option'></li><li class='dijitMenuItem dijitMenuNextButton' dojoAttachPoint='nextButton' role='option'></li></ul>",
_messages:null,baseClass:"dijitComboBoxMenu",postMixInProperties:function(){this.inherited(arguments);this._messages=c.i18n.getLocalization("dijit.form","ComboBox",this.lang)},buildRendering:function(){this.inherited(arguments);this.previousButton.innerHTML=this._messages.previousMessage;this.nextButton.innerHTML=this._messages.nextMessage},_setValueAttr:function(a){this.value=a;this.onChange(a)},onChange:function(){},onPage:function(){},onClose:function(){this._blurOptionNode()},_createOption:function(a,
b){var d=c.create("li",{"class":"dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl"),role:"option"});b=b(a);if(b.html)d.innerHTML=b.label;else d.appendChild(c.doc.createTextNode(b.label));if(d.innerHTML=="")d.innerHTML="&nbsp;";d.item=a;return d},createOptions:function(a,b,d){this.previousButton.style.display=b.start==0?"none":"";c.attr(this.previousButton,"id",this.id+"_prev");c.forEach(a,function(g,j){g=this._createOption(g,d);c.attr(g,"id",this.id+j);this.domNode.insertBefore(g,
this.nextButton)},this);var f=false;if(b._maxOptions&&b._maxOptions!=-1)if(b.start+b.count<b._maxOptions)f=true;else{if(b.start+b.count>b._maxOptions&&b.count==a.length)f=true}else if(b.count==a.length)f=true;this.nextButton.style.display=f?"":"none";c.attr(this.nextButton,"id",this.id+"_next");return this.domNode.childNodes},clearResultList:function(){for(;this.domNode.childNodes.length>2;)this.domNode.removeChild(this.domNode.childNodes[this.domNode.childNodes.length-2]);this._blurOptionNode()},
_onMouseDown:function(a){c.stopEvent(a)},_onMouseUp:function(a){if(!(a.target===this.domNode||!this._highlighted_option))if(a.target==this.previousButton){this._blurOptionNode();this.onPage(-1)}else if(a.target==this.nextButton){this._blurOptionNode();this.onPage(1)}else{for(a=a.target;!a.item;)a=a.parentNode;this._setValueAttr({target:a},true)}},_onMouseOver:function(a){if(a.target!==this.domNode){a=a.target;if(!(a==this.previousButton||a==this.nextButton))for(;!a.item;)a=a.parentNode;this._focusOptionNode(a)}},
_onMouseOut:function(a){a.target!==this.domNode&&this._blurOptionNode()},_focusOptionNode:function(a){if(this._highlighted_option!=a){this._blurOptionNode();this._highlighted_option=a;c.addClass(this._highlighted_option,"dijitMenuItemSelected")}},_blurOptionNode:function(){if(this._highlighted_option){c.removeClass(this._highlighted_option,"dijitMenuItemSelected");this._highlighted_option=null}},_highlightNextOption:function(){if(this.getHighlightedOption()){var a=this._highlighted_option.nextSibling;
a&&a.style.display!="none"?this._focusOptionNode(a):this.highlightFirstOption()}else{a=this.domNode.firstChild;this._focusOptionNode(a.style.display=="none"?a.nextSibling:a)}c.window.scrollIntoView(this._highlighted_option)},highlightFirstOption:function(){var a=this.domNode.firstChild,b=a.nextSibling;this._focusOptionNode(b.style.display=="none"?a:b);c.window.scrollIntoView(this._highlighted_option)},highlightLastOption:function(){this._focusOptionNode(this.domNode.lastChild.previousSibling);c.window.scrollIntoView(this._highlighted_option)},
_highlightPrevOption:function(){if(this.getHighlightedOption()){var a=this._highlighted_option.previousSibling;a&&a.style.display!="none"?this._focusOptionNode(a):this.highlightLastOption()}else{a=this.domNode.lastChild;this._focusOptionNode(a.style.display=="none"?a.previousSibling:a)}c.window.scrollIntoView(this._highlighted_option)},_page:function(a){var b=0,d=this.domNode.scrollTop,f=c.style(this.domNode,"height");for(this.getHighlightedOption()||this._highlightNextOption();b<f;){if(a){if(!this.getHighlightedOption().previousSibling||
this._highlighted_option.previousSibling.style.display=="none")break;this._highlightPrevOption()}else{if(!this.getHighlightedOption().nextSibling||this._highlighted_option.nextSibling.style.display=="none")break;this._highlightNextOption()}var g=this.domNode.scrollTop;b+=(g-d)*(a?-1:1);d=g}},pageUp:function(){this._page(true)},pageDown:function(){this._page(false)},getHighlightedOption:function(){var a=this._highlighted_option;return a&&a.parentNode?a:null},handleKey:function(a){switch(a.charOrCode){case c.keys.DOWN_ARROW:this._highlightNextOption();
return false;case c.keys.PAGE_DOWN:this.pageDown();return false;case c.keys.UP_ARROW:this._highlightPrevOption();return false;case c.keys.PAGE_UP:this.pageUp();return false;default:return true}}});c.declare("dijit.form.ComboBox",[e.form.ValidationTextBox,e.form.ComboBoxMixin],{_setValueAttr:function(a,b,d){this._set("item",null);a||(a="");e.form.ValidationTextBox.prototype._setValueAttr.call(this,a,b,d)}});c.declare("dijit.form._ComboBoxDataStore",null,{constructor:function(a){this.root=a;if(a.tagName!=
"SELECT"&&a.firstChild){a=c.query("select",a);if(a.length>0)a=a[0];else{this.root.innerHTML="<SELECT>"+this.root.innerHTML+"</SELECT>";a=this.root.firstChild}this.root=a}c.query("> option",a).forEach(function(b){b.innerHTML=c.trim(b.innerHTML)})},getValue:function(a,b){return b=="value"?a.value:a.innerText||a.textContent||""},isItemLoaded:function(){return true},getFeatures:function(){return{"dojo.data.api.Read":true,"dojo.data.api.Identity":true}},_fetchItems:function(a,b){if(!a.query)a.query={};
if(!a.query.name)a.query.name="";if(!a.queryOptions)a.queryOptions={};var d=c.data.util.filter.patternToRegExp(a.query.name,a.queryOptions.ignoreCase),f=c.query("> option",this.root).filter(function(g){return(g.innerText||g.textContent||"").match(d)});a.sort&&f.sort(c.data.util.sorter.createSortFunction(a.sort,this));b(f,a)},close:function(){},getLabel:function(a){return a.innerHTML},getIdentity:function(a){return c.attr(a,"value")},fetchItemByIdentity:function(a){var b=c.query("> option[value='"+
a.identity+"']",this.root)[0];a.onItem(b)},fetchSelectedItem:function(){var a=this.root,b=a.selectedIndex;return typeof b=="number"?c.query("> option:nth-child("+(b!=-1?b+1:1)+")",a)[0]:null}});c.extend(e.form._ComboBoxDataStore,c.data.util.simpleFetch);return e.form.ComboBox});define("text!orion/widgets/templates/SFTPConnectionDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoType="dojo.data.ItemFileReadStore" data="sftpConnectionStoreData" jsId="sftpConnectionStore">\n\t</div>\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="locationLabel" for="${id}_sftpPath" style="padding-right: 10">${locationLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<div dojoType="dijit.form.ComboBox" store="sftpConnectionStore" style="display: inline-block; width: 88%;" dojoAttachPoint="sftpConnectionList" searchAttr="name">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div dojoType="dijit.form.DropDownButton">\n\t\t\t\t\t    <span>New</span>\n\t\t\t    \t\t<div dojoType="dijit.TooltipDialog">\n\t\t\t\t\t\t\t<div style="display: table">\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpHostLabel" for="${id}_sftpHost" style="padding-right: 10">${sftpHostLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpHost" id="${id}_sftpHost" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpPathLabel" for="${id}_sftpPath" style="padding-right: 10">${sftpPathLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpPath" id="${id}_sftpPath" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\t\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpUserLabel" for="${id}_sftpUser" style="padding-right: 10">${sftpUserLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpUser" id="${id}_sftpUser" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<button dojoAttachPoint="addSFTPConnection" type="submit" dojoType="dijit.form.Button" style="padding: 20 0 10 0; float: right; clear: both;">Add</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- End inner table--\>\n\t\t\t    \t\t</div><!-- End TooltipDialog --\>\n\t\t\t    \t</div><!-- End DropDownButton --\>\n\t\t\t\t</div><!-- End table cell --\>\n\t\t\t</div><!-- End table row --\>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="sftpPasswordLabel" for="${id}_sftpPassword" style="padding-right: 10">${sftpPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="sftpPassword" id="${id}_sftpPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<p>If the same file exists in both the source and destination:</p>\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteCancel" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteCancel" checked value="overwriteCancel" />\n\t\t\t\t    <label for="radioOne">Cancel the transfer</label>\n\t\t\t\t    <br />\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteAll" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteAll"/>\n\t\t\t\t    <label for="radioOne">Always overwrite destination</label>\n\t\t\t\t    <br />\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteOlder" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteOlder"/>\n\t\t\t\t    <label for="radioOne">Overwrite if source is newer</label>\n\t\t\t\t</div>\n\t\t\t</div><!-- End table row --\>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="sftpConnectionButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div><!-- End table row --\>\n\t\t</div><!-- End table --\>\n\t</div><!-- End dijitDialogPaneContent --\>\n</div>'});
define("orion/widgets/SFTPConnectionDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/ComboBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/SFTPConnectionDialog.html"],function(c,e){localStorage.getItem("orion.sftpConnections")||localStorage.setItem("orion.sftpConnections",JSON.stringify({identifier:"name",label:"name",items:[]}));window.sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"));c.declare("orion.widgets.SFTPConnectionDialog",
[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/SFTPConnectionDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="SFTP Transfer";this.sftpHostLabelText="Remote host:";this.sftpPathLabelText="Remote path:";this.sftpUserLabelText="User name:";this.sftpPasswordLabelText="Password:";this.buttonOk="Start Transfer";this.locationLabelText=
"Location:";sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"))},postCreate:function(){this.inherited(arguments);c.connect(this.addSFTPConnection,"onClick",null,c.hitch(this,this.onAddConnection))},execute:function(){var a=this.sftpConnectionList.value.split("@");if(a.length===2){var b=a[0],d=a[1].indexOf("/");if(!(d<=0)){var f=a[1].substring(0,d);a=a[1].substring(d);this.options.func(f,a,b,this.sftpPassword.value,this._computeOverwriteValue())}}},_computeOverwriteValue:function(){if(this.overwriteCancel.checked)return"no-overwrite";
else if(this.overwriteOlder.checked)return"overwrite-older";return""},onAddConnection:function(){for(var a={name:this.sftpUser.value+"@"+this.sftpHost.value+this.sftpPath.value},b=JSON.parse(localStorage.getItem("orion.sftpConnections")),d=false,f=0;f<b.items.length;f++)if(b.items[f].name===a.name){d=true;break}if(!d){b.items.unshift(a);localStorage.setItem("orion.sftpConnections",JSON.stringify(b));this.sftpConnectionList.set("value",a.name)}}})});
define("orion/extensionCommands",["require","dojo","orion/util","orion/commands","orion/editor/regex","orion/contentTypes","orion/URITemplate","orion/widgets/NewItemDialog","orion/widgets/DirectoryPrompterDialog","orion/widgets/ImportDialog","orion/widgets/SFTPConnectionDialog"],function(c,e,a,b,d,f,g){var j={};j._cloneItemWithoutChildren=function i(k){if(k===null||typeof k!=="object")return k;var m=k.constructor();for(var o in k)if(o!=="children"&&o!=="Children")m[o]=i(k[o]);return m};j._createOpenWithCommands=
function(i,k){function m(){for(var r=i.getServiceReferences("orion.edit.editor"),y=[],B=0;B<r.length;B++){var z=r[B],E=z.getProperty("id");y.push({id:E,name:z.getProperty("name"),uriTemplate:new g(z.getProperty("orionTemplate")||z.getProperty("uriTemplate"))})}return y}function o(r,y){r=r.map(function(B){return d.escape(B)});y=y.map(function(B){return d.escape(B)});r=r.length&&"(*\\.("+r.join("|")+")$)";y=y.length&&"(^("+y.join("|")+")$)";return r&&y?r+"|"+y:r?r:y?y:null}function v(r,y){r=r.getServiceReferences("orion.navigate.openWith");
for(var B=[],z=0;z<r.length;z++){var E=r[z];if(E.getProperty("editor")===y.id){E=E.getProperty("contentType");if(E instanceof Array)B=B.concat(E);else E!==null&&typeof E!=="undefined"&&B.push(E)}}return B}function t(r){for(r=r.getServiceReferences("orion.navigate.openWith.default");0<r.length;)return{editor:r[0].getProperty("editor")};return null}for(var w=m(),u=t(i),s=[],q=0;q<w.length;q++){var x=w[q],A=u&&u.editor===x.id,D=v(i,x);if(D.length){for(var h=[],l=[],n=0;n<D.length;n++){var p=k[D[n]];
if(p){h=h.concat(p.extension);l=l.concat(p.filename)}}D=x.uriTemplate;h={Directory:false,Name:o(h,l)};x={name:x.name||x.id,id:"eclipse.openWithCommand."+x.id,tooltip:x.name,validationProperties:h,href:true,forceSingleItem:true,isEditor:A?"default":"editor"};A={run:e.hitch(D,D.expand)};s.push({properties:x,service:A})}}return s};j._makeValidationFunction=function(i,k){function m(t){for(var w="^",u=0;u<t.length;u++){var s=t.charAt(u);switch(s){case "?":w+=".";break;case "*":w+=".*";break;default:w+=
s}}w+="$";return new RegExp(w)}function o(t,w,u){var s,q;if(w.indexOf(":")>=0){s=m(w.substring(0,w.indexOf(":")));var x=w.substring(w.indexOf(":")+1);for(q in t)if(s.test(q))if(o(t[q],x,u))return true}s=m(w);for(q in t)if(s.test(q))if(typeof u==="string"){if(m(u).test(t[q]))return true}else if(u===t[q])return true;return false}function v(t,w){for(var u in w)if(!o(t,u,w[u]))return false;return true}return e.hitch(i,function(t){if(typeof k==="function")t=k(t);if(e.isArray(t)){if((this.forceSingleItem||
this.href)&&t.length!==1)return false;if(!this.forceSingleItem&&t.length<1)return false}else t=[t];if(!this.validationProperties)return true;for(var w in t)if(!v(t[w],this.validationProperties))return false;return true})};j._createCommandOptions=function(i,k,m,o,v){var t={name:i.name,image:i.image,id:i.id||i.name,tooltip:i.tooltip,isEditor:i.isEditor};t.visibleWhen=j._makeValidationFunction(i,v);if(o)if(i.href)t.hrefCallback=e.hitch(i,function(w){w=e.isArray(w.items)?w.items[0]:w.items;w=j._cloneItemWithoutChildren(w);
if(k.run)return k.run(w);else if(m)return m.getService(k).run(w)});else t.callback=e.hitch(i,function(w){var u;if(this.forceSingleItem){w=e.isArray()?w.items[0]:w.items;u=j._cloneItemWithoutChildren(w)}else if(e.isArray(w.items)){u=[];for(var s=0;s<w.items.length;s++)u.push(j._cloneItemWithoutChildren(w.items[s]))}else u=j._cloneItemWithoutChildren(w.items);if(k.run)k.run(u);else m&&m.getService(k).run(u)});return t};j.getOpenWithCommands=function(i){var k=[];for(var m in i._objectScope){var o=i._objectScope[m];
o.isEditor&&k.push(o)}return k};return j});
define("orion/textview/keyBinding",[],function(){function c(a,b,d,f,g){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=b!==undefined&&b!==null?b:false;this.mod2=d!==undefined&&d!==null?d:false;this.mod3=f!==undefined&&f!==null?f:false;this.mod4=g!==undefined&&g!==null?g:false}var e=window.navigator.platform.indexOf("Mac")!==-1;c.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(e?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;
if(this.mod3!==a.altKey)return false;if(e&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return{KeyBinding:c}});
define("orion/favorites",["require","dojo","orion/util"],function(c,e,a){function b(d){this._favorites=[];this._searches=[];this._init(d);this._initializeFavorites()}b.prototype={_init:function(d){this._registry=d.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this._serviceRegistration.dispatchEvent("favoritesChanged",{navigator:this._favorites,search:this._searches,registry:this._registry})},makeFavorites:function(d){d=
e.isArray(d)?d:[d];for(var f=0;f<d.length;f++){var g=d[f],j=g.ChildrenLocation?g.ChildrenLocation:g.Location;j=a.makeRelative(j);this.addFavorite(g.Name,j,g.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(d){this.addFavorite(d,d,false,true)},addFavorite:function(d,f,g,j){this._favorites.push({name:d,path:f,directory:g,isFavorite:true,isExternalResource:j});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(d){for(var f in this._favorites)if(this._favorites[f].path===
d){this._favorites.splice(f,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(d,f){var g=false;for(var j in this._favorites)if(this._favorites[j].path===d){var i=this._favorites[j];if(i.name!==f){i.name=f;g=true}}if(g){this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(d,f){this._searches.push({name:d,query:f,isSearch:true});this._searches.sort(this._sorter);this._storeSearches();
this._notifyListeners()},hasFavorite:function(d){for(var f in this._favorites)if(this._favorites[f].path===d)return true;return false},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(d){var f;if(!d)return this._favorites;var g="";for(f=0;f<d.length;f++){var j=d.charAt(f);g+=j==="*"?".*":j==="?"?".?":this._SPECIAL_CHARS.indexOf(j)>=0?"\\"+j:j}g+=".*";d=new RegExp(g);g=[];for(f in this._favorites)this._favorites[f].name.search(d)===0&&g.push(this._favorites[f]);return g},removeSearch:function(d){for(var f in this._searches)if(this._searches[f].query===
d){this._searches.splice(f,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(d,f){var g=false;for(var j in this._searches)if(this._searches[j].query===d){var i=this._searches[j];if(i.name!==f){i.name=f;g=true}}if(g){this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()}},_initializeFavorites:function(){var d=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){var g,
j=f.get("navigate");if(typeof j==="string")j=JSON.parse(j);if(j)for(g in j){j[g].isFavorite=true;d._favorites.push(j[g])}f=f.get("search");if(typeof f==="string")f=JSON.parse(f);if(f)for(g in f){f[g].isSearch=true;d._searches.push(f[g])}d._favorites.sort(d._sorter);d._notifyListeners()})},_storeFavorites:function(){var d=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("navigate",d)})},_storeSearches:function(){var d=this._searches;
this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("search",d)})},_sorter:function(d,f){d=d.name.toLowerCase();f=f.name.toLowerCase();return d>f?1:d<f?-1:0},getFavorites:function(){return{navigator:this._favorites,search:this._searches}}};b.prototype.constructor=b;return{FavoritesService:b}});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="statusbar" style="display:table-cell;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/OpenResourceDialog",["require","dojo","dijit","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/OpenResourceDialog.html"],function(c,e,a){return e.declare("orion.widgets.OpenResourceDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,searcher:null,searchRenderer:null,favService:null,
constructor:function(){this.inherited(arguments);this.timeoutId=null;this.time=0;this.searcher=(this.options=arguments[0])&&this.options.searcher;if(!this.searcher)throw new Error("Missing required argument: searcher");this.searchRenderer=this.options&&this.options.searchRenderer;if(!this.searchRenderer||typeof this.searchRenderer.makeRenderFunction!=="function")throw new Error("Missing required argument: searchRenderer");this.favService=this.options.favoriteService;if(!this.favService)throw new Error("Missing required argument: favService");
},postMixInProperties:function(){this.options.title=this.options.title||"Find File Named";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder="Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);e.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(e.hitch(this,this.checkSearch),0)});e.connect(this.resourceName,"onKeyPress",this,function(b){if(b.keyCode===
e.keys.ENTER&&this.results){b=e.query("a",this.results);if(b.length>0){window.open(b[0].href);this.hide()}}});e.connect(this,"onKeyPress",this,function(b){var d,f,g,j,i;g=function(m,o,v){return o<m.length-1?m[o+1]:v};var k=function(m,o,v){return o>0?m[o-1]:v};if(b.keyCode===e.keys.DOWN_ARROW||b.keyCode===e.keys.UP_ARROW){f=e.query("a",this.results);d=e.query("a",this.favresults);j=a.getFocus();i=f.indexOf(j.node);j=d.indexOf(j.node);if(b.keyCode===e.keys.DOWN_ARROW)if(j>=0)a.focus(g(d,j,f.length>
0?f[0]:d[0]));else if(i>=0)a.focus(g(f,i,d.length>0?d[0]:f[0]));else{if(f.length>0||d.length>0)a.focus(g(d,-1,f[0]))}else if(j>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(k(d,j,g))}else if(i>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(k(f,i,d.length>0?d[d.length-1]:g))}else if(f.length>0)a.focus(f[f.length-1]);else d.length>0&&a.focus(d[d.length-1]);e.stopEvent(b)}});e.connect(this,"onMouseUp",function(b){b.target.focus()});this.populateFavorites()},populateFavorites:function(){e.place("<div>Populating favorites&#x2026;</div>",
this.favresults,"only");this.favService.getFavorites().then(this.showFavorites());this.favService.addEventListener("favoritesChanged",this.showFavorites())},showFavorites:function(){var b=this;return function(d){if(d.navigator)d=d.navigator;b.searchRenderer.makeRenderFunction(b.favresults,false,e.hitch(b,b.decorateResult),b.showFavoritesImage)(d);d&&d.length>0&&e.place("<hr/>",b.favresults,"last")}},showFavoritesImage:function(b){var d=new Image;e.addClass(d,"commandSprite");e.addClass(d,"core-sprite-makeFavorite");
e.addClass(d,"commandImage");d.src=c.toUrl("images/none.png");d.title="Favorite";b.appendChild(d);e.style(d,"verticalAlign","middle")},checkSearch:function(){clearTimeout(this.timeoutId);var b=(new Date).getTime();if(b-this.time>this.SEARCH_DELAY){this.time=b;this.doSearch()}else this.timeoutId=setTimeout(e.hitch(this,"checkSearch"),50)},doSearch:function(){var b=this.resourceName&&this.resourceName.get("value"),d=this.showFavorites();this.favService.queryFavorites(b).then(function(g){d(g)});if(b){e.place("<div>Searching&#x2026;</div>",
this.results,"only");var f=this;setTimeout(function(){var g=f.searcher.createSearchQuery(null,b,"Name"),j=f.searchRenderer.makeRenderFunction(f.results,false,e.hitch(f,f.decorateResult));f.searcher.search(g,false,j)},0)}},decorateResult:function(b){var d=this;e.query("a",b).forEach(function(f){e.connect(f,"onmouseup",function(g){!e.mouseButtons.isMiddle(g)&&!e.isCopyKey(g)&&d.hide()});e.connect(f,"onkeyup",d,function(g){g.keyCode===e.keys.ENTER&&d.hide()})})},show:function(){this.inherited(arguments);
this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);this.inherited(arguments)}})});define("text!orion/widgets/templates/LoginDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="width: 300px; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0.45em">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table style="width: 100%;">\n\t\t\t\t<tr>\n\t\t\t\t\t<td style="text-align: left; vertical-align: top;">\n\t\t\t\t\t\t<h2 dojoAttachPoint="emptyListInfo" class="LoginWindowLeft">No authentication required.</h2>\n\t\t\t\t\t\t<table dojoAttachPoint="authenticated" style="display: none; width: 100%;">\n\t\t\t\t\t\t\t<tbody dojoAttachPoint="authenticatedList">\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table dojoAttachPoint="otherUnauthenticated" style="display: none; width: 100%;">\n\t\t\t\t\t\t\t<tbody dojoAttachPoint="otherUnauthenticatedList">\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style="text-align: right; vertical-align: top; padding-right: 2px; margin: 0">\n\t\t\t\t\t\t<span dojoAttachPoint="closeLink" role="button" title="Close"></span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/LoginDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/LoginDialog.html"],function(c,e,a){e.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/LoginDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},postCreate:function(){this.inherited(arguments);var b=
this;e.addClass(this.closeLink,"imageSprite");e.addClass(this.closeLink,"core-sprite-close");e.connect(this.closeLink,"onmouseover",this.closeLink,function(){b.closeLink.style.cursor="pointer"});e.connect(this.closeLink,"onmouseout",this.closeLink,function(){b.closeLink.style.cursor="default"});e.connect(this.closeLink,"onclick",function(){e.hitch(b,b.closeDialog)()})},setPendingAuthentication:function(b){for(var d in this.unauthenticatedServices)delete this.unauthenticatedServices[d].pending;for(d in b)if(this.unauthenticatedServices[b[d].SignInKey])this.unauthenticatedServices[b[d].SignInKey].pending=
true;else if(this.authenticatedServices[b[d].SignInKey]){this.unauthenticatedServices[b[d].SignInKey]=this.authenticatedServices[b[d].SignInKey];this.unauthenticatedServices[b[d].SignInKey].pending=true;delete this.authenticatedServices[b[d].SignInKey]}else this.unauthenticatedServices[b[d].SignInKey]={label:b[d].label,SignInLocation:b[d].SignInLocation,pending:true};this.renderUnauthenticatedServices();this.renderAuthenticatedServices()},authenticatedService:function(b){if(this.unauthenticatedServices[b]&&
!this.unauthenticatedServices[b].authService){this.authenticatedServices[b]=this.unauthenticatedServices[b];delete this.unauthenticatedServices[b]}},addUserItem:function(b,d,f,g){if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:d,label:f,data:g}}else{this.authenticatedServices[b]&&delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:d,label:f,pending:this.unauthenticatedServices[b].pending}:
{authService:d,label:f}}e.hitch(this,this.renderAuthenticatedServices)();e.hitch(this,this.renderUnauthenticatedServices)()},renderAuthenticatedServices:function(){e.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var b=this,d=true;for(var f in this.authenticatedServices){if(!d){var g=e.create("tr",null,this.authenticatedList);e.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},
g)}d=false;g=e.create("tr",{className:"navTableHeading"});var j=this.authenticatedServices[f].authService,i=e.create("td",null,g,"only"),k=e.create("h2",null,i,"only");if(j)if(j.getAuthForm)e.hitch(b,function(v,t){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(w){if(b.authenticatedServices[t].label)v.innerHTML=b.authenticatedServices[t].label+"<br>";v.innerHTML+=b.getHostname(w)})})(k,f);else k.innerHTML=this.authenticatedServices[f].label?this.authenticatedServices[f].label:
f;else{var m=this.authenticatedServices[f].SignInLocation;if(this.authenticatedServices[f].label)k.innerHTML=this.authenticatedServices[f].label+"<br>";k.innerHTML+=this.getHostname(m)}e.addClass(i,"LoginWindowLeft");i=e.create("td",{style:"text-align: right"},g,"last");e.addClass(i,"LoginWindowRight");k=this.authenticatedServices[f].data;j=this.authenticatedServices[f].authService;if(!j){e.place(g,this.authenticatedList,"last");return}k.Location&&e.create("a",{href:c.toUrl("profile/user-profile.html")+
"#"+k.Location,innerHTML:"Profile"},i,"last");e.place(document.createTextNode(" "),i,"last");if(j.logout){var o=e.create("a",{innerHTML:"Sign out"},i,"last");e.connect(o,"onmouseover",o,function(){o.style.cursor="pointer"});e.connect(o,"onmouseout",o,function(){o.style.cursor="default"});e.connect(o,"onclick",e.hitch(b,function(v,t){return function(){v.logout().then(e.hitch(b,function(){this.addUserItem(t,v,this.authenticatedServices[t].label);this.isSingleService()&&this.closeDialog();localStorage.removeItem(t)}))}})(j,
f))}e.place(g,this.authenticatedList,"last");i="N/A";if(k&&k.lastlogintimestamp)i=e.date.locale.format(new Date(k.lastlogintimestamp),{formatLength:"short"});k=k.Name&&k.Name.replace(/^\s+|\s+$/g,"")!==""?k.Name:k.login;g=e.create("tr");i=k.length>40?e.create("td",{innerHTML:k.substring(0,30)+"... logged in since "+i,colspan:2,title:k+" logged in since "+i},g,"only"):e.create("td",{innerHTML:k+" logged in since "+i,colspan:2},g,"only");e.addClass(i,"LoginWindowLeft");e.addClass(i,"LoginWindowRight");
e.addClass(i,"LoginWindowComment");e.place(g,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){this.emptyListInfo.style.display=this.unauthenticatedServices.length===0&&this.authenticatedServices.length===0?"":"none";e.empty(this.otherUnauthenticatedList);var b=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var d=true;for(var f in this.unauthenticatedServices){if(!d||!this.isEmpty(this.authenticatedServices)){var g=e.create("tr",
null,this.otherUnauthenticatedList);e.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},g)}d=false;g=e.create("tr",{className:"navTableHeading"});var j=e.create("td",null,g,"only");e.addClass(j,"LoginWindowLeft");var i=e.create("h2",null,j,"only");j=e.create("td",{style:"text-align: right"},g,"last");e.addClass(j,"LoginWindowRight");var k=this.unauthenticatedServices[f].authService;
if(k)if(k.getAuthForm)e.hitch(b,function(v,t){k.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(w){w.indexOf("?")==-1?e.create("a",{target:"_blank",href:w+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+t,innerHTML:"Sign in"},v,"last"):e.create("a",{target:"_blank",href:w+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+t,innerHTML:"Sign in"},v,"last");if(b.unauthenticatedServices[t].label)i.innerHTML=b.unauthenticatedServices[t].label+
"<br>";i.innerHTML+=b.getHostname(w)})})(j,f);else{if(k.login){e.place(document.createTextNode(this.unauthenticatedServices[f].label?this.unauthenticatedServices[f].label:f),i,"only");var m=e.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},j,"last");e.connect(m,"onmouseover",m,function(){m.style.cursor="pointer"});e.connect(m,"onmouseout",m,function(){m.style.cursor="default"});e.connect(m,"onclick",e.hitch(b,function(v){return function(){v.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){b.isSingleService()&&
a.popup.hide&&a.popup.hide(b);a.popup.close(b)})}})(k))}}else{var o=this.unauthenticatedServices[f].SignInLocation;o.indexOf("?")==-1?e.create("a",{target:"_blank",href:o+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+f,innerHTML:"Sign in"},j,"last"):e.create("a",{target:"_blank",href:o+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+f,innerHTML:"Sign in"},j,"last");if(this.unauthenticatedServices[f].label)i.innerHTML=this.unauthenticatedServices[f].label+
"<br>";i.innerHTML+=this.getHostname(o)}e.place(g,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[f].pending){g=e.create("tr");j=e.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},g,"only");e.addClass(j,"LoginWindowLeft");e.addClass(j,"LoginWindowRight");e.create("img",{src:c.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},j,"first");e.place(g,this.otherUnauthenticatedList,"last")}}},
isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(b){for(var d in b)if(b.hasOwnProperty(d))return false;return true},length:function(b){var d=0;for(var f in b)b.hasOwnProperty(f)&&d++;return d},getHostname:function(b){var d=document.createElement("img");d.src=b;b=d.src;d.src=null;return b.match(/^(?:f|ht)tp(?:s)?:\/\/([^\/]+)/im)[1].toString()},closeDialog:function(){a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/widgets/UserMenu",["require","dojo","dijit","orion/util","dijit/Menu"],function(c,e,a){e.declare("orion.widgets.UserMenu",[a.Menu],{widgetsInTemplate:false,id:"userMenu",postCreate:function(){this.inherited(arguments)},constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+
this.length(this.authenticatedServices)>0},length:function(b){var d=0;for(var f in b)b.hasOwnProperty(f)&&d++;return d},_renderAuthenticatedService:function(b,d,f){var g=this,j=this.authenticatedServices[b].authService;if(j&&j.logout)this.addChild(new a.MenuItem({label:f?"Sign Out "+f:"Sign Out",onClick:e.hitch(this,function(i,k){return function(){i.logout().then(e.hitch(g,function(){this.addUserItem(k,i,this.authenticatedServices[k].label);localStorage.removeItem(k)}))}})(j,b)}),d)},_renderUnauthenticatedService:function(b,
d,f){var g=this,j=this.unauthenticatedServices[b].authService;if(j)if(j.getAuthForm)e.hitch(g,function(k){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;g.addChild(new a.MenuItem({label:f?"<a target='_blank' href="+m+">Sign In To "+f+"</a>":"<a target='_blank' href="+m+">Sign In</a>",onKeyDown:function(o){o.keyCode===
13&&window.open(m)},_onClick:function(o){this.getParent().onItemClick(this,o)}}),d)})})(b);else{if(j.login)this.addChild(new a.MenuItem({label:f?"Sign In To "+f:"Sign In",onClick:e.hitch(g,function(k){return function(){k.login(eclipse.globalCommandUtils.notifyAuthenticationSite)}})(j)}),d)}else{var i=this.unauthenticatedServices[b].SignInLocation;i+=i.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+b:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+
"?key="+b;this.addChild(new a.MenuItem({label:f?"<a target='_blank' href="+i+">Sign In To "+f+"</a>":"<a target='_blank' href="+i+">Sign In</a>",onKeyDown:function(k){k.keyCode===13&&window.open(i)},_onClick:function(k){this.getParent().onItemClick(this,k)}}),d)}},renderServices:function(){for(var b=this.getChildren(),d=0;d<b.length;d++)this.removeChild(b[d]);if(this.isSingleService())for(d in this.authenticatedServices)this._renderAuthenticatedService(d,0);this.addChild(new a.MenuItem({label:"<a href="+
c.toUrl("settings/settings.html")+">Settings</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=c.toUrl("settings/settings.html")},_onClick:function(f){this.getParent().onItemClick(this,f)}}));this.addChild(new a.MenuItem({label:"<a href="+c.toUrl("operations/list.html")+">Background Operations</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=c.toUrl("operations/list.html")},_onClick:function(f){this.getParent().onItemClick(this,f)}}));this.addChild(new a.MenuSeparator);this.addChild(new a.MenuItem({label:"<a href="+
c.toUrl("help/index.jsp")+">Help</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=c.toUrl("help/index.jsp")},_onClick:function(f){this.getParent().onItemClick(this,f)}}));this.keyAssistFunction&&this.addChild(new a.MenuItem({label:"Keyboard Help",onClick:this.keyAssistFunction}));this.addChild(new a.MenuItem({label:"<a href='"+c.toUrl("help/about.html")+"'>About Orion</a>",onKeyDown:function(f){if(f.keyCode===13)window.location=c.toUrl("help/about.html")},_onClick:function(f){this.getParent().onItemClick(this,
f)}}))},getUserLabel:function(b){if(b.data){var d=b.data.Name&&b.data.Name.replace(/^\s+|\s+$/g,"")!==""?b.data.Name:b.data.login;if(d.length>40)d=d.substring(0,30)+"...";d+=" ("+b.label+")";return d}else return b.label},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,d,f,g){var j=this;if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:d,label:f,data:g}}else{this.authenticatedServices[b]&&
delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:d,label:f,pending:this.unauthenticatedServices[b].pending}:{authService:d,label:f}}e.hitch(this,this.renderServices)();if(e.byId("userInfo"))if(this.isSingleService()&&g){f=b=g.Name&&g.Name.replace(/^\s+|\s+$/g,"")!==""?g.Name:g.login;if(f.length>40)f=f.substring(0,30)+"...";e.create("a",{innerHTML:f,href:c.toUrl("profile/user-profile.html")+"#"+g.Location,title:"View profile of "+b,style:"margin-right: 0px"},
e.byId("userInfo"),"only")}else if(this.isSingleService()&&!g)if(d.getAuthForm)e.hitch(this,function(k){d.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;e.create("a",{innerHTML:"Sign In",href:m,title:"Sign In",style:"margin-right: 0px",target:"_blank"},e.byId("userInfo"),"only")})})(b);else{if(d.login){var i=
e.create("a",{innerHTML:"Sign In",title:"Sign In",style:"margin-right: 0px"},e.byId("userInfo"),"only");e.connect(i,"onmouseover",i,function(){i.style.cursor="pointer"});e.connect(i,"onmouseout",i,function(){i.style.cursor="default"});e.connect(i,"onclick",function(){d.login(eclipse.globalCommandUtils.notifyAuthenticationSite)})}}else if(this.hasServices()){i=e.create("a",{innerHTML:"Profiles",style:"margin-right: 0px"},e.byId("userInfo"),"only");e.connect(i,"onmouseover",i,function(){i.style.cursor=
"pointer"});e.connect(i,"onmouseout",i,function(){i.style.cursor="default"});e.connect(i,"onclick",function(){try{a.popup.open({popup:j.options.loginDialog,around:e.byId("userInfo")})}catch(k){}a.focus(j.options.loginDialog.domNode)})}else e.empty(e.byId("userInfo"))}})});
define("orion/globalCommands",["require","dojo","dijit","orion/commonHTMLFragments","orion/commands","orion/parameterCollectors","orion/extensionCommands","orion/util","orion/textview/keyBinding","orion/favorites","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog","orion/widgets/LoginDialog","orion/widgets/UserMenu"],function(c,e,a,b,d,f,g,j,i,k){function m(L){var R=document.createElement("a");R.href=L;return R.href}function o(L,R){if(L.getLabel)return L.getLabel();
else{L=new e.Deferred;L.callback(R.properties.name);return L}}function v(){return E}function t(L){(L=L.getService("orion.page.progress"))&&e.hitch(L,L.init)("progressPane")}function w(L){var R=L.getServiceReferences("orion.core.auth");E=[];var T=e.byId("userMenu");if(T){if(!a.byId("logins")){var C=new a.form.DropDownButton({id:"logins",dropDown:z,label:"Options",showLabel:false,alt:"Options"});e.place(C.domNode,T,"only");C.valueNode&&e.destroy(C.valueNode)}for(T=0;T<R.length;T++){C=R[T];var F=L.getService(C);
e.hitch(this,function(K,P){o(K,P).then(function(V){K.getKey().then(function(X){E.push(X);K.getUser().then(function(Y){B.addUserItem(X,K,V,Y);z.addUserItem(X,K,V,Y)},function(){B.addUserItem(X,K,V);z.addUserItem(X,K,V,jsonData)});window.addEventListener("storage",function(){if(y[X]!==localStorage.getItem(X)){y[X]=localStorage.getItem(X);K.getUser().then(function(Y){B.addUserItem(X,K,V,Y);z.addUserItem(X,K,V,Y)},function(){B.addUserItem(X,K,V);z.addUserItem(X,K,V)})}},false)})})})(F,C)}}}function u(L){B.setPendingAuthentication(L);
var R;for(R in L)if(L.hasOwnProperty(R)){if(e.byId("userInfo").innerHTML)try{a.popup.open({popup:B,around:e.byId("userInfo")})}catch(T){}else window.setTimeout(function(){try{a.popup.open({popup:B,around:e.byId("userInfo")})}catch(C){}},500);return}a.popup.hide&&a.popup.hide(B);a.popup.close(B)}function s(L){B.authenticatedService(L)}function q(L,R,T,C,F,K,P){L.closeParameterCollector();if(K=e.byId("pageActions")){e.empty(K);(K=L.renderCommands(K,"dom",T||R,R,"button"))&&K.then?K.then(function(){L.processURL(window.location.href)}):
L.processURL(window.location.href)}if(!P)if(K=e.byId("pageNavigationActions")){e.empty(K);L.renderCommands(K,"dom",F||T||R,C||R,"button")}}function x(){if(e.byId("relatedLinks")){if(G){G.focusedChild=null;e.forEach(G.getChildren(),function(L){G.removeChild(L);L.destroy()});G.destroy()}return G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"})}}function A(L,R){G||(G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"}));L._addMenuItem(G,R);L=a.byId("related");if((R=e.byId("relatedLinks"))&&
!L){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:G});e.place(L.domNode,R,"only");j.forceLayout(R)}}function D(L,R,T,C,F){var K=L.getServiceReferences("orion.page.link.related");if(!(K.length<=0)){var P=e.byId("relatedLinks");if(P){for(var V=x(),X=false,Y=0;Y<K.length;Y++){for(var ia={},ba=K[Y].getPropertyNames(),ja=0;ja<ba.length;ja++)ia[ba[ja]]=K[Y].getProperty(ba[ja]);if(ia.id)if(e.indexOf(T,ia.id)<0){ba=C.findCommand(ia.id);if(!ba){var ha=L.getServiceReferences("orion.navigate.command");
for(ja=0;ja<ha.length;ja++)if(ha[ja].getProperty("id")===ia.id){ia={};ba=ha[ja].getPropertyNames();for(var ka=0;ka<ba.length;ka++)ia[ba[ka]]=ha[ja].getProperty(ba[ka]);ja=g._createCommandOptions(ia,ha[ja],L,true);ba=new d.Command(ja);break}}if(ba)if(!ba.visibleWhen||ba.visibleWhen(R)){X=true;ja=new d.CommandInvocation(C,R,R,null,ba);ba._addMenuItem(V,ja)}else typeof F==="function"&&window.setTimeout(e.hitch(ba,function(){e.when(F(),e.hitch(this,function(na){na&&R===M&&this.visibleWhen(na)&&A(this,
new d.CommandInvocation(C,na,na,null,this))}))}),0)}}(L=a.byId("related"))&&L.destroy();if(X){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:V});e.place(L.domNode,P,"only")}j.forceLayout(P)}}}function h(L,R,T){var C=e.byId("globalActions");if(C){e.empty(C);T=(T=e.isArray(T)?T[0]:T)||R||{};L.renderCommands(C,"global",T,R,"tool")}}function l(L){H=L}function n(L,R,T,C,F){M=L;D(R,L,H,T,C);N=F}function p(L,R,T,C,F,K,P,V){function X(){var I=R.getService("orion.core.favorite");
if(!I){I=new k.FavoritesService({serviceRegistry:R});I=R.getService("orion.core.favorite")}if(N&&N.Location)I.hasFavorite(N.ChildrenLocation||N.Location).then(function(Q){if(Q)R.getService("orion.page.message").setMessage(N.Name+" is already a favorite.",2E3);else{I.makeFavorites([N]);R.getService("orion.page.message").setMessage(N.Name+" has been added to the favorites list.",2E3)}});else{var O=window.location.pathname+window.location.hash;I.hasFavorite(O).then(function(Q){if(Q)R.getService("orion.page.message").setMessage(O+
" is already a favorite.",2E3);else{I.addFavoriteUrl(O);R.getService("orion.page.message").setMessage(O+" has been added to the favorites list.",2E3)}})}}var Y,ia=e.byId(L);if(!ia)throw"could not find banner parent, id was "+L;e.place(b.topHTMLFragment,ia,"only");if(L=e.byId("pageToolbar")){e.place(b.toolbarHTMLFragment,L,"only");e.addClass(L,"toolComposite")}else{L=e.create("div",{id:"pageToolbar","class":"toolbar toolComposite layoutBlock"},"titleArea","after");e.place(b.toolbarHTMLFragment,L,"only")}T.setParameterCollector(new f.CommandParameterCollector);
e.place('<div id="keyAssist" style="display: none" class="keyAssistFloat" role="list" aria-atomic="true" aria-live="assertive"></div>',document.body,"last");if(L=e.byId("primaryNav")){C=R.getServiceReferences("orion.page.link");for(var ba=0;ba<C.length;ba++){Y={};for(var ja=C[ba].getPropertyNames(),ha=0;ha<ja.length;ha++)Y[ja[ha]]=C[ba].getProperty(ja[ha]);if(Y.href&&Y.name){ja=e.create("a",{href:Y.href},L,"last");Y=document.createTextNode(Y.name);e.place(Y,ja,"only")}}}var ka=e.byId("search");if(!ka)throw"failed to generate HTML for banner";
e.connect(ka,"onkeypress",function(I){if(I.charOrCode===e.keys.ENTER)if(F){if(ka.value.length>0){I=F.createSearchQuery(ka.value);window.location=c.toUrl("search/search.html")+"#"+I}}else window.alert("Can't search: no search service is available")});if(L=e.byId("pageTitle")){Y=document.createTextNode(document.title);e.place(Y,L,"last")}if(L=e.byId("pageFavorite")){e.addClass(L,"commandButton");e.connect(L,"onclick",this,function(){X()});e.connect(L,"onkeypress",this,function(I){if(I.keyCode===e.keys.ENTER||
I.keyCode===e.keys.SPACE)X()});e.connect(L,"onmouseover",L,function(){e.addClass(this,"commandButtonOver")});e.connect(L,"onfocus",L,function(){e.addClass(this,"commandButtonOver")});e.connect(L,"onmouseout",L,function(){e.removeClass(this,"commandButtonOver")});e.connect(L,"onblur",L,function(){e.removeClass(this,"commandButtonOver")});new d.CommandTooltip({connectId:[L],label:"Add this page to the favorites list",position:["below","left","right","above"],commandParent:ia,commandService:T})}L=new d.Command({name:"Make Favorite",
tooltip:"Add to the favorites list",imageClass:"core-sprite-makeFavorite",id:"orion.makeFavorite",visibleWhen:function(I){I=e.isArray(I)?I:[I];for(var O=0;O<I.length;O++)if(!I[O].Location)return false;return true},callback:function(I){I=e.isArray(I.items)?I.items:[I.items];for(var O=R.getService("orion.core.favorite"),Q=function(fa){return function(S){S?R.getService("orion.page.message").setMessage(fa.Name+" is already a favorite.",2E3):O.makeFavorites(fa)}},U=0;U<I.length;U++){var Z=I[U];O.hasFavorite(Z.ChildrenLocation||
Z.Location).then(Q(Z))}}});T.addCommand(L,"dom");var na=function(I,O,Q){var U=O.getService("orion.core.favorite");if(!U){U=new k.FavoritesService({serviceRegistry:O});U=O.getService("orion.core.favorite")}var Z=new orion.widgets.OpenResourceDialog({searcher:I,searchRenderer:I.defaultRenderer,favoriteService:U});Q&&e.connect(Z,"onHide",function(){Q.getTextView().focus()});window.setTimeout(function(){Z.show()},0)};L=new d.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",
id:"eclipse.openResource",callback:function(){na(F,R,P)}});if(P){P.getTextView().setKeyBinding(new i.KeyBinding("f",true,true,false),"Find File Named...");P.getTextView().setAction("Find File Named...",function(){na(F,R,P);return true})}T.addCommand(L,"global");T.registerCommandContribution("eclipse.openResource",100,"globalActions",null,true,new d.CommandKeyBinding("f",true,true));L=new d.Command({name:"Toggle banner and footer",tooltip:"Hide or show the page banner and footer",id:"orion.toggleTrim",
callback:function(){var I=a.byId(ia.parentNode.id);if(I){var O=e.byId("footer");if(ia.style.display==="none"){ia.style.display="block";O.style.display="block"}else{ia.style.display="none";O.style.display="none"}I.layout()}return true}});T.addCommand(L,"global");T.registerCommandContribution("orion.toggleTrim",100,"globalActions",null,true,new d.CommandKeyBinding("m",true,true));if(P){P.getTextView().setKeyBinding(new d.CommandKeyBinding("m",true,true),"Toggle Trim");P.getTextView().setAction("Toggle Trim",
L.callback)}var J=e.byId("keyAssist");e.connect(document,"onkeypress",e.hitch(this,function(I){if(I.charOrCode===e.keys.ESCAPE)J.style.display="none"}));e.connect(document,"onclick",e.hitch(this,function(I){if((I=I.target||I.originalTarget||I.srcElement)&&I.id!=="keyAssist")J.style.display="none"}));P&&P.getTextView().addEventListener("MouseDown",function(){J.style.display="none"});V&&V.addHandler({isActive:function(){return J.style.display==="block"},cancel:function(){if(this.isActive()){J.style.display=
"none";return true}return false}});V=new d.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){if(J.style.display==="none"){e.empty(J);if(P){e.place("<h2>Editor</h2>",J,"last");for(var I=P.getTextView().getActions(false),O=0;O<I.length;O++)for(var Q=I[O],U=P.getTextView().getKeyBindings(Q),Z=0;Z<U.length;Z++)e.place('<span role="listitem">'+j.getUserKeyString(U[Z])+" = "+Q+"<br></span>",J,"last")}e.place("<h2>Global</h2>",
J,"last");T.showKeyBindings(J);J.style.display="block"}else J.style.display="none";return true}});T.addCommand(V,"global");T.registerCommandContribution("eclipse.keyAssist",100,"globalActions",null,true,new d.CommandKeyBinding(191,false,true));if(P){L=window.navigator.platform.indexOf("Mac")!==-1;P.getTextView().setKeyBinding(new d.CommandKeyBinding(191,false,true,!L,L),"Show Keys");P.getTextView().setAction("Show Keys",V.callback)}z.setKeyAssist(V.callback);h(T,K,M);if(e.indexOf(H,"eclipse.openWith")<
0)(K=R.getService("orion.file.contenttypes"))&&K.getContentTypesMap().then(function(I){I=g._createOpenWithCommands(R,I);for(var O=0;O<I.length;O++){var Q=I[O].properties,U=g._createCommandOptions(Q,I[O].service,R,true);U=new d.Command(U);U.isEditor=Q.isEditor;T.addCommand(U,"object");T.addCommandGroup("eclipse.openWith",1E3,"Open With");T.registerCommandContribution(U.id,O,null,"eclipse.openWith")}});w(R);if(b.bottomHTMLFragment)(K=e.byId("footer"))&&e.place(b.bottomHTMLFragment,K,"only");t(R);j.forceLayout(ia.parentNode);
e.subscribe("/dojo/hashchange",T,function(){T.processURL(window.location.href)})}var r=m(c.toUrl("auth/NotifyAuthentication.html")),y={},B=new orion.widgets.LoginDialog,z=new orion.widgets.UserMenu({loginDialog:B}),E=[],G,M,H=[],N=null;return{generateUserInfo:w,generateRelatedLinks:D,generateDomCommandsInBanner:q,generateBanner:p,notifyAuthenticationSite:r,setPendingAuthentication:u,getAuthenticationIds:v,setPageTarget:n,setPageCommandExclusions:l,authenticatedService:s}});
define("dojo/date",["dojo"],function(c){c.getObject("date",true,c);c.date.getDaysInMonth=function(e){var a=e.getMonth();if(a==1&&c.date.isLeapYear(e))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};c.date.isLeapYear=function(e){e=e.getFullYear();return!(e%400)||!(e%4)&&!!(e%100)};c.date.getTimezoneName=function(e){var a=e.toString(),b="",d=a.indexOf("(");if(d>-1)b=a.substring(++d,a.indexOf(")"));else{d=/([A-Z\/]+) \d{4}$/;if(a=a.match(d))b=a[1];else{a=e.toLocaleString();d=/ ([A-Z\/]+)$/;
if(a=a.match(d))b=a[1]}}return b=="AM"||b=="PM"?"":b};c.date.compare=function(e,a,b){e=new Date(+e);a=new Date(+(a||new Date));if(b=="date"){e.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(b=="time"){e.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(e>a)return 1;if(e<a)return-1;return 0};c.date.add=function(e,a,b){var d=new Date(+e),f=false,g="Date";switch(a){case "day":break;case "weekday":var j;if(a=b%5){a=a;j=parseInt(b/5)}else{a=b>0?5:-5;j=b>0?(b-5)/5:(b+5)/5}var i=e.getDay(),k=0;if(i==6&&b>0)k=1;
else if(i==0&&b<0)k=-1;i=i+a;if(i==0||i==6)k=b>0?2:-2;b=7*j+a+k;break;case "year":g="FullYear";f=true;break;case "week":b*=7;break;case "quarter":b*=3;case "month":f=true;g="Month";break;default:g="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}g&&d["set"+g](d["get"+g]()+b);f&&d.getDate()<e.getDate()&&d.setDate(0);return d};c.date.difference=function(e,a,b){a=a||new Date;b=b||"day";var d=a.getFullYear()-e.getFullYear(),f=1;switch(b){case "quarter":e=e.getMonth();a=a.getMonth();e=Math.floor(e/3)+
1;a=Math.floor(a/3)+1;a+=d*4;f=a-e;break;case "weekday":d=Math.round(c.date.difference(e,a,"day"));b=parseInt(c.date.difference(e,a,"week"));f=d%7;if(f==0)d=b*5;else{var g=0,j=e.getDay();a=a.getDay();b=parseInt(d/7);f=d%7;e=new Date(e);e.setDate(e.getDate()+b*7);e=e.getDay();if(d>0)switch(true){case j==6:g=-1;break;case j==0:g=0;break;case a==6:g=-1;break;case a==0:g=-2;break;case e+f>5:g=-2}else if(d<0)switch(true){case j==6:g=0;break;case j==0:g=1;break;case a==6:g=2;break;case a==0:g=1;break;case e+
f<0:g=2}d+=g;d-=b*2}f=d;break;case "year":f=d;break;case "month":f=a.getMonth()-e.getMonth()+d*12;break;case "week":f=parseInt(c.date.difference(e,a,"day")/7);break;case "day":f/=24;case "hour":f/=60;case "minute":f/=60;case "second":f/=1E3;case "millisecond":f*=a.getTime()-e.getTime()}return Math.round(f)};return c.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(c){c.getObject("cldr.supplemental",true,c);c.cldr.supplemental.getFirstDayOfWeek=function(e){e={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[c.cldr.supplemental._region(e)];return e===undefined?
1:e};c.cldr.supplemental._region=function(e){e=c.i18n.normalizeLocale(e);e=e.split("-");var a=e[1];if(a){if(a.length==4)a=e[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[e[0]];return a};c.cldr.supplemental.getWeekend=function(e){var a=c.cldr.supplemental._region(e);e={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(e===undefined)e=6;if(a===undefined)a=0;return{start:e,end:a}};return c.cldr.supplemental});
define("dojo/cldr/nls/gregorian",{root:{"months-format-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d",eraNarrow:["BCE","CE"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateTimeFormat-medium":"{1} {0}",
"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","field-era":"Era","dateFormatItem-yM":"y-M","months-standAlone-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q",
"dateTimeFormats-appendItem-Era":"{0} {1}","field-hour":"Hour","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","dateFormatItem-H":"HH","months-standAlone-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L",
"days-standAlone-wide":["1","2","3","4","5","6","7"],"timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["BCE","CE"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"Yesterday","dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM",
"dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","field-day":"Day","days-format-wide":["1","2","3","4","5","6","7"],"field-zone":"Zone","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1",
"2","3","4","5","6","7"],eraNames:["BCE","CE"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","field-month":"Month","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","field-second":"Second","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}",
"field-week":"Week","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-ca":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true,"zh-tw":true});
define("dojo/cldr/nls/en/gregorian",{"dateFormatItem-yM":"M/y","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q y","dayPeriods-format-wide-pm":"PM","field-minute":"Minute",eraNames:["Before Christ","Anno Domini"],"dateFormatItem-MMMEd":"E, MMM d","dateTimeFormat-full":"{1} {0}","field-day-relative+-1":"Yesterday","field-weekday":"Day of the Week","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yQQQ":"QQQ y","days-standAlone-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dateFormatItem-MMM":"LLL","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateTimeFormat-short":"{1} {0}","field-era":"Era","field-hour":"Hour","dayPeriods-format-wide-am":"AM","dateTimeFormat-medium":"{1} {0}","dateFormatItem-y":"y","timeFormat-full":"h:mm:ss a zzzz","months-standAlone-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormatItem-yMMM":"MMM y","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","days-standAlone-narrow":["S",
"M","T","W","T","F","S"],eraAbbr:["BC","AD"],"dateFormat-long":"MMMM d, y","timeFormat-medium":"h:mm:ss a","dateFormatItem-EEEd":"d EEE","field-zone":"Zone","dateFormatItem-Hm":"HH:mm","dateFormat-medium":"MMM d, y","dateFormatItem-Hms":"HH:mm:ss","quarters-standAlone-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"dateFormatItem-ms":"mm:ss","field-year":"Year","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","field-week":"Week","months-standAlone-wide":["January",
"February","March","April","May","June","July","August","September","October","November","December"],"dateFormatItem-MMMd":"MMM d","timeFormat-long":"h:mm:ss a z","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayPeriods-format-wide-noon":"noon","timeFormat-short":"h:mm a","field-month":"Month","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormatItem-M":"L","days-format-narrow":["S",
"M","T","W","T","F","S"],"field-second":"Second","field-day":"Day","dateFormatItem-MEd":"E, M/d","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-hm":"h:mm a","days-standAlone-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormat-short":"M/d/yy","dateFormatItem-yMMMEd":"EEE, MMM d, y","dateFormat-full":"EEEE, MMMM d, y","dateFormatItem-Md":"M/d","dateFormatItem-yMEd":"EEE, M/d/y","months-format-wide":["January","February","March","April","May","June",
"July","August","September","October","November","December"],"dateFormatItem-d":"d","quarters-format-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eraNarrow:["B","A"]});
define("dojo/date/locale",["dojo","dojo/date","dojo/cldr/supplemental","dojo/regexp","dojo/string","dojo/i18n","i18n!dojo/cldr/nls/gregorian"],function(c){c.getObject("date.locale",true,c);(function(){function e(d,f,g,j){return j.replace(/([a-z])\1*/ig,function(i){var k,m,o=i.charAt(0);i=i.length;var v=["abbr","wide","narrow"];switch(o){case "G":k=f[i<4?"eraAbbr":"eraNames"][d.getFullYear()<0?0:1];break;case "y":k=d.getFullYear();switch(i){case 1:break;case 2:if(!g.fullYear){k=String(k);k=k.substr(k.length-
2);break}default:m=true}break;case "Q":case "q":k=Math.ceil((d.getMonth()+1)/3);m=true;break;case "M":k=d.getMonth();if(i<3){k=k+1;m=true}else{o=["months-format",v[i-3]].join("-");k=f[o][k]}break;case "w":k=c.date.locale._getWeekOfYear(d,0);m=true;break;case "d":k=d.getDate();m=true;break;case "D":k=c.date.locale._getDayOfYear(d);m=true;break;case "E":k=d.getDay();if(i<3){k=k+1;m=true}else{o=["days-format",v[i-3]].join("-");k=f[o][k]}break;case "a":k=d.getHours()<12?"am":"pm";k=g[k]||f["dayPeriods-format-wide-"+
k];break;case "h":case "H":case "K":case "k":m=d.getHours();switch(o){case "h":k=m%12||12;break;case "H":k=m;break;case "K":k=m%12;break;case "k":k=m||24;break}m=true;break;case "m":k=d.getMinutes();m=true;break;case "s":k=d.getSeconds();m=true;break;case "S":k=Math.round(d.getMilliseconds()*Math.pow(10,i-3));m=true;break;case "v":case "z":if(k=c.date.locale._getZone(d,true,g))break;i=4;case "Z":k=c.date.locale._getZone(d,false,g);k=[k<=0?"+":"-",c.string.pad(Math.floor(Math.abs(k)/60),2),c.string.pad(Math.abs(k)%
60,2)];if(i==4){k.splice(0,0,"GMT");k.splice(3,0,":")}k=k.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+j);}if(m)k=c.string.pad(k,i);return k})}function a(d,f,g,j){var i=function(o){return o};f=f||i;g=g||i;j=j||i;var k=d.match(/(''|[^'])+/g),m=d.charAt(0)=="'";c.forEach(k,function(o,v){if(o){k[v]=(m?g:f)(o.replace(/''/g,"'"));m=!m}else k[v]=""});return j(k.join(""))}function b(d,f,g,j){j=c.regexp.escapeString(j);g.strict||(j=j.replace(" a"," ?a"));return j.replace(/([a-z])\1*/ig,
function(i){var k;k=i.charAt(0);var m=i.length,o="",v="";if(g.strict){if(m>1)o="0{"+(m-1)+"}";if(m>2)v="0{"+(m-2)+"}"}else{o="0?";v="0{0,2}"}switch(k){case "y":k="\\d{2,4}";break;case "M":k=m>2?"\\S+?":"1[0-2]|"+o+"[1-9]";break;case "D":k="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+v+"[1-9][0-9]|"+o+"[1-9]";break;case "d":k="3[01]|[12]\\d|"+o+"[1-9]";break;case "w":k="[1-4][0-9]|5[0-3]|"+o+"[1-9]";break;case "E":k="\\S+";break;case "h":k="1[0-2]|"+o+"[1-9]";break;case "k":k="1[01]|"+o+"\\d";break;case "H":k=
"1\\d|2[0-3]|"+o+"\\d";break;case "K":k="1\\d|2[0-4]|"+o+"[1-9]";break;case "m":case "s":k="[0-5]\\d";break;case "S":k="\\d{"+m+"}";break;case "a":m=g.am||f["dayPeriods-format-wide-am"];o=g.pm||f["dayPeriods-format-wide-pm"];k=m+"|"+o;if(!g.strict){if(m!=m.toLowerCase())k+="|"+m.toLowerCase();if(o!=o.toLowerCase())k+="|"+o.toLowerCase();if(k.indexOf(".")!=-1)k+="|"+k.replace(/\./g,"")}k=k.replace(/\./g,"\\.");break;default:k=".*"}d&&d.push(i);return"("+k+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}c.date.locale._getZone=
function(d,f){return f?c.date.getTimezoneName(d):d.getTimezoneOffset()};c.date.locale.format=function(d,f){f=f||{};var g=c.i18n.normalizeLocale(f.locale),j=f.formatLength||"short";g=c.date.locale._getGregorianBundle(g);var i=[];d=c.hitch(this,e,d,g,f);if(f.selector=="year")return a(g["dateFormatItem-yyyy"]||"yyyy",d);var k;if(f.selector!="date")(k=f.timePattern||g["timeFormat-"+j])&&i.push(a(k,d));if(f.selector!="time")(k=f.datePattern||g["dateFormat-"+j])&&i.push(a(k,d));return i.length==1?i[0]:
g["dateTimeFormat-"+j].replace(/\{(\d+)\}/g,function(m,o){return i[o]})};c.date.locale.regexp=function(d){return c.date.locale._parseInfo(d).regexp};c.date.locale._parseInfo=function(d){d=d||{};var f=c.i18n.normalizeLocale(d.locale);f=c.date.locale._getGregorianBundle(f);var g=d.formatLength||"short",j=d.datePattern||f["dateFormat-"+g],i=d.timePattern||f["timeFormat-"+g];g=d.selector=="date"?j:d.selector=="time"?i:f["dateTimeFormat-"+g].replace(/\{(\d+)\}/g,function(m,o){return[i,j][o]});var k=[];
return{regexp:a(g,c.hitch(this,b,k,f,d)),tokens:k,bundle:f}};c.date.locale.parse=function(d,f){var g=/[\u200E\u200F\u202A\u202E]/g,j=c.date.locale._parseInfo(f),i=j.tokens,k=j.bundle;d=(new RegExp("^"+j.regexp.replace(g,"")+"$",j.strict?"":"i")).exec(d&&d.replace(g,""));if(!d)return null;var m=["abbr","wide","narrow"],o=[1970,0,1,0,0,0,0],v="";d=c.every(d,function(w,u){if(!u)return true;u=i[u-1];var s=u.length;switch(u.charAt(0)){case "y":if(s!=2&&f.strict)o[0]=w;else if(w<100){w=Number(w);s=""+(new Date).getFullYear();
u=s.substring(0,2)*100;s=Math.min(Number(s.substring(2,4))+20,99);o[0]=w<s?u+w:u-100+w}else{if(f.strict)return false;o[0]=w}break;case "M":if(s>2){u=k["months-format-"+m[s-3]].concat();if(!f.strict){w=w.replace(".","").toLowerCase();u=c.map(u,function(x){return x.replace(".","").toLowerCase()})}w=c.indexOf(u,w);if(w==-1)return false}else w--;o[1]=w;break;case "E":case "e":u=k["days-format-"+m[s-3]].concat();if(!f.strict){w=w.toLowerCase();u=c.map(u,function(x){return x.toLowerCase()})}w=c.indexOf(u,
w);if(w==-1)return false;break;case "D":o[1]=0;case "d":o[2]=w;break;case "a":u=f.am||k["dayPeriods-format-wide-am"];s=f.pm||k["dayPeriods-format-wide-pm"];if(!f.strict){var q=/\./g;w=w.replace(q,"").toLowerCase();u=u.replace(q,"").toLowerCase();s=s.replace(q,"").toLowerCase()}if(f.strict&&w!=u&&w!=s)return false;v=w==s?"p":w==u?"a":"";break;case "K":if(w==24)w=0;case "h":case "H":case "k":if(w>23)return false;o[3]=w;break;case "m":o[4]=w;break;case "s":o[5]=w;break;case "S":o[6]=w}return true});
g=+o[3];if(v==="p"&&g<12)o[3]=g+12;else if(v==="a"&&g==12)o[3]=0;g=new Date(o[0],o[1],o[2],o[3],o[4],o[5],o[6]);f.strict&&g.setFullYear(o[0]);var t=i.join("");j=t.indexOf("d")!=-1;t=t.indexOf("M")!=-1;if(!d||t&&g.getMonth()>o[1]||j&&g.getDate()>o[2])return null;if(t&&g.getMonth()<o[1]||j&&g.getDate()<o[2])g=c.date.add(g,"hour",1);return g}})();(function(){var e=[];c.date.locale.addCustomFormats=function(a,b){e.push({pkg:a,name:b})};c.date.locale._getGregorianBundle=function(a){var b={};c.forEach(e,
function(d){d=c.i18n.getLocalization(d.pkg,d.name,a);b=c.mixin(b,d)},this);return b}})();c.date.locale.addCustomFormats("dojo.cldr","gregorian");c.date.locale.getNames=function(e,a,b,d){var f;d=c.date.locale._getGregorianBundle(d);e=[e,b,a];if(b=="standAlone"){b=e.join("-");f=d[b];if(f[0]==1)f=undefined}e[1]="format";return(f||d[e.join("-")]).concat()};c.date.locale.isWeekend=function(e,a){a=c.cldr.supplemental.getWeekend(a);e=(e||new Date).getDay();if(a.end<a.start){a.end+=7;if(e<a.start)e+=7}return e>=
a.start&&e<=a.end};c.date.locale._getDayOfYear=function(e){return c.date.difference(new Date(e.getFullYear(),0,1,e.getHours()),e)+1};c.date.locale._getWeekOfYear=function(e,a){if(arguments.length==1)a=0;var b=(new Date(e.getFullYear(),0,1)).getDay(),d=(b-a+7)%7;d=Math.floor((c.date.locale._getDayOfYear(e)+d-1)/7);b==a&&d++;return d};return c.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(c,e,a){function b(g,j){if(g.status===403){if(typeof d==="undefined")d=new e.Dialog({title:"Forbidden access"});var i=g.message;if(g.responseText)i=JSON.parse(g.responseText).Message||g.message;d.set("content",i);d.show()}else if(g.status===401)try{var k=JSON.parse(g.responseText);if(!k.SignInKey)return k;var m=localStorage.getItem(k.SignInKey),o=function(){var w=localStorage.getItem(k.SignInKey);
if(m!==w){window.removeEventListener("storage",o,false);delete f[k.SignInKey];a.setPendingAuthentication(f);a.authenticatedService(k.SignInKey);j&&j()}};window.addEventListener("storage",o,false);if(k.SignInKey){f[k.SignInKey]=k;a.setPendingAuthentication(f)}}catch(v){}else try{return JSON.parse(g.responseText)}catch(t){return{Message:g.Message,HttpCode:g.status}}}var d,f={};c.addOnLoad(function(){window.dojo=c;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:b}});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(c,e,a){function b(k,m){this._name=k;this._providers=m;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function d(k,m){return{get:function(o,v){if(m===0)return null;o=localStorage.getItem(k+o);if(o===null)return null;o=JSON.parse(o);if(v||m===-1||o._expires&&o._expires>(new Date).getTime()){delete o._expires;return o}return null},set:function(o,v){if(m!==0){if(m!==-1)v._expires=(new Date).getTime()+
1E3*m;if(Object.keys(v).length===0)localStorage.removeItem(k+o);else{var t=JSON.stringify(v);localStorage.setItem(k+o,t);delete v._expires}}},remove:function(o){localStorage.removeItem(k+o)}}}function f(k){this._currentPromises={};this._cache=new d("/orion/preferences/user",0);this._service=null;this.available=function(){if(!this._service){var m=k.getServiceReferences("orion.core.preference.provider");if(m.length>0)this._service=k.getService(m[0])}return!!this._service}}function g(k){this._location=
k;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function j(){this._cache=new d("/orion/preferences/local",-1)}function i(k,m){this._userProvider=new f(k);this._localProvider=new j;m=m||"defaults.pref";if(m.indexOf("://")===-1)m=c.toUrl(m);this._defaultsProvider=new g(m);this._serviceRegistration=k.registerService("orion.core.preference",this)}b.prototype={_flush:function(){for(var k=[],m=0;m<this._stores.length;++m){var o=this._stores[m];this._dirty.indexOf(o)!==-1&&
k.push(this._providers[m].put(this._name,o))}this._dirty=[];return new e.DeferredList(k)},_scheduleFlush:function(k){this._dirty.indexOf(k)===-1&&this._dirty.push(k);if(!this._flushPending){this._flushPending=true;window.setTimeout(e.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var k=0;k<this._stores.length;++k){var m=this._stores[k];for(var o in m)if(m.hasOwnProperty(o)&&typeof this._cached[o]===
"undefined")this._cached[o]=m[o]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(k){return this._getCached()[k]},put:function(k,m){if(this._stores.length!==0){var o=this._stores[0];if(o[k]!==m){o[k]=m;this._cached=null;this._scheduleFlush(o)}}},remove:function(k){for(var m=0;m<this._stores.length;++m){var o=this._stores[m];if(o.hasOwnProperty(k)){delete o[k];this._cached=null;this._scheduleFlush(o);return true}}return false},clear:function(){for(var k=0;k<
this._stores.length;++k){this._stores[k]={};this._scheduleFlush(this._stores[k])}this._cached=null},sync:function(k){if(this._flushPending){this._flushPending=false;return this._flush()}for(var m=this,o=[],v=0;v<this._providers.length;++v)o.push(this._providers[v].get(this._name,k).then(function(t){return function(w){m._stores[t]=w}}(v)));return(new e.DeferredList(o)).then(function(){m._cached=null;m._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(k,m){if(this._currentPromises[k])return this._currentPromises[k];
var o=new e.Deferred,v=null;if(m)this._cache.remove(k);else v=this._cache.get(k);if(v!==null)o.resolve(v);else{this._currentPromises[k]=o;var t=this;this._service.get(k).then(function(w){t._cache.set(k,w);delete t._currentPromises[k];o.resolve(w)},function(w){if(w.status===401){delete t._currentPromises[k];o.resolve({});a.handleAuthenticationError(w,function(){t.get(k)})}else if(w.status===404){w={};t._cache.set(k,w);delete t._currentPromises[k];o.resolve(w)}else{delete t._currentPromises[k];o.resolve(t._cache.get(k,
true)||{})}})}return o},put:function(k,m){var o=new e.Deferred;this._cache.set(k,m);var v=this;this._service.put(k,m).then(function(){o.resolve()},function(t){t.status===401?a.handleAuthenticationError(t,function(){v._service.put(k,m).then(function(){o.resolve()},function(){o.resolve()})}):o.resolve()});return o}};g.prototype={get:function(k,m){if(this._currentPromise)return this._currentPromise;var o=new e.Deferred,v=null;if(m)this._cache.remove(k);else v=this._cache.get(k);if(v!==null)o.resolve(v);
else{this._currentPromise=o;var t=this;e.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(w){t._cache.set(k,w[k]||{});t._currentPromise=null;o.resolve(w[k]||{})},error:function(w,u){if(u.xhr.status===401){t._currentPromise=null;o.resolve({});o=new e.Deferred;t._currentPromise=o;var s=this;a.handleAuthenticationError(u.xhr,function(){e.xhrGet(s)})}else if(u.xhr.status===404){t._cache.set(k,{});t._currentPromise=null;o.resolve({})}else{t._currentPromise=
null;w=t._cache.get(k,true);w!==null?o.resolve(w[k]||{}):o.resolve({})}}})}return o},put:function(){var k=new e.Deferred;k.resolve();return k}};j.prototype={get:function(k){var m=new e.Deferred;k=this._cache.get(k);k!==null?m.resolve(k):m.resolve({});return m},put:function(k,m){var o=new e.Deferred;this._cache.set(k,m);o.resolve();return o}};i.DEFAULT_SCOPE=1;i.LOCAL_SCOPE=2;i.USER_SCOPE=4;i.prototype={getPreferences:function(k,m){if(!m||typeof m!=="number"||m>7||m<1)m=i.DEFAULT_SCOPE|i.LOCAL_SCOPE|
i.USER_SCOPE;var o=[];i.USER_SCOPE&m&&this._userProvider.available()&&o.push(this._userProvider);i.LOCAL_SCOPE&m&&o.push(this._localProvider);i.DEFAULT_SCOPE&m&&o.push(this._defaultsProvider);var v=new b(k,o);return v.sync().then(function(){return v})}};return{PreferencesService:i}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(c,e){var a=a||{};a.Plugin=function(b,d,f){function g(x,A,D,h){if(!o)throw new Error("plugin not connected");var l=u++;s[String(l)]=h;f.postMessage({id:l,serviceId:x,method:A,params:D},o)}function j(x){var A={};if(x.methods)for(var D=0;D<x.methods.length;D++){var h=x.methods[D];A[h]=function(l){return function(){var n=Array.prototype.slice.call(arguments),p=new c.Deferred;m._load().then(function(){g(x.serviceId,
l,n,p)});return p.promise}}(h)}return A}function i(){var x=d.services;if(x)for(var A=0;A<x.length;A++){var D=x[A],h=j(D);q[D.serviceId]=f.registerService(D.type,h,D.properties)}}function k(x){try{if(x.method)if("plugin"===x.method){if(d){if(JSON.stringify(d)!==JSON.stringify(x.params[0])){for(var A in q)if(q.hasOwnProperty(A)){q[A].unregister();delete q[A]}d=x.params[0];i();f.updatePlugin(m)}}else{d=x.params[0];i()}if(!w){w=true;v.resolve(m)}if(t){t.resolve(m);t=null}}else if("dispatchEvent"===x.method){var D=
q[x.serviceId];D.dispatchEvent.apply(D,x.params)}else if("progress"===x.method){var h=s[String(x.requestId)];h.progress.apply(h,x.params)}else throw new Error("Bad response method: "+x.method);else{h=s[String(x.id)];delete s[String(x.id)];x.error?h.reject(x.error):h.resolve(x.result)}}catch(l){console.log(l)}}var m=this,o=null,v=new c.Deferred,t=null,w=false,u=0,s={},q={};this.getLocation=function(){return b};this.getData=function(){return d};this.uninstall=function(){for(var x in q)if(q.hasOwnProperty(x)){q[x].unregister();
delete q[x]}if(o){f.disconnect(o);o=null}f.uninstallPlugin(this)};this.getServiceReferences=function(){var x=[],A;for(A in q)q.hasOwnProperty(A)&&x.push(q[A].getServiceReference());return x};this.update=function(){if(!w)return this._load();var x;if(t===null){x=t=new c.Deferred;f.disconnect(o);o=f.connect(b,k);setTimeout(function(){t===x&&t.reject(new Error("Load timeout for plugin: "+b))},15E3)}return t};this._load=function(x){if(!o){o=f.connect(b,k);setTimeout(function(){if(!w){if(!x){d={};f.updatePlugin(m)}v.reject(new Error("Load timeout for plugin: "+
b))}},15E3)}return v.promise};if(typeof b!=="string")throw new Error("invalid url:"+b);d&&i()};a.PluginRegistry=function(b,d,f){function g(u){if(u.indexOf("://")===-1){var s=document.createElement("a");s.href=u;return s.href}return u}function j(u){delete m["plugin."+u.getLocation()]}function i(u){u.getData()._expires=(new Date).getTime()+36E5;m["plugin."+u.getLocation()]=JSON.stringify(u.getData())}function k(u){u=g(u);for(var s=0,q=o.length;s<q;s++){var x=o[s];if(u===x.getLocation())return x}return null}
var m=d||localStorage||{},o=[],v=[],t=new e.EventTarget;addEventListener("message",function(u){for(var s=0,q=u.source;s<v.length;s++)if(q===v[s].target){if(typeof v[s].useStructuredClone==="undefined")v[s].useStructuredClone=typeof u.data!=="string";v[s].handler(v[s].useStructuredClone?u.data:JSON.parse(u.data));break}},false);var w={registerService:c.hitch(b,b.registerService),connect:function(u,s){var q=document.createElement("iframe");q.id=u;q.name=u;if(!f){q.style.display="none";q.style.visibility=
"hidden"}q.src=u;document.body.appendChild(q);u={iframe:q,target:q.contentWindow,handler:s,url:u};v.push(u);return u},disconnect:function(u){for(var s=0;s<v.length;s++)if(u===v[s]){v.splice(s,1);try{document.body.removeChild(u.iframe)}catch(q){}break}},uninstallPlugin:function(u){j(u);for(var s=0;s<o.length;s++)if(u===o[s]){o.splice(s,1);t.dispatchEvent("pluginRemoved",u);break}},updatePlugin:function(u){i(u);t.dispatchEvent("pluginUpdated",u)},postMessage:function(u,s){s.target.postMessage(s.useStructuredClone?
u:JSON.stringify(u),s.url)}};this.startup=function(u){for(var s=[],q=0;q<u.length;++q){var x=u[q];x=g(x);var A="plugin."+x,D=m[A]?JSON.parse(m[A]):null;if(D&&D._expires&&D._expires>(new Date).getTime()){if(k(x)===null){delete D._expires;o.push(new a.Plugin(x,D,w))}}else{m[A]="{}";x=new a.Plugin(x,{},w);o.push(x);s.push(x._load(false))}}return new c.DeferredList(s)};this.shutdown=function(){for(var u=0;u<v.length;u++)try{document.body.removeChild(v[u].iframe)}catch(s){}};this.installPlugin=function(u,
s){u=g(u);var q=new c.Deferred,x=k(u);if(x)if(x.getData())q.resolve(x);else{var A=function(D){if(D.getLocation()===u){q.resolve(D);t.removeEventListener("pluginAdded",A)}};t.addEventListener("pluginAdded",A)}else{x=new a.Plugin(u,s,w);o.push(x);if(x.getData()){i(x);t.dispatchEvent("pluginAdded",x);q.resolve(x)}else x._load(true).then(function(){i(x);t.dispatchEvent("pluginAdded",x);q.resolve(x)},function(D){q.reject(D)})}return q.promise};this.getPlugins=function(){for(var u=[],s=0;s<o.length;s++)o[s].getData()&&
u.push(o[s]);return u};this.getPlugin=function(u){if((u=k(u))&&u.getData())return u;return null};this.addEventListener=function(u,s){t.addEventListener(u,s)};this.removeEventListener=function(u,s){t.removeEventListener(u,s)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(c,e,a,b,d){function f(){var g=new a.ServiceRegistry,j=new b.PreferencesService(g),i=new d.PluginRegistry(g);return j.getPreferences("/plugins").then(function(k){k=k.keys();for(var m=0;m<k.length;++m)if(k[m].indexOf("://")===-1)k[m]=c.toUrl(k[m]);return i.startup(k)}).then(function(){if(g.getServiceReferences("orion.core.preference.provider").length>0)return j.getPreferences("/plugins",
j.USER_SCOPE).then(function(k){k=k.keys();for(var m=0;m<k.length;++m)if(k[m].indexOf("://")===-1)k[m]=c.toUrl(k[m]);return i.startup(k)})}).then(function(){e.addOnWindowUnload(function(){i.shutdown()})}).then(function(){return{serviceRegistry:g,preferences:j,pluginRegistry:i}})}return{startup:f}});
define("orion/selection",["dojo"],function(c){function e(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.selection",this);this._selections=[]}e.prototype={getSelection:function(a){a(this._getSingleSelection())},getSelections:function(a){a(this._selections)},_getSingleSelection:function(){if(this._selections&&this._selections.length>0)return this._selections[0];return null},setSelections:function(a){this._selections=c.isArray(a)?a:a?[a]:null;this._serviceRegistration.dispatchEvent("selectionChanged",
this._getSingleSelection(),this._selections)}};e.prototype.constructor=e;return{Selection:e}});
define("orion/status",["require","dojo","orion/util"],function(c,e,a){function b(d,f,g,j,i){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.message",this);this._operationsClient=f;this.notificationContainerDomId=i;this.domId=g;this.progressDomId=j||g;this._hookedClose=false}b.prototype={_init:function(){var d=e.byId("closeNotifications");if(d&&!this._hookedClose){e.connect(d,"onclick",this,function(){this.setProgressMessage("");e.removeClass(this.notificationContainerDomId,
"slideContainerActive")});e.connect(d,"onkeypress",this,function(f){if(f.keyCode===e.keys.ENTER||f.keyCode===e.keys.SPACE){this.setProgressMessage("");e.removeClass(this.notificationContainerDomId,"slideContainerActive")}})}},setMessage:function(d,f){this._init();e.place(window.document.createTextNode(d),this.domId,"only");if(typeof f==="number"){var g=this;window.setTimeout(function(){var j=e.byId(g.domId);(typeof j.textContent==="string"?j.textContent:j.innerText)===d&&e.place(window.document.createTextNode(""),
g.domId,"only")},f)}},setErrorMessage:function(d){this._init();var f=d.responseText||d.message||d;try{f=JSON.parse(f)}catch(g){}d=f.Message||f;var j="red";if(f.Severity)switch(f.Severity){case "Warning":j="#FFCC00";break;case "Error":j="red";break;case "Info":case "Ok":j="green";break}f=e.create("span",{style:{color:j}});e.place(window.document.createTextNode(d),f);e.place(f,this.domId,"only")},setProgressMessage:function(d){this._init();var f=e.create("span",{"class":"imageSprite core-sprite-progress"});
e.place(f,this.progressDomId,"only");e.place(window.document.createTextNode(d),this.progressDomId,"last");e.addClass(this.notificationContainerDomId,"progressNormal");d.length>0?e.addClass(this.notificationContainerDomId,"slideContainerActive"):e.removeClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},setProgressResult:function(d){d=d.responseText||d;try{d=JSON.parse(d)}catch(f){}this._init();var g=d.Message||d,j="imageSprite core-sprite-info",
i="progressInfo",k="progressWarning progressError progressNormal";if(d.Severity)switch(d.Severity){case "Warning":j="imageSprite core-sprite-warning";i="progressWarning";k="progressInfo progressError progressNormal";break;case "Error":j="imageSprite core-sprite-error";i="progressError";k="progressWarning progressInfo progressNormal";break}j=e.create("span",{"class":j});e.place(j,this.progressDomId,"only");if(d.HTML)e.place(g,this.progressDomId,"last");else{e.place(window.document.createTextNode("   "+
g),this.progressDomId,"last");if(i&&this.progressDomId!==this.domId){e.addClass(this.notificationContainerDomId,i);e.removeClass(this.notificationContainerDomId,k)}}e.addClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},showWhile:function(d,f){var g=this;g.setProgressMessage(f);return d.then(function(j){if(j&&j.Location&&j.Message&&j.Running)return e.hitch(g,g._doProgressWhile)(j);g.setProgressMessage("");j&&j.Result&&g.setProgressResult(j.Result);
return j})},_doProgressWhile:function(d){var f=new e.Deferred,g=this;window.setTimeout(function(){g._operationsClient.getOperation(d.Location).then(function(j){f.callback(j)})},2E3);return this.showWhile(f,d.Message)}};b.prototype.constructor=b;return{StatusReportingService:b}});define("text!orion/widgets/templates/OperationsDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="padding: 0.5em; min-width: 300px;">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table style="width: 100%;">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><h2>Recent operations</h2></td>\n\t\t\t\t\t<td style="text-align: right;"><a dojoAttachPoint="allOperationsLink">All Operations</a></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<span dojoAttachPoint="operationsExist">\n\t\t\t\t<span class="secondaryColumn" dojoAttachPoint="myOperationsListEmpty">No operations running on this page.</span>\n\t\t\t\t<table dojoAttachPoint="myOperationsList" style="display: none;">\n\t\t\t\t</table>\n\t\t\t\t<span class="secondaryColumn" dojoAttachPoint="otherOperations"><br>Operations from other pages:</span>\n\t\t\t\t<table dojoAttachPoint="operationsList" style="display: none;">\n\t\t\t\t</table>\n\t\t\t</span>\n\t\t\t<span class="secondaryColumn" dojoAttachPoint="operationsDontExist">No operations running.</span>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/OperationsDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/OperationsDialog.html"],function(c,e,a){e.declare("orion.widgets.OperationsDialog",[a.TooltipDialog],{widgetsInTemplate:true,closable:true,templateString:e.cache("orion","widgets/templates/OperationsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this._operations=[];this._myOperations=[]},postCreate:function(){this.inherited(arguments);
this.allOperationsLink.href=c.toUrl("operations/list.html");this._setOperationsVisibility()},setOperations:function(b,d){this._operations=[];d=d||{};this._myOperations=[];if(b.Children)for(var f=0;f<b.Children.length;f++)d[b.Children[f].Id]?this._myOperations.push(b.Children[f]):this._operations.push(b.Children[f]);this._operations.sort(function(g,j){return parseInt(j.Modified)-parseInt(g.Modified)});this._myOperations.sort(function(g,j){return parseInt(j.Modified)-parseInt(g.Modified)});this._renderOperations()},
parseProgressResult:function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var f={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==f.Message)f.DetailedMessage=b.DetailedMessage;return f},_renderOperations:function(){this._renderOperationsTable(this.myOperationsList,this._myOperations);this._renderOperationsTable(this.operationsList,this._operations)},_renderOperationsTable:function(b,d){e.empty(b);for(var f=0;f<d.length;f++){var g=d[f],j=e.create("tr"),
i=e.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:g.Name},j);i=e.create("div",null,i,"only");link=e.create("span",{innerHTML:g.Name,className:"primaryColumn"},i,"last");e.place(document.createTextNode(g.Name),link,"only");var k=e.create("span",null,i,"first");e.addClass(k,"imageSprite");var m=this.parseProgressResult(g.Result);switch(m.Severity){case "Warning":e.addClass(k,"core-sprite-warning");break;case "Error":e.addClass(k,"core-sprite-error");break;default:if(g.Running===
true)e.addClass(k,"core-sprite-start");else if(g.Canceled===true)e.addClass(k,"core-sprite-stop");else g.Failed===true?e.addClass(k,"core-sprite-error"):e.addClass(k,"core-sprite-ok")}if(m.Message||g.Message){g=m.Message||g.Message;if(m.DetailedMessage&&m.DetailedMessage!=="")g+=": "+m.DetailedMessage;e.create("br",null,i,"last");e.create("span",{className:"secondaryColumn",style:"margin-left: 18px;",innerHTML:g},i,"last")}e.place(j,b,"last")}this._setOperationsVisibility()},_setOperationsVisibility:function(){this.operationsList.style.display=
this._operations.length>0?"":"none";this.otherOperations.style.display=this._operations.length>0?"":"none";this.myOperationsList.style.display=this._myOperations.length>0?"":"none";this.myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.operationsDontExist.style.display=this._operations.length+this._myOperations.length>0?"none":"";this.operationsExist.style.display=this._operations.length+this._myOperations.length>0?"":"none"},_onBlur:function(){this.inherited(arguments);
a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/progress",["require","dojo","orion/globalCommands","orion/widgets/OperationsDialog"],function(c,e,a){function b(d,f){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.progress",this);this._operationsClient=f;this._initDone=false;this._topicListeners={};this._myOperations={};this._lastIconClass=this._lastOperation=null}b.prototype={init:function(d){if(!this._progressPane){this._progressPane=e.byId(d);this._operationsDialog=new orion.widgets.OperationsDialog;
e.connect(this._progressPane,"onclick",e.hitch(this,this._openOperationsPopup));var f=this;if(new Date-this.getLastListUpdate()>3E5)this._operationsClient.getRunningOperations().then(function(g){e.hitch(f,f._loadOperationsList)(g);window.setTimeout(function(){e.hitch(f,f._checkOperationsChanges())},5E3)},function(g){console.error(g)});else{e.hitch(f,f._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')));window.setTimeout(function(){e.hitch(f,f._checkOperationsChanges())},
5E3)}window.addEventListener("storage",function(g){a.getAuthenticationIds().indexOf(g.key)>=0&&f._operationsClient.getRunningOperations().then(function(j){e.hitch(f,f._loadOperationsList)(j)},function(j){console.error(j)})},false);window.addEventListener("storage",function(g){if(g.key==="orionOperations")e.hitch(f,f._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')))})}},_loadOperationsList:function(d){d.lastClientDate=new Date;if(d.lastClientDate-this.getLastListUpdate()>
3E5){localStorage.setItem("orionOperations",JSON.stringify(d));this._generateOperationsInfo(d)}},getLastListUpdate:function(){var d=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}');return d.lastClientDate?new Date(d.lastClientDate):new Date(0)},_markOperationAsFailed:function(d,f,g){d.Message="Operation status is unknown";d.Running=false;d.Failed=true;d.Result={HttpCode:g?g.xhr.staus:500,Severity:f,Message:f.Message?f.Message:f};this.writeOperation(d)},_checkOperationsChanges:function(){for(var d=
this,f=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=[],j=[],i=0;i<f.Children.length;i++){var k=f.Children[i];if(k.Running==true&&new Date-new Date(k.lastClientDate?k.lastClientDate:0)>5E3){var m=this._operationsClient.getOperation(k.Location);j.push(m);e.hitch(this,function(o){m.then(function(v){v.lastClientDate=new Date;e.hitch(d,d.writeOperation)(v)},function(v,t){if(v.status==404){g.push(o);return v}e.hitch(d,d._markOperationAsFailed(f.Children[o],v,t))})})(i)}if(!k.Running&&
new Date-new Date(k.lastClientDate?k.lastClientDate:0)>3E5)g.push(i)}(new e.DeferredList(j)).addBoth(function(){if(g.length>0){f.lastClientDate=new Date;for(var o=g.length-1;o>=0;o--)f.Children.splice(g[o],1);localStorage.setItem("orionOperations",JSON.stringify(f));e.hitch(d,d._generateOperationsInfo)(f)}window.setTimeout(function(){e.hitch(d,d._checkOperationsChanges())},5E3)})},_openOperationsPopup:function(){try{dijit.popup.open({popup:this._operationsDialog,around:this._progressPane})}catch(d){}dijit.focus(this._operationsDialog.domNode)},
_switchIconTo:function(d){this._lastIconClass&&e.removeClass(this._progressPane,this._lastIconClass);this._lastIconClass=d;e.addClass(this._progressPane,this._lastIconClass)},_generateOperationsInfo:function(d){this._operationsDialog.setOperations(d,this._myOperations);if(!d.Children||d.Children.length==0){this._switchIconTo("progressPane_empty");this._progressPane.title="Operations"}else{for(var f="",g=0;g<d.Children.length;g++){var j=d.Children[g];if(this._myOperations[j.Id])if(j.Running==true){f=
"running";break}}if(f===""&&this._lastOperation!=null)if(this._lastOperation.Result)switch(this._operationsDialog.parseProgressResult(this._lastOperation.Result).Severity){case "Warning":if(f!=="error")f="warning";break;case "Error":f="error"}switch(f){case "running":this._progressPane.title="Operations running";this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title="Some operations finished with warning";this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=
"Some operations finished with error";this._switchIconTo("progressPane_error");break;default:this._progressPane.title="Operations";this._switchIconTo("progressPane_operations")}}},followOperation:function(d,f,g){if(d.Id)this._myOperations[d.Id]=true;var j=f?f:new e.Deferred;this.writeOperation(d);var i=this;if(d&&d.Location&&d.Running==true)window.setTimeout(function(){i._operationsClient.getOperation(d.Location).then(function(k){e.hitch(i,i.followOperation(k,j,d.Location))},function(k,m){e.hitch(i,
i.setProgressResult)({Severity:"Error",Message:k});e.hitch(i,i._markOperationAsFailed(d,k,m));j.errback(k,m)})},2E3);else if(d&&d.Result){i._serviceRegistry.getService("orion.page.message").setProgressMessage("");f=this._operationsDialog.parseProgressResult(d.Result).Severity;if(f=="Error"||f=="Warning"){d.Result.failedOperation={Location:g,Id:d.Id,Name:d.Name};j.callback(d);setTimeout(function(){i._myOperations[d.Id]&&e.hitch(i,i._openOperationsPopup)()},10)}else j.callback(d);!d.Failed&&d.Idempotent==
true&&window.setTimeout(function(){e.hitch(i,i.removeOperation)(g,d.Id)},5E3)}return j},removeOperation:function(d,f){that=this;if(f){if(this._lastOperation!=null&&this._lastOperation.Id===f)this._lastOperation=null;delete this._myOperations[f]}e.hitch(that._operationsClient,that._operationsClient.removeOperation)(d).then(function(){e.hitch(that,that.removeOperationFromTheList)(f)})},removeOperationFromTheList:function(d){if(this._lastOperation!=null&&this._lastOperation.Id===d)this._lastOperation=
null;delete this._myOperations[d];for(var f=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<f.Children.length;g++){var j=f.Children[g];if(j.Id&&j.Id===d){f.Children.splice(g,1);break}}localStorage.setItem("orionOperations",JSON.stringify(f));this._generateOperationsInfo(f)},removeCompletedOperations:function(){for(var d=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),f=d.Children.length-1;f>=0;f--)d.Children[f].Running||d.Children.splice(f,1);
localStorage.setItem("orionOperations",JSON.stringify(d));this._generateOperationsInfo(d)},setProgressResult:function(d){this._serviceRegistry.getService("orion.page.message").setProgressResult(d)},showWhile:function(d,f){f&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(f);var g=this;return d.then(function(j){if(j&&j.Location&&j.Message&&j.Running)return e.hitch(g,g.followOperation)(j,null,j.Location);g._serviceRegistry.getService("orion.page.message").setProgressMessage("");
return j},function(j){e.hitch(g,g.setProgressResult)(j);return j})},followTopic:function(d,f){this._topicListeners[d]||(this._topicListeners[d]=[]);this._topicListeners[d].push(f)},writeOperation:function(d){this._lastOperation=d=JSON.parse(JSON.stringify(d));for(var f=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<f.Children.length;g++){var j=f.Children[g];if(j.Id&&j.Id===d.Id){f.Children.splice(g,1);break}}!d.Running&&!d.Failed&&delete d.Result;d.lastClientDate=new Date;
f.Children.push(d);f.lastClientDate=new Date;localStorage.setItem("orionOperations",JSON.stringify(f));this._generateOperationsInfo(f)}};b.prototype.constructor=b;return{ProgressService:b}});define("orion/dialogs",[],function(){function c(e){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.page.dialog",this)}c.prototype={confirm:function(e,a){a(window.confirm(e))},openFiles:function(){}};c.prototype.constructor=c;return{DialogService:c}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(c,e){function a(f,g,j){if(!f[g])throw g+" is not supportted in this file system";var i=new c.Deferred;f[g].apply(f,j).then(function(k){i.callback(k)},function(k){k.status===401?e.handleAuthenticationError(k,function(){f[g].apply(f,j).then(function(m){i.callback(m)},function(m){i.errback(m)})}):i.errback(k)});return i}function b(f,g,j,i){if(!f.readBlob)throw"source file service does not support binary read";if(!j.writeBlob)throw"target file service does not support binary write";
if(g[g.length-1]!=="/")return a(f,"readBlob",[g]).then(function(o){return a(j,"writeBlob",[i,o])});var k=i.substring(0,i.length-1),m=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=k.substring(0,k.lastIndexOf("/")+1);return a(j,"createFolder",[k,m]).then(function(){},function(){}).then(function(){if(g.indexOf("/")===0)g+="?depth=1";return a(f,"fetchChildren",[g]).then(function(o){for(var v=[],t=0;t<o.length;++t){var w=o[t].Location,u=w;if(o[t].Directory)u=w.substring(0,w.length-1);u=decodeURIComponent(u.substring(u.lastIndexOf("/")+
1));u=i+encodeURIComponent(u);if(o[t].Directory)u+="/";v[t]=b(f,w,j,u)}return new c.DeferredList(v)})})}function d(f,g){function j(s){var q=new c.Deferred;q.reject("No Matching FileService for location:"+s);return q}var i=f.getServiceReferences("orion.core.file"),k=i;if(g){k=[];for(var m=0;m<i.length;++m)g(i[m])&&k.push(i[m])}var o=[],v=[],t=[],w=[],u={fetchChildren:function(){var s=new c.Deferred;s.resolve(w);return s},createWorkspace:function(){var s=new c.Deferred;s.reject("no file service");return s},
loadWorkspaces:function(){var s=new c.Deferred;s.reject("no file service");return s},loadWorkspace:function(){var s=new c.Deferred;window.setTimeout(function(){s.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"File Servers",Location:"/",Children:w,ChildrenLocation:"/"})},100);return s},search:j,createProject:j,createFolder:j,createFile:j,deleteFile:j,moveFile:j,copyFile:j,read:j,write:j};for(g=0;g<k.length;++g){w[g]={Directory:true,Length:0,LocalTimeStamp:0,Location:k[g].getProperty("top"),
ChildrenLocation:k[g].getProperty("top"),Name:k[g].getProperty("Name")};i=k[g].getProperty("pattern")||".*";if(i[0]!=="^")i="^"+i;o[g]=new RegExp(i);v[g]=f.getService(k[g]);t[g]=k[g].getProperty("Name")}this._getServiceIndex=function(s){if(s==="/")return-1;else if(!s||s.length&&s.length===0)return 0;for(var q=0;q<o.length;++q)if(o[q].test(s))return q;throw"No Matching FileService for location:"+s;};this._getService=function(s){s=this._getServiceIndex(s);return s===-1?u:v[s]};this._getServiceName=
function(s){s=this._getServiceIndex(s);return s===-1?u.Name:t[s]}}d.prototype={fileServiceName:function(f){return this._getServiceName(f)},fetchChildren:function(f){return a(this._getService(f),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(f){return a(this._getService(f),"loadWorkspace",arguments)},createProject:function(f){return a(this._getService(f),
"createProject",arguments)},createFolder:function(f){return a(this._getService(f),"createFolder",arguments)},createFile:function(f){return a(this._getService(f),"createFile",arguments)},deleteFile:function(f){return a(this._getService(f),"deleteFile",arguments)},moveFile:function(f,g,j){var i=this._getService(f),k=this._getService(g);if(i===k)return a(i,"moveFile",arguments);var m=f[f.length-1]==="/",o=g;if(o[o.length-1]!=="/")o+="/";if(j)o+=encodeURIComponent(j);else{var v=f;if(m)v=v.substring(0,
v.length-1);o+=v.substring(v.lastIndexOf("/")+1)}if(m&&o[o.length-1]!=="/")o+="/";return b(i,f,k,o).then(function(){return a(i,"deleteFile",[f])})},copyFile:function(f,g){var j=this._getService(f),i=this._getService(g);if(j===i)return a(j,"copyFile",arguments);var k=f[f.length-1]==="/",m=g;if(m[m.length-1]!=="/")m+="/";var o=f;if(k)o=o.substring(0,o.length-1);m+=o.substring(o.lastIndexOf("/")+1);if(k&&m[m.length-1]!=="/")m+="/";return b(j,f,i,m)},read:function(f){return a(this._getService(f),"read",
arguments)},write:function(f){return a(this._getService(f),"write",arguments)},remoteImport:function(f){return a(this._getService(f),"remoteImport",arguments)},remoteExport:function(f){return a(this._getService(f),"remoteExport",arguments)},search:function(f){return a(this._getService(f),"search",arguments)}};d.prototype.constructor=d;return{FileClient:d}});
define("orion/operationsClient",["dojo","orion/auth","dojo/DeferredList"],function(c,e){function a(m,o,v){var t=new c.Deferred;m[o].apply(m,v).then(function(w){t.callback(w)},function(w){w.status===401?e.handleAuthenticationError(w,function(){m[o].apply(m,v).then(function(u){t.callback(u)},function(u){t.errback(u)})}):t.errback(w)});return t}function b(m,o){return a(m,"getOperations",[o])}function d(m){this._location=m}function f(){var m=new c.Deferred;m.errback("No Matching OperationService for location:"+
this._location);return m}function g(m){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];for(var o=m.getServiceReferences("orion.core.operation"),v=0;v<o.length;v++){var t=m.getService(o[v]);this._services[v]=t;t=o[v].getProperty("pattern")||".*";if(t[0]!=="^")t="^"+t;this._patterns[v]=new RegExp(t)}this._getService=function(w){if(!w)return this._services[0];for(var u=0;u<this._patterns.length;++u)if(this._patterns[u].test(w))return this._services[u];return new d(w)}}
function j(m){if(m.length===1){if(m[0][0])return m[0][1];console.error(m[0][1]);return{Children:[]}}for(var o={Children:[]},v=0;v<m.length;v++)if(m[v][0]){if(m[v][1]&&m[v][1].Children)o.Children=o.Children.concat(m[v][1].Children)}else console.error(m[v][1]);return o}function i(m,o,v){var t=this,w={Longpolling:true};if(v)w.LongpollingId=v;a(m,"getOperations",[w]).then(function(u){if(!(v&&t._currentLongpollingIds.indexOf(v)<0)){o(u,v);if(u.LongpollingId){t._currentLongpollingIds.push(u.LongpollingId);
c.hitch(t,i)(m,o,u.LongpollingId)}else c.hitch(t,i)(m,o,v)}},function(u){v&&t._currentLongpollingIds.indexOf(v)<0||("timeout"===u.dojoType?c.hitch(t,i)(m,o,v):setTimeout(function(){c.hitch(t,i)(m,o,v)},2E3))})}function k(m){for(var o=0;o<this._operationListeners.length;o++)this._operationListeners[o](m)}d.prototype={getOperation:f,getOperations:f,removeCompletedOperations:f,removeOperation:f,cancelOperation:f};d.prototype.constructor=d;g.prototype={getOperations:function(){var m=new c.Deferred,o=
[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var v=0;v<this._services.length;v++)o[v]=b(this._services[v]);(new c.DeferredList(o)).then(function(t){m.resolve(j(t))});return m},getRunningOperations:function(){var m=new c.Deferred,o=[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var v=0;v<this._services.length;v++)o[v]=b(this._services[v],{RunningOnly:true});(new c.DeferredList(o)).then(function(t){m.resolve(j(t))});
return m},getOperation:function(m){return a(this._getService(m),"getOperation",arguments)},removeCompletedOperations:function(){var m=[];if(this._services.length<1){result.errback("No operations services registered.");return result}for(var o=0;o<this._services.length;o++)m[o]=a(this._services[o],"removeCompletedOperations");return new c.DeferredList(m)},removeOperation:function(m){return a(this._getService(m),"removeOperation",arguments)},cancelOperation:function(m){return a(this._getService(m),"cancelOperation",
arguments)},addOperationChangeListener:function(m){this._operationListeners.push(m);if(this._operationListeners.length===1){if(this._services.length<1)throw"No operations services registered.";for(m=0;m<this._services.length;m++)c.hitch(this,i)(this._services[m],c.hitch(this,k))}},removeOperationChangeListener:function(m){for(var o=0;o<this._operationListeners.length;o++)if(this._operationListeners[o]===m){this._operationListeners.splice(o,1);break}if(this._operationListeners.length===0)this._currentLongpollingIds=
[]},resetChangeListeners:function(){this._currentLongpollingIds=[];if(this._services.length<1)throw"No operations services registered.";for(var m=0;m<this._services.length;m++)c.hitch(this,i)(this._services[m],c.hitch(this,k))}};g.prototype.constructor=g;return{OperationsClient:g}});
define("orion/searchUtils",["require","dojo","orion/editor/regex"],function(c,e,a){var b=b||{};b.searchUtils=b.searchUtils||{};b.searchUtils.parseQueryStr=function(d){var f=d.indexOf("?"),g=d.indexOf("q=");if(f<g&&g>0)d=d.substring(f+1);f=d.split("&");d={queryStr:d,start:0,rows:10,sort:"Path asc",replace:null};for(g=0;g<f.length;g++){var j=f[g].indexOf("q="),i=f[g].indexOf("replace=");if(j>=0)b.searchUtils.parseLocationAndSearchStr(f[g].substring(j+2),d);else if(i>=0)d.replace=f[g].substring(i+8);
else{j=f[g].split("=");if(j.length===2)if(j[0]==="rows")d.rows=parseInt(j[1]);else if(j[0]==="start")d.start=parseInt(j[1]);else if(j[0]==="sort")d.sort=j[1]}}return d};b.searchUtils.copyQueryParams=function(d,f){return{sort:d.sort,rows:d.rows,start:d.start,searchStr:d.searchStr,location:d.location,replace:f?d.replace:null}};b.searchUtils.generateSearchHref=function(d){return c.toUrl("search/search.html")+"#"+b.searchUtils.generateSearchQuery(d)};b.searchUtils.generateSearchQuery=function(d){var f=
"Path asc",g=40,j=0,i="",k="",m="";if(d){if(d.sort)f=d.sort;if(d.rows)g=d.rows;if(d.start)j=d.start;if(d.searchStr){i=d.searchStr;i=i.split(" ").join("")}if(d.location){k=d.location;if(k.length>0&&k[k.length-1]!=="*")k+="*";if(k!=="")k="+Location:"+k}if(d.replace!==null&&d.replace!==undefined)m="&replace="+d.replace}return"?sort="+f+"&rows="+g+"&start="+j+"&q="+i+k+m};b.searchUtils.parseLocationAndSearchStr=function(d,f){var g=d.indexOf("+Location:")>-1;f.location="";f.searchStr=d;if(g){d=d.split("+Location:");
if(d.length===2){g=d[1];if(g.length>0&&g[g.length-1]==="*")g=g.substring(0,g.length-1);f.location=g;f.searchStr=d[0].split(" ").join("")}}f.searchStrTitle=f.searchStr.split("\\").join("");f.inFileQuery=b.searchUtils.generateInFileQuery(f.searchStr)};b.searchUtils.generateInFileQuery=function(d){var f={},g=d.indexOf("*")>-1,j=d.indexOf("?")>-1;if(g)d=d.split("*").join(".*");if(j)d=d.split("?").join(".");if(!g&&!j){f.searchStr=d.split("\\").join("").toLowerCase();f.wildCard=false}else{f.searchStr=d.toLowerCase();
if(g=a.parse("/"+f.searchStr+"/")){d=g.pattern;g=g.flags;g+=g.indexOf("i")===-1?"i":"";f.regExp={pattern:d,flags:g};f.wildCard=true}}f.searchStrLength=f.searchStr.length;return f};b.searchUtils.replaceRegEx=function(d,f,g){return d.replace(new RegExp(f.pattern,f.flags),g)};b.searchUtils.replaceStringLiteral=function(d,f,g){f=a.parse("/"+f+"/gim");return b.searchUtils.replaceRegEx(d,f,g)};b.searchUtils.searchOnelineLiteral=function(d,f,g){var j;j=0;for(var i=false,k=[];;){j=f.indexOf(d.searchStr,j);
if(j<0)break;else{k.push({startIndex:j});i=true;if(g)break;j=j+d.searchStrLength}}if(i)return k;return null};b.searchUtils.findRegExp=function(d,f,g,j){if(!f)return null;g=g||"";g+=(g.indexOf("g")===-1?"g":"")+(g.indexOf("m")===-1?"m":"");var i=null;return(i=(new RegExp(f,g)).exec(d.substring(j)))&&{startIndex:i.index+j,length:i[0].length}};b.searchUtils.searchOnelineRegEx=function(d,f,g){for(var j=0,i=false,k=[];;)if(j=b.searchUtils.findRegExp(f,d.regExp.pattern,d.regExp.flags,j)){k.push(j);i=true;
if(g)break;j=j.startIndex+j.length}else break;if(i)return k;return null};b.searchUtils.generateNewContents=function(d,f,g,j,i){if(g&&d){var k;k=f.length>0?true:false;for(var m=0;m<d.length;m++){for(var o=d[m],v=false,t=false,w=[],u,s=0,q=0;q<g.children.length;q++)if(g.children[q].lineNumber-1===m){s=q;for(v=0;v<g.children[q].matches.length;v++)g.children[q+v].checked!==false&&w.push(v);t=w.length>0;u=g.children[q].matches;v=true;break}if(v){if(t){w=b.searchUtils.replaceCheckedMatches(o,j,u,w,i);o=
w.replacedStr;for(v=0;v<g.children[s].matches.length;v++)g.children[s+v].newMatches=w.newMatches}else{o=o;for(v=0;v<g.children[s].matches.length;v++)g.children[s+v].newMatches=g.children[s+v].matches}if(k)f[m]=o;else f.push(o)}else k||f.push(o)}}};b.searchUtils.generateMatchContext=function(d,f,g){var j=[],i=d*2+1,k;if(f.length<=i){k=0;d=f.length-1}else{k=g-d;if(k<0){k=0;d=k+i-1}else{d=g+d;if(d>f.length-1){d=f.length-1;k=d-i+1}}}for(i=k;i<=d;i++)j.push({context:f[i],current:i===g});return j};b.searchUtils.searchWithinFile=
function(d,f,g,j,i){g=g.split(j);if(i)f.contents=g;if(f){f.children=[];for(var k=j=0;k<g.length;k++){var m=g[k];if(m&&m.length>0){var o=m.toLowerCase();if(o=d.wildCard?b.searchUtils.searchOnelineRegEx(d,o):b.searchUtils.searchOnelineLiteral(d,o)){var v=k+1;if(i)for(var t=0;t<o.length;t++){var w=t+1;w={parent:f,checked:f.checked,type:"detail",matches:o,lineNumber:v,matchNumber:w,name:m,location:f.location+"-"+v+"-"+w};f.children.push(w)}else{w={parent:f,context:b.searchUtils.generateMatchContext(2,
g,k),checked:f.checked,type:"detail",matches:o,lineNumber:v,name:m,linkLocation:f.linkLocation+",line="+v,location:f.location+"-"+v};f.children.push(w)}j+=o.length}}}f.totalMatches=j}};b.searchUtils.replaceCheckedMatches=function(d,f,g,j,i){i=i;for(var k=0,m="",o=[],v=0;v<g.length;v++){if(k!==g[v].startIndex)m+=d.substring(k,g[v].startIndex);if(g[v].length)i=g[v].length;k=false;for(var t=0;t<j.length;t++)if(j[t]===v){k=true;break}if(k){o.push({startIndex:m.length,length:f.length});m+=f}else{o.push({startIndex:m.length,
length:i});m+=d.substring(g[v].startIndex,g[v].startIndex+i)}k=g[v].startIndex+i}if(k<d.length-1)m+=d.substring(k);return{replacedStr:m,newMatches:o}};b.searchUtils.fullPathNameByMeta=function(d){var f=d.length,g="";if(f>0)for(f=f-1;f>-1;f--)g=g+(g===""?"":"/")+d[f].Name;return g};b.searchUtils.path2FolderName=function(d,f,g){return d.substring(0,d.length-f.length-(g?0:1))};return b.searchUtils});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(c,e){c.declare("dijit.layout.BorderContainer",e.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){c.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var b=a.region;if(b){this.inherited(arguments);c.addClass(a.domNode,this.baseClass+"Pane");var d=this.isLeftToRight();if(b=="leading")b=d?"left":"right";if(b=="trailing")b=d?"right":"left";if(b!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var f=c.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");d=new f({id:a.id+"_splitter",container:this,child:a,region:b,live:this.liveSplitters});d.isSplitter=
true;a._splitterWidget=d;c.place(d.domNode,a.domNode,"after");d.startup()}a.region=b}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var b=a.region,d=a._splitterWidget;if(d){d.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();c.removeClass(a.domNode,this.baseClass+"Pane");c.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
c.style(a.domNode,b=="top"||b=="bottom"?"width":"height","auto")},getChildren:function(){return c.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return c.filter(this.getChildren(),function(b){return b.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=c.getComputedStyle(a);this.pe=c._getPadExtents(a,this.cs);this.pe.r=c._toPixelValue(a,this.cs.paddingRight);this.pe.b=c._toPixelValue(a,this.cs.paddingBottom);
c.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,b){if(this._borderBox&&this._borderBox.h){var d=c.map(this.getChildren(),function(g,j){return{pane:g,weight:[g.region=="center"?Infinity:0,g.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(g.region)?1:-1),j]}},this);d.sort(function(g,j){g=g.weight;j=j.weight;for(var i=0;i<g.length;i++)if(g[i]!=j[i])return g[i]-j[i];return 0});var f=[];c.forEach(d,function(g){g=g.pane;f.push(g);g._splitterWidget&&f.push(g._splitterWidget)});
e.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},f,a,b)}},destroyRecursive:function(){c.forEach(this.getChildren(),function(a){var b=a._splitterWidget;b&&b.destroy();delete a._splitterWidget});this.inherited(arguments)}});c.extend(e._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});c.declare("dijit.layout._Splitter",[e._Widget,e._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);c.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=c.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",b=c.marginBox(this.child.domNode)[a],d=c.filter(this.container.getChildren(),function(f){return f.region=="center"})[0];a=c.marginBox(d.domNode)[a];return Math.min(this.child.maxSize,b+a)},_startDrag:function(a){if(!this.cover){this.cover=c.doc.createElement("div");c.addClass(this.cover,"dijitSplitterCover");c.place(this.cover,this.child.domNode,"after")}c.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&c.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
c.addClass(this.domNode,"dijitSplitterShadow");c.place(this.fake,this.domNode,"after")}c.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)c.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var b=this._factor,d=this.horizontal,f=d?"pageY":"pageX",g=a[f],j=this.domNode.style;d=d?"h":"w";var i=c.marginBox(this.child.domNode)[d],k=this._computeMaxSize(),m=this.child.minSize||20;d=this.region;var o=d==
"top"||d=="bottom"?"top":"left",v=parseInt(j[o],10),t=this._resize,w=c.hitch(this.container,"_layoutChildren",this.child.id);d=c.doc;this._handlers=(this._handlers||[]).concat([c.connect(d,"onmousemove",this._drag=function(u,s){u=u[f]-g;var q=b*u+i,x=Math.max(Math.min(q,k),m);if(t||s)w(x);j[o]=u+v+b*(x-q)+"px"}),c.connect(d,"ondragstart",c.stopEvent),c.connect(c.body(),"onselectstart",c.stopEvent),c.connect(d,"onmouseup",this,"_stopDrag")]);c.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";c.toggleClass(this.domNode,"dijitSplitterHover",a);c.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&c.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&c.destroy(this.fake);c.removeClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow");this._drag(a);this._drag(a,true)}finally{this._cleanupHandlers();delete this._drag}if(this.container.persist)c.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){c.forEach(this._handlers,c.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var b=this.horizontal,d=1,f=c.keys;switch(a.charOrCode){case b?f.UP_ARROW:f.LEFT_ARROW:d*=-1;case b?f.DOWN_ARROW:f.RIGHT_ARROW:break;default:return}b=c._getMarginSize(this.child.domNode)[b?"h":"w"]+this._factor*d;this.container._layoutChildren(this.child.id,Math.max(Math.min(b,this._computeMaxSize()),
this.child.minSize));c.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});c.declare("dijit.layout._Gutter",[e._Widget,e._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);c.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return e.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchUtils","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(c,e,a,b,d,f){function g(j){this.registry=j.serviceRegistry;this._commandService=j.commandService;(this._fileService=j.fileService)||console.error("No file service on search client")}g.prototype={search:function(j,i,k){i=f.parseQueryStr(j);try{this._fileService.search(i.location,j).then(function(o){var v=o.responseHeader.params.q;
v=v.substring(v.indexOf("}")+1);k(function(t){for(var w=[],u=0;u<t.response.docs.length;u++){var s=t.response.docs[u];w.push({name:s.Name,path:s.Location,folderName:f.path2FolderName(s.Path,s.Name),directory:s.Directory,lineNumber:s.LineNumber})}return w}(o),v)})}catch(m){this.registry.getService("orion.page.message").setErrorMessage(m)}},handleError:function(j,i){console.error(j);var k=document.createTextNode(j);e.place(k,i,"only");return j},setLocationByMetaData:function(j,i){var k="",m=null;if(i&&
j&&j.Parents&&j.Parents.length>0)m=i.index==="last"?j.Parents[j.Parents.length-1]:j.Parents[0];else if(j&&j.Directory&&j.Location&&j.Parents)m=j;if(m){this.setLocationByURL(m.Location);k=m.Name}else if(j)k=this._fileService.fileServiceName(j&&j.Location);if((j=e.byId("search"))&&j.placeholder)j.placeholder=k.length>23?"Search "+k.substring(0,20)+"...":"Search "+k;if(j&&j.title)j.title="Type a keyword or wild card to search in "+k},setLocationByURL:function(j){this.location=j},createSearchQuery:function(j,
i,k,m){k||(k="Path");k+=" asc";if(i){j=/\*$/.test(i)?"":"*";return f.generateSearchQuery({sort:k,rows:100,start:0,searchStr:"Name:"+this._luceneEscape(i,true)+j})}return f.generateSearchQuery({sort:k,rows:40,start:0,searchStr:this._luceneEscape(j,true),location:m?"":this.location})},_luceneEscape:function(j,i){var k="";i='+-&|!(){}[]^"~:\\'+(!i?"*?":"");for(var m=0;m<j.length;m++){var o=j.charAt(m);if(i.indexOf(o)>=0)k+="\\";k+=o}return k},defaultRenderer:{makeRenderFunction:function(j,i,k,m){function o(v,
t){var w=function(){function l(r,y){r.appendChild(document.createTextNode(" - "+(y.folderName?y.folderName:y.path)+" "))}function n(r,y){var B=y.name;if(p.hasOwnProperty(B)){l(r,y);var z=p[B];if(typeof z==="function"){p[B]=null;z()}}else p[B]=function(){l(r,y)}}var p={};return n}(),u=false;e.empty(j);if(v&&v.length>0){for(var s=document.createElement("table"),q=0;q<v.length;q++){var x=v[q],A;if(!u){u=true;if(i){A=s.insertRow(0).insertCell(0);A.innerHTML=i}}A=s.insertRow(-1).insertCell(0);A.colspan=
2;m&&m(A);var D=document.createElement("a");e.place(document.createTextNode(x.name),D);x.LineNumber&&e.place(document.createTextNode(" (Line "+x.LineNumber+")"),D);var h=x.location;if(x.isExternalResource)h=x.path;else{h=x.directory?c.toUrl("navigate/table.html")+"#"+x.path:c.toUrl("edit/edit.html")+"#"+x.path;if(h==="#")h=""}D.setAttribute("href",h);e.style(D,"verticalAlign","middle");A.appendChild(D);w(A,x)}e.place(s,j,"last");typeof k==="function"&&k(j)}if(!u)if(t){v=e.place("<div>No matches found for </div>",
j,"only");v=e.create("b",null,v,"last");e.place(document.createTextNode(t),v,"only");typeof k==="function"&&k(j)}}return o}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/outliner",["dojo","orion/util","orion/commands","orion/URITemplate"],function(c,e,a,b){function d(g){this._init(g)}function f(g){this._serviceRegistry=g.serviceRegistry;this._preferences=g.preferences;this._serviceRegistration=this._serviceRegistry.registerService("orion.edit.outline",this);this._outlinePref=this._preferences.getPreferences("/edit/outline");this._provider=new c.Deferred}d.prototype={_init:function(g){var j=g.parent;if(typeof j==="string")j=c.byId(j);if(!j)throw"no parent";
if(!g.outlineService)throw"no outline service";this._parent=j;this._serviceRegistry=g.serviceRegistry;this._outlineService=g.outlineService;this._commandService=g.commandService;this._selectionService=g.selectionService;var i=this;c.when(this._outlineService,function(k){k.addEventListener("outline",function(m,o,v){i.providerId=v;i._renderMenu(i.outlineProviders);i._renderOutline.apply(i,Array.prototype.slice.call(arguments))})});this._commandService.addCommand(new a.Command({name:"Outline",id:"eclipse.edit.outline.switch",
visibleWhen:function(){return true},choiceCallback:c.hitch(this,this._menuCallback)}),"dom")},outlineChanged:function(g,j,i){var k=this;g.getOutline(i,j).then(function(m){k._renderOutline(m,j)})},setSelectedProvider:function(g){this.providerId=g.getProperty("id")},setOutlineProviders:function(g){this.outlineProviders=g;this._renderMenu(this.outlineProviders)},_renderOutline:function(g,j){if(g=g instanceof Array?g:[g]){if(this.outlineNode)c.empty(this.outlineNode);else this.outlineNode=c.create("ul",
{className:"outline"});for(var i=0;i<g.length;i++)this._renderElement(this.outlineNode,g[i],j);c.place(this.outlineNode,this._parent,"last")}},_menuCallback:function(){for(var g=[],j=0;j<this.outlineProviders.length;j++){var i=this.outlineProviders[j],k=i.getProperty("name")||i.name+i.serviceId||"undefined",m=i.getProperty("id")===this.providerId?"&bull; ":"";g.push({name:m+k,callback:c.hitch(this,this.setSelectedProvider,i)})}return g},_renderMenu:function(g){if(this.menuNode)c.empty(this.menuNode);
else this.menuNode=c.create("div",{id:"switchOutlineMenu"},this._parent,"last");if(g.length>1){this._commandService.registerCommandContribution("eclipse.edit.outline.switch",1,this.menuNode.id);this._commandService.renderCommands(this.menuNode,"dom",null,this,"button")}},_renderElement:function(g,j,i){if(j){g=c.create("li",null,g,"last");j.className&&c.addClass(g,j.className);if(j.href)this._createLink(j.label,j.href,g);else if(j.line||j.column||j.start){var k=(new b("#{,resource,params*}")).expand({resource:i,
params:j});this._createLink(j.label,k,g)}else j.label&&c.place(document.createTextNode(j.label),g,"only");if(j=j.children){g=c.create("ul",null,g,"last");for(k=0;k<j.length;k++)this._renderElement(g,j[k],i)}}},_createLink:function(g,j,i){i=c.create("a",null,i,"last");if(this._selectionService)c.style(i,"cursor","pointer");else i.href=j;c.addClass(i,"navlinkonpage");c.place(document.createTextNode(g),i);if(this._selectionService){var k=this._selectionService;c.connect(i,"onclick",i,function(m){e.openInNewWindow(m)?
e.followLink(j,m):k.setSelections(j)})}return i}};d.prototype.constructor=d;f.prototype={setOutlineProviders:function(g){this.providers=g;var j=this;c.when(this._outlinePref,function(i){for(var k,m=0;m<g.length;m++){k=g[m];if(i.get("outlineProvider")===g[m].getProperty("id"))break}k&&j.setProvider(k)})},setProvider:function(g){if(this._provider.fired!==-1)this._provider=new c.Deferred;this._provider.callback(g);var j=g.getProperty("id");j&&this._outlinePref.then(function(i){i.put("outlineProvider",
j)})},getProvider:function(){return this._provider},emitOutline:function(g,j){var i=this;c.when(this.getProvider(),function(k){i._serviceRegistry.getService(k).getOutline(g,j).then(function(m){i._serviceRegistration.dispatchEvent("outline",m,j,k.getProperty("id"))})})}};f.prototype.constructor=f;return{Outliner:d,OutlineService:f}});
define("orion/problems",[],function(){function c(e){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.core.marker",this)}c.prototype={_setProblems:function(e){this.problems=e;this._serviceRegistration.dispatchEvent("problemsChanged",e)}};c.prototype.constructor=c;return{ProblemService:c}});
define("orion/editor/nls/messages",{root:{currentLine:"Current Line",incrementalFind:"Incremental find: {0}",incrementalFindNotFound:"Incremental find: {0} (not found)",find:"Find...",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",incrementalFindKey:"Incremental Find",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",
gotoLinePrompty:"Goto Line:",lastEdit:"Last Edit Location",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line {0} : Col {1}",formatMessage:function(c){var e=arguments;return c.replace(/\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})}},"pt-br":true});
define("orion/textview/eventTarget",[],function(){function c(){}c.addMixin=function(e){var a=c.prototype;for(var b in a)if(a.hasOwnProperty(b))e[b]=a[b]};c.prototype={addEventListener:function(e,a,b){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[e];d||(d=this._eventTypes[e]={level:0,listeners:[]});d.listeners.push({listener:a,useCapture:b})},dispatchEvent:function(e){if(this._eventTypes){var a=e.type,b=this._eventTypes[a];if(b){var d=b.listeners;try{b.level++;if(d)for(var f=0,g=
d.length;f<g;f++)if(d[f]){var j=d[f].listener;if(typeof j==="function")j.call(this,e);else j.handleEvent&&typeof j.handleEvent==="function"&&j.handleEvent(e)}}finally{b.level--;if(b.compact&&b.level===0){for(e=d.length-1;e>=0;e--)d[e]||d.splice(e,1);d.length===0&&delete this._eventTypes[a];b.compact=false}}}}},isListening:function(e){if(!this._eventTypes)return false;return this._eventTypes[e]!==undefined},removeEventListener:function(e,a,b){if(this._eventTypes){var d=this._eventTypes[e];if(d){for(var f=
d.listeners,g=0,j=f.length;g<j;g++){var i=f[g];if(i&&i.listener===a&&i.useCapture===b){if(d.level!==0){f[g]=null;d.compact=true}else f.splice(g,1);break}}f.length===0&&delete this._eventTypes[e]}}}};return{EventTarget:c}});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget"],function(c,e,a){function b(d,f){this.editor=d;this.textView=d.getTextView();this.contentAssistPanel=document.getElementById(f);this.active=false;this.prefix="";this.filteredProviders=[];this.proposals=[];var g=this;this.contentAssistListener={onModelChanging:function(j){g.ignoreNextChange=g.isIgnorable(j)},onModelChanged:function(j){g.ignoreNextChange?g.cancel():g.showContentAssist(true,
j);g.ignoreNextChange=false},onScroll:function(){g.cancel()},onMouseUp:function(j){j.event.target.parentElement!==g.contentAssistPanel&&g.cancel()}};this.init()}b.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==-1?new e.KeyBinding(" ",false,false,false,true):new e.KeyBinding(" ",true),c.contentAssist);this.textView.setAction(c.contentAssist,function(){this.showContentAssist(true);return true}.bind(this))},cancel:function(){this.showContentAssist(false)},
isActive:function(){return this.active},isIgnorable:function(d){var f=d.removedCharCount>0&&d.addedCharCount===0,g=this.textView;g=d.start+1<=g.getModel().getCharCount()&&/^\s*$/.test(g.getText(d.start,d.start+1));return d.removedLineCount>0||f&&g},lineUp:function(){if(this.contentAssistPanel){var d=this.getSelectedNode();d===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(d.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var d=
this.getSelectedNode();d===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(d.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var d=this.getSelectedProposal();if(d===null)return false;this.ignoreNextChange=true;this.cancel();this.dispatchEvent({type:"accept",data:{proposal:d,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()}});return true},
setSelected:function(d){for(var f=this.contentAssistPanel.childNodes,g=0;g<f.length;g++){var j=f[g];if(j.className==="selected")j.className="";if(j===d){j.className="selected";j.focus();if(j.offsetTop<this.contentAssistPanel.scrollTop)j.scrollIntoView(true);else j.offsetTop+j.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&j.scrollIntoView(false)}}},getSelectedNode:function(){var d=this.getSelectedIndex();return d===-1?null:this.contentAssistPanel.childNodes[d]},
getSelectedIndex:function(){for(var d=this.contentAssistPanel.childNodes,f=0;f<d.length;f++)if(d[f].className==="selected")return f;return-1},getSelectedProposal:function(){var d=this.getSelectedIndex();return d===-1?null:this.proposals[d]},click:function(d){this.setSelected(d.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(d,f){if(this.contentAssistPanel){this.dispatchEvent({type:d?"show":"hide",data:null});if(d){var g=f?f.start+f.addedCharCount:this.textView.getCaretOffset();
d=g;for(var j;d>0&&(97<=(j=this.textView.getText(d-1,d).charCodeAt(0))&&j<=122||65<=j&&j<=90||j===95||48<=j&&j<=57);)d--;this.prefix=this.textView.getText(d,g);j=this.textView.getText();d=this.textView.getSelection();d.offset=g;this.getKeywords(this.prefix,j,d).then(function(i){this.proposals=[];for(var k=0;k<i.length;k++){var m=i[k];if(!(m===null||m===undefined))if(this.matchesPrefix(m)||this.matchesPrefix(m.proposal))this.proposals.push(m)}if(this.proposals.length===0)this.cancel();else{i=this.textView.getLocationAtOffset(g);
i.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(k=0;k<this.proposals.length;k++)this.createDiv(this.getDisplayString(this.proposals[k]),k===0,this.contentAssistPanel);this.textView.convert(i,"document","page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=i.x+"px";this.contentAssistPanel.style.top=i.y+"px";this.contentAssistPanel.style.display="block";this.contentAssistPanel.scrollTop=0;k=document.documentElement.clientWidth;if(i.y+
this.contentAssistPanel.offsetHeight>document.documentElement.clientHeight)this.contentAssistPanel.style.top=i.y-this.contentAssistPanel.offsetHeight-this.textView.getLineHeight()+"px";if(i.x+this.contentAssistPanel.offsetWidth>k)this.contentAssistPanel.style.left=k-this.contentAssistPanel.offsetWidth+"px";if(!this.listenerAdded){this.textView.addEventListener("ModelChanging",this.contentAssistListener.onModelChanging);this.textView.addEventListener("ModelChanged",this.contentAssistListener.onModelChanged);
this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll);this.textView.addEventListener("MouseUp",this.contentAssistListener.onMouseUp)}this.listenerAdded=true;this.contentAssistPanel.onclick=this.click.bind(this);this.active=true}}.bind(this))}else{if(this.listenerAdded){this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging);this.textView.removeEventListener("ModelChanged",this.contentAssistListener.onModelChanged);this.textView.removeEventListener("Scroll",
this.contentAssistListener.onScroll);this.textView.removeEventListener("MouseUp",this.contentAssistListener.onMouseUp);this.listenerAdded=false}this.active=false;this.contentAssistPanel.style.display="none";this.contentAssistPanel.onclick=null}}},createDiv:function(d,f,g){var j=document.createElement("div");if(f)j.className="selected";d=document.createTextNode(d);j.appendChild(d,j);g.appendChild(j)},getDisplayString:function(d){if(typeof d==="string")return d;if(d.description&&typeof d.description===
"string")return d.description;return d.proposal},matchesPrefix:function(d){return typeof d==="string"&&d.substr(0,this.prefix.length)===this.prefix},getKeywords:function(d,f,g){function j(s){if(s)k=k.concat(s);++m===v.length&&o.done(k)}function i(){++m===v.length&&o.done(k)}for(var k=[],m=0,o=new this.Promise,v=this.filteredProviders,t=0;t<v.length;t++){var w=v[t],u=w.getKeywords;if(typeof w.computeProposals==="function")u=w.computeProposals;(w=u.apply(w,[d,f,g]))&&w.then?w.then(j,i):j(w)}return o},
Promise:function(){function d(){}d.prototype.then=function(f){this.callback=f;if(this.result){var g=this;setTimeout(function(){g.callback(g.result)},0)}};d.prototype.done=function(f){this.result=f;this.callback&&this.callback(this.result)};return d}(),setProviders:function(d){this.filteredProviders=d}};a.EventTarget.addMixin(b.prototype);return{ContentAssist:b}});
define("orion/textview/undoStack",[],function(){function c(b,d,f){this.offset=b;this.text=d;this.previousText=f}function e(){this.changes=[]}function a(b,d){this.view=b;this.size=d!==undefined?d:100;this.reset();d=b.getModel();if(d.getBaseModel)d=d.getBaseModel();this.model=d;var f=this;this._listener={onChanging:function(g){f._onChanging(g)},onDestroy:function(g){f._onDestroy(g)}};d.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Destroy",this._listener.onDestroy)}c.prototype=
{undo:function(b,d){this._doUndoRedo(this.offset,this.previousText,this.text,b,d)},redo:function(b,d){this._doUndoRedo(this.offset,this.text,this.previousText,b,d)},_doUndoRedo:function(b,d,f,g,j){var i=g.getModel();if(i.mapOffset&&g.annotationModel){var k=i.mapOffset(b,true);if(k<0)for(var m=g.annotationModel.getAnnotations(b,b+1);m.hasNext();){var o=m.next();if(o.type==="orion.annotation.folding"){o.expand();k=i.mapOffset(b,true);break}}if(k<0)return;b=k}g.setText(d,b,b+f.length);j&&g.setSelection(b,
b+d.length)}};e.prototype={add:function(b){this.changes.push(b)},end:function(b){this.endSelection=b.getSelection();this.endCaret=b.getCaretOffset()},undo:function(b,d){for(var f=this.changes.length-1;f>=0;f--)this.changes[f].undo(b,false);if(d){d=this.startSelection.start;f=this.startSelection.end;b.setSelection(this.startCaret?d:f,this.startCaret?f:d)}},redo:function(b,d){for(var f=0;f<this.changes.length;f++)this.changes[f].redo(b,false);if(d){d=this.endSelection.start;f=this.endSelection.end;
b.setSelection(this.endCaret?d:f,this.endCaret?f:d)}},start:function(b){this.startSelection=b.getSelection();this.startCaret=b.getCaretOffset()}};a.prototype={add:function(b){if(this.compoundChange)this.compoundChange.add(b);else{this.stack.splice(this.index,this.stack.length-this.index,b);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===
this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=undefined},getSize:function(){var b=this.index,d=this.stack.length;this._undoStart!==undefined&&b++;return{undo:b,redo:d-b}},undo:function(){this._commitUndo();if(this.index<=0)return false;var b=this.stack[--this.index];this._ignoreUndo=true;b.undo(this.view,true);this._ignoreUndo=
false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var b=this.stack[this.index++];this._ignoreUndo=true;b.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=undefined;this._undoText="";this._undoType=0;this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var b=new e;this.add(b);this.compoundChange=b;this.compoundChange.start(this.view)},
_commitUndo:function(){if(this._undoStart!==undefined){this._undoType===-1?this.add(new c(this._undoStart,"",this._undoText)):this.add(new c(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText="";this._undoType=0}},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(b){var d=b.text,f=b.start,g=b.removedCharCount;b=b.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==
undefined&&!(b===1&&g===0&&this._undoType===1&&f===this._undoStart+this._undoText.length||b===0&&g===1&&this._undoType===-1&&(f+1===this._undoStart||f===this._undoStart)))this._commitUndo();if(!this.compoundChange)if(b===1&&g===0){if(this._undoStart===undefined)this._undoStart=f;this._undoText+=d;this._undoType=1;return}else if(b===0&&g===1){d=this._undoText.length>0&&this._undoStart===f;this._undoStart=f;this._undoType=-1;if(d)this._undoText+=this.model.getText(f,f+g);else this._undoText=this.model.getText(f,
f+g)+this._undoText;return}this.add(new c(f,d,this.model.getText(f,f+g)))}}};return{UndoStack:a}});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/extensionCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(c,e,a,b,d,f){var g={};g.EditorCommandFactory=function(){function j(i,k,m,o,v,t,w){this.serviceRegistry=i;this.commandService=k;this.fileClient=m;this.inputManager=o;this.toolbarId=v;this.pageNavId=w;this.isReadOnly=t}j.prototype={generateEditorCommands:function(i){function k(x){var A=new d.KeyBinding;d.KeyBinding.apply(A,x);return A}
if(!this.isReadOnly){i.getTextView().setKeyBinding(new d.KeyBinding("s",true),"Save");this.inputManager.onSave?i.getTextView().setAction("Save",c.hitch(this,function(){var x=i.getText();this.inputManager.onSave(this.inputManager.getInput(),x,c.hitch(this,function(){i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),c.hitch(this,function(A){A.log=true}));return true})):i.getTextView().setAction("Save",c.hitch(this,function(){var x=i.getText(),
A={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),x,A).then(c.hitch(this,function(D){this.inputManager.getFileMetadata().ETag=D.ETag;i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),c.hitch(this,function(D){if(D.status===412)confirm("Resource is out of sync with the server. Do you want to save it anyway?")&&this.fileClient.write(this.inputManager.getInput(),x).then(c.hitch(this,function(h){this.inputManager.getFileMetadata().ETag=
h.ETag;i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else D.log=true}));return true}));this.commandService.addCommand(new e.Command({name:"Save",tooltip:"Save this file",id:"orion.save",callback:function(x){x.items.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,
"orion.editorActions.unlabeled",false,new e.CommandKeyBinding("s",true));var m=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],false);this.commandService.addCommand(new e.Command({name:"Go to Line",tooltip:"Go to specified line number",id:"orion.gotoLine",parameters:m,callback:function(x){var A=i.getModel();if(x.parameters&&x.parameters.valueFor("line"))x=x.parameters.valueFor("line");else{x=A.getLineAtOffset(i.getCaretOffset());if(x=prompt("Go to line:",x+1))x=parseInt(x,
10)}x&&i.onGotoLine(x-1,0)}}),"dom");this.commandService.registerCommandContribution("orion.gotoLine",1,this.pageNavId,null,true,new e.CommandKeyBinding("l",true),new e.URLBinding("gotoLine","line"));i.getTextView().setKeyBinding(new d.KeyBinding("l",true),"gotoLine");i.getTextView().setAction("gotoLine",c.hitch(this,function(){this.commandService.runCommand("orion.gotoLine");return true}));this.commandService.addCommandGroup("orion.editorActions.contributed",101,null,null,this.toolbarId);m=this.serviceRegistry.getServiceReferences("orion.edit.command");
for(var o=this.inputManager,v=function(x,A,D){D.callback=c.hitch(i,function(h){i=h?h.items||this:this;var l=i.getSelection();h=i.getModel();var n=h.getText();A.run(h.getText(l.start,l.end),n,l,o.getInput()).then(function(p){if(p&&p.text){i.setText(p.text);if(p.selection){i.setSelection(p.selection.start,p.selection.end);i.getTextView().focus()}}else if(typeof p==="string"){i.setText(p,l.start,l.end);i.setSelection(l.start,l.start+p.length);i.getTextView().focus()}});return true});return new e.Command(D)},
t=0;t<m.length;t++){for(var w=this.serviceRegistry.getService(m[t]),u={},s=m[t].getPropertyNames(),q=0;q<s.length;q++)u[s[q]]=m[t].getProperty(s[q]);u.forceSingleItem=true;w=v(u,w,b._createCommandOptions(u,m[t],this.serviceRegistry,false,function(){return o.getFileMetadata()}));this.commandService.addCommand(w,"dom");this.commandService.registerCommandContribution(w.id,t,this.toolbarId,"orion.editorActions.contributed");a.generateDomCommandsInBanner(this.commandService,i);if(u.key){s=i.getTextView();
s.setKeyBinding(k(u.key),w.id);s.setAction(w.id,w.callback)}}}}};return j}();g.UndoCommandFactory=function(){function j(i,k,m){this.serviceRegistry=i;this.commandService=k;this.toolbarId=m}j.prototype={createUndoStack:function(i){var k=new f.UndoStack(i.getTextView(),200);i.getTextView().setKeyBinding(new d.KeyBinding("z",true),"Undo");i.getTextView().setAction("Undo",function(){k.undo();return true});this.commandService.addCommand(new e.Command({name:"Undo",id:"orion.undo",callback:function(o){o.items.getTextView().invokeAction("Undo")}}),
"dom");var m=navigator.platform.indexOf("Mac")!==-1?new d.KeyBinding("z",true,true):new d.KeyBinding("y",true);i.getTextView().setKeyBinding(m,"Redo");i.getTextView().setAction("Redo",function(){k.redo();return true});this.commandService.addCommand(new e.Command({name:"Redo",id:"orion.redo",callback:function(o){o.items.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",true,new e.CommandKeyBinding("z",
true));this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,"orion.editorActions.unlabeled",true,m);return k}};return j}();return g});define("orion/textview/nls/messages",{root:{multipleAnnotations:"Multiple annotations:",line:"Line: {0}",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",formatMessage:function(c){var e=arguments;return c.replace(/\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})}},"pt-br":true,"fr-fr":true});
define("orion/textview/annotations",["orion/textview/eventTarget"],function(c){function e(f,g,j,i,k,m,o,v){this.type=g;this.start=j;this.end=i;this._projectionModel=f;this._expandedHTML=this.html=k;this._expandedStyle=this.style=m;this._collapsedHTML=o;this._collapsedStyle=v;this.expanded=true}function a(){}function b(f){this._annotations=[];var g=this;this._listener={onChanged:function(j){g._onChanged(j)}};this.setTextModel(f)}function d(f,g){this._view=f;this._annotationModel=g;var j=this;this._listener=
{onDestroy:function(i){j._onDestroy(i)},onLineStyle:function(i){j._onLineStyle(i)},onChanged:function(i){j._onAnnotationModelChanged(i)}};f.addEventListener("Destroy",this._listener.onDestroy);f.addEventListener("LineStyle",this._listener.onLineStyle);g.addEventListener("Changed",this._listener.onChanged)}e.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var f=this._projectionModel,g=f.getBaseModel();this._projection=
{start:g.getLineStart(g.getLineAtOffset(this.start)+1),end:g.getLineEnd(g.getLineAtOffset(this.end),true)};f.addProjection(this._projection)}},expand:function(){if(!this.expanded){this.expanded=true;this.html=this._expandedHTML;this.style=this._expandedStyle;this._projectionModel.removeProjection(this._projection)}}};a.addMixin=function(f){var g=a.prototype;for(var j in g)if(g.hasOwnProperty(j))f[j]=g[j]};a.prototype={addAnnotationType:function(f){if(!this._annotationTypes)this._annotationTypes=[];
this._annotationTypes.push(f)},getAnnotationTypePriority:function(f){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===f)return g+1;return 0},getAnnotationsByType:function(f,g,j){f=f.getAnnotations(g,j);for(j=[];f.hasNext();){g=f.next();this.getAnnotationTypePriority(g.type)!==0&&j.push(g)}var i=this;j.sort(function(k,m){return i.getAnnotationTypePriority(k.type)-i.getAnnotationTypePriority(m.type)});return j},isAnnotationTypeVisible:function(f){return this.getAnnotationTypePriority(f)!==
0},removeAnnotationType:function(f){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===f){this._annotationTypes.splice(g,1);break}}};b.prototype={addAnnotation:function(f){if(f){var g=this._annotations,j=this._binarySearch(g,f.start);g.splice(j,0,f);this.onChanged({type:"Changed",added:[f],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(f,g){var j=this._annotations,i,k=0,m=function(){for(;k<j.length;){var o=
j[k++];if(f===o.start||(f>o.start?f<o.end:o.start<g))return o;if(o.start>=g)break}return null};i=m();return{next:function(){var o=i;if(o)i=m();return o},hasNext:function(){return i!==null}}},modifyAnnotation:function(f){if(f)this._getAnnotationIndex(f)<0||this.onChanged({type:"Changed",added:[],removed:[],changed:[f]})},onChanged:function(f){return this.dispatchEvent(f)},removeAnnotations:function(f){var g=this._annotations,j,i;if(f){j=[];for(i=g.length-1;i>=0;i--){var k=g[i];k.type===f&&g.splice(i,
1);j.splice(0,0,k)}}else j=g;this.onChanged({type:"Changed",removed:j,added:[],changed:[]})},removeAnnotation:function(f){if(f){f=this._getAnnotationIndex(f);f<0||this.onChanged({type:"Changed",removed:this._annotations.splice(f,1),added:[],changed:[]})}},replaceAnnotations:function(f,g){var j=this._annotations,i,k,m,o=[];if(f)for(i=f.length-1;i>=0;i--){m=f[i];k=this._getAnnotationIndex(m);if(!(k<0)){j.splice(k,1);o.splice(0,0,m)}}g||(g=[]);for(i=0;i<g.length;i++){m=g[i];k=this._binarySearch(j,m.start);
j.splice(k,0,m)}this.onChanged({type:"Changed",removed:o,added:g,changed:[]})},setTextModel:function(f){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=f)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(f,g){for(var j=f.length,i=-1,k;j-i>1;){k=Math.floor((j+i)/2);if(g<=f[k].start)j=k;else i=k}return j},_getAnnotationIndex:function(f){for(var g=this._annotations,j=this._binarySearch(g,f.start);j<g.length&&g[j].start===
f.start;){if(g[j]===f)return j;j++}return-1},_onChanged:function(f){var g=f.start,j=f.removedCharCount,i=this._annotations,k=g+j;if(0<i.length){var m={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:f};f=f.addedCharCount-j;for(j=0;j<i.length;j++){var o=i[j];if(o.start>=k){o.start+=f;o.end+=f;m.changed.push(o)}else if(!(o.end<=g))if(o.start<g&&k<o.end){o.end+=f;m.changed.push(o)}else{i.splice(j,1);m.removed.push(o);j--}}if(m.added.length>0||m.removed.length>0||m.changed.length>
0)this.onChanged(m)}}};c.EventTarget.addMixin(b.prototype);d.prototype={destroy:function(){var f=this._view;if(f){f.removeEventListener("Destroy",this._listener.onDestroy);f.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}(f=this._annotationModel)&&f.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(f,g){if(g){f||(f={});if(f.styleClass&&g.styleClass&&f.styleClass!==g.styleClass)f.styleClass+=" "+g.styleClass;else f.styleClass=g.styleClass;var j;
if(g.style){if(!f.style)f.style={};for(j in g.style)f.style[j]||(f.style[j]=g.style[j])}if(g.attributes){if(!f.attributes)f.attributes={};for(j in g.attributes)f.attributes[j]||(f.attributes[j]=g.attributes[j])}}return f},_mergeStyleRanges:function(f,g){if(f)for(var j=0;j<f.length;j++){var i=f[j];if(g.end<=i.start)break;if(!(g.start>=i.end)){var k=this._mergeStyle({},i.style);k=this._mergeStyle(k,g.style);if(g.start<=i.start&&g.end>=i.end)f[j]={start:i.start,end:i.end,style:k};else if(g.start>i.start&&
g.end<i.end){f.splice(j,1,{start:i.start,end:g.start,style:i.style},{start:g.start,end:g.end,style:k},{start:g.end,end:i.end,style:i.style});j+=2}else if(g.start>i.start){f.splice(j,1,{start:i.start,end:g.start,style:i.style},{start:g.start,end:i.end,style:k});j+=1}else if(g.end<i.end){f.splice(j,1,{start:i.start,end:g.end,style:k},{start:g.end,end:i.end,style:i.style});j+=1}}}},_onAnnotationModelChanged:function(f){function g(m){for(var o=0;o<m.length;o++)if(i.isAnnotationTypeVisible(m[o].type)){var v=
m[o].start,t=m[o].end;if(k.getBaseModel){v=k.mapOffset(v,true);t=k.mapOffset(t,true)}v!==-1&&t!==-1&&j.redrawRange(v,t)}}if(!f.textModelChangedEvent){var j=this._view;if(j){var i=this,k=j.getModel();g(f.added);g(f.removed);g(f.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(f){var g=this._annotationModel,j=this._view.getModel(),i=g.getTextModel(),k=f.lineStart,m=f.lineStart+f.lineText.length;if(i!==j){k=j.mapOffset(k);m=j.mapOffset(m)}for(g=g.getAnnotations(k,m);g.hasNext();){k=
g.next();if(this.isAnnotationTypeVisible(k.type)){if(k.rangeStyle){m=k.start;var o=k.end;if(i!==j){m=j.mapOffset(m,true);o=j.mapOffset(o,true)}this._mergeStyleRanges(f.ranges,{start:m,end:o,style:k.rangeStyle})}if(k.lineStyle){f.style=this._mergeStyle({},f.style);f.style=this._mergeStyle(f.style,k.lineStyle)}}}}};a.addMixin(d.prototype);return{FoldingAnnotation:e,AnnotationTypeList:a,AnnotationModel:b,AnnotationStyler:d}});
define("orion/textview/textModel",["orion/textview/eventTarget"],function(c){function e(b,d){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(d)}var a=window.navigator.platform.indexOf("Win")!==-1;e.prototype={getCharCount:function(){for(var b=0,d=0;d<this._text.length;d++)b+=this._text[d].length;return b},getLine:function(b,d){var f=this.getLineCount();if(!(0<=b&&b<f))return null;var g=this._lineOffsets[b];if(b+1<f){b=this.getText(g,this._lineOffsets[b+
1]);if(d)return b;d=b.length;for(var j;(j=b.charCodeAt(d-1))===10||j===13;)d--;return b.substring(0,d)}else return this.getText(g)},getLineAtOffset:function(b){var d=this.getCharCount();if(!(0<=b&&b<=d))return-1;var f=this.getLineCount();if(b===d)return f-1;var g,j,i=this._lastLineIndex;if(0<=i&&i<f){g=this._lineOffsets[i];j=i+1<f?this._lineOffsets[i+1]:d;if(g<=b&&b<j)return i}for(var k=f,m=-1;k-m>1;){i=Math.floor((k+m)/2);g=this._lineOffsets[i];j=i+1<f?this._lineOffsets[i+1]:d;if(b<=g)k=i;else if(b<
j){k=i;break}else m=i}return this._lastLineIndex=k},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(b,d){var f=this.getLineCount();if(!(0<=b&&b<f))return-1;if(b+1<f){f=this._lineOffsets[b+1];if(d)return f;b=this.getText(Math.max(this._lineOffsets[b],f-2),f);d=b.length;for(var g;(g=b.charCodeAt(d-1))===10||g===13;)d--;return f-(b.length-d)}else return this.getCharCount()},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;
return this._lineOffsets[b]},getText:function(b,d){if(b===undefined)b=0;if(d===undefined)d=this.getCharCount();if(b===d)return"";for(var f=0,g=0,j;g<this._text.length;){j=this._text[g].length;if(b<=f+j)break;f+=j;g++}for(var i=f,k=g;g<this._text.length;){j=this._text[g].length;if(d<=f+j)break;f+=j;g++}f=f;g=g;if(k===g)return this._text[k].substring(b-i,d-f);b=this._text[k].substring(b-i);d=this._text[g].substring(0,d-f);return b+this._text.slice(k+1,g).join("")+d},onChanging:function(b){return this.dispatchEvent(b)},
onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){if(b==="auto"){b=undefined;if(this.getLineCount()>1)b=this.getText(this.getLineEnd(0),this.getLineEnd(0,true))}this._lineDelimiter=b?b:a?"\r\n":"\n"},setText:function(b,d,f){if(b===undefined)b="";if(d===undefined)d=0;if(f===undefined)f=this.getCharCount();if(!(d===f&&b==="")){for(var g=this.getLineAtOffset(d),j=this.getLineAtOffset(f),i=d,k=f-d,m=j-g,o=b.length,v=0,t=this.getLineCount(),w=0,u=0,s=0,q=[];;){if(w!==-1&&
w<=s)w=b.indexOf("\r",s);if(u!==-1&&u<=s)u=b.indexOf("\n",s);if(u===-1&&w===-1)break;s=w!==-1&&u!==-1?w+1===u?u+1:(w<u?w:u)+1:w!==-1?w+1:u+1;q.push(d+s);v++}this.onChanging({type:"Changing",text:b,start:i,removedCharCount:k,addedCharCount:o,removedLineCount:m,addedLineCount:v});if(q.length===0){w=this.getLineStart(g);j=j+1<t?this.getLineStart(j+1):this.getCharCount();if(d!==w){b=this.getText(w,d)+b;d=w}if(f!==j){b+=this.getText(f,j);f=j}}j=o-k;for(w=g+m+1;w<t;w++)this._lineOffsets[w]+=j;g=[g+1,m].concat(q);
Array.prototype.splice.apply(this._lineOffsets,g);for(j=q=0;j<this._text.length;){w=this._text[j].length;if(d<=q+w)break;q+=w;j++}t=q;for(g=j;j<this._text.length;){w=this._text[j].length;if(f<=q+w)break;q+=w;j++}q=q;j=j;w=this._text[j];d=this._text[g].substring(0,d-t);f=w.substring(f-q);g=[g,j-g+1];d&&g.push(d);b&&g.push(b);f&&g.push(f);Array.prototype.splice.apply(this._text,g);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:i,removedCharCount:k,addedCharCount:o,removedLineCount:m,
addedLineCount:v})}}};c.EventTarget.addMixin(e.prototype);return{TextModel:e}});
define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding","orion/textview/eventTarget"],function(c,e,a){function b(h,l,n,p){typeof h.addEventListener==="function"?h.addEventListener(l,n,p===true):h.attachEvent("on"+l,n)}function d(h,l,n,p){typeof h.removeEventListener==="function"?h.removeEventListener(l,n,p===true):h.detachEvent("on"+l,n)}function f(h,l,n){this.start=h;this.end=l;this.caret=n}function g(h){this._init(h)}var j=navigator.userAgent,i;if(document.selection&&
window.ActiveXObject&&/MSIE/.test(j))i=document.documentMode?document.documentMode:7;var k=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||undefined,m=j.indexOf("Opera")!==-1,o=j.indexOf("Chrome")!==-1,v=j.indexOf("Safari")!==-1&&!o,t=j.indexOf("WebKit")!==-1,w=j.indexOf("iPad")!==-1,u=navigator.platform.indexOf("Mac")!==-1,s=navigator.platform.indexOf("Win")!==-1,q=navigator.platform.indexOf("Linux")!==-1,x=typeof window.document.documentElement.addEventListener==="function",A=(!i||
i>=9)&&typeof window.document.createRange().getBoundingClientRect==="function",D=s?"\r\n":"\n";f.prototype={clone:function(){return new f(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(h){if(this.caret)this.start=h;else this.end=h;if(this.start>this.end){h=this.start;this.start=this.end;this.end=h;this.caret=!this.caret}},setCaret:function(h){this.end=this.start=h;this.caret=false},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(h){return this.caret===h.caret&&this.start===h.start&&this.end===h.end}};g.prototype={addRuler:function(h){this._rulers.push(h);h.setView(this);this._createRuler(h);this._updatePage()},computeSize:function(){var h=0,l=0,n=this._model,p=this._clientDiv;if(!p)return{width:h,height:l};var r=p.style.width;
if(t)p.style.width=(524287).toString()+"px";for(var y=n.getLineCount(),B=this._frameDocument,z=0;z<y;z++){var E=this._getLineNode(z),G=null;if(!E||E.lineChanged||E.lineRemoved)E=G=this._createLine(p,null,B,z,n);E=this._getLineBoundingClientRect(E);h=Math.max(h,E.right-E.left);l+=E.bottom-E.top;G&&p.removeChild(G)}if(t)p.style.width=r;n=this._getViewPadding();h+=n.right-n.left;l+=n.bottom-n.top;return{width:h,height:l}},convert:function(h,l,n){if(this._clientDiv){var p=this._getScroll(),r=this._getViewPadding(),
y=this._frame.getBoundingClientRect(),B=this._viewDiv.getBoundingClientRect();switch(l){case "document":if(h.x!==undefined)h.x+=-p.x+B.left+r.left;if(h.y!==undefined)h.y+=-p.y+B.top+r.top;break;case "page":if(h.x!==undefined)h.x+=-y.left;if(h.y!==undefined)h.y+=-y.top;break}switch(n){case "document":if(h.x!==undefined)h.x+=p.x-B.left-r.left;if(h.y!==undefined)h.y+=p.y-B.top-r.top;break;case "page":if(h.x!==undefined)h.x+=y.left;if(h.y!==undefined)h.y+=y.top;break}return h}},destroy:function(){for(var h=
0;h<this._rulers.length;h++)this._rulers[h].setView(null);this.rulers=null;this._destroyFrame();this.onDestroy({type:"Destroy"});this._actions=this._keyBindings=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},focus:function(){if(this._clientDiv){this._updateDOMSelection();if(w)this._textArea.focus();else{m&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},hasFocus:function(){return this._hasFocus},getActions:function(h){for(var l=
[],n=this._actions,p=0;p<n.length;p++)!h&&n[p].defaultHandler||l.push(n[p].name);return l},getBottomIndex:function(h){if(!this._clientDiv)return 0;return this._getBottomIndex(h)},getBottomPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var h=this._getScroll();return{x:h.x,y:h.y,width:this._getClientWidth(),
height:this._getClientHeight()}},getHorizontalPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().x},getKeyBindings:function(h){for(var l=[],n=this._keyBindings,p=0;p<n.length;p++)n[p].name===h&&l.push(n[p].keyBinding);return l},getLineHeight:function(){if(!this._clientDiv)return 0;return this._getLineHeight()},getLinePixel:function(h){if(!this._clientDiv)return 0;h=Math.min(Math.max(0,h),this._model.getLineCount());return this._getLineHeight()*h},getLocationAtOffset:function(h){if(!this._clientDiv)return{x:0,
y:0};var l=this._model;h=Math.min(Math.max(0,h),l.getCharCount());l=l.getLineAtOffset(h);var n=this._getScroll(),p=this._viewDiv.getBoundingClientRect(),r=this._getViewPadding();h=this._getOffsetToX(h)+n.x-p.left-r.left;l=this.getLinePixel(l);return{x:h,y:l}},getOptions:function(){var h;if(arguments.length===0)h=this._defaultOptions();else if(arguments.length===1){h=arguments[0];if(typeof h==="string")return this._clone(this["_"+h]);h=h}else{h={};for(var l in arguments)if(arguments.hasOwnProperty(l))h[arguments[l]]=
undefined}for(var n in h)if(h.hasOwnProperty(n))h[n]=this._clone(this["_"+n]);return h},getModel:function(){return this._model},getOffsetAtLocation:function(h,l){if(!this._clientDiv)return 0;var n=this._getScroll(),p=this._viewDiv.getBoundingClientRect(),r=this._getViewPadding();l=this._getYToLine(l-n.y);h+=-n.x+p.left+r.left;return this._getXToOffset(l,h)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var h=this._getSelection();return{start:h.start,end:h.end}},getText:function(h,
l){return this._model.getText(h,l)},getTopIndex:function(h){if(!this._clientDiv)return 0;return this._getTopIndex(h)},getTopPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().y},invokeAction:function(h,l){if(this._clientDiv){for(var n=this._actions,p=0;p<n.length;p++){var r=n[p];if(r.name&&r.name===h){if(!l&&r.userHandler)if(r.userHandler())return;if(r.defaultHandler)return r.defaultHandler();return false}}return false}},isLoaded:function(){return!!this._clientDiv},onContextMenu:function(h){return this.dispatchEvent(h)},
onDragStart:function(h){return this.dispatchEvent(h)},onDrag:function(h){return this.dispatchEvent(h)},onDragEnd:function(h){return this.dispatchEvent(h)},onDragEnter:function(h){return this.dispatchEvent(h)},onDragOver:function(h){return this.dispatchEvent(h)},onDragLeave:function(h){return this.dispatchEvent(h)},onDrop:function(h){return this.dispatchEvent(h)},onDestroy:function(h){return this.dispatchEvent(h)},onLineStyle:function(h){return this.dispatchEvent(h)},onLoad:function(h){return this.dispatchEvent(h)},
onModelChanged:function(h){return this.dispatchEvent(h)},onModelChanging:function(h){return this.dispatchEvent(h)},onModify:function(h){return this.dispatchEvent(h)},onMouseDown:function(h){return this.dispatchEvent(h)},onMouseUp:function(h){return this.dispatchEvent(h)},onMouseMove:function(h){return this.dispatchEvent(h)},onMouseOver:function(h){return this.dispatchEvent(h)},onMouseOut:function(h){return this.dispatchEvent(h)},onSelection:function(h){return this.dispatchEvent(h)},onScroll:function(h){return this.dispatchEvent(h)},
onVerify:function(h){return this.dispatchEvent(h)},onUnload:function(h){return this.dispatchEvent(h)},onFocus:function(h){return this.dispatchEvent(h)},onBlur:function(h){return this.dispatchEvent(h)},redraw:function(){if(!(this._redrawCount>0)){for(var h=this._model.getLineCount(),l=this.getRulers(),n=0;n<l.length;n++)this.redrawLines(0,h,l[n]);this.redrawLines(0,h)}},redrawLines:function(h,l,n){if(!(this._redrawCount>0)){if(h===undefined)h=0;if(l===undefined)l=this._model.getLineCount();if(h!==
l){var p=this._clientDiv;if(p){if(n)for(var r=(n.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,y=0;y<r.length;y++)if(r[y].firstChild._ruler===n){p=r[y].firstChild;break}if(n)p.rulerChanged=true;if(!n||n.getOverview()==="page")for(p=p.firstChild;p;){r=p.lineIndex;if(h<=r&&r<l)p.lineChanged=true;p=p.nextSibling}if(!n)if(h<=this._maxLineIndex&&this._maxLineIndex<l){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},
redrawRange:function(h,l){if(!(this._redrawCount>0)){var n=this._model;if(h===undefined)h=0;if(l===undefined)l=n.getCharCount();var p=n.getLineAtOffset(h);h=n.getLineAtOffset(Math.max(h,l-1))+1;this.redrawLines(p,h)}},removeRuler:function(h){for(var l=this._rulers,n=0;n<l.length;n++)if(l[n]===h){l.splice(n,1);h.setView(null);this._destroyRuler(h);this._updatePage();break}},setAction:function(h,l){if(h){for(var n=this._actions,p=0;p<n.length;p++){var r=n[p];if(r.name===h){r.userHandler=l;return}}n.push({name:h,
userHandler:l})}},setKeyBinding:function(h,l){for(var n=this._keyBindings,p=0;p<n.length;p++){var r=n[p];if(r.keyBinding.equals(h)){if(l)r.name=l;else if(r.predefined)r.name=null;else{h=r.name;n.splice(p,1);for(p=0;p<n.length&&h!==n[p].name;)p++;if(p===n.length){n=this._actions;for(p=0;p<n.length;p++)if(n[p].name===h)n[p].defaultHandler||n.splice(p,1)}}return}}l&&n.push({keyBinding:h,name:l})},setCaretOffset:function(h,l){var n=this._model.getCharCount();h=Math.max(0,Math.min(h,n));this._setSelection(new f(h,
h,false),l===undefined||l)},setHorizontalPixel:function(h){if(this._clientDiv){h=Math.max(0,h);this._scrollView(h-this._getScroll().x,0)}},setRedraw:function(h){if(h)--this._redrawCount===0&&this.redraw();else this._redrawCount++},setModel:function(h){if(h)if(h!==this._model){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);var l=this._model.getLineCount(),n=this._model.getCharCount(),p=h.getLineCount(),
r=h.getCharCount(),y={type:"ModelChanging",text:h.getText(),start:0,removedCharCount:n,addedCharCount:r,removedLineCount:l,addedLineCount:p};this.onModelChanging(y);this._model=h;y={type:"ModelChanged",start:0,removedCharCount:n,addedCharCount:r,removedLineCount:l,addedLineCount:p};this.onModelChanged(y);this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);this._reset();this._updatePage()}},setOptions:function(h){var l=
this._defaultOptions(),n=false,p,r=this._clientDiv;if(r)for(p in h)if(h.hasOwnProperty(p))if(l[p].recreate){n=true;break}var y=false;for(p in h)if(h.hasOwnProperty(p)){var B=h[p];if(!this._compare(this["_"+p],B)){y=true;if(!n){var z=l[p].update;if(r&&z){if(z.call(this,B))n=true;continue}}this["_"+p]=this._clone(B)}}if(y)if(n){this._frame.parentNode.removeChild(this._frame);this._parent.appendChild(this._frame)}},setSelection:function(h,l,n){var p=h>l;if(p){var r=h;h=l;l=r}r=this._model.getCharCount();
h=Math.max(0,Math.min(h,r));l=Math.max(0,Math.min(l,r));this._setSelection(new f(h,l,p),n===undefined||n)},setText:function(h,l,n){var p=l===undefined&&n===undefined;if(l===undefined)l=0;if(n===undefined)n=this._model.getCharCount();this._modifyContent({text:h,start:l,end:n,_code:true},!p);if(p){this._columnX=-1;this._setSelection(new f(0,0,false),true);k&&this._fixCaret()}},setTopIndex:function(h){if(this._clientDiv){var l=this._model;if(l.getCharCount()!==0){l=l.getLineCount();var n=this._getLineHeight(),
p=Math.max(1,Math.min(l,Math.floor(this._getClientHeight()/n)));if(h<0)h=0;else if(h>l-p)h=l-p;this._scrollView(0,h*n-this._getScroll().y)}}},setTopPixel:function(h){if(this._clientDiv){var l=this._getLineHeight(),n=this._getClientHeight(),p=this._model.getLineCount();h=Math.min(Math.max(0,h),l*p-n);this._scrollView(0,h-this._getScroll().y)}},showSelection:function(){return this._showCaret(true)},_handleBodyMouseDown:function(h){if(!h)h=window.event;if(k&&h.which===1){this._clientDiv.contentEditable=
false;this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=true}for(var l=m||k&&!this._overlayDiv?this._clientDiv:this._overlayDiv||this._viewDiv,n=h.target?h.target:h.srcElement;n;){if(l===n)return;n=n.parentNode}h.preventDefault&&h.preventDefault();h.stopPropagation&&h.stopPropagation();if(!x){l.setCapture();setTimeout(function(){l.releaseCapture()},0)}},_handleBodyMouseUp:function(h){if(!h)h=window.event;if(k&&h.which===1){this._clientDiv.contentEditable=true;(this._overlayDiv||this._clientDiv).draggable=
false;this._fixCaret();this._ignoreBlur=false}},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=false;if(i<9)if(!this._getSelection().isEmpty()){var h=this._frameDocument,l=h.createElement("DIV");h=h.body;h.appendChild(l);h.removeChild(l)}if(k||i)if(this._selDiv1){l=i?"transparent":"#AFAFAF";this._selDiv1.style.background=l;this._selDiv2.style.background=l;this._selDiv3.style.background=l}this._ignoreFocus||this.onBlur({type:"Blur"})}},_handleContextMenu:function(h){if(!h)h=window.event;
k&&this._lastMouseButton===3&&h.timeStamp-this._lastMouseTime<=this._clickTime&&this._updateDOMSelection();if(this.isListening("ContextMenu")){var l=this._createMouseEvent("ContextMenu",h);l.screenX=h.screenX;l.screenY=h.screenY;this.onContextMenu(l)}h.preventDefault&&h.preventDefault();return false},_handleCopy:function(h){if(!this._ignoreCopy){if(!h)h=window.event;if(this._doCopy(h)){h.preventDefault&&h.preventDefault();return false}}},_handleCut:function(h){if(!h)h=window.event;if(this._doCut(h)){h.preventDefault&&
h.preventDefault();return false}},_handleDOMAttrModified:function(h){if(!h)h=window.event;for(var l=false,n=this._parent;n;){if(n===h.target){l=true;break}n=n.parentNode}if(l){h=this._getVisible();if(h==="visible")this._createView();else h==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(h){if(!h)h=window.event;this._lastMouseTime=h.timeStamp?h.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(h)}},
_handleDragStart:function(h){if(!h)h=window.event;if(k){var l=this;setTimeout(function(){l._clientDiv.contentEditable=true;l._clientDiv.draggable=false;l._ignoreBlur=false},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1){this._isMouseDown=false;this.onDragStart(this._createMouseEvent("DragStart",h));this._dragOffset=-1}else{h.preventDefault&&h.preventDefault();return false}},_handleDrag:function(h){if(!h)h=window.event;this.isListening("Drag")&&this.onDrag(this._createMouseEvent("Drag",
h))},_handleDragEnd:function(h){if(!h)h=window.event;this._dropTarget=false;this._dragOffset=-1;this.isListening("DragEnd")&&this.onDragEnd(this._createMouseEvent("DragEnd",h));if(k){this._fixCaret();h.dataTransfer.dropEffect==="none"&&!h.dataTransfer.mozUserCancelled&&this._fixCaret()}},_handleDragEnter:function(h){if(!h)h=window.event;var l=true;this._dropTarget=true;if(this.isListening("DragEnter")){l=false;this.onDragEnter(this._createMouseEvent("DragEnter",h))}if(t||l){h.preventDefault&&h.preventDefault();
return false}},_handleDragOver:function(h){if(!h)h=window.event;var l=true;if(this.isListening("DragOver")){l=false;this.onDragOver(this._createMouseEvent("DragOver",h))}if(t||l){if(l)h.dataTransfer.dropEffect="none";h.preventDefault&&h.preventDefault();return false}},_handleDragLeave:function(h){if(!h)h=window.event;this._dropTarget=false;this.isListening("DragLeave")&&this.onDragLeave(this._createMouseEvent("DragLeave",h))},_handleDrop:function(h){if(!h)h=window.event;this._dropTarget=false;this.isListening("Drop")&&
this.onDrop(this._createMouseEvent("Drop",h));h.preventDefault&&h.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;i&&this._updateDOMSelection();if(k||i)if(this._selDiv1){var h=this._hightlightRGB;this._selDiv1.style.background=h;this._selDiv2.style.background=h;this._selDiv3.style.background=h}this._ignoreFocus||this.onFocus({type:"Focus"})},_handleKeyDown:function(h){if(!h)h=window.event;if(w){if(h.keyCode===8){this._doBackspace({});
h.preventDefault()}}else{switch(h.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(h.keyCode===229){if(this._readonly){h.preventDefault&&h.preventDefault();return false}var l=true;if(v&&u)if(h.ctrlKey)l=false;l&&this._startIME()}else this._commitIME();if((u||q)&&k<4||m){this._keyDownEvent=h;return true}if(this._doAction(h)){if(h.preventDefault)h.preventDefault();else{h.cancelBubble=true;h.returnValue=false;h.keyCode=0}return false}}},_handleKeyPress:function(h){if(!h)h=
window.event;if(u&&t)if(63232<=h.keyCode&&h.keyCode<=63487||h.keyCode===13||h.keyCode===8){h.preventDefault&&h.preventDefault();return false}if((u||q)&&k<4||m)if(this._doAction(this._keyDownEvent)){h.preventDefault&&h.preventDefault();return false}var l=u?h.metaKey:h.ctrlKey;if(h.charCode!==undefined)if(l)switch(h.charCode){case 99:case 118:case 120:return true}l=false;if(u){if(h.ctrlKey||h.metaKey)l=true}else if(k){if(h.ctrlKey||h.altKey)l=true}else if(h.ctrlKey^h.altKey)l=true;if(!l){l=m?h.which:
h.charCode!==undefined?h.charCode:h.keyCode;if(l>31){this._doContent(String.fromCharCode(l));h.preventDefault&&h.preventDefault();return false}}},_handleKeyUp:function(h){if(!h)h=window.event;(u?h.metaKey:h.ctrlKey)||this._setLinksVisible(false);h.keyCode===13&&this._commitIME()},_handleLinkClick:function(h){if(!h)h=window.event;if(!(u?h.metaKey:h.ctrlKey)){h.preventDefault&&h.preventDefault();return false}},_handleLoad:function(){var h=this._getVisible();if(h==="visible"||h==="hidden"&&t)this._createView()},
_handleMouse:function(h){var l=true,n=this._frameWindow;if(i||k&&!this._overlayDiv)n=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=true;var p=this;setTimeout(function(){p.focus();p._ignoreFocus=false},0)}if(this._clickCount===1)(l=this._setSelectionTo(h.clientX,h.clientY,h.shiftKey,!m&&this.isListening("DragStart")))&&this._setGrab(n);else{x&&this._setGrab(n);this._doubleClickSelection=null;this._setSelectionTo(h.clientX,h.clientY,h.shiftKey);this._doubleClickSelection=
this._getSelection()}return l},_handleMouseDown:function(h){if(!h)h=window.event;this.isListening("MouseDown")&&this.onMouseDown(this._createMouseEvent("MouseDown",h));if(this._linksVisible)if((h.target||h.srcElement).tagName!=="A")this._setLinksVisible(false);else return;this._commitIME();var l=h.which;if(!l){if(h.button===4)l=2;if(h.button===2)l=3;if(h.button===1)l=1}var n=l!==2&&h.timeStamp?h.timeStamp:(new Date).getTime(),p=n-this._lastMouseTime,r=Math.abs(this._lastMouseX-h.clientX),y=Math.abs(this._lastMouseY-
h.clientY),B=this._lastMouseButton===l;this._lastMouseX=h.clientX;this._lastMouseY=h.clientY;this._lastMouseTime=n;this._lastMouseButton=l;if(l===1){this._isMouseDown=true;if(B&&p<=this._clickTime&&r<=this._clickDist&&y<=this._clickDist)this._clickCount++;else this._clickCount=1;if(this._handleMouse(h)&&(m||o||k&&!this._overlayDiv)){this._hasFocus||this.focus();h.preventDefault()}}},_handleMouseOver:function(h){if(!h)h=window.event;this.isListening("MouseOver")&&this.onMouseOver(this._createMouseEvent("MouseOver",
h))},_handleMouseOut:function(h){if(!h)h=window.event;this.isListening("MouseOut")&&this.onMouseOut(this._createMouseEvent("MouseOut",h))},_handleMouseMove:function(h){if(!h)h=window.event;if(this.isListening("MouseMove"))for(var l=this._overlayDiv||this._clientDiv,n=h.target?h.target:h.srcElement;n;){if(l===n){this.onMouseMove(this._createMouseEvent("MouseMove",h));break}n=n.parentNode}if(!this._dropTarget){l=this._linksVisible||this._lastMouseMoveX!==h.clientX||this._lastMouseMoveY!==h.clientY;
this._lastMouseMoveX=h.clientX;this._lastMouseMoveY=h.clientY;this._setLinksVisible(l&&!this._isMouseDown&&(u?h.metaKey:h.ctrlKey));if(!x){if(h.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&h.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(h,this._clickCount)}}if(!(!this._isMouseDown||this._dragOffset!==-1)){l=h.clientX;n=h.clientY;if(o)if(h.currentTarget!==this._frameWindow){h=this._frame.getBoundingClientRect();l-=h.left;n-=h.top}var p=this._getViewPadding(),
r=this._viewDiv.getBoundingClientRect(),y=this._getClientWidth(),B=this._getClientHeight();h=r.left+p.left;var z=r.top+p.top;y=r.left+p.left+y;p=r.top+p.top+B;r=this._model;B=r.getLineAtOffset(this._getSelection().getCaret());if(n<z&&B!==0)this._doAutoScroll("up",l,n-z);else if(n>p&&B!==r.getLineCount()-1)this._doAutoScroll("down",l,n-p);else if(l<h)this._doAutoScroll("left",l-h,n);else if(l>y)this._doAutoScroll("right",l-y,n);else{this._endAutoScroll();this._setSelectionTo(l,n,true);i&&this._frameDocument.body.getBoundingClientRect()}}}},
_createMouseEvent:function(h,l){var n=this._getScroll(),p=this._viewDiv.getBoundingClientRect(),r=this._getViewPadding();return{type:h,event:l,x:l.clientX+n.x-p.left-r.left,y:l.clientY+n.y-p.top}},_handleMouseUp:function(h){if(!h)h=window.event;this.isListening("MouseUp")&&this.onMouseUp(this._createMouseEvent("MouseUp",h));if(!this._linksVisible)if(h.which?h.button===0:h.button===1){if(this._dragOffset!==-1){var l=this._getSelection();l.extend(this._dragOffset);l.collapse();this._setSelection(l,
true,true);this._dragOffset=-1}this._isMouseDown=false;this._endAutoScroll();x&&this._setGrab(null);k&&h.preventDefault()}},_handleMouseWheel:function(h){if(!h)h=window.event;var l=this._getLineHeight(),n=0,p=0;if(k){l=u?h.detail*3:Math.max(-256,Math.min(256,h.detail))*l;if(h.axis===h.HORIZONTAL_AXIS)n=l;else p=l}else if(u){p=n=40;if(h.wheelDeltaX%120!==0)n=1;if(h.wheelDeltaY%120!==0)p=1;n=-h.wheelDeltaX/n;if(-1<n&&n<0)n=-1;if(0<n&&n<1)n=1;p=-h.wheelDeltaY/p;if(-1<p&&p<0)p=-1;if(0<p&&p<1)p=1}else{n=
-h.wheelDeltaX;p=-h.wheelDeltaY/120*8*l}if(v){for(l=h.target;l&&l.lineIndex===undefined;)l=l.parentNode;this._mouseWheelLine=l}l=this._getScroll();this._scrollView(n,p);n=this._getScroll();if(v)this._mouseWheelLine=null;if(l.x!==n.x||l.y!==n.y){h.preventDefault&&h.preventDefault();return false}},_handlePaste:function(h){if(!this._ignorePaste){if(!h)h=window.event;if(this._doPaste(h)){if(i){var l=this;this._ignoreFocus=true;setTimeout(function(){l._updateDOMSelection();this._ignoreFocus=false},0)}h.preventDefault&&
h.preventDefault();return false}}},_handleResize:function(){var h=this._frameDocument.documentElement,l=h.clientWidth;h=h.clientHeight;if(this._frameWidth!==l||this._frameHeight!==h){this._frameWidth=l;this._frameHeight=h;i<9?this._queueUpdatePage():this._updatePage()}},_handleRulerEvent:function(h){if(!h)h=window.event;var l=h.target?h.target:h.srcElement,n=l.lineIndex;for(l=l;l&&!l._ruler;){if(n===undefined&&l.lineIndex!==undefined)n=l.lineIndex;l=l.parentNode}l=l?l._ruler:null;if(n===undefined&&
l&&l.getOverview()==="document"){n=w?0:17;var p=this._getClientHeight(),r=this._model.getLineCount(),y=this._getViewPadding();n=Math.floor((h.clientY-n)*r/(p+y.top+y.bottom-2*n));0<=n&&n<r||(n=undefined)}if(l)switch(h.type){case "click":l.onClick&&l.onClick(n,h);break;case "dblclick":l.onDblClick&&l.onDblClick(n,h);break;case "mousemove":l.onMouseMove&&l.onMouseMove(n,h);break;case "mouseover":l.onMouseOver&&l.onMouseOver(n,h);break;case "mouseout":l.onMouseOut&&l.onMouseOut(n,h);break}},_handleScroll:function(){var h=
this._getScroll(),l=this._hScroll,n=this._vScroll;if(l!==h.x||n!==h.y){this._hScroll=h.x;this._vScroll=h.y;this._commitIME();this._updatePage(n===h.y);this.onScroll({type:"Scroll",oldValue:{x:l,y:n},newValue:h})}},_handleSelectStart:function(h){if(!h)h=window.event;if(this._ignoreSelect){h&&h.preventDefault&&h.preventDefault();return false}},_handleUnload:function(){this._frameLoaded=false;this._destroyView()},_handleInput:function(h){var l=this._textArea;this._doContent(l.value);l.selectionStart=
l.selectionEnd=0;l.value="";h.preventDefault()},_handleTextInput:function(h){this._doContent(h.data);h.preventDefault()},_touchConvert:function(h){var l=this._frame.getBoundingClientRect(),n=this._parentDocument.body;return{left:h.clientX-l.left-n.scrollLeft,top:h.clientY-l.top-n.scrollTop}},_handleTextAreaClick:function(h){h=this._touchConvert(h);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(h.left,h.top,false);this._textArea.focus()},_handleTouchStart:function(h){var l=
h.touches,n,p;this._touchMoved=false;this._touchStartScroll=undefined;if(l.length===1){n=l[0];p=n.pageY;this._touchStartX=n.pageX;this._touchStartY=p;this._touchStartTime=h.timeStamp;this._touchStartScroll=this._getScroll();h=this._getSelection();p=this._touchConvert(l[0]);this._touchGesture="none";if(!h.isEmpty())if(this._hitOffset(h.end,p.left,p.top))this._touchGesture="extendEnd";else if(this._hitOffset(h.start,p.left,p.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){l=this._textArea;
l.value="";l.style.left="-1000px";l.style.top="-1000px";l.style.width="3000px";l.style.height="3000px"}}else if(l.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}p=this._touchConvert(l[0]);n=this._getXToOffset(this._getYToLine(p.top),p.left);p=this._touchConvert(l[1]);l=this._getXToOffset(this._getYToLine(p.top),p.left);h=this._getSelection();h.setCaret(n);h.extend(l);this._setSelection(h,true,true)}},_handleTouchMove:function(h){this._touchMoved=
true;var l=h.touches,n;if(l.length===1){l=l[0];var p=l.pageX,r=l.pageY,y=this._touchStartX-p,B=this._touchStartY-r;n=this._touchConvert(l);l=this._getSelection();if(this._touchGesture==="none")this._touchGesture=h.timeStamp-this._touchStartTime<200&&(Math.abs(y)>5||Math.abs(B)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(l.end,n.left,n.top)?"extendEnd":this._hitOffset(l.start,n.left,n.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=
p;this._touchStartY=r;this._scrollView(y,B);break;case "extendStart":case "extendEnd":this._clickCount=1;n=this._getXToOffset(this._getYToLine(n.top),n.left);l.setCaret(this._touchGesture==="extendStart"?l.end:l.start);l.extend(n);if(n>=l.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(n<=l.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(l,true,true);break;case "caret":this._setSelectionTo(n.left,n.top,false);break}}else if(l.length===
2){n=this._touchConvert(l[0]);p=this._getXToOffset(this._getYToLine(n.top),n.left);n=this._touchConvert(l[1]);n=this._getXToOffset(this._getYToLine(n.top),n.left);l=this._getSelection();l.setCaret(p);l.extend(n);this._setSelection(l,true,true)}h.preventDefault()},_handleTouchEnd:function(h){var l=this;if(!this._touchMoved)if(h.touches.length===0&&h.changedTouches.length===1){var n=this._touchConvert(h.changedTouches[0]),p=this._textArea;p.value="";p.style.left="-1000px";p.style.top="-1000px";p.style.width=
"3000px";p.style.height="3000px";setTimeout(function(){l._clickCount=1;l._ignoreDOMSelection=false;l._setSelectionTo(n.left,n.top,false)},300)}h.touches.length===0&&setTimeout(function(){var r=l._getSelection(),y=l._model.getText(r.start,r.end),B=l._textArea;B.value=y;B.selectionStart=0;B.selectionEnd=y.length;if(!r.isEmpty()){y=l._touchDiv.getBoundingClientRect();r=l._getOffsetBounds(r.start);B.style.left=y.width/2+"px";B.style.top=(r.top>40?r.top-30:r.top+30)+"px"}},0)},_doAction:function(h){for(var l=
this._keyBindings,n=0;n<l.length;n++){var p=l[n];if(p.keyBinding.match(h)){if(p.name){h=this._actions;for(l=0;l<h.length;l++){n=h[l];if(n.name===p.name){if(n.userHandler){if(!n.userHandler())if(n.defaultHandler)n.defaultHandler();else return false}else n.defaultHandler&&n.defaultHandler();break}}}return true}}return false},_doBackspace:function(h){var l=this._getSelection();if(l.isEmpty()){var n=this._model,p=l.getCaret(),r=n.getLineAtOffset(p),y=n.getLineStart(r);if(p===y)r>0&&l.extend(n.getLineEnd(r-
1));else{r=false;if(this._expandTab&&h.unit==="character"&&(p-y)%this._tabSize===0)r=!/[^ ]/.test(n.getText(y,p));r?l.extend(p-this._tabSize):l.extend(this._getOffset(p,h.unit,-1))}}this._modifyContent({text:"",start:l.start,end:l.end},true);return true},_doContent:function(h){var l=this._getSelection();this._modifyContent({text:h,start:l.start,end:l.end,_ignoreDOMSelection:true},true)},_doCopy:function(h){var l=this._getSelection();if(!l.isEmpty())return this._setClipboardText(this._getBaseText(l.start,
l.end),h);return true},_doCursorNext:function(h){if(!h.select)if(this._clearSelection("next"))return true;var l=this._model,n=this._getSelection(),p=n.getCaret(),r=l.getLineAtOffset(p);if(p===l.getLineEnd(r))r+1<l.getLineCount()&&n.extend(l.getLineStart(r+1));else n.extend(this._getOffset(p,h.unit,1));h.select||n.collapse();this._setSelection(n,true);return true},_doCursorPrevious:function(h){if(!h.select)if(this._clearSelection("previous"))return true;var l=this._model,n=this._getSelection(),p=n.getCaret(),
r=l.getLineAtOffset(p);if(p===l.getLineStart(r))r>0&&n.extend(l.getLineEnd(r-1));else n.extend(this._getOffset(p,h.unit,-1));h.select||n.collapse();this._setSelection(n,true);return true},_doCut:function(h){var l=this._getSelection();if(!l.isEmpty()){l=this._getBaseText(l.start,l.end);this._doContent("");return this._setClipboardText(l,h)}return true},_doDelete:function(h){var l=this._getSelection();if(l.isEmpty()){var n=this._model,p=l.getCaret(),r=n.getLineAtOffset(p);if(p===n.getLineEnd(r))r+1<
n.getLineCount()&&l.extend(n.getLineStart(r+1));else l.extend(this._getOffset(p,h.unit,1))}this._modifyContent({text:"",start:l.start,end:l.end},true);return true},_doEnd:function(h){var l=this._getSelection(),n=this._model;if(h.ctrl)l.extend(n.getCharCount());else{var p=n.getLineAtOffset(l.getCaret());l.extend(n.getLineEnd(p))}h.select||l.collapse();this._setSelection(l,true);return true},_doEnter:function(h){var l=this._model,n=this._getSelection();this._doContent(l.getLineDelimiter());if(h&&h.noCursor){n.end=
n.start;this._setSelection(n)}return true},_doHome:function(h){var l=this._getSelection(),n=this._model;if(h.ctrl)l.extend(0);else{var p=n.getLineAtOffset(l.getCaret());l.extend(n.getLineStart(p))}h.select||l.collapse();this._setSelection(l,true);return true},_doLineDown:function(h){var l=this._model,n=this._getSelection(),p=n.getCaret(),r=l.getLineAtOffset(p);if(r+1<l.getLineCount()){var y=this._getScroll().x,B=this._columnX;if(B===-1||h.wholeLine||h.select&&i)B=this._getOffsetToX(h.wholeLine?l.getLineEnd(r+
1):p)+y;n.extend(this._getXToOffset(r+1,B-y));h.select||n.collapse();this._setSelection(n,true,true);this._columnX=B}return true},_doLineUp:function(h){var l=this._model,n=this._getSelection(),p=n.getCaret(),r=l.getLineAtOffset(p);if(r>0){var y=this._getScroll().x,B=this._columnX;if(B===-1||h.wholeLine||h.select&&i)B=this._getOffsetToX(h.wholeLine?l.getLineStart(r-1):p)+y;n.extend(this._getXToOffset(r-1,B-y));h.select||n.collapse();this._setSelection(n,true,true);this._columnX=B}return true},_doPageDown:function(h){var l=
this._model,n=this._getSelection(),p=n.getCaret(),r=l.getLineAtOffset(p),y=l.getLineCount();if(r<y-1){l=this._getScroll();var B=this._getClientHeight(),z=this._getLineHeight(),E=Math.floor(B/z),G=Math.min(y-r-1,E);G=Math.max(1,G);E=this._columnX;if(E===-1||h.select&&i)E=this._getOffsetToX(p)+l.x;n.extend(this._getXToOffset(r+G,E-l.x));h.select||n.collapse();h=y*z;p=l.y+G*z;if(p+B>h)p=h-B;this._setSelection(n,true,true,p-l.y);this._columnX=E}return true},_doPageUp:function(h){var l=this._model,n=this._getSelection(),
p=n.getCaret(),r=l.getLineAtOffset(p);if(r>0){l=this._getScroll();var y=this._getClientHeight(),B=this._getLineHeight();y=Math.floor(y/B);var z=Math.max(1,Math.min(r,y));y=this._columnX;if(y===-1||h.select&&i)y=this._getOffsetToX(p)+l.x;n.extend(this._getXToOffset(r-z,y-l.x));h.select||n.collapse();h=Math.max(0,l.y-z*B);this._setSelection(n,true,true,h-l.y);this._columnX=y}return true},_doPaste:function(h){var l=this;return this._getClipboardText(h,function(n){if(n){q&&l._lastMouseButton===2&&(new Date).getTime()-
l._lastMouseTime<=l._clickTime&&l._setSelectionTo(l._lastMouseX,l._lastMouseY);l._doContent(n)}})!==null},_doScroll:function(h){var l=h.type,n=this._model,p=n.getLineCount();h=this._getClientHeight();var r=this._getLineHeight();p=p*r;var y=this._getScroll().y,B;switch(l){case "textStart":B=0;break;case "textEnd":B=p-h;break;case "pageDown":B=y+h;break;case "pageUp":B=y-h;break;case "centerLine":l=this._getSelection();B=n.getLineAtOffset(l.start);n=(n.getLineAtOffset(l.end)-B+1)*r;B=B*r-h/2+n/2;break}if(B!==
undefined){B=Math.min(Math.max(0,B),p-h);this._scrollView(0,B-y)}},_doSelectAll:function(){var h=this._model,l=this._getSelection();l.setCaret(0);l.extend(h.getCharCount());this._setSelection(l,false);return true},_doTab:function(){var h="\t";if(this._expandTab){var l=this._model;h=this._getSelection().getCaret();var n=l.getLineAtOffset(h);l=l.getLineStart(n);h=(new Array(this._tabSize-(h-l)%this._tabSize+1)).join(" ")}this._doContent(h);return true},_applyStyle:function(h,l,n){if(n){n=l.attributes;
for(var p=n.length;p-- >0;)n[p].specified&&l.removeAttributeNode(n[p])}if(h){if(h.styleClass)l.className=h.styleClass;if(n=h.style)for(var r in n)if(n.hasOwnProperty(r))l.style[r]=n[r];if(h=h.attributes)for(var y in h)h.hasOwnProperty(y)&&l.setAttribute(y,h[y])}},_autoScroll:function(){var h=this._getSelection(),l,n=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var p=this._autoScrollY/this._getLineHeight();p=p<0?Math.floor(p):Math.ceil(p);l=this._model.getLineAtOffset(h.getCaret());
l=Math.max(0,Math.min(this._model.getLineCount()-1,l+p))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){l=this._getYToLine(this._autoScrollY);n+=this._getOffsetToX(h.getCaret())}h.extend(this._getXToOffset(l,n));this._setSelection(h,true)},_autoScrollTimer:function(){this._autoScroll();var h=this;this._autoScrollTimerID=setTimeout(function(){h._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateMetrics:function(){var h=this._clientDiv,l=this._frameDocument,n=l.createElement("DIV"),
p={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(p);this._applyStyle(p.style,n);n.style.position="fixed";n.style.left="-1000px";p=l.createElement("SPAN");p.appendChild(l.createTextNode(" "));n.appendChild(p);var r=l.createElement("SPAN");r.style.fontStyle="italic";r.appendChild(l.createTextNode(" "));n.appendChild(r);var y=l.createElement("SPAN");y.style.fontWeight="bold";y.appendChild(l.createTextNode(" "));n.appendChild(y);var B=l.createElement("SPAN");
B.style.fontWeight="bold";B.style.fontStyle="italic";B.appendChild(l.createTextNode(" "));n.appendChild(B);h.appendChild(n);l=n.getBoundingClientRect();p=p.getBoundingClientRect();r=r.getBoundingClientRect();y=y.getBoundingClientRect();var z=B.getBoundingClientRect();B=r.bottom-r.top;y=y.bottom-y.top;r=z.bottom-z.top;z=0;l=l.bottom-l.top;if(B>p.bottom-p.top)z=1;if(y>B)z=2;if(r>y)z=3;var E;if(z!==0){E={style:{}};if((z&1)!==0)E.style.fontStyle="italic";if((z&2)!==0)E.style.fontWeight="bold"}p=this._getLineTrim(n);
h.removeChild(n);return{lineHeight:l,largestFontStyle:E,lineTrim:p,viewPadding:this._calculatePadding()}},_calculatePadding:function(){var h=this._frameDocument,l=this._clientDiv,n=this._getPadding(this._viewDiv),p=h.createElement("DIV");p.style.position="fixed";p.style.left="-1000px";p.style.paddingLeft=n.left+"px";p.style.paddingTop=n.top+"px";p.style.paddingRight=n.right+"px";p.style.paddingBottom=n.bottom+"px";p.style.width="100px";p.style.height="100px";n=h.createElement("DIV");n.style.width=
"100%";n.style.height="100%";p.appendChild(n);l.appendChild(p);h=p.getBoundingClientRect();n=n.getBoundingClientRect();l.removeChild(p);return n={left:n.left-h.left,top:n.top-h.top,right:h.right-n.right,bottom:h.bottom-n.bottom}},_clearSelection:function(h){var l=this._getSelection();if(l.isEmpty())return false;if(h==="next")l.start=l.end;else l.end=l.start;this._setSelection(l,true);return true},_clone:function(h){if(h instanceof Array)return h.slice(0);return h},_compare:function(h,l){if(h===l)return true;
if(h&&!l||!h&&l)return false;if(h&&h.constructor===String||l&&l.constructor===String)return false;if(h instanceof Array||l instanceof Array){if(!(h instanceof Array&&l instanceof Array))return false;if(h.length!==l.length)return false;for(var n=0;n<h.length;n++)if(!this._compare(h[n],l[n]))return false;return true}if(!(h instanceof Object)||!(l instanceof Object))return false;for(n in h)if(h.hasOwnProperty(n)){if(!l.hasOwnProperty(n))return false;if(!this._compare(h[n],l[n]))return false}for(n in l)if(!h.hasOwnProperty(n))return false;
return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var h=this._model,l=h.getLineAtOffset(this._imeOffset),n=h.getLineStart(l),p=this._getDOMText(l);h=h.getLine(l);n=this._imeOffset-n;h=n+p.length-h.length;n!==h&&this._doContent(p.substring(n,h));this._imeOffset=-1}},_convertDelimiter:function(h,l,n){for(var p=0,r=0,y=0,B=h.length;y<B;){if(p!==-1&&p<=y)p=h.indexOf("\r",y);if(r!==-1&&r<=y)r=h.indexOf("\n",y);var z=y,E;if(r===-1&&p===-1){l(h.substring(y));
break}if(p!==-1&&r!==-1)if(p+1===r){E=p;y=r+1}else{E=p<r?p:r;y=(p<r?p:r)+1}else if(p!==-1){E=p;y=p+1}else{E=r;y=r+1}l(h.substring(z,E));n()}},_createActions:function(){var h=e.KeyBinding,l=this._keyBindings=[];l.push({name:"lineUp",keyBinding:new h(38),predefined:true});l.push({name:"lineDown",keyBinding:new h(40),predefined:true});l.push({name:"charPrevious",keyBinding:new h(37),predefined:true});l.push({name:"charNext",keyBinding:new h(39),predefined:true});if(u){l.push({name:"scrollPageUp",keyBinding:new h(33),
predefined:true});l.push({name:"scrollPageDown",keyBinding:new h(34),predefined:true});l.push({name:"pageUp",keyBinding:new h(33,null,null,true),predefined:true});l.push({name:"pageDown",keyBinding:new h(34,null,null,true),predefined:true});l.push({name:"lineStart",keyBinding:new h(37,true),predefined:true});l.push({name:"lineEnd",keyBinding:new h(39,true),predefined:true});l.push({name:"wordPrevious",keyBinding:new h(37,null,null,true),predefined:true});l.push({name:"wordNext",keyBinding:new h(39,
null,null,true),predefined:true});l.push({name:"scrollTextStart",keyBinding:new h(36),predefined:true});l.push({name:"scrollTextEnd",keyBinding:new h(35),predefined:true});l.push({name:"textStart",keyBinding:new h(38,true),predefined:true});l.push({name:"textEnd",keyBinding:new h(40,true),predefined:true});l.push({name:"scrollPageUp",keyBinding:new h(38,null,null,null,true),predefined:true});l.push({name:"scrollPageDown",keyBinding:new h(40,null,null,null,true),predefined:true});l.push({name:"lineStart",
keyBinding:new h(37,null,null,null,true),predefined:true});l.push({name:"lineEnd",keyBinding:new h(39,null,null,null,true),predefined:true});l.push({name:"lineStart",keyBinding:new h(38,null,null,true),predefined:true});l.push({name:"lineEnd",keyBinding:new h(40,null,null,true),predefined:true})}else{l.push({name:"pageUp",keyBinding:new h(33),predefined:true});l.push({name:"pageDown",keyBinding:new h(34),predefined:true});l.push({name:"lineStart",keyBinding:new h(36),predefined:true});l.push({name:"lineEnd",
keyBinding:new h(35),predefined:true});l.push({name:"wordPrevious",keyBinding:new h(37,true),predefined:true});l.push({name:"wordNext",keyBinding:new h(39,true),predefined:true});l.push({name:"textStart",keyBinding:new h(36,true),predefined:true});l.push({name:"textEnd",keyBinding:new h(35,true),predefined:true})}if(k&&q){l.push({name:"lineUp",keyBinding:new h(38,true),predefined:true});l.push({name:"lineDown",keyBinding:new h(40,true),predefined:true})}l.push({name:"selectLineUp",keyBinding:new h(38,
null,true),predefined:true});l.push({name:"selectLineDown",keyBinding:new h(40,null,true),predefined:true});l.push({name:"selectCharPrevious",keyBinding:new h(37,null,true),predefined:true});l.push({name:"selectCharNext",keyBinding:new h(39,null,true),predefined:true});l.push({name:"selectPageUp",keyBinding:new h(33,null,true),predefined:true});l.push({name:"selectPageDown",keyBinding:new h(34,null,true),predefined:true});if(u){l.push({name:"selectLineStart",keyBinding:new h(37,true,true),predefined:true});
l.push({name:"selectLineEnd",keyBinding:new h(39,true,true),predefined:true});l.push({name:"selectWordPrevious",keyBinding:new h(37,null,true,true),predefined:true});l.push({name:"selectWordNext",keyBinding:new h(39,null,true,true),predefined:true});l.push({name:"selectTextStart",keyBinding:new h(36,null,true),predefined:true});l.push({name:"selectTextEnd",keyBinding:new h(35,null,true),predefined:true});l.push({name:"selectTextStart",keyBinding:new h(38,true,true),predefined:true});l.push({name:"selectTextEnd",
keyBinding:new h(40,true,true),predefined:true});l.push({name:"selectLineStart",keyBinding:new h(37,null,true,null,true),predefined:true});l.push({name:"selectLineEnd",keyBinding:new h(39,null,true,null,true),predefined:true});l.push({name:"selectLineStart",keyBinding:new h(38,null,true,true),predefined:true});l.push({name:"selectLineEnd",keyBinding:new h(40,null,true,true),predefined:true})}else{if(q){l.push({name:"selectWholeLineUp",keyBinding:new h(38,true,true),predefined:true});l.push({name:"selectWholeLineDown",
keyBinding:new h(40,true,true),predefined:true})}l.push({name:"selectLineStart",keyBinding:new h(36,null,true),predefined:true});l.push({name:"selectLineEnd",keyBinding:new h(35,null,true),predefined:true});l.push({name:"selectWordPrevious",keyBinding:new h(37,true,true),predefined:true});l.push({name:"selectWordNext",keyBinding:new h(39,true,true),predefined:true});l.push({name:"selectTextStart",keyBinding:new h(36,true,true),predefined:true});l.push({name:"selectTextEnd",keyBinding:new h(35,true,
true),predefined:true})}l.push({name:"deletePrevious",keyBinding:new h(8),predefined:true});l.push({name:"deletePrevious",keyBinding:new h(8,null,true),predefined:true});l.push({name:"deleteNext",keyBinding:new h(46),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h(8,true),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h(8,true,true),predefined:true});l.push({name:"deleteWordNext",keyBinding:new h(46,true),predefined:true});l.push({name:"tab",keyBinding:new h(9),
predefined:true});l.push({name:"enter",keyBinding:new h(13),predefined:true});l.push({name:"enter",keyBinding:new h(13,null,true),predefined:true});l.push({name:"selectAll",keyBinding:new h("a",true),predefined:true});if(u){l.push({name:"deleteNext",keyBinding:new h(46,null,true),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h(8,null,null,true),predefined:true});l.push({name:"deleteWordNext",keyBinding:new h(46,null,null,true),predefined:true})}if(!k){var n=u&&o;l.push({name:null,
keyBinding:new h("u",!n,false,false,n),predefined:true});l.push({name:null,keyBinding:new h("i",!n,false,false,n),predefined:true});l.push({name:null,keyBinding:new h("b",!n,false,false,n),predefined:true})}if(k){l.push({name:"copy",keyBinding:new h(45,true),predefined:true});l.push({name:"paste",keyBinding:new h(45,null,true),predefined:true});l.push({name:"cut",keyBinding:new h(46,null,true),predefined:true})}if(u){l.push({name:"lineStart",keyBinding:new h("a",false,false,false,true),predefined:true});
l.push({name:"lineEnd",keyBinding:new h("e",false,false,false,true),predefined:true});l.push({name:"lineUp",keyBinding:new h("p",false,false,false,true),predefined:true});l.push({name:"lineDown",keyBinding:new h("n",false,false,false,true),predefined:true});l.push({name:"charPrevious",keyBinding:new h("b",false,false,false,true),predefined:true});l.push({name:"charNext",keyBinding:new h("f",false,false,false,true),predefined:true});l.push({name:"deletePrevious",keyBinding:new h("h",false,false,false,
true),predefined:true});l.push({name:"deleteNext",keyBinding:new h("d",false,false,false,true),predefined:true});l.push({name:"deleteLineEnd",keyBinding:new h("k",false,false,false,true),predefined:true});if(k){l.push({name:"scrollPageDown",keyBinding:new h("v",false,false,false,true),predefined:true});l.push({name:"deleteLineStart",keyBinding:new h("u",false,false,false,true),predefined:true});l.push({name:"deleteWordPrevious",keyBinding:new h("w",false,false,false,true),predefined:true})}else{l.push({name:"pageDown",
keyBinding:new h("v",false,false,false,true),predefined:true});l.push({name:"centerLine",keyBinding:new h("l",false,false,false,true),predefined:true});l.push({name:"enterNoCursor",keyBinding:new h("o",false,false,false,true),predefined:true})}}var p=this;this._actions=[{name:"lineUp",defaultHandler:function(){return p._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return p._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return p._doHome({select:false,
ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return p._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return p._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return p._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return p._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return p._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return p._doScroll({type:"pageUp"})}},
{name:"scrollPageDown",defaultHandler:function(){return p._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return p._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return p._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return p._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return p._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return p._doScroll({type:"textStart"})}},
{name:"scrollTextEnd",defaultHandler:function(){return p._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return p._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return p._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return p._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return p._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return p._doLineDown({select:true,
wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return p._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return p._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return p._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return p._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return p._doPageUp({select:true})}},
{name:"selectPageDown",defaultHandler:function(){return p._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return p._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return p._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return p._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return p._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",
defaultHandler:function(){return p._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return p._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return p._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return p._doDelete({unit:"word"})}},{name:"deleteLineStart",defaultHandler:function(){return p._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return p._doDelete({unit:"line"})}},
{name:"tab",defaultHandler:function(){return p._doTab()}},{name:"enter",defaultHandler:function(){return p._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return p._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return p._doSelectAll()}},{name:"copy",defaultHandler:function(){return p._doCopy()}},{name:"cut",defaultHandler:function(){return p._doCut()}},{name:"paste",defaultHandler:function(){return p._doPaste()}}]},_createLine:function(h,l,n,p,r){var y=r.getLine(p),
B=r.getLineStart(p),z={type:"LineStyle",textView:this,lineIndex:p,lineText:y,lineStart:B};this.onLineStyle(z);r=l||n.createElement("DIV");if(!l||!this._compare(l.viewStyle,z.style)){this._applyStyle(z.style,r,l);if(l)l._trim=null;r.viewStyle=z.style;r.setAttribute("role","presentation")}r.lineIndex=p;p=[];this._createRanges(z.ranges,y,0,y.length,B,{tabOffset:0,ranges:p});y=" ";if(!this._fullSelection&&i<9)y="\ufeff";if(t)y="\u200c";p.push({text:y,style:this._metrics.largestFontStyle,ignoreChars:1});
var E,G,M,H,N,L;z=y=0;var R,T;if(l){if(M=l.modelChangedEvent){if(M.removedLineCount===0&&M.addedLineCount===0){T=M.start-B;R=M.addedCharCount-M.removedCharCount}else T=-1;l.modelChangedEvent=undefined}M=l.firstChild}for(B=0;B<p.length;B++){E=p[B];N=E.text;y+=N.length;G=E.style;if(M){L=M.firstChild.data;H=M.viewStyle;if(L===N&&this._compare(G,H)){z+=L.length;M._rectsCache=undefined;E=M=M.nextSibling;continue}else for(;M;){if(T!==-1){H=y;if(H>=T)H-=R;L=M.firstChild.data.length;if(z+L>H)break;z+=L}H=
M.nextSibling;r.removeChild(M);M=H}}E=this._createSpan(r,n,N,G,E.ignoreChars);M?r.insertBefore(E,M):r.appendChild(E);if(l)l.lineWidth=undefined}if(l)for(h=E?E.nextSibling:null;h;){H=h.nextSibling;l.removeChild(h);h=H}else h.appendChild(r);return r},_createRanges:function(h,l,n,p,r,y){if(!(n>=p)){if(h)for(var B=0;B<h.length;B++){var z=h[B];if(!(z.end<=r+n)){var E=Math.max(r+n,z.start)-r;if(E>=p)break;var G=Math.min(r+p,z.end)-r;if(E<G){E=Math.max(n,E);G=Math.min(p,G);for(n<E&&this._createRange(l,n,
E,null,y);B+1<h.length&&h[B+1].start-r===G&&this._compare(z.style,h[B+1].style);){z=h[B+1];G=Math.min(r+p,z.end)-r;B++}this._createRange(l,E,G,z.style,y);n=G}}}n<p&&this._createRange(l,n,p,null,y)}},_createRange:function(h,l,n,p,r){if(!(l>=n)){var y=this._customTabSize;if(y&&y!==8)for(var B=h.indexOf("\t",l);B!==-1&&B<n;){if(l<B){l={text:h.substring(l,B),style:p};r.ranges.push(l);r.tabOffset+=l.text.length}l=y-r.tabOffset%y;if(l>0){for(var z="\u00a0",E=1;E<l;E++)z+=" ";l={text:z,style:p,ignoreChars:l-
1};r.ranges.push(l);r.tabOffset+=l.text.length}l=B+1;B=h.indexOf("\t",l)}if(l<n){l={text:h.substring(l,n),style:p};r.ranges.push(l);r.tabOffset+=l.text.length}}},_createSpan:function(h,l,n,p,r){var y=p&&p.tagName==="A";if(y)h.hasLink=true;h=y&&this._linksVisible?"A":"SPAN";y=l.createElement(h);y.appendChild(l.createTextNode(n));this._applyStyle(p,y);if(h==="A"){var B=this;b(y,"click",function(z){return B._handleLinkClick(z)},false)}y.viewStyle=p;if(r)y.ignoreChars=r;return y},_createRuler:function(h){if(this._clientDiv){var l=
this._frameDocument,n=l.body,p=h.getLocation(),r=p==="left"?this._leftDiv:this._rightDiv;if(!r){r=l.createElement("DIV");r.style.overflow="hidden";r.style.MozUserSelect="none";r.style.WebkitUserSelect="none";i&&r.attachEvent("onselectstart",function(){return false});r.style.position="absolute";r.style.top="0px";r.style.cursor="default";n.appendChild(r);if(p==="left"){this._leftDiv=r;r.className="viewLeftRuler"}else{this._rightDiv=r;r.className="viewRightRuler"}n=l.createElement("TABLE");r.appendChild(n);
n.cellPadding="0px";n.cellSpacing="0px";n.border="0px";n.insertRow(0);var y=this;b(r,"click",function(B){y._handleRulerEvent(B)});b(r,"dblclick",function(B){y._handleRulerEvent(B)});b(r,"mousemove",function(B){y._handleRulerEvent(B)});b(r,"mouseover",function(B){y._handleRulerEvent(B)});b(r,"mouseout",function(B){y._handleRulerEvent(B)})}l=l.createElement("DIV");l._ruler=h;l.rulerChanged=true;l.style.position="relative";h=r.firstChild.rows[0];h=h.insertCell(h.cells.length);h.vAlign="top";h.appendChild(l)}},
_createFrame:function(){if(!this.frame){for(var h=this._parent;h.hasChildNodes();)h.removeChild(h.lastChild);var l=h.ownerDocument;this._parentDocument=l;var n=l.createElement("IFRAME");this._frame=n;n.frameBorder="0px";n.style.border="0px";n.style.width="100%";n.style.height="100%";n.scrolling="no";var p=this;p._frameLoaded=false;this._loadHandler=function(r){p._frameLoaded=true;p._sync?p._handleLoad(r):setTimeout(function(){p._handleLoad(r)},0)};b(n,"load",this._loadHandler,!!k);if(!t)b(l,"DOMAttrModified",
this._attrModifiedHandler=function(r){p._frameLoaded&&p._handleDOMAttrModified(r)});h.appendChild(n);this._sync&&this._handleLoad()}},_getFrameHTML:function(){var h=[];h.push("<!DOCTYPE html>");h.push("<html>");h.push("<head>");i<9&&h.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");h.push("<style>");h.push(".viewContainer {font-family: monospace; font-size: 10pt;}");h.push(".view {padding: 1px 2px;}");h.push(".viewContent {}");h.push("</style>");if(this._stylesheet)for(var l=
typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,n=0;n<l.length;n++){var p=l[n],r=this._isLinkURL(p);if(r&&this._sync)try{var y=new XMLHttpRequest;y.overrideMimeType&&y.overrideMimeType("text/css");y.open("GET",p,false);y.send(null);p=y.responseText;r=false}catch(B){}if(r){h.push("<link rel='stylesheet' type='text/css' ");i<9&&h.push("onload='window' ");h.push("href='");h.push(p);h.push("'></link>")}else{h.push("<style>");h.push(p);h.push("</style>")}}h.push("<script>");h.push("var waitForStyleSheets = true;");
h.push("<\/script>");h.push("</head>");h.push("<body spellcheck='false'></body>");h.push("</html>");return h.join("")},_createView:function(){if(!this._frameDocument){var h=this._frameWindow=this._frame.contentWindow,l=this._frameDocument=h.document,n=this;l.open("text/html","replace");l.write(n._getFrameHTML());l.close();n._windowLoadHandler=function(){l.readyState==="complete"&&n._createContent()};b(h,"load",n._windowLoadHandler);if(this._sync)this._createContent();else{this._createViewTimer=function(){n._clientDiv||
(l.readyState==="complete"?n._createContent():setTimeout(n._createViewTimer,10))};setTimeout(this._createViewTimer,10)}}},_createContent:function(){if(!this._clientDiv){var h=this._parent,l=this._parentDocument,n=this._frameDocument,p=n.body;this._setThemeClass(this._themeClass,true);p.style.margin="0px";p.style.borderWidth="0px";p.style.padding="0px";if(w){var r=l.createElement("DIV");this._touchDiv=r;r.style.position="absolute";r.style.border="0px";r.style.padding="0px";r.style.margin="0px";r.style.zIndex=
"2";r.style.overflow="hidden";r.style.background="transparent";r.style.WebkitUserSelect="none";h.appendChild(r);this._textArea=h=l.createElement("TEXTAREA");h.style.position="absolute";h.style.whiteSpace="pre";h.style.left="-1000px";h.tabIndex=1;h.autocapitalize="off";h.autocorrect="off";h.className="viewContainer";h.style.background="transparent";h.style.color="transparent";h.style.border="0px";h.style.padding="0px";h.style.margin="0px";h.style.borderRadius="0px";h.style.WebkitAppearance="none";
h.style.WebkitTapHighlightColor="transparent";r.appendChild(h)}if(k){this._clipboardDiv=r=n.createElement("DIV");r.style.position="fixed";r.style.whiteSpace="pre";r.style.left="-1000px";p.appendChild(r)}r=n.createElement("DIV");r.className="view";this._viewDiv=r;r.id="viewDiv";r.tabIndex=-1;r.style.overflow="auto";r.style.position="absolute";r.style.top="0px";r.style.borderWidth="0px";r.style.margin="0px";r.style.MozOutline="none";r.style.outline="none";r.setAttribute("role","application");p.appendChild(r);
this._scrollDiv=h=n.createElement("DIV");h.id="scrollDiv";h.style.margin="0px";h.style.borderWidth="0px";h.style.padding="0px";r.appendChild(h);if(k){this._clipDiv=l=n.createElement("DIV");l.id="clipDiv";l.style.position="fixed";l.style.overflow="hidden";l.style.margin="0px";l.style.borderWidth="0px";l.style.padding="0px";h.appendChild(l);var y=n.createElement("DIV");this._clipScrollDiv=y;y.id="clipScrollDiv";y.style.position="absolute";y.style.height="1px";y.style.top="-1000px";l.appendChild(y)}this._setFullSelection(this._fullSelection,
true);l=n.createElement("DIV");l.className="viewContent";this._clientDiv=l;l.id="clientDiv";l.style.whiteSpace="pre";l.style.position=this._clipDiv?"absolute":"fixed";l.style.borderWidth="0px";l.style.margin="0px";l.style.padding="0px";l.style.MozOutline="none";l.style.outline="none";l.style.zIndex="1";if(w)l.style.WebkitTapHighlightColor="transparent";(this._clipDiv||h).appendChild(l);if(k&&!l.setCapture){this._overlayDiv=n=n.createElement("DIV");n.id="overlayDiv";n.style.position=l.style.position;
n.style.borderWidth=l.style.borderWidth;n.style.margin=l.style.margin;n.style.padding=l.style.padding;n.style.cursor="text";n.style.zIndex="2";(this._clipDiv||h).appendChild(n)}if(!w)l.contentEditable="true";l.setAttribute("role","textbox");l.setAttribute("aria-multiline","true");n=this._metrics=this._calculateMetrics();if(i)p.style.lineHeight=n.lineHeight-(n.lineTrim.top+n.lineTrim.bottom)+"px";this._setTabSize(this._tabSize,true);this._hookEvents();p=this._rulers;for(n=0;n<p.length;n++)this._createRuler(p[n]);
this._updatePage();p=this._hScroll;n=this._vScroll;this._vScroll=this._hScroll=0;if(p>0||n>0){r.scrollLeft=p;r.scrollTop=n}this.onLoad({type:"Load"})}},_defaultOptions:function(){return{parent:{value:undefined,recreate:true,update:null},model:{value:undefined,recreate:false,update:this.setModel},readonly:{value:false,recreate:false,update:null},fullSelection:{value:true,recreate:false,update:this._setFullSelection},tabSize:{value:8,recreate:false,update:this._setTabSize},expandTab:{value:false,recreate:false,
update:null},stylesheet:{value:[],recreate:false,update:this._setStyleSheet},themeClass:{value:undefined,recreate:false,update:this._setThemeClass},sync:{value:false,recreate:false,update:null}}},_destroyFrame:function(){var h=this._frame;if(h){if(this._loadHandler){d(h,"load",this._loadHandler,!!k);this._loadHandler=null}if(this._attrModifiedHandler){d(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}h.parentNode.removeChild(h);this._frame=null}},_destroyRuler:function(h){var l=
h.getLocation()==="left"?this._leftDiv:this._rightDiv;if(l){l=l.firstChild.rows[0];for(var n=l.cells,p=0;p<n.length;p++)if(n[p].firstChild._ruler===h)break;if(p!==n.length){l.cells[p]._ruler=undefined;l.deleteCell(p)}}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();if(this._windowLoadHandler){d(this._frameWindow,"load",this._windowLoadHandler);this._windowLoadHandler=null}if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=
null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}for(var h=this._frameDocument.body;h.hasChildNodes();)h.removeChild(h.lastChild);if(this._touchDiv){this._parent.removeChild(this._touchDiv);this._touchDiv=null}this._selDiv3=this._selDiv2=this._selDiv1=null;this._insertedSelRule=false;this._frameWindow=this._frameDocument=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._clipboardDiv=
this._textArea=null;this.onUnload({type:"Unload"})}},_doAutoScroll:function(h,l,n){this._autoScrollDir=h;this._autoScrollX=l;this._autoScrollY=n;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_fixCaret:function(){var h=this._clientDiv;if(h){var l=this._hasFocus;this._ignoreFocus=true;l&&h.blur();h.contentEditable=false;h.contentEditable=true;l&&h.focus();
this._ignoreFocus=false}},_getBaseText:function(h,l){var n=this._model;if(n.getBaseModel){h=n.mapOffset(h);l=n.mapOffset(l);n=n.getBaseModel()}return n.getText(h,l)},_getBorder:function(h){var l,n,p,r;if(this._frameWindow.getComputedStyle){h=this._frameWindow.getComputedStyle(h,null);l=h.getPropertyValue("border-left-width");n=h.getPropertyValue("border-top-width");p=h.getPropertyValue("border-right-width");r=h.getPropertyValue("border-bottom-width")}else if(h.currentStyle){l=h.currentStyle.borderLeftWidth;
n=h.currentStyle.borderTopWidth;p=h.currentStyle.borderRightWidth;r=h.currentStyle.borderBottomWidth}return{left:parseInt(l,10)||0,top:parseInt(n,10)||0,right:parseInt(p,10)||0,bottom:parseInt(r,10)||0}},_getBoundsAtOffset:function(h){var l=this._model,n=this._frameDocument,p=this._clientDiv,r=l.getLineAtOffset(h),y,B=this._getLineNode(r);B||(B=y=this._createLine(p,null,n,r,l));var z=null;if(h<l.getLineEnd(r)){l=l.getLineStart(r);for(r=B.firstChild;r;){var E=r.firstChild,G=E.length;if(r.ignoreChars)G-=
r.ignoreChars;if(l+G>h){z=h-l;if(A){n=n.createRange();n.setStart(E,z);n.setEnd(E,z+1);z=n.getBoundingClientRect()}else if(i){n=n.body.createTextRange();n.moveToElementText(r);n.collapse();n.moveEnd("character",z+1);n.moveStart("character",z);z=n.getBoundingClientRect()}else{h=E.data;r.removeChild(E);r.appendChild(n.createTextNode(h.substring(0,z)));var M=n.createElement("SPAN");M.appendChild(n.createTextNode(h.substring(z,z+1)));r.appendChild(M);r.appendChild(n.createTextNode(h.substring(z+1)));z=
M.getBoundingClientRect();r.innerHTML="";r.appendChild(E);if(!y){n=this._getSelection();if(l<=n.start&&n.start<l+G||l<=n.end&&n.end<l+G)this._updateDOMSelection()}}if(i){n=window.screen.logicalXDPI;l=window.screen.deviceXDPI;z.left=z.left*n/l;z.right=z.right*n/l}break}l+=G;r=r.nextSibling}}if(!z){B=this._getLineBoundingClientRect(B);z={left:B.right,right:B.right}}y&&p.removeChild(y);return z},_getBottomIndex:function(h){var l=this._bottomChild;if(h&&this._getClientHeight()>this._getLineHeight()){h=
l.getBoundingClientRect();var n=this._clientDiv.getBoundingClientRect();if(h.bottom>n.bottom)l=this._getLinePrevious(l)||l}return l.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var h=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-h.top-h.bottom)},_getClientWidth:function(){var h=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-h.left-h.right)},_getClipboardText:function(h,l){var n=this._model.getLineDelimiter(),p,r;if(this._frameWindow.clipboardData){p=[];r=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(r,function(H){p.push(H)},function(){p.push(n)});r=p.join("");l&&l(r);return r}if(k){this._ignoreFocus=true;var y=this._frameDocument,B=this._clipboardDiv;B.innerHTML="<pre contenteditable=''></pre>";B.firstChild.focus();var z=this,E=function(){var H=z._getTextFromElement(B);
B.innerHTML="";p=[];z._convertDelimiter(H,function(N){p.push(N)},function(){p.push(n)});return p.join("")},G=false;this._ignorePaste=true;if(!q||this._lastMouseButton!==2)try{G=y.execCommand("paste",false,null)}catch(M){G=B.childNodes.length>1||B.firstChild&&B.firstChild.childNodes.length>0}this._ignorePaste=false;if(!G)if(h){setTimeout(function(){z.focus();(r=E())&&l&&l(r);z._ignoreFocus=false},0);return null}else{this.focus();this._ignoreFocus=false;return""}this.focus();this._ignoreFocus=false;
(r=E())&&l&&l(r);return r}if(h&&h.clipboardData){p=[];r=h.clipboardData.getData("text/plain");this._convertDelimiter(r,function(H){p.push(H)},function(){p.push(n)});(r=p.join(""))&&l&&l(r);return r}return""},_getDOMText:function(h){h=this._getLineNode(h).firstChild;for(var l="";h;){for(var n=h.firstChild;n;){if(h.ignoreChars)for(var p=0;p<n.length;p++){var r=n.data.substring(p,p+1);if(r!==" ")l+=r}else l+=n.data;n=n.nextSibling}h=h.nextSibling}return l},_getTextFromElement:function(h){var l=h.ownerDocument,
n=l.defaultView;if(!n.getSelection)return h.innerText||h.textContent;l=l.createRange();l.selectNode(h);h=n.getSelection();n=[];var p;for(p=0;p<h.rangeCount;p++)n.push(h.getRangeAt(p));this._ignoreSelect=true;h.removeAllRanges();h.addRange(l);l=h.toString();h.removeAllRanges();for(p=0;p<n.length;p++)h.addRange(n[p]);this._ignoreSelect=false;return l},_getViewPadding:function(){return this._metrics.viewPadding},_getLineTrim:function(h){var l=h._trim;if(!l){l=this._getPadding(h);var n=this._getBorder(h);
l.left+=n.left;l.top+=n.top;l.right+=n.right;l.bottom+=n.bottom;h._trim=l}return l},_getLineBoundingClientRect:function(h,l){var n=h.getBoundingClientRect();n={left:n.left,top:n.top,right:n.left,bottom:n.bottom};for(var p=h.lastChild;p&&p.ignoreChars===p.firstChild.length;)p=p.previousSibling;if(p){p=p.getBoundingClientRect();n.right=p.right+this._getLineTrim(h).right}if(l){h=this._getLineTrim(h);n.left+=h.left;n.right-=h.right}return n},_getLineHeight:function(){return this._metrics.lineHeight},
_getLineNode:function(h){for(var l=this._clientDiv.firstChild;l;){if(h===l.lineIndex)return l;l=l.nextSibling}},_getLineNext:function(h){for(h=h?h.nextSibling:this._clientDiv.firstChild;h&&h.lineIndex===-1;)h=h.nextSibling;return h},_getLinePrevious:function(h){for(h=h?h.previousSibling:this._clientDiv.lastChild;h&&h.lineIndex===-1;)h=h.previousSibling;return h},_getOffset:function(h,l,n){if(l==="line"){l=this._model;h=l.getLineAtOffset(h);if(n>0)return l.getLineEnd(h);return l.getLineStart(h)}if(l===
"wordend")return this._getOffset_W3C(h,l,n);return i?this._getOffset_IE(h,l,n):this._getOffset_W3C(h,l,n)},_getOffset_W3C:function(h,l,n){function p(H){return 33<=H&&H<=47||58<=H&&H<=64||91<=H&&H<=94||H===96||123<=H&&H<=126}function r(H){return H===32||H===9}if(l==="word"||l==="wordend"){var y=this._model,B=y.getLineAtOffset(h),z=y.getLine(B),E=y.getLineStart(B);B=y.getLineEnd(B);y=z.length;h=h-E;var G,M;if(n>0){if(h===y)return B;G=z.charCodeAt(h);M=p(G);n=!M&&!r(G);for(h++;h<y;){G=z.charCodeAt(h);
B=p(G);if(l==="wordend"){if(!B&&M)break}else if(B&&!M)break;G=!B&&!r(G);if(l==="wordend"){if(!G&&n)break}else if(G&&!n)break;n=G;M=B;h++}}else{if(h===0)return E;h--;G=z.charCodeAt(h);M=p(G);for(n=!M&&!r(G);0<h;){G=z.charCodeAt(h-1);B=p(G);if(l==="wordend"){if(B&&!M)break}else if(!B&&M)break;G=!B&&!r(G);if(l==="wordend"){if(G&&!n)break}else if(!G&&n)break;n=G;M=B;h--}}return E+h}return h+n},_getOffset_IE:function(h,l,n){var p=this._frameDocument,r=this._model,y=r.getLineAtOffset(h),B=this._clientDiv,
z,E=this._getLineNode(y);E||(E=z=this._createLine(B,null,p,y,r));var G=0,M;M=r.getLineStart(y);if(h===r.getLineEnd(y)){p=p.body.createTextRange();p.moveToElementText(E.lastChild);M=p.text.length;p.moveEnd(l,n);G=h+p.text.length-M}else if(h===M&&n<0)G=M;else for(E=E.firstChild;E;){r=E.firstChild.length;if(E.ignoreChars)r-=E.ignoreChars;if(M+r>h){p=p.body.createTextRange();if(h===M&&n<0)p.moveToElementText(E.previousSibling);else{p.moveToElementText(E);p.collapse();p.moveEnd("character",h-M)}M=p.text.length;
p.moveEnd(l,n);G=h+p.text.length-M;break}M=r+M;E=E.nextSibling}z&&B.removeChild(z);return G},_getOffsetToX:function(h){return this._getBoundsAtOffset(h).left},_getPadding:function(h){var l,n,p,r;if(this._frameWindow.getComputedStyle){h=this._frameWindow.getComputedStyle(h,null);l=h.getPropertyValue("padding-left");n=h.getPropertyValue("padding-top");p=h.getPropertyValue("padding-right");r=h.getPropertyValue("padding-bottom")}else if(h.currentStyle){l=h.currentStyle.paddingLeft;n=h.currentStyle.paddingTop;
p=h.currentStyle.paddingRight;r=h.currentStyle.paddingBottom}return{left:parseInt(l,10)||0,top:parseInt(n,10)||0,right:parseInt(p,10)||0,bottom:parseInt(r,10)||0}},_getScroll:function(){var h=this._viewDiv;return{x:h.scrollLeft,y:h.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(h){var l=this._topChild;if(h&&this._getClientHeight()>this._getLineHeight()){h=l.getBoundingClientRect();var n=this._getViewPadding(),p=this._viewDiv.getBoundingClientRect();if(h.top<
p.top+n.top)l=this._getLineNext(l)||l}return l.lineIndex},_getXToOffset:function(h,l){function n(ia){var ba,ja,ha,ka;if(!ia._rectsCache){ba=ia.getClientRects();ja=[ba.length];for(ha=0;ha<ba.length;ha++){ka=ba[ha];ja[ha]={left:ka.left-M+L,top:ka.top,right:ka.right-M+L,bottom:ka.bottom}}ia._rectsCache=ja}ba=ia._rectsCache;ja=[ba.length];for(ha=0;ha<ba.length;ha++){ka=ba[ha];ja[ha]={left:ka.left-L,top:ka.top,right:ka.right-L,bottom:ka.bottom}}return ja}var p=this._model,r=p.getLineStart(h),y=p.getLineEnd(h);
if(r===y)return r;var B=this._frameDocument,z=this._clientDiv,E,G=this._getLineNode(h);G||(G=E=this._createLine(z,null,B,h,p));h=this._getLineBoundingClientRect(G,true);if(l<h.left)l=h.left;if(l>h.right)l=h.right;var M=0,H;if(i<9){H=G.getClientRects();p=H[0].left;for(var N=1;N<H.length;N++)p=Math.min(H[N].left,p);M=p-h.left-this._getLineTrim(G).left}var L=this._getScroll().x,R=i?window.screen.logicalXDPI:1,T=i?window.screen.deviceXDPI:1;h=r;p=G.firstChild;a:for(;p;){N=p.firstChild;G=N.length;if(p.ignoreChars)G-=
p.ignoreChars;H=n(p);for(var C=0;C<H.length;C++){var F=H[C];if(F.left<=l&&l<F.right){if(i||A){B=A?B.createRange():B.body.createTextRange();C=G;for(var K=-1;C-K>1;){var P=Math.floor((C+K)/2);H=K+1;F=P===G-1&&p.ignoreChars?N.length:P+1;if(A){B.setStart(N,H);B.setEnd(N,F)}else{B.moveToElementText(p);B.move("character",H);B.moveEnd("character",F-H)}H=B.getClientRects();for(var V=false,X=0;X<H.length;X++){F=H[X];var Y=F.right*R/T-M;if(F.left*R/T-M<=l&&l<Y){V=true;break}}if(V)C=P;else K=P}h+=C;H=C;F=C===
G-1&&p.ignoreChars?N.length:Math.min(C+1,N.length);if(A){B.setStart(N,H);B.setEnd(N,F)}else{B.moveToElementText(p);B.move("character",H);B.moveEnd("character",F-H)}F=B.getClientRects()[0];l>F.left*R/T-M+(F.right-F.left)*R/T/2&&h++}else{H=[];for(R=0;R<G;R++){H.push("<span>");R===G-1?H.push(N.data.substring(R)):H.push(N.data.substring(R,R+1));H.push("</span>")}p.innerHTML=H.join("");for(H=p.firstChild;H;){F=H.getBoundingClientRect();if(F.left<=l&&l<F.right){l>F.left+(F.right-F.left)/2&&h++;break}h++;
H=H.nextSibling}if(!E){p.innerHTML="";p.appendChild(N);l=this._getSelection();if(h<=l.start&&l.start<h+G||h<=l.end&&l.end<h+G)this._updateDOMSelection()}}break a}}h+=G;p=p.nextSibling}E&&z.removeChild(E);return Math.min(y,Math.max(r,h))},_getYToLine:function(h){var l=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect();h-=n.top+l.top;l=this._getLineHeight();h=Math.floor((h+this._getScroll().y)/l);l=this._model.getLineCount();return Math.max(0,Math.min(l-1,h))},_getOffsetBounds:function(h){var l=
this._model.getLineAtOffset(h),n=this._getLineHeight(),p=this._getScroll(),r=this._getViewPadding(),y=this._viewDiv.getBoundingClientRect();h=this._getBoundsAtOffset(h);l=l*n-p.y+y.top+r.top;return{left:h.left,top:l,right:h.right,bottom:l+n}},_getVisible:function(){for(var h=this._parent,l=h.ownerDocument;h!==l;){var n;if(i<9)n=h.currentStyle&&h.currentStyle.display==="none";else n=(n=l.defaultView.getComputedStyle(h,null))&&n.getPropertyValue("display")==="none";if(n)return"hidden";h=h.parentNode;
if(!h)return"disconnected"}return"visible"},_hitOffset:function(h,l,n){var p=this._getOffsetBounds(h);h=p.left;var r=p.right,y=p.top;p=p.bottom;h-=20;y-=20;r+=20;p+=20;return h<=l&&l<=r&&y<=n&&n<=p},_hookEvents:function(){var h=this;this._modelListener={onChanging:function(z){h._onModelChanging(z)},onChanged:function(z){h._onModelChanged(z)}};this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);var l=this._clientDiv,
n=this._viewDiv,p=this._frameDocument.body,r=this._handlers=[],y=i<9?this._frame:this._frameWindow,B=w?this._textArea:i||k?this._clientDiv:this._frameWindow;r.push({target:this._frameWindow,type:"unload",handler:function(z){return h._handleUnload(z)}});r.push({target:y,type:"resize",handler:function(z){return h._handleResize(z)}});r.push({target:B,type:"blur",handler:function(z){return h._handleBlur(z)}});r.push({target:B,type:"focus",handler:function(z){return h._handleFocus(z)}});r.push({target:n,
type:"scroll",handler:function(z){return h._handleScroll(z)}});if(w){l=this._touchDiv;p=this._textArea;r.push({target:p,type:"keydown",handler:function(z){return h._handleKeyDown(z)}});r.push({target:p,type:"input",handler:function(z){return h._handleInput(z)}});r.push({target:p,type:"textInput",handler:function(z){return h._handleTextInput(z)}});r.push({target:p,type:"click",handler:function(z){return h._handleTextAreaClick(z)}});r.push({target:l,type:"touchstart",handler:function(z){return h._handleTouchStart(z)}});
r.push({target:l,type:"touchmove",handler:function(z){return h._handleTouchMove(z)}});r.push({target:l,type:"touchend",handler:function(z){return h._handleTouchEnd(z)}})}else{n=this._overlayDiv||this._clientDiv;y=i?l:this._frameWindow;r.push({target:l,type:"keydown",handler:function(z){return h._handleKeyDown(z)}});r.push({target:l,type:"keypress",handler:function(z){return h._handleKeyPress(z)}});r.push({target:l,type:"keyup",handler:function(z){return h._handleKeyUp(z)}});r.push({target:l,type:"selectstart",
handler:function(z){return h._handleSelectStart(z)}});r.push({target:l,type:"contextmenu",handler:function(z){return h._handleContextMenu(z)}});r.push({target:l,type:"copy",handler:function(z){return h._handleCopy(z)}});r.push({target:l,type:"cut",handler:function(z){return h._handleCut(z)}});r.push({target:l,type:"paste",handler:function(z){return h._handlePaste(z)}});r.push({target:l,type:"mousedown",handler:function(z){return h._handleMouseDown(z)}});r.push({target:l,type:"mouseover",handler:function(z){return h._handleMouseOver(z)}});
r.push({target:l,type:"mouseout",handler:function(z){return h._handleMouseOut(z)}});r.push({target:y,type:"mouseup",handler:function(z){return h._handleMouseUp(z)}});r.push({target:y,type:"mousemove",handler:function(z){return h._handleMouseMove(z)}});r.push({target:p,type:"mousedown",handler:function(z){return h._handleBodyMouseDown(z)}});r.push({target:p,type:"mouseup",handler:function(z){return h._handleBodyMouseUp(z)}});r.push({target:n,type:"dragstart",handler:function(z){return h._handleDragStart(z)}});
r.push({target:n,type:"drag",handler:function(z){return h._handleDrag(z)}});r.push({target:n,type:"dragend",handler:function(z){return h._handleDragEnd(z)}});r.push({target:n,type:"dragenter",handler:function(z){return h._handleDragEnter(z)}});r.push({target:n,type:"dragover",handler:function(z){return h._handleDragOver(z)}});r.push({target:n,type:"dragleave",handler:function(z){return h._handleDragLeave(z)}});r.push({target:n,type:"drop",handler:function(z){return h._handleDrop(z)}});if(o){r.push({target:this._parentDocument,
type:"mousemove",handler:function(z){return h._handleMouseMove(z)}});r.push({target:this._parentDocument,type:"mouseup",handler:function(z){return h._handleMouseUp(z)}})}i&&r.push({target:this._frameDocument,type:"activate",handler:function(z){return h._handleDocFocus(z)}});k&&r.push({target:this._frameDocument,type:"focus",handler:function(z){return h._handleDocFocus(z)}});if(!i&&!m)r.push({target:this._viewDiv,type:k?"DOMMouseScroll":"mousewheel",handler:function(z){return h._handleMouseWheel(z)}});
k&&!s&&r.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(z){return h._handleDataModified(z)}});if(this._overlayDiv){r.push({target:this._overlayDiv,type:"mousedown",handler:function(z){return h._handleMouseDown(z)}});r.push({target:this._overlayDiv,type:"mouseover",handler:function(z){return h._handleMouseOver(z)}});r.push({target:this._overlayDiv,type:"mouseout",handler:function(z){return h._handleMouseOut(z)}});r.push({target:this._overlayDiv,type:"contextmenu",handler:function(z){return h._handleContextMenu(z)}})}x||
r.push({target:this._clientDiv,type:"dblclick",handler:function(z){return h._handleDblclick(z)}})}for(l=0;l<r.length;l++){p=r[l];b(p.target,p.type,p.handler,p.capture)}},_init:function(h){var l=h.parent;if(typeof l==="string")l=window.document.getElementById(l);if(!l)throw"no parent";h.parent=l;h.model=h.model||new c.TextModel;l=this._defaultOptions();for(var n in l)if(l.hasOwnProperty(n))this["_"+n]=h[n]!==undefined?h[n]:l[n].value;this._rulers=[];this._selection=new f(0,0,false);this._linksVisible=
false;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=true;this._ignoreFocus=false;this._dragOffset=this._columnX=-1;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=false;this._doubleClickSelection=null;this._vScroll=this._hScroll=
0;this._imeOffset=-1;this._createActions();this._createFrame()},_isLinkURL:function(h){return h.toLowerCase().lastIndexOf(".css")===h.length-4},_modifyContent:function(h,l){if(!(this._readonly&&!h._code)){h.type="Verify";this.onVerify(h);if(!(h.text===null||h.text===undefined)){var n=this._model;try{if(h._ignoreDOMSelection)this._ignoreDOMSelection=true;n.setText(h.text,h.start,h.end)}finally{if(h._ignoreDOMSelection)this._ignoreDOMSelection=false}if(l){l=this._getSelection();l.setCaret(h.start+h.text.length);
this._setSelection(l,true)}this.onModify({type:"Modify"})}}},_onModelChanged:function(h){h.type="ModelChanged";this.onModelChanged(h);h.type="Changed";var l=h.start,n=h.addedCharCount,p=h.removedCharCount,r=h.addedLineCount,y=h.removedLineCount,B=this._getSelection();if(B.end>l){if(B.end>l&&B.start<l+p)B.setCaret(l+n);else{B.start+=n-p;B.end+=n-p}this._setSelection(B,false,false)}l=this._model.getLineAtOffset(l);for(n=this._getLineNext();n;){p=n.lineIndex;if(l<=p&&p<=l+y)if(l===p&&!n.modelChangedEvent&&
!n.lineRemoved){n.modelChangedEvent=h;n.lineChanged=true}else{n.lineRemoved=true;n.lineChanged=false;n.modelChangedEvent=null}if(p>l+y)n.lineIndex=p+r-y;n=this._getLineNext(n)}if(l<=this._maxLineIndex&&this._maxLineIndex<=l+y){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(h){h.type="ModelChanging";this.onModelChanging(h);h.type="Changing"},_queueUpdatePage:function(){if(!this._updateTimer){var h=this;this._updateTimer=
setTimeout(function(){h._updateTimer=null;h._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new f(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var h=this._clientDiv;if(h){for(var l=h.firstChild;l;){l.lineRemoved=true;l=l.nextSibling}if(k){this._ignoreFocus=false;(l=this._hasFocus)&&h.blur();h.contentEditable=false;h.contentEditable=
true;l&&h.focus();this._ignoreFocus=false}}},_resizeTouchDiv:function(){for(var h=this._viewDiv.getBoundingClientRect(),l=this._frame.getBoundingClientRect(),n=this._frame;n;){if(n.style&&n.style.top)break;n=n.parentNode}var p=l.top;if(n)p-=n.getBoundingClientRect().top;else p+=this._parentDocument.body.scrollTop;for(n=this._frame;n;){if(n.style&&n.style.left)break;n=n.parentNode}l=l.left;if(n)l-=n.getBoundingClientRect().left;else l+=this._parentDocument.body.scrollLeft;n=this._touchDiv;n.style.left=
l+h.left+"px";n.style.top=p+h.top+"px";n.style.width=h.width+"px";n.style.height=h.height+"px"},_scrollView:function(h,l){this._ensureCaretVisible=false;var n=this._viewDiv;if(h)n.scrollLeft+=h;if(l)n.scrollTop+=l},_setClipboardText:function(h,l){var n;if(this._frameWindow.clipboardData){n=[];this._convertDelimiter(h,function(E){n.push(E)},function(){n.push(D)});return this._frameWindow.clipboardData.setData("Text",n.join(""))}if(o||k||!l){var p=this._frameWindow,r=this._frameDocument,y=r.createElement("PRE");
y.style.position="fixed";y.style.left="-1000px";this._convertDelimiter(h,function(E){y.appendChild(r.createTextNode(E))},function(){y.appendChild(r.createElement("BR"))});y.appendChild(r.createTextNode(" "));this._clientDiv.appendChild(y);h=r.createRange();h.setStart(y.firstChild,0);h.setEndBefore(y.lastChild);p=p.getSelection();p.rangeCount>0&&p.removeAllRanges();p.addRange(h);var B=this;p=function(){y&&y.parentNode===B._clientDiv&&B._clientDiv.removeChild(y);B._updateDOMSelection()};h=false;this._ignoreCopy=
true;try{h=r.execCommand("copy",false,null)}catch(z){}this._ignoreCopy=false;if(!h)if(l){setTimeout(p,0);return false}p();return true}if(l&&l.clipboardData){n=[];this._convertDelimiter(h,function(E){n.push(E)},function(){n.push(D)});return l.clipboardData.setData("text/plain",n.join(""))}},_setDOMSelection:function(h,l,n,p){for(var r=this._frameWindow,y=this._frameDocument,B,z,E,G,M=0,H=h.firstChild,N,L,R=this._model.getLine(h.lineIndex).length;H;){N=H.firstChild;L=N.length;if(H.ignoreChars)L-=H.ignoreChars;
if(M+L>l||M+L>=R){B=N;z=l-M;if(H.ignoreChars&&L>0&&z===L)z+=H.ignoreChars;break}M+=L;H=H.nextSibling}M=0;H=n.firstChild;for(var T=this._model.getLine(n.lineIndex).length;H;){N=H.firstChild;L=N.length;if(H.ignoreChars)L-=H.ignoreChars;if(L+M>p||M+L>=T){E=N;G=p-M;if(H.ignoreChars&&L>0&&G===L)G+=H.ignoreChars;break}M+=L;H=H.nextSibling}this._setDOMFullSelection(h,l,R,n,p,T);if(!w)if(r.getSelection){y=y.createRange();y.setStart(B,z);y.setEnd(E,G);E=r.getSelection();this._ignoreSelect=false;E.rangeCount>
0&&E.removeAllRanges();E.addRange(y);this._ignoreSelect=true}else if(y.selection){r=y.body;y=y.createElement("DIV");r.appendChild(y);r.removeChild(y);y=r.createTextRange();y.moveToElementText(B.parentNode);y.moveStart("character",z);B=r.createTextRange();B.moveToElementText(E.parentNode);B.moveStart("character",G);y.setEndPoint("EndToStart",B);this._ignoreSelect=false;y.select();this._ignoreSelect=true}},_setDOMFullSelection:function(h,l,n,p,r,y){var B=this._model;if(this._selDiv1){var z,E;z=this._getLineBoundingClientRect(h);
if(l===0)E=z.left;else if(l>=n)E=z.right;else{this._ignoreDOMSelection=true;E=this._getBoundsAtOffset(B.getLineStart(h.lineIndex)+l).left;this._ignoreDOMSelection=false}if((n=this._textArea)&&w){n.selectionStart=n.selectionEnd=0;var G=this._frame.getBoundingClientRect(),M=this._touchDiv.getBoundingClientRect(),H=this._viewDiv.getBoundingClientRect();n.style.left=!(H.left<=E&&E<=H.left+H.width&&H.top<=z.top&&z.top<=H.top+H.height)||!(h===p&&l===r)?"-1000px":E-4+G.left-M.left+"px";n.style.top=z.top+
G.top-M.top+"px";n.style.width="6px";n.style.height=z.bottom-z.top+"px"}n=this._selDiv1;n.style.width="0px";n.style.height="0px";n=this._selDiv2;n.style.width="0px";n.style.height="0px";n=this._selDiv3;n.style.width="0px";n.style.height="0px";if(!(h===p&&l===r)){G=w?2:0;M=G+"px blue solid";var N=this._getViewPadding();H=this._clientDiv.getBoundingClientRect();var L=this._viewDiv.getBoundingClientRect();l=L.left+N.left;n=H.right;L=L.top+N.top;var R=H.bottom;N=H=0;if(this._clipDiv){N=this._clipDiv.getBoundingClientRect();
H=N.left-this._clipDiv.scrollLeft;N=N.top}var T=this._getLineBoundingClientRect(p);if(r===0)r=T.left;else if(r>=y)r=T.right;else{this._ignoreDOMSelection=true;r=this._getBoundsAtOffset(B.getLineStart(p.lineIndex)+r).left;this._ignoreDOMSelection=false}y=this._selDiv1;E=Math.min(n,Math.max(l,E));B=Math.min(R,Math.max(L,z.top));var C=n;z=Math.min(R,Math.max(L,z.bottom));y.style.left=E-H+"px";y.style.top=B-N+"px";y.style.width=Math.max(0,C-E)+"px";y.style.height=Math.max(0,z-B)+(w?1:0)+"px";if(w){y.style.borderLeft=
M;y.style.borderRight="0px"}if(h===p){C=Math.min(r,n);y.style.width=Math.max(0,C-E-G*2)+"px";if(w)y.style.borderRight=M}else{h=Math.min(R,Math.max(L,T.top));p=Math.min(n,Math.max(l,r));E=Math.min(R,Math.max(L,T.bottom));r=this._selDiv3;r.style.left=l-H+"px";r.style.top=h-N+"px";r.style.width=Math.max(0,p-l-G)+"px";r.style.height=Math.max(0,E-h)+"px";if(w)r.style.borderRight=M;if(h-z>0){p=this._selDiv2;p.style.left=l-H+"px";p.style.top=z-N+"px";p.style.width=Math.max(0,n-l)+"px";p.style.height=Math.max(0,
h-z)+(w?1:0)+"px"}}}}},_setGrab:function(h){if(h!==this._grabControl)if(h){h.setCapture&&h.setCapture();this._grabControl=h}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(h){if(this._linksVisible!==h){this._linksVisible=h;if(i&&h)this._hadFocus=this._hasFocus;var l=this._clientDiv;l.contentEditable=!h;this._hadFocus&&!h&&l.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=h?"-1":"1";h=this._frameDocument;for(l=this._getLineNext();l;){if(l.hasLink)for(var n=
l.firstChild;n;){var p=n.nextSibling,r=n.viewStyle;r&&r.tagName==="A"&&l.replaceChild(this._createSpan(l,h,n.firstChild.data,r),n);n=p}l=this._getLineNext(l)}}},_setSelection:function(h,l,n,p){if(h){this._columnX=-1;if(n===undefined)n=true;var r=this._selection;if(!r.equals(h)){this._selection=h;this.onSelection({type:"Selection",oldValue:{start:r.start,end:r.end},newValue:{start:h.start,end:h.end}})}if(l)n=!this._showCaret(false,p);n&&this._updateDOMSelection()}},_setSelectionTo:function(h,l,n,p){var r=
this._model,y=this._getSelection();l=this._getYToLine(l);if(this._clickCount===1){r=this._getXToOffset(l,h);if(p&&!n)if(y.start<=r&&r<y.end){this._dragOffset=r;return false}y.extend(r);n||y.collapse()}else{if((this._clickCount&1)===0){r=this._getXToOffset(l,h);if(this._doubleClickSelection)if(r>=this._doubleClickSelection.start){n=this._doubleClickSelection.start;r=this._getOffset(r,"wordend",+1)}else{n=this._getOffset(r,"word",-1);r=this._doubleClickSelection.end}else{n=this._getOffset(r,"word",
-1);r=this._getOffset(n,"wordend",+1)}}else if(this._doubleClickSelection){p=r.getLineAtOffset(this._doubleClickSelection.start);if(l>=p){n=r.getLineStart(p);r=r.getLineEnd(l)}else{n=r.getLineStart(l);r=r.getLineEnd(p)}}else{n=r.getLineStart(l);r=r.getLineEnd(l)}y.setCaret(n);y.extend(r)}this._setSelection(y,true,true);return true},_setStyleSheet:function(h){var l=this._stylesheet;l instanceof Array||(l=[l]);this._stylesheet=h;h instanceof Array||(h=[h]);for(var n=this._frameDocument,p=n.styleSheets,
r=n.getElementsByTagName("head")[0],y=false,B=0,z,E;B<h.length;){if(B>=l.length)break;z=h[B];E=l[B];if(z!==E)if(this._isLinkURL(z))return true;else{y=p[B+1];y=y.ownerNode;E=n.createElement("STYLE");z=n.createTextNode(z);E.appendChild(z);r.replaceChild(E,y);y=true}B++}if(B<l.length)for(;B<l.length;){z=l[B];if(this._isLinkURL(z))return true;else{y=p[B+1];y=y.ownerNode;r.removeChild(y);y=true}B++}else for(;B<h.length;){z=h[B];if(this._isLinkURL(z))return true;else{E=n.createElement("STYLE");z=n.createTextNode(z);
E.appendChild(z);r.appendChild(E);y=true}B++}y&&this._updateStyle();return false},_setFullSelection:function(h,l){this._fullSelection=h;if(i<9)this._fullSelection=false;if(t)this._fullSelection=true;var n=this._clipDiv||this._scrollDiv;if(n)if(!w&&!this._fullSelection){if(this._selDiv1){n.removeChild(this._selDiv1);this._selDiv1=null}if(this._selDiv2){n.removeChild(this._selDiv2);this._selDiv2=null}if(this._selDiv3){n.removeChild(this._selDiv3);this._selDiv3=null}}else if(!this._selDiv1&&(w||this._fullSelection&&
!t)){h=this._frameDocument;this._hightlightRGB="Highlight";var p=h.createElement("DIV");this._selDiv1=p;p.id="selDiv1";p.style.position=this._clipDiv?"absolute":"fixed";p.style.borderWidth="0px";p.style.margin="0px";p.style.padding="0px";p.style.MozOutline="none";p.style.outline="none";p.style.background=this._hightlightRGB;p.style.width="0px";p.style.height="0px";p.style.zIndex="0";n.appendChild(p);var r=h.createElement("DIV");this._selDiv2=r;r.id="selDiv2";r.style.position=this._clipDiv?"absolute":
"fixed";r.style.borderWidth="0px";r.style.margin="0px";r.style.padding="0px";r.style.MozOutline="none";r.style.outline="none";r.style.background=this._hightlightRGB;r.style.width="0px";r.style.height="0px";r.style.zIndex="0";n.appendChild(r);var y=h.createElement("DIV");this._selDiv3=y;y.id="selDiv3";y.style.position=this._clipDiv?"absolute":"fixed";y.style.borderWidth="0px";y.style.margin="0px";y.style.padding="0px";y.style.MozOutline="none";y.style.outline="none";y.style.background=this._hightlightRGB;
y.style.width="0px";y.style.height="0px";y.style.zIndex="0";n.appendChild(y);if(k&&u){n=this._frameWindow.getComputedStyle(y,null).getPropertyValue("background-color");switch(n){case "rgb(119, 141, 168)":n="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":n="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":n="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":n="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":n="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":n="rgb(194, 249, 144)";break;
case "rgb(140, 78, 184)":n="rgb(232, 184, 255)";break;default:n="rgb(180, 213, 255)";break}this._hightlightRGB=n;p.style.background=n;r.style.background=n;y.style.background=n;if(!this._insertedSelRule){h.styleSheets[0].insertRule("::-moz-selection {background: "+n+"; }",0);this._insertedSelRule=true}}l||this._updateDOMSelection()}},_setTabSize:function(h,l){this._tabSize=h;this._customTabSize=undefined;h=this._clientDiv;if(m){if(h)h.style.OTabSize=this._tabSize+""}else if(k>=4){if(h)h.style.MozTabSize=
this._tabSize+""}else if(this._tabSize!==8){this._customTabSize=this._tabSize;l||this.redrawLines()}},_setThemeClass:function(h,l){this._themeClass=h;if(h=this._frameDocument){var n="viewContainer";if(this._themeClass)n+=" "+this._themeClass;h.body.className=n;l||this._updateStyle()}},_showCaret:function(h,l){if(this._clientDiv){var n=this._model,p=this._getSelection(),r=this._getScroll(),y=p.getCaret(),B=p.start,z=p.end,E=n.getLineAtOffset(B),G=n.getLineAtOffset(z),M=Math.max(Math.max(B,n.getLineStart(G)),
z-1),H=this._getViewPadding(),N=this._getClientWidth(),L=H.left;H=H.left+N;var R=this._getBoundsAtOffset(y===B?B:M),T=R.left,C=R.right,F=N/4;if(h&&!p.isEmpty()&&E===G){R=this._getBoundsAtOffset(y===z?B:M);if(N-F>(y===B?R.right-T:C-R.left)){if(T>R.left)T=R.left;if(C<R.right)C=R.right}}p=this._viewDiv.getBoundingClientRect();T-=p.left;C-=p.left;p=0;if(T<L)p=Math.min(T-L,-F);if(C>H)p=Math.min(this._scrollDiv.scrollWidth-r.x-N,Math.max(C-H,F));L=0;T=this._getTopIndex(true);C=this._getBottomIndex(true);
n=n.getLineAtOffset(y);H=this._getClientHeight();if(!(T<=n&&n<=C)){T=this._getLineHeight();h=h?(G-E)*T:0;L=n*T;L-=r.y;if(L+T>H){L-=H-T;if(y===B&&B!==z)L+=Math.min(H-T,h)}else if(y===z)L-=Math.min(H-T,h);if(l)if(l>0){if(L>0)L=Math.max(L,l)}else if(L<0)L=Math.min(L,l)}if(p!==0||L!==0){this._scrollView(p,L);if(H!==this._getClientHeight()||N!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false}},_startIME:function(){if(this._imeOffset===-1){var h=this._getSelection();
h.isEmpty()||this._modifyContent({text:"",start:h.start,end:h.end},true);this._imeOffset=h.start}},_unhookEvents:function(){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);this._modelListener=null;for(var h=0;h<this._handlers.length;h++){var l=this._handlers[h];d(l.target,l.type,l.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var h=this._getSelection(),
l=this._model,n=l.getLineAtOffset(h.start),p=l.getLineAtOffset(h.end),r=this._getLineNext();if(r){var y=this._getLinePrevious(),B;if(n<r.lineIndex){B=r;n=0}else if(n>y.lineIndex){B=y;n=0}else{B=this._getLineNode(n);n=h.start-l.getLineStart(n)}if(p<r.lineIndex){r=r;h=0}else if(p>y.lineIndex){r=y;h=0}else{r=this._getLineNode(p);h=h.end-l.getLineStart(p)}this._setDOMSelection(B,n,r,h)}}},_updatePage:function(h){if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=
null;h=false}var l=this._clientDiv;if(l){var n=this._model,p=this._getScroll(),r=this._getViewPadding(),y=n.getLineCount(),B=this._getLineHeight(),z=Math.max(0,p.y)/B,E=Math.floor(z),G=Math.max(0,E-1),M=Math.round((z-G)*B),H=this._partialY=Math.round((z-E)*B);z=y*B;var N,L;if(h){N=this._getClientWidth();L=this._getClientHeight();n=this._leftDiv?this._leftDiv.scrollWidth:0;E=Math.max(this._maxLineWidth,N)}else{var R=this._frameDocument;p=this._getFrameWidth();L=this._getFrameHeight();R.body.style.width=
p+"px";R.body.style.height=L+"px";N=this._viewDiv;N.style.height=Math.max(0,L-r.top-r.bottom)+"px";L=this._getClientHeight();B=Math.floor((L+H)/B);B=Math.min(E+B,y-1);for(var T=Math.min(B+1,y-1),C=l.firstChild;C;){H=C.lineIndex;var F=C.nextSibling;if(!(G<=H&&H<=T)||C.lineRemoved||C.lineIndex===-1)if(this._mouseWheelLine===C){C.style.display="none";C.lineIndex=-1}else l.removeChild(C);C=F}C=this._getLineNext();F=R.createDocumentFragment();for(H=G;H<=T;H++)if(!C||C.lineIndex>H)this._createLine(F,null,
R,H,n);else{if(F.firstChild){l.insertBefore(F,C);F=R.createDocumentFragment()}if(C&&C.lineChanged){C=this._createLine(F,C,R,H,n);C.lineChanged=false}C=this._getLineNext(C)}F.firstChild&&l.insertBefore(F,C);if(t)l.style.width=(524287).toString()+"px";for(C=this._getLineNext();C;){G=C.lineWidth;if(G===undefined){G=this._getLineBoundingClientRect(C);G=C.lineWidth=G.right-G.left}if(G>=this._maxLineWidth){this._maxLineWidth=G;this._maxLineIndex=C.lineIndex}if(C.lineIndex===E)this._topChild=C;if(C.lineIndex===
B)this._bottomChild=C;if(this._checkMaxLineIndex===C.lineIndex)this._checkMaxLineIndex=-1;C=this._getLineNext(C)}if(this._checkMaxLineIndex!==-1){H=this._checkMaxLineIndex;this._checkMaxLineIndex=-1;if(0<=H&&H<y){n=this._createLine(l,null,R,H,n);G=this._getLineBoundingClientRect(n);G=G.right-G.left;if(G>=this._maxLineWidth){this._maxLineWidth=G;this._maxLineIndex=H}l.removeChild(n)}}this._updateRuler(this._leftDiv,E,B);this._updateRuler(this._rightDiv,E,B);n=this._leftDiv?this._leftDiv.scrollWidth:
0;E=this._rightDiv?this._rightDiv.scrollWidth:0;N.style.left=n+"px";N.style.width=Math.max(0,p-n-E-r.left-r.right)+"px";if(this._rightDiv)this._rightDiv.style.left=p-E+"px";p=this._scrollDiv;p.style.height=z+"px";N=this._getClientWidth();E=y=Math.max(this._maxLineWidth,N);if(!i||i>=9)y+=r.right;p.style.width=y+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=y+"px";p=this._getScroll();y=L+r.top+r.bottom;this._updateRulerSize(this._leftDiv,y);this._updateRulerSize(this._rightDiv,y)}H=p.x;
B=this._clipDiv;y=this._overlayDiv;if(B){B.scrollLeft=H;G=n+r.left;R=r.top;h=N;n=L;H=0;C=-M;if(p.x===0){G-=r.left;h+=r.left;H=r.left}if(p.x+N===E)h+=r.right;if(p.y===0){R-=r.top;n+=r.top;C+=r.top}if(p.y+L===z)n+=r.bottom;B.style.left=G+"px";B.style.top=R+"px";B.style.width=h+"px";B.style.height=n+"px";l.style.left=H+"px";l.style.top=C+"px";l.style.width=E+"px";l.style.height=L+M+"px";if(y){y.style.left=l.style.left;y.style.top=l.style.top;y.style.width=l.style.width;y.style.height=l.style.height}}else{G=
H;R=M;B=H+N;C=M+L;if(G===0)G-=r.left;if(R===0)R-=r.top;if(B===E)B+=r.right;if(p.y+L===z)C+=r.bottom;l.style.clip="rect("+R+"px,"+B+"px,"+C+"px,"+G+"px)";l.style.left=-H+n+r.left+"px";l.style.width=(t?E:N+H)+"px";if(!h){l.style.top=-M+r.top+"px";l.style.height=L+M+"px"}if(y){y.style.clip=l.style.clip;y.style.left=l.style.left;y.style.width=l.style.width;if(!h){y.style.top=l.style.top;y.style.height=l.style.height}}}this._updateDOMSelection();l=this._ensureCaretVisible;this._ensureCaretVisible=false;
if(L!==this._getClientHeight()){this._updatePage();l&&this._showCaret()}if(w){var K=this;setTimeout(function(){K._resizeTouchDiv()},0)}}}},_updateRulerSize:function(h,l){if(h){for(var n=this._partialY,p=this._getLineHeight(),r=h.firstChild.rows[0].cells,y=0;y<r.length;y++){var B=r[y].firstChild,z=p;if(B._ruler.getOverview()==="page")z+=n;B.style.top=-z+"px";B.style.height=l+z+"px"}h.style.height=l+"px"}},_updateRuler:function(h,l,n){if(h){h=h.firstChild.rows[0].cells;for(var p=this._getLineHeight(),
r=this._frameDocument,y=this._getViewPadding(),B=0;B<h.length;B++){var z=h[B].firstChild,E=z._ruler;z.rulerChanged&&this._applyStyle(E.getRulerStyle(),z);var G,M=z.firstChild;if(M){G=M;M=M.nextSibling}else{G=r.createElement("DIV");G.style.visibility="hidden";z.appendChild(G)}var H,N;if(z.rulerChanged)if(G){H=-1;if(N=E.getWidestAnnotation()){this._applyStyle(N.style,G);if(N.html)G.innerHTML=N.html}G.lineIndex=H;G.style.height=p+y.top+"px"}var L,R;if(E.getOverview()==="page"){for(E=E.getAnnotations(l,
n+1);M;){H=M.lineIndex;N=M.nextSibling;if(!(l<=H&&H<=n)||M.lineChanged)z.removeChild(M);M=N}M=z.firstChild.nextSibling;R=r.createDocumentFragment();for(H=l;H<=n;H++)if(!M||M.lineIndex>H){L=r.createElement("DIV");if(N=E[H]){this._applyStyle(N.style,L);if(N.html)L.innerHTML=N.html;L.annotation=N}L.lineIndex=H;L.style.height=p+"px";R.appendChild(L)}else{if(R.firstChild){z.insertBefore(R,M);R=r.createDocumentFragment()}if(M)M=M.nextSibling}R.firstChild&&z.insertBefore(R,M)}else{M=w?0:17;N=this._getClientHeight();
H=this._model.getLineCount();G=N+y.top+y.bottom-2*M;var T;T=p*H<G?p:G/H;if(z.rulerChanged){for(N=z.childNodes.length;N>1;){z.removeChild(z.lastChild);N--}E=E.getAnnotations(0,H);R=r.createDocumentFragment();for(var C in E){H=C>>>0;if(!(H<0)){L=r.createElement("DIV");N=E[C];this._applyStyle(N.style,L);L.style.position="absolute";L.style.top=M+p+Math.floor(H*T)+"px";if(N.html)L.innerHTML=N.html;L.annotation=N;L.lineIndex=H;R.appendChild(L)}}z.appendChild(R)}else if(z._oldTrackHeight!==G)for(L=z.firstChild?
z.firstChild.nextSibling:null;L;){L.style.top=M+p+Math.floor(L.lineIndex*T)+"px";L=L.nextSibling}z._oldTrackHeight=G}z.rulerChanged=false}}},_updateStyle:function(){var h=this._frameDocument;if(i)h.body.style.lineHeight="normal";var l=this._metrics=this._calculateMetrics();if(i)h.body.style.lineHeight=l.lineHeight-(l.lineTrim.top+l.lineTrim.bottom)+"px";this.redraw()}};a.EventTarget.addMixin(g.prototype);return{TextView:g}});
define("orion/textview/projectionTextModel",["orion/textview/textModel","orion/textview/eventTarget"],function(c,e){function a(b){this._model=b;this._projections=[]}a.prototype={addProjection:function(b){if(b){var d=this._model,f=this._projections;b._lineIndex=d.getLineAtOffset(b.start);b._lineCount=d.getLineAtOffset(b.end)-b._lineIndex;var g=b.text;g||(g="");b._model=typeof g==="string"?new c.TextModel(g,d.getLineDelimiter()):g;d=this.mapOffset(b.start,true);g=b.end-b.start;var j=b._lineCount,i=
b._model.getCharCount(),k=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:b._model.getText(),start:d,removedCharCount:g,addedCharCount:i,removedLineCount:j,addedLineCount:k});var m=this._binarySearch(f,b.start);f.splice(m,0,b);this.onChanged({type:"Changed",start:d,removedCharCount:g,addedCharCount:i,removedLineCount:j,addedLineCount:k})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,d){var f=this._projections,
g=0,j;if(d){for(d=0;d<f.length;d++){j=f[d];if(j.start>b)break;if(j.end>b)return-1;g+=j._model.getCharCount()-(j.end-j.start)}return b+g}for(d=0;d<f.length;d++){j=f[d];if(j.start>b-g)break;var i=j._model.getCharCount();if(j.start+i>b-g)return-1;g+=i-(j.end-j.start)}return b-g},removeProjection:function(b){var d,f=0;for(d=0;d<this._projections.length;d++){var g=this._projections[d];if(g===b){b=g;break}f+=g._model.getCharCount()-(g.end-g.start)}if(d<this._projections.length){g=this._model;f=b.start+
f;var j=b.end-b.start,i=b._lineCount,k=b._model.getCharCount(),m=b._model.getLineCount()-1;this.onChanging({type:"Changing",text:g.getText(b.start,b.end),start:f,removedCharCount:k,addedCharCount:j,removedLineCount:m,addedLineCount:i});this._projections.splice(d,1);this.onChanged({type:"Changed",start:f,removedCharCount:k,addedCharCount:j,removedLineCount:m,addedLineCount:i})}},_binarySearch:function(b,d){for(var f=b.length,g=-1,j;f-g>1;){j=Math.floor((f+g)/2);if(d<=b[j].start)f=j;else g=j}return f},
getCharCount:function(){for(var b=this._model.getCharCount(),d=this._projections,f=0;f<d.length;f++){var g=d[f];b+=g._model.getCharCount()-(g.end-g.start)}return b},getLine:function(b,d){if(b<0)return null;var f=this._model,g=this._projections,j=0,i=[],k=0,m,o,v;for(m=0;m<g.length;m++){v=g[m];if(v._lineIndex>=b-j)break;o=v._model.getLineCount()-1;if(v._lineIndex+o>=b-j){k=b-(v._lineIndex+j);if(k<o)return v._model.getLine(k,d);else i.push(v._model.getLine(o))}k=v.end;j+=o-v._lineCount}for(k=Math.max(k,
f.getLineStart(b-j));m<g.length;m++){v=g[m];if(v._lineIndex>b-j)break;i.push(f.getText(k,v.start));o=v._model.getLineCount()-1;if(v._lineIndex+o>b-j){i.push(v._model.getLine(0,d));return i.join("")}i.push(v._model.getText());k=v.end;j+=o-v._lineCount}b=f.getLineEnd(b-j,d);k<b&&i.push(f.getText(k,b));return i.join("")},getLineAtOffset:function(b){for(var d=this._model,f=this._projections,g=0,j=0,i=0;i<f.length;i++){var k=f[i];if(k.start>b-g)break;var m=k._model.getCharCount();if(k.start+m>b-g){f=b-
(k.start+g);j+=k._model.getLineAtOffset(f);g+=f;break}j+=k._model.getLineCount()-1-k._lineCount;g+=m-(k.end-k.start)}return d.getLineAtOffset(b-g)+j},getLineCount:function(){for(var b=this._projections,d=this._model.getLineCount(),f=0;f<b.length;f++){var g=b[f];d+=g._model.getLineCount()-1-g._lineCount}return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,d){if(b<0)return-1;for(var f=this._model,g=this._projections,j=0,i=0,k=0;k<g.length;k++){var m=g[k];
if(m._lineIndex>b-j)break;var o=m._model.getLineCount()-1;if(m._lineIndex+o>b-j)return m._model.getLineEnd(b-(m._lineIndex+j),d)+m.start+i;i+=m._model.getCharCount()-(m.end-m.start);j+=o-m._lineCount}return f.getLineEnd(b-j,d)+i},getLineStart:function(b){if(b<0)return-1;for(var d=this._model,f=this._projections,g=0,j=0,i=0;i<f.length;i++){var k=f[i];if(k._lineIndex>=b-g)break;var m=k._model.getLineCount()-1;if(k._lineIndex+m>=b-g)return k._model.getLineStart(b-(k._lineIndex+g))+k.start+j;j+=k._model.getCharCount()-
(k.end-k.start);g+=m-k._lineCount}return d.getLineStart(b-g)+j},getText:function(b,d){if(b===undefined)b=0;var f=this._model,g=this._projections,j=0,i=[],k,m,o;for(k=0;k<g.length;k++){m=g[k];if(m.start>b-j)break;o=m._model.getCharCount();if(m.start+o>b-j)if(d!==undefined&&m.start+o>d-j)return m._model.getText(b-(m.start+j),d-(m.start+j));else{i.push(m._model.getText(b-(m.start+j)));b=m.end+j+o-(m.end-m.start)}j+=o-(m.end-m.start)}b=b-j;if(d!==undefined){for(;k<g.length;k++){m=g[k];if(m.start>d-j)break;
i.push(f.getText(b,m.start));o=m._model.getCharCount();if(m.start+o>d-j){i.push(m._model.getText(0,d-(m.start+j)));return i.join("")}i.push(m._model.getText());b=m.end;j+=o-(m.end-m.start)}i.push(f.getText(b,d-j))}else{for(;k<g.length;k++){m=g[k];i.push(f.getText(b,m.start));i.push(m._model.getText());b=m.end}i.push(f.getText(b))}return i.join("")},_onChanging:function(b,d,f,g,j,i){for(var k=this._model,m=this._projections,o,v=0,t,w=d+f;o<m.length;o++){f=m[o];if(f.start>d)break;v+=f._model.getCharCount()-
(f.end-f.start)}d=d+v;for(var u=o;o<m.length;o++){f=m[o];if(f.start>w)break;v+=f._model.getCharCount()-(f.end-f.start);t+=f._model.getLineCount()-1-f._lineCount}f=w+v;v=o;this.onChanging(d,f-d,g,j+t,i);m.splice(m,v-u);for(b=b.length-(f-d);o<m.length;o++){f=m[o];f.start+=b;f.end+=b;f._lineIndex=k.getLineAtOffset(f.start)}},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,
d,f){if(b===undefined)b="";if(d===undefined)d=0;var g=d,j=f,i=this._model,k=this._projections,m=0,o=0,v,t,w,u,s,q=0;for(v=0;v<k.length;v++){t=k[v];if(t.start>d-m)break;w=t._model.getCharCount();if(t.start+w>d-m)if(f!==undefined&&t.start+w>f-m){t._model.setText(b,d-(t.start+m),f-(t.start+m));return}else{q=t._model.getLineCount()-1-t._model.getLineAtOffset(d-(t.start+m));u={projection:t,start:d-(t.start+m)};d=t.end+m+w-(t.end-t.start)}o+=t._model.getLineCount()-1-t._lineCount;m+=w-(t.end-t.start)}d=
d-m;var x=v;q=i.getLineAtOffset(d)+o-q;if(f!==undefined)for(;v<k.length;v++){t=k[v];if(t.start>f-m)break;w=t._model.getCharCount();if(t.start+w>f-m){o+=t._model.getLineAtOffset(f-(t.start+m));w=f-(t.start+m);f=t.end+m;s={projection:t,end:w};break}o+=t._model.getLineCount()-1-t._lineCount;m+=w-(t.end-t.start)}else{for(;v<k.length;v++){t=k[v];o+=t._model.getLineCount()-1-t._lineCount;m+=t._model.getCharCount()-(t.end-t.start)}f=j=i.getCharCount()+m}f=f-m;v=v;t=i.getLineAtOffset(f)+o;j=j-g;o=t-q;q=b.length;
for(var A=w=t=m=0;;){if(t!==-1&&t<=A)t=b.indexOf("\r",A);if(w!==-1&&w<=A)w=b.indexOf("\n",A);if(w===-1&&t===-1)break;A=t!==-1&&w!==-1?t+1===w?w+1:(t<w?t:w)+1:t!==-1?t+1:w+1;m++}this.onChanging({type:"Changing",text:b,start:g,removedCharCount:j,addedCharCount:q,removedLineCount:o,addedLineCount:m});i.setText(b,d,f);if(u){t=u.projection;t._model.setText("",u.start)}if(s){t=s.projection;t._model.setText("",0,s.end);t.start=t.end;t._lineCount=0}k.splice(x,v-x);b=b.length-(f-d);for(v=v;v<k.length;v++){t=
k[v];t.start+=b;t.end+=b;t._lineIndex=i.getLineAtOffset(t.start)}this.onChanged({type:"Changed",start:g,removedCharCount:j,addedCharCount:q,removedLineCount:o,addedLineCount:m})}};e.EventTarget.addMixin(a.prototype);return{ProjectionTextModel:a}});
define("orion/textview/tooltip",["i18n!orion/textview/nls/messages","orion/textview/textView","orion/textview/textModel","orion/textview/projectionTextModel"],function(c,e,a,b){function d(f){this._view=f;this._create(f._parent.ownerDocument);f.addEventListener("Destroy",this,this.destroy)}d.getTooltip=function(f){if(!f._tooltip)f._tooltip=new d(f);return f._tooltip};d.prototype={_create:function(f){if(!this._domNode){this._document=f;var g=this._domNode=f.createElement("DIV");g.className="viewTooltip";
var j=this._viewParent=f.createElement("DIV");g.appendChild(j);j=this._htmlParent=f.createElement("DIV");g.appendChild(j);f.body.appendChild(g);this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var f=this._domNode.parentNode;f&&f.removeChild(this._domNode);this._domNode=null}},hide:function(){this._contentsView&&this._contentsView.setModel(this._emptyModel);if(this._viewParent){this._viewParent.style.left=
"-10000px";this._viewParent.style.position="fixed";this._viewParent.style.visibility="hidden"}if(this._htmlParent){this._htmlParent.style.left="-10000px";this._htmlParent.style.position="fixed";this._htmlParent.style.visibility="hidden";this._htmlParent.innerHTML=""}if(this._domNode)this._domNode.style.visibility="hidden";if(this._showTimeout){clearTimeout(this._showTimeout);this._showTimeout=null}if(this._hideTimeout){clearTimeout(this._hideTimeout);this._hideTimeout=null}if(this._fadeTimeout){clearInterval(this._fadeTimeout);
this._fadeTimeout=null}},isVisible:function(){return this._domNode&&this._domNode.style.visibility==="visible"},setTarget:function(f){if(this.target!==f){this._target=f;this.hide();if(f){var g=this;g._showTimeout=setTimeout(function(){g.show(true)},1E3)}}},show:function(f){if(this._target){var g=this._target.getTooltipInfo();if(g){var j=this._domNode;j.style.left=j.style.right=j.style.width=j.style.height="auto";var i=g.contents,k;if(i instanceof Array)i=this._getAnnotationContents(i);if(typeof i===
"string")(k=this._htmlParent).innerHTML=i;else if(i instanceof Node)(k=this._htmlParent).appendChild(i);else if(i instanceof b.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new a.TextModel("");k=this._contentsView=new e.TextView({model:this._emptyModel,parent:this._viewParent,tabSize:4,sync:true,stylesheet:["/orion/textview/tooltip.css","/orion/textview/rulers.css","/examples/textview/textstyler.css","/css/default-theme.css"]});k._clientDiv.contentEditable=false;var m=this._view;k.addEventListener("LineStyle",
{onLineStyle:function(v){m.onLineStyle(v)}}.onLineStyle)}k=this._contentsView;k.setModel(i);i=k.computeSize();k=this._viewParent;k.style.width=i.width+20+"px";k.style.height=i.height+"px"}else return;k.style.left="auto";k.style.position="static";k.style.visibility="visible";i=parseInt(this._getNodeStyle(j,"padding-left","0"),10);i+=parseInt(this._getNodeStyle(j,"border-left-width","0"),10);if(g.anchor==="right"){k=parseInt(this._getNodeStyle(j,"padding-right","0"),10);k+=parseInt(this._getNodeStyle(j,
"border-right-width","0"),10);j.style.right=j.ownerDocument.body.getBoundingClientRect().right-g.x+i+k+"px"}else j.style.left=g.x-i+"px";i=parseInt(this._getNodeStyle(j,"padding-top","0"),10);i+=parseInt(this._getNodeStyle(j,"border-top-width","0"),10);j.style.top=g.y-i+"px";j.style.maxWidth=g.maxWidth+"px";j.style.maxHeight=g.maxHeight+"px";j.style.opacity="1";j.style.visibility="visible";if(f){var o=this;o._hideTimeout=setTimeout(function(){var v=parseFloat(o._getNodeStyle(j,"opacity","1"));o._fadeTimeout=
setInterval(function(){if(j.style.visibility==="visible"&&v>0){v-=0.1;j.style.opacity=v}else o.hide()},50)},5E3)}}}},_getAnnotationContents:function(f){function g(v,t){v=i.getLineStart(i.getLineAtOffset(v));t=i.getLineEnd(i.getLineAtOffset(t),true);return i.getText(v,t)}if(f.length===0)return null;var j=this._view.getModel(),i=j.getBaseModel?j.getBaseModel():j,k;if(f.length===1){j=f[0];if(j.title){k=j.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div>"+j.html+"&nbsp;<span style='vertical-align:middle;'>"+
k+"</span><div>"}else{f=new b.ProjectionTextModel(i);k=i.getLineStart(i.getLineAtOffset(j.start));f.addProjection({start:j.end,end:f.getCharCount()});f.addProjection({start:0,end:k});return f}}else{for(var m="<div><em>"+c.multipleAnnotations+"</em></div>",o=0;o<f.length;o++){j=f[o];(k=j.title)||(k=g(j.start,j.end));k=k.replace(/</g,"&lt;").replace(/>/g,"&gt;");m+="<div>"+j.html+"&nbsp;<span style='vertical-align:middle;'>"+k+"</span><div>"}return m}},_getNodeStyle:function(f,g,j){var i;if(f){i=f.style[g];
if(!i)if(f.currentStyle){i=0;for(g=g;(i=g.indexOf("-",i))!==-1;)g=g.substring(0,i)+g.substring(i+1,i+2).toUpperCase()+g.substring(i+2);i=f.currentStyle[g]}else i=(f=f.ownerDocument.defaultView.getComputedStyle(f,null))?f.getPropertyValue(g):null}return i||j}};return{Tooltip:d}});
define("orion/textview/rulers",["i18n!orion/textview/nls/messages","orion/textview/annotations","orion/textview/tooltip"],function(c,e,a){function b(i,k,m,o){this._location=k||"left";this._overview=m||"page";this._rulerStyle=o;this._view=null;var v=this;this._listener={onTextModelChanged:function(t){v._onTextModelChanged(t)},onAnnotationModelChanged:function(t){v._onAnnotationModelChanged(t)}};this.setAnnotationModel(i)}function d(i,k,m,o,v){b.call(this,i,k,"page",m);this._oddStyle=o||{style:{backgroundColor:"white"}};
this._evenStyle=v||{style:{backgroundColor:"white"}};this._numOfDigits=0}function f(i,k,m){b.call(this,i,k,"page",m)}function g(i,k,m){b.call(this,i,k,"document",m)}function j(i,k,m){f.call(this,i,k,m)}b.prototype={getAnnotations:function(i,k){var m=this._annotationModel;if(!m)return[];var o=this._view.getModel(),v=o.getLineStart(i),t=o.getLineEnd(k-1),w=o;if(o.getBaseModel){w=o.getBaseModel();v=o.mapOffset(v);t=o.mapOffset(t)}var u=[];m=this.getAnnotationsByType(m,v,t);for(v=0;v<m.length;v++){t=
m[v];for(var s=w.getLineAtOffset(t.start),q=w.getLineAtOffset(Math.max(t.start,t.end-1)),x=s;x<=q;x++){var A=x;if(o!==w){A=w.getLineStart(x);A=o.mapOffset(A,true);if(A===-1)continue;A=o.getLineAtOffset(A)}if(i<=A&&A<k){var D=this._mergeAnnotation(u[A],t,x-s,q-s+1);if(D)u[A]=D}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var h in u)if(u[h]._multiple)u[h].html+=this._multiAnnotationOverlay.html;return u},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getWidestAnnotation:function(){return null},setAnnotationModel:function(i){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=i)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(i){this._multiAnnotation=i},setMultiAnnotationOverlay:function(i){this._multiAnnotationOverlay=
i},setView:function(i){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=i;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(i,k){var m=a.Tooltip.getTooltip(this._view);if(m)if(!(m.isVisible()&&this._tooltipLineIndex===i)){this._tooltipLineIndex=i;var o=this;m.setTarget({y:k.clientY,getTooltipInfo:function(){return o._getTooltipInfo(o._tooltipLineIndex,
this.y)}})}},onMouseOver:function(i,k){this.onMouseMove(i,k)},onMouseOut:function(){var i=a.Tooltip.getTooltip(this._view);i&&i.setTarget(null)},_getTooltipInfo:function(i,k){if(i!==undefined){var m=this._view,o=m.getModel(),v=this._annotationModel,t=[];if(v){t=o.getLineStart(i);var w=o.getLineEnd(i);if(o.getBaseModel){t=o.mapOffset(t);w=o.mapOffset(w)}t=this.getAnnotationsByType(v,t,w)}v=this._getTooltipContents(i,t);if(!v)return null;v={contents:v,anchor:this.getLocation()};t=m.getClientArea();
t.y=this.getOverview()==="document"?m.convert({y:k},"view","document").y:m.getLocationAtOffset(o.getLineStart(i)).y;m.convert(t,"document","page");v.x=t.x;v.y=t.y;if(v.anchor==="right")v.x+=t.width;v.maxWidth=t.width;v.maxHeight=t.height-(t.y-m._parent.getBoundingClientRect().top);return v}},_getTooltipContents:function(i,k){return k},_onAnnotationModelChanged:function(i){function k(w){for(var u=0;u<w.length;u++)if(v.isAnnotationTypeVisible(w[u].type)){var s=w[u].start,q=w[u].end;if(o.getBaseModel){s=
o.mapOffset(s,true);q=o.mapOffset(q,true)}s!==-1&&q!==-1&&m.redrawLines(o.getLineAtOffset(s),o.getLineAtOffset(Math.max(s,q-1))+1,v)}}var m=this._view;if(m){var o=m.getModel(),v=this,t=o.getLineCount();if(i.textModelChangedEvent){i=i.textModelChangedEvent.start;if(o.getBaseModel)i=o.mapOffset(i,true);i=o.getLineAtOffset(i);m.redrawLines(i,t,v)}else{k(i.added);k(i.removed);k(i.changed)}}},_mergeAnnotation:function(i,k,m){i||(i={});if(m===0)if(i.html&&k.html){if(k.html!==i.html)if(!i._multiple&&this._multiAnnotation)i.html=
this._multiAnnotation.html;i._multiple=true}else i.html=k.html;i.style=this._mergeStyle(i.style,k.style);return i},_mergeStyle:function(i,k){if(k){i||(i={});if(i.styleClass&&k.styleClass&&i.styleClass!==k.styleClass)i.styleClass+=" "+k.styleClass;else i.styleClass=k.styleClass;var m;if(k.style){if(!i.style)i.style={};for(m in k.style)i.style[m]||(i.style[m]=k.style[m])}if(k.attributes){if(!i.attributes)i.attributes={};for(m in k.attributes)i.attributes[m]||(i.attributes[m]=k.attributes[m])}}return i}};
e.AnnotationTypeList.addMixin(b.prototype);d.prototype=new b;d.prototype.getAnnotations=function(i,k){var m=b.prototype.getAnnotations.call(this,i,k),o=this._view.getModel();for(i=i;i<k;i++){var v=i&1?this._oddStyle:this._evenStyle,t=i;if(o.getBaseModel){t=o.getLineStart(t);t=o.getBaseModel().getLineAtOffset(o.mapOffset(t))}m[i]||(m[i]={});m[i].html=t+1+"";if(!m[i].style)m[i].style=v}return m};d.prototype.getWidestAnnotation=function(){var i=this._view.getModel().getLineCount();return this.getAnnotations(i-
1,i)[i-1]};d.prototype._onTextModelChanged=function(i){i=i.start;var k=this._view.getModel(),m=((k.getBaseModel?k.getBaseModel().getLineCount():k.getLineCount())+"").length;if(this._numOfDigits!==m){this._numOfDigits=m;this._view.redrawLines(k.getLineAtOffset(i),k.getLineCount(),this)}};f.prototype=new b;g.prototype=new b;g.prototype.getRulerStyle=function(){var i={style:{lineHeight:"1px",fontSize:"1px"}};return i=this._mergeStyle(i,this._rulerStyle)};g.prototype.onClick=function(i){i!==undefined&&
this._view.setTopIndex(i)};g.prototype._getTooltipContents=function(i,k){if(k.length===0){k=this._view.getModel();i=i;if(k.getBaseModel){i=k.getLineStart(i);i=k.getBaseModel().getLineAtOffset(k.mapOffset(i))}return c.formatMessage(c.line,i+1)}return b.prototype._getTooltipContents.call(this,i,k)};g.prototype._mergeAnnotation=function(i,k,m,o){if(m===0){i=i;if(!i){i={html:"&nbsp;",style:{style:{height:3*o+"px"}}};i.style=this._mergeStyle(i.style,k.overviewStyle)}return i}};j.prototype=new f;j.prototype.onClick=
function(i){if(i!==undefined){var k=this._annotationModel;if(k){var m=this._view.getModel(),o=m.getLineStart(i);i=m.getLineEnd(i,true);if(m.getBaseModel){o=m.mapOffset(o);i=m.mapOffset(i);m=m.getBaseModel()}var v;for(k=k.getAnnotations(o,i);!v&&k.hasNext();){i=k.next();if(this.isAnnotationTypeVisible(i.type))v=i}if(v&&m.getLineAtOffset(v.start)===m.getLineAtOffset(o)){(m=a.Tooltip.getTooltip(this._view))&&m.setTarget(null);v.expanded?v.collapse():v.expand();this._annotationModel.modifyAnnotation(v)}}}};
j.prototype._getTooltipContents=function(i,k){if(k.length===1)if(k[0].expanded)return null;return f.prototype._getTooltipContents.call(this,i,k)};j.prototype._onAnnotationModelChanged=function(i){function k(s){for(t=0;t<s.length;t++)if(v.isAnnotationTypeVisible(s[t].type)){var q=s[t].start;if(o.getBaseModel)q=o.mapOffset(q,true);if(q!==-1)u=Math.min(u,o.getLineAtOffset(q))}}if(i.textModelChangedEvent)f.prototype._onAnnotationModelChanged.call(this,i);else{var m=this._view;if(m){var o=m.getModel(),
v=this,t,w=o.getLineCount(),u=w;k(i.added);k(i.removed);k(i.changed);i=m.getRulers();for(t=0;t<i.length;t++)m.redrawLines(u,w,i[t])}}};return{Ruler:b,AnnotationRuler:f,LineNumberRuler:d,OverviewRuler:g,FoldingRuler:j}});
define("orion/textview/textDND",[],function(){function c(e,a){this._view=e;this._undoStack=a;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(d){b._onDragStart(d)},onDragEnd:function(d){b._onDragEnd(d)},onDragEnter:function(d){b._onDragEnter(d)},onDragOver:function(d){b._onDragOver(d)},onDrop:function(d){b._onDrop(d)},onDestroy:function(d){b._onDestroy(d)}};e.addEventListener("DragStart",this._listener.onDragStart);e.addEventListener("DragEnd",
this._listener.onDragEnd);e.addEventListener("DragEnter",this._listener.onDragEnter);e.addEventListener("DragOver",this._listener.onDragOver);e.addEventListener("Drop",this._listener.onDrop);e.addEventListener("Destroy",this._listener.onDestroy)}c.prototype={destroy:function(){var e=this._view;if(e){e.removeEventListener("DragStart",this._listener.onDragStart);e.removeEventListener("DragEnd",this._listener.onDragEnd);e.removeEventListener("DragEnter",this._listener.onDragEnter);e.removeEventListener("DragOver",
this._listener.onDragOver);e.removeEventListener("Drop",this._listener.onDrop);e.removeEventListener("Destroy",this._listener.onDestroy);this._view=null}},_onDestroy:function(){this.destroy()},_onDragStart:function(e){var a=this._view,b=a.getSelection();a=a.getModel();if(a.getBaseModel){b.start=a.mapOffset(b.start);b.end=a.mapOffset(b.end);a=a.getBaseModel()}if(a=a.getText(b.start,b.end)){this._dragSelection=b;e.event.dataTransfer.effectAllowed="copyMove";e.event.dataTransfer.setData("Text",a)}},
_onDragEnd:function(e){var a=this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(e=e.event.dataTransfer.dropEffect==="move")&&a.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,d=this._dropOffset;if(e)if(d>=this._dragSelection.end)d-=this._dragSelection.end-this._dragSelection.start;else if(d>=this._dragSelection.start)d=this._dragSelection.start;a.setText(b,d,d);a.setSelection(d,d+b.length);this._dropText=
null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(e){this._onDragOver(e)},_onDragOver:function(e){var a=e.event.dataTransfer.types;if(a)if(!(a.contains?a.contains("text/plain"):a.indexOf("text/plain")!==-1))e.event.dataTransfer.dropEffect="none"},_onDrop:function(e){var a=this._view,b=e.event.dataTransfer.getData("Text");if(b){e=a.getOffsetAtLocation(e.x,e.y);if(this._dragSelection){this._dropOffset=e;this._dropText=b}else{a.setText(b,
e,e);a.setSelection(e,e+b.length)}}}};return{TextDND:c}});
define("orion/editor/editorFeatures",["i18n!orion/editor/nls/messages","orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers","orion/textview/annotations","orion/textview/textDND","orion/editor/regex"],function(c,e,a,b,d,f,g){function j(){}function i(){}function k(){}function m(){}function o(){}function v(u,s,q){this.editor=u;this.textView=u.getTextView();this.undoStack=s;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=
false;this._incrementalFindPrefix="";(this._searcher=q)&&this._searcher.getAdaptor().setEditor(this.editor);this._lastEditLocation=null;this.init()}function t(u,s,q,x){this.editor=u;this.textView=u.getTextView();this.undoStack=s;this.contentAssist=q;this.linkedMode=x;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}function w(u){this.editor=u;this.textView=u.getTextView();this.linkedModeActive=false;this.linkedModePositions=
[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(s){for(var q=false,x=0,A=0;A<this.linkedModePositions.length;++A){var D=this.linkedModePositions[A];if(q)D.offset+=x;else if(s.start>=D.offset&&s.end<=D.offset+D.length){q=D.length;D.length=s.start-D.offset+s.text.length+(D.offset+D.length-s.end);x=D.length-q;q=true}}if(q)this.linkedModeEscapePosition+=x;else this.cancel()}.bind(this)}}j.prototype={createUndoStack:function(u){u=u.getTextView();
var s=new e.UndoStack(u,200);u.setKeyBinding(new a.KeyBinding("z",true),"Undo");u.setAction("Undo",function(){s.undo();return true});var q=navigator.platform.indexOf("Mac")!==-1;u.setKeyBinding(q?new a.KeyBinding("z",true,true):new a.KeyBinding("y",true),"Redo");u.setAction("Redo",function(){s.redo();return true});return s}};i.prototype={createLineNumberRuler:function(u){return new b.LineNumberRuler(u,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};
k.prototype={createFoldingRuler:function(u){return new b.FoldingRuler(u,"left",{styleClass:"ruler folding"})}};m.prototype={createAnnotationModel:function(u){return new d.AnnotationModel(u)},createAnnotationStyler:function(u,s){return new d.AnnotationStyler(u,s)},createAnnotationRulers:function(u){var s=new b.AnnotationRuler(u,"left",{styleClass:"ruler annotations"});u=new b.OverviewRuler(u,"right",{styleClass:"ruler overview"});return{annotationRuler:s,overviewRuler:u}}};o.prototype={createTextDND:function(u,
s){return new f.TextDND(u.getTextView(),s)}};v.prototype={init:function(){var u=this;this._incrementalFindListener={onVerify:function(q){var x=u.editor,A=x.getModel(),D=x.mapOffset(q.start),h=x.mapOffset(q.end);D=A.getText(D,h);A=u._incrementalFindPrefix;if((A=A.match(new RegExp("^"+g.escape(D),"i")))&&A.length>0){A=u._incrementalFindPrefix+=q.text;u.editor.reportStatus(c.formatMessage(c.incrementalFind,A));D=A.toLowerCase()===A;h=x.getSelection().start;if(D=x.doFind(A,h,D)){u._incrementalFindSuccess=
true;u._incrementalFindIgnoreSelection=true;x.moveSelection(D.index,D.index+D.length);u._incrementalFindIgnoreSelection=false}else{x.reportStatus(c.formatMessage(c.incrementalFindNotFound,A),"error");u._incrementalFindSuccess=false}q.text=null}},onSelection:function(){u._incrementalFindIgnoreSelection||u.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(q){if(u.editor.isDirty())u._lastEditLocation=q.start+q.addedCharCount}};this.textView.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);
this.textView.setKeyBinding(new a.KeyBinding("f",true),c.find);this.textView.setAction(c.find,function(){if(this._searcher){var q=this.editor,x=q.getSelection(),A="";if(x.end>x.start)A=q.getModel().getText(x.start,x.end);this._searcher.buildToolBar(A);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",true),c.findNext);this.textView.setAction(c.findNext,function(){if(this._searcher){this._searcher.findNext(true);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",
true,true),c.findPrevious);this.textView.setAction(c.findPrevious,function(){if(this._searcher){this._searcher.findNext(false);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("j",true),c.incrementalFindKey);this.textView.setAction(c.incrementalFindKey,function(){if(this._searcher&&this._searcher.visible())return true;var q=this.editor;if(this._incrementalFindActive){var x=this._incrementalFindPrefix;if(x.length!==0){var A;if(this._searcher)A=this._searcher.findNext(true,
x);else{A=0;if(this._incrementalFindSuccess)A=q.getSelection().start+1;var D=x.toLowerCase()===x;A=q.doFind(x,A,D)}if(A){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.moveSelection(A.index,A.index+A.length);this._incrementalFindIgnoreSelection=false;q.reportStatus(c.formatMessage(c.incrementalFind,x))}else{q.reportStatus(c.formatMessage(c.incrementalFindNotFound,x),"error");this._incrementalFindSuccess=false}}}else{q.setCaretOffset(q.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));
this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var q=this.editor,x=this._incrementalFindPrefix;x=this._incrementalFindPrefix=x.substring(0,x.length-1);if(x.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.setCaretOffset(q.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}q.reportStatus(c.formatMessage(c.incrementalFind,x));var A=q.getCaretOffset();A=q.getModel().getText().lastIndexOf(x,
A-x.length-1);if(A!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.moveSelection(A,A+x.length);this._incrementalFindIgnoreSelection=false}else q.reportStatus(c.formatMessage(c.incrementalFindNotFound,x),"error");return true}return false}.bind(this));this.textView.setAction("tab",function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start),h=x.getLineAtOffset(A.end>A.start?A.end-1:A.end);if(D!==h){var l=[];l.push("");for(var n=D;n<=h;n++)l.push(x.getLine(n,
true));n=x.getLineStart(D);x=x.getLineEnd(h,true);var p=this.textView.getOptions("tabSize","expandTab");p=p.expandTab?(new Array(p.tabSize+1)).join(" "):"\t";q.setText(l.join(p),n,x);q.setSelection(n===A.start?A.start:A.start+p.length,A.end+(h-D+1)*p.length);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),c.unindentLines);this.textView.setAction(c.unindentLines,function(){for(var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start),
h=x.getLineAtOffset(A.end>A.start?A.end-1:A.end),l=this.textView.getOptions("tabSize"),n=(new Array(l+1)).join(" "),p=[],r=0,y=0,B=D;B<=h;B++){var z=x.getLine(B,true);if(x.getLineStart(B)!==x.getLineEnd(B))if(z.indexOf("\t")===0){z=z.substring(1);r++}else if(z.indexOf(n)===0){z=z.substring(l);r+=l}else return true;if(B===D)y=r;p.push(z)}D=x.getLineStart(D);l=x.getLineEnd(h,true);x=x.getLineStart(h);q.setText(p.join(""),D,l);q.setSelection(D===A.start?A.start:A.start-y,A.end-r+(A.end===x+1?1:0));return true}.bind(this));
this.textView.setKeyBinding(new a.KeyBinding(38,false,false,true),c.moveLinesUp);this.textView.setAction(c.moveLinesUp,function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start);if(D===0)return true;var h=x.getLineAtOffset(A.end>A.start?A.end-1:A.end),l=x.getLineCount();A=x.getLineStart(D-1);var n=x.getLineStart(D),p=x.getLineEnd(h,true),r=x.getText(n,p),y=0;if(h===l-1){h=x.getLineEnd(D-1);D=x.getLineEnd(D-1,true);r+=x.getText(h,D);n=h;y=D-h}this.startUndo();q.setText("",
n,p);q.setText(r,A,A);q.setSelection(A,A+r.length-y);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,false,false,true),c.moveLinesDown);this.textView.setAction(c.moveLinesDown,function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start),h=x.getLineAtOffset(A.end>A.start?A.end-1:A.end),l=x.getLineCount();if(h===l-1)return true;D=x.getLineStart(D);A=x.getLineEnd(h,true);var n=x.getLineEnd(h+1,true)-(A-D),p=0;if(h!==l-2)x=x.getText(D,
A);else{h=x.getLineEnd(h);x=x.getText(h,A)+x.getText(D,h);p+=A-h}this.startUndo();q.setText("",D,A);q.setText(x,n,n);q.setSelection(n+p,n+p+x.length);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(38,true,false,true),c.copyLinesUp);this.textView.setAction(c.copyLinesUp,function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start);A=x.getLineAtOffset(A.end>A.start?A.end-1:A.end);D=x.getLineStart(D);var h=x.getLineEnd(A,true),l=x.getLineCount(),
n="";h=x.getText(D,h);if(A===l-1)h+=n=x.getLineDelimiter();q.setText(h,D,D);q.setSelection(D,D+h.length-n.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,true,false,true),c.copyLinesDown);this.textView.setAction(c.copyLinesDown,function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start);A=x.getLineAtOffset(A.end>A.start?A.end-1:A.end);var h=x.getLineStart(D);D=x.getLineEnd(A,true);var l=x.getLineCount(),n="";h=x.getText(h,D);if(A===
l-1)h=(n=x.getLineDelimiter())+h;q.setText(h,D,D);q.setSelection(D+n.length,D+h.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("d",true,false,false),c.deleteLines);this.textView.setAction(c.deleteLines,function(){var q=this.editor,x=q.getSelection(),A=q.getModel(),D=A.getLineAtOffset(x.start);x=A.getLineAtOffset(x.end>x.start?x.end-1:x.end);D=A.getLineStart(D);A=A.getLineEnd(x,true);q.setText("",D,A);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("l",
true),c.gotoLine);this.textView.setAction(c.gotoLine,function(){var q=this.editor,x=q.getModel().getLineAtOffset(q.getCaretOffset());if(x=prompt(c.gotoLinePrompty,x+1)){x=parseInt(x,10);q.onGotoLine(x-1,0)}return true}.bind(this));var s=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding("q",!s,false,false,s),c.lastEdit);this.textView.setAction(c.lastEdit,function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return true}.bind(this))},
toggleIncrementalFind:function(){if(this._incrementalFindActive=!this._incrementalFindActive){this.editor.reportStatus(c.formatMessage(c.incrementalFind,this._incrementalFindPrefix));this.textView.addEventListener("Verify",this._incrementalFindListener.onVerify);this.textView.addEventListener("Selection",this._incrementalFindListener.onSelection)}else{this._incrementalFindPrefix="";this.editor.reportStatus("");this.textView.removeEventListener("Verify",this._incrementalFindListener.onVerify);this.textView.removeEventListener("Selection",
this._incrementalFindListener.onSelection);this.textView.setCaretOffset(this.textView.getCaretOffset())}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},lineUp:function(){if(this._incrementalFindActive){var u=this._incrementalFindPrefix;
if(u.length===0)return false;var s=this.editor,q=s.getModel(),x;x=this._incrementalFindSuccess?s.getCaretOffset()-u.length-1:q.getCharCount()-1;q=q.getText().lastIndexOf(u,x);if(q!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;s.moveSelection(q,q+u.length);this._incrementalFindIgnoreSelection=false;s.reportStatus(c.formatMessage(c.incrementalFind,u))}else{s.reportStatus(c.formatMessage(c.incrementalFindNotFound,u),"error");this._incrementalFindSuccess=false}return true}return false},
lineDown:function(){if(this._incrementalFindActive){var u=this._incrementalFindPrefix;if(u.length===0)return false;var s=this.editor,q=s.getModel(),x=0;if(this._incrementalFindSuccess)x=s.getSelection().start+1;q=q.getText().indexOf(u,x);if(q!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;s.moveSelection(q,q+u.length);this._incrementalFindIgnoreSelection=false;s.reportStatus(c.formatMessage(c.incrementalFind,u))}else{s.reportStatus(c.formatMessage(c.incrementalFindNotFound,
u),"error");this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};t.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function u(q,x,A){var D=q.getLineAtOffset(x),h=q.getLineAtOffset(A),l,n,p,r,y,B;for(l=D;l>=0;l--){n=q.getLine(l);p=l===D?x-q.getLineStart(D):n.length;r=n.lastIndexOf("/*",p);n=n.lastIndexOf("*/",p);if(n>r)break;else if(r!==
-1){y=q.getLineStart(l)+r;break}}for(l=h;l<q.getLineCount();l++){n=q.getLine(l);p=l===h?A-q.getLineStart(h):0;r=n.indexOf("/*",p);n=n.indexOf("*/",p);if(r!==-1&&r<n)break;else if(n!==-1){B=q.getLineStart(l)+n;break}}return{commentStart:y,commentEnd:B}}this.textView.setKeyBinding(new a.KeyBinding(191,true),c.toggleLineComment);this.textView.setAction(c.toggleLineComment,function(){for(var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getLineAtOffset(A.start),h=x.getLineAtOffset(A.end>A.start?
A.end-1:A.end),l=true,n=[],p,r,y=D;y<=h;y++){p=x.getLine(y,true);n.push(p);if(!l||(r=p.indexOf("//"))===-1)l=false;else if(r!==0){var B;for(B=0;B<r;B++){l=p.charCodeAt(B);if(!(l===32||l===9))break}l=B===r}}y=x.getLineStart(D);B=x.getLineEnd(h,true);if(l){for(l=0;l<n.length;l++){p=n[l];r=p.indexOf("//");n[l]=p.substring(0,r)+p.substring(r+2)}n=n.join("");p=x.getLineStart(h);x=y===A.start?A.start:A.start-2;A=A.end-2*(h-D+1)+(A.end===p+1?2:0)}else{n.splice(0,0,"");n=n.join("//");x=y===A.start?A.start:
A.start+2;A=A.end+2*(h-D+1)}q.setText(n,y,B);q.setSelection(x,A);return true}.bind(this));var s=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding(191,true,!s,false,s),c.addBlockComment);this.textView.setAction(c.addBlockComment,function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=new RegExp("/\\*|\\*/","g"),h=u(x,A.start,A.end);if(h.commentStart!==undefined&&h.commentEnd!==undefined)return true;x=x.getText(A.start,A.end);if(x.length===0)return true;h=
x.length;x=x.replace(D,"");D=x.length;q.setText("/*"+x+"*/",A.start,A.end);q.setSelection(A.start+2,A.end+2+(D-h));return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(220,true,!s,false,s),c.removeBlockComment);this.textView.setAction(c.removeBlockComment,function(){var q=this.editor,x=q.getModel(),A=q.getSelection(),D=x.getText(A.start,A.end),h,l,n;for(n=0;n<D.length;n++)if(D.substring(n,n+2)==="/*"){h=A.start+n;break}for(;n<D.length;n++)if(D.substring(n,n+2)==="*/"){l=A.start+n;
break}if(h!==undefined&&l!==undefined){q.setText(x.getText(h+2,l),h,l+2);q.setSelection(h,l)}else{D=u(x,A.start,A.end);if(D.commentStart===undefined||D.commentEnd===undefined)return true;x=x.getText(D.commentStart+2,D.commentEnd);q.setText(x,D.commentStart,D.commentEnd+2);q.setSelection(A.start-2,A.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(u){var s=u.data.proposal,q;if(typeof s==="string")q=s;else if(typeof s.proposal==="string")q=s.proposal;this.textView.setText(q,u.data.start,
u.data.end);if(s.positions&&this.linkedMode){u=[];for(q=0;q<s.positions.length;++q)u[q]={positions:[{offset:s.positions[q].offset,length:s.positions[q].length}]};this.linkedMode.enterLinkedMode({groups:u,escapePosition:s.escapePosition})}else s.escapePosition&&this.textView.setCaretOffset(s.escapePosition);return true},cancel:function(){return false},isActive:function(){return true},isStatusActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){var u=
this.editor,s=u.getSelection();if(s.start===s.end){var q=u.getModel(),x=q.getLineAtOffset(s.start),A=q.getLine(x,true),D=q.getLineStart(x);x=0;D=s.start-D;for(var h;x<D&&((h=A.charCodeAt(x))===32||h===9);)x++;if(x>0){var l=A.substring(0,x);for(x=D;x<A.length&&((h=A.charCodeAt(x++))===32||h===9);)s.end++;u.setText(q.getLineDelimiter()+l,s.start,s.end);return true}}return false}};w.prototype={enterLinkedMode:function(u){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=
[];for(var s=0;s<u.groups.length;++s){var q=u.groups[s];this.linkedModePositions[s]={offset:q.positions[0].offset,length:q.positions[0].length}}this.linkedModeEscapePosition=u.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);this.textView.addEventListener("Verify",this.linkedModeListener.onVerify);this.textView.setKeyBinding(new a.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",
function(){this.linkedModeCurrentPositionIndex=++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-
1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.editor.reportStatus(c.linkedModeEntered)}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},enter:function(){this.cancel();return true},cancel:function(){if(this.linkedModeActive){this.linkedModeActive=false;this.textView.removeEventListener("Verify",this.linkedModeListener.onVerify);
this.textView.setKeyBinding(new a.KeyBinding(9),"tab");this.textView.setKeyBinding(new a.KeyBinding(9,false,true),null);this.textView.setCaretOffset(this.linkedModeEscapePosition,false);this.editor.reportStatus(c.linkedModeExited)}},selectTextForLinkedModePosition:function(u){this.textView.setSelection(u.offset,u.offset+u.length)}};return{UndoFactory:j,LineNumberRulerFactory:i,FoldingRulerFactory:k,AnnotationFactory:m,TextDNDFactory:o,TextActions:v,SourceCodeActions:t,LinkedMode:w}});
define("orion/editor/editor",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget","orion/textview/tooltip"],function(c,e,a,b){function d(g){this._textViewFactory=g.textViewFactory;this._undoStackFactory=g.undoStackFactory;this._textDNDFactory=g.textDNDFactory;this._annotationFactory=g.annotationFactory;this._foldingRulerFactory=g.foldingRulerFactory;this._lineNumberRulerFactory=g.lineNumberRulerFactory;this._contentAssistFactory=g.contentAssistFactory;this._keyBindingFactory=
g.keyBindingFactory;this._statusReporter=g.statusReporter;this._domNode=g.domNode;this._syntaxHighlightProviders=g.syntaxHighlightProviders;this._foldingRuler=this._overviewRuler=this._annotationRuler=null;this._dirty=false;this._title=this._contentAssist=null;this._keyModes=[]}var f;d.prototype={errorType:"orion.annotation.error",warningType:"orion.annotation.warning",taskType:"orion.annotation.task",foldingType:"orion.annotation.folding",currentBracketType:"orion.annotation.currentBracket",matchingBracketType:"orion.annotation.matchingBracket",
currentLineType:"orion.annotation.currentLine",highlightErrorType:"orion.annotation.highlightError",getTextView:function(){return this._textView},reportStatus:function(g,j){this._statusReporter?this._statusReporter(g,j):window.alert(j==="error"?"ERROR: "+g:g)},getModel:function(){var g=this._textView.getModel();if(g.getBaseModel)g=g.getBaseModel();return g},mapOffset:function(g,j){var i=this._textView.getModel();if(i.getBaseModel)g=i.mapOffset(g,j);return g},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var g=this._textView,j=g.getSelection();g=g.getModel();if(g.getBaseModel){j.start=g.mapOffset(j.start);j.end=g.mapOffset(j.end)}return j},getText:function(g,j){var i=this._textView.getModel();if(i.getBaseModel)i=i.getBaseModel();return i.getText(g,j)},_expandOffset:function(g){var j=this._textView.getModel(),i=this._annotationModel;if(i&&j.getBaseModel)for(g=i.getAnnotations(g,g+1);g.hasNext();){j=g.next();if(j.type==="orion.annotation.folding")if(j.expand){j.expand();i.modifyAnnotation(j)}}},
setCaretOffset:function(g){var j=this._textView,i=j.getModel();if(i.getBaseModel){this._expandOffset(g);g=i.mapOffset(g,true)}j.setCaretOffset(g)},setText:function(g,j,i){var k=this._textView,m=k.getModel();if(m.getBaseModel){if(j!==undefined){this._expandOffset(j);j=m.mapOffset(j,true)}if(i!==undefined){this._expandOffset(i);i=m.mapOffset(i,true)}}k.setText(g,j,i)},setFoldingEnabled:function(g){this._foldingEnabled=g;this._updateFoldingRuler()},_updateFoldingRuler:function(){var g=this._textView;
if(this._foldingEnabled){if(!this._foldingRuler&&this._foldingRulerFactory&&g.getModel().getBaseModel&&this._foldingEnabled){g.annotationModel=this._annotationModel;this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel);this._foldingRuler.addAnnotationType(this.foldingType);g.addRuler(this._foldingRuler)}}else if(this._foldingRuler){g.removeRuler(this._foldingRuler);this._foldingRuler=null}},setSelection:function(g,j,i){var k=this._textView,m=k.getModel();if(m.getBaseModel){this._expandOffset(g);
this._expandOffset(j);g=m.mapOffset(g,true);j=m.mapOffset(j,true)}k.setSelection(g,j,i)},moveSelection:function(g,j,i){j=j||g;var k=this._textView;this.setSelection(g,j,false);j=k.getTopPixel();var m=k.getBottomPixel();g=this.getModel().getLineAtOffset(g);g=k.getLinePixel(g);if(g<j||g>m){m=Math.max(0,g-Math.floor((g<j?3:1)*(m-j)/4));(new f.Animation({node:k,duration:300,curve:[j,m],onAnimate:function(o){k.setTopPixel(Math.floor(o))},onEnd:function(){k.showSelection();k.focus();i&&i()}})).play()}else{k.showSelection();
k.focus();i&&i()}},isDirty:function(){return this._dirty},setDirty:function(g){if(this._dirty!==g){this._dirty=g;this.onDirtyChanged({type:"DirtyChanged"})}},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(g,j){var i=this._textView,k=this.getAnnotationModel();if(!k)return null;var m=this._annotationStyler;if(!m)return null;var o=i.getOffsetAtLocation(g,j);if(o===-1)return null;o=this.mapOffset(o);m=m.getAnnotationsByType(k,o,o+1);k=[];for(o=0;o<m.length;o++)m[o].rangeStyle&&
k.push(m[o]);if(k.length===0)return null;g=i.convert({x:g,y:j},"document","page");return{contents:k,anchor:"left",x:g.x+10,y:g.y+20}},getAnnotationModel:function(){return this._annotationModel},doFind:function(g,j,i,k){var m=this.getText();if(i){g=g.toLowerCase();m=m.toLowerCase()}if(k){m=m.split("").reverse().join("");g=g.split("").reverse().join("");j=m.length-j-1;j=m.indexOf(g,j);if(j!==-1)return{index:m.length-g.length-j,length:g.length}}else{j=m.indexOf(g,j);if(j!==-1)return{index:j,length:g.length}}return null},
doFindRegExp:function(g,j,i,k){if(!g)return null;j=j||"";j+=(j.indexOf("g")===-1?"g":"")+(j.indexOf("m")===-1?"m":"");g=new RegExp(g,j);j=this.getText();var m=null,o=null;if(k)for(;;)if((m=g.exec(j))&&m.index<=i)o={index:m.index,length:m[0].length};else return o;else return(m=g.exec(j.substring(i)))&&{index:m.index+i,length:m[0].length}},_highlightCurrentLine:function(g,j){var i=this._annotationModel;if(i){var k=this._textView.getModel(),m=j?k.getLineAtOffset(j.start):-1,o=k.getLineAtOffset(g.start);
g=g.start===g.end;j=!j||j.start===j.end;if(!(m===o&&j&&g)){m=this._currentLineAnnotation?[this._currentLineAnnotation]:null;this._currentLineAnnotation=null;var v;if(g){v=k.getLineStart(o);o=k.getLineEnd(o);if(k.getBaseModel){v=k.mapOffset(v);o=k.mapOffset(o)}this._currentLineAnnotation={start:v,end:o,type:this.currentLineType,title:c.currentLine,html:"<div class='annotationHTML currentLine'></div>",overviewStyle:{styleClass:"annotationOverview currentLine"},lineStyle:{styleClass:"annotationLine currentLine"}};
v=[this._currentLineAnnotation]}i.replaceAnnotations(m,v)}}},highlightAnnotations:function(){if(this._annotationStyler){this._annotationStyler.destroy();this._annotationStyler=null}if(this._annotationFactory){this._annotationStyler=this._annotationFactory.createAnnotationStyler(this.getTextView(),this._annotationModel);this._annotationStyler.addAnnotationType(this.errorType);this._annotationStyler.addAnnotationType(this.warningType);this._annotationStyler.addAnnotationType(this.matchingBracketType);
this._annotationStyler.addAnnotationType(this.currentBracketType);this._annotationStyler.addAnnotationType(this.currentLineType);this._annotationStyler.addAnnotationType(this.highlightErrorType)}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory){this._contentAssist=this._contentAssistFactory(this);
this._keyModes.push(this._contentAssist)}var g=this,j=this._textView,i=this;this._listener={onModelChanged:function(){i.checkDirty()},onMouseOver:function(m){i._listener.onMouseMove(m)},onMouseMove:function(m){var o=b.Tooltip.getTooltip(j);o&&o.setTarget({x:m.x,y:m.y,getTooltipInfo:function(){return i._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(){var m=b.Tooltip.getTooltip(j);m&&m.setTarget(null)},onSelection:function(m){i._updateCursorStatus();i._highlightCurrentLine(m.newValue,m.oldValue)}};
j.addEventListener("ModelChanged",this._listener.onModelChanged);j.addEventListener("Selection",this._listener.onSelection);j.addEventListener("MouseOver",this._listener.onMouseOver);j.addEventListener("MouseOut",this._listener.onMouseOut);j.addEventListener("MouseMove",this._listener.onMouseMove);this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);j.setKeyBinding(new e.KeyBinding(27),"Cancel Current Mode");j.setAction("Cancel Current Mode",function(){for(var m=
false,o=0;o<this._keyModes.length;o++)if(this._keyModes[o].isActive())m=this._keyModes[o].cancel()||m;return m}.bind(this));j.setAction("lineUp",function(){for(var m=0;m<this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].lineUp();return false}.bind(this));j.setAction("lineDown",function(){for(var m=0;m<this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].lineDown();return false}.bind(this));j.setAction("enter",function(){for(var m=0;m<
this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].enter();return false}.bind(this));if(this._annotationFactory){var k=j.getModel();if(k.getBaseModel)k=k.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(k);k=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=k.annotationRuler;this._annotationRuler.onClick=function(m){if(m!==undefined)if(m!==-1){var o=j.getModel(),v=this.getAnnotationModel(),
t=g.mapOffset(o.getLineStart(m));m=g.mapOffset(o.getLineEnd(m));for(m=v.getAnnotations(t,m);m.hasNext();){v=m.next();if(this.isAnnotationTypeVisible(v.type)){m=g.getModel();g.onGotoLine(m.getLineAtOffset(t),v.start-t,v.end-t);break}}}};this._overviewRuler=k.overviewRuler;this._overviewRuler.onClick=function(m){if(m!==undefined){m=j.getModel().getLineStart(m);g.moveSelection(g.mapOffset(m))}};this._annotationRuler.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"});this._annotationRuler.addAnnotationType(this.errorType);
this._annotationRuler.addAnnotationType(this.warningType);this._annotationRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.errorType);this._overviewRuler.addAnnotationType(this.warningType);this._overviewRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.matchingBracketType);this._overviewRuler.addAnnotationType(this.currentBracketType);this._overviewRuler.addAnnotationType(this.currentLineType);j.addRuler(this._annotationRuler);j.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);j.addRuler(this._lineNumberRuler)}this._updateFoldingRuler();this.dispatchEvent({type:"TextViewInstalled",textView:j})},_updateCursorStatus:function(){var g=this.getModel(),j=this.getCaretOffset(),i=g.getLineAtOffset(j);g=g.getLineStart(i);j=j-g;for(g=0;g<this._keyModes.length;g++){var k=this._keyModes[g];if(k.isActive()&&k.isStatusActive&&k.isStatusActive())return}this.reportStatus(c.formatMessage(c.lineColumn,i+1,j+1))},showProblems:function(g){var j=
this._annotationModel;if(j){for(var i=[],k=[],m=j.getTextModel(),o=j.getAnnotations(0,m.getCharCount()),v;o.hasNext();){v=o.next();if(v.type===this.errorType||v.type===this.warningType)i.push(v)}if(g)for(o=0;o<g.length;o++)if(v=g[o]){var t=v.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),w=m.getLineStart(v.line-1),u=v.severity;v={type:this[u+"Type"],start:w+v.start-1,end:w+v.end,title:t,html:"<div class='annotationHTML "+u+"'></div>",style:{styleClass:"annotation "+u},overviewStyle:{styleClass:"annotationOverview "+
u},rangeStyle:{styleClass:"annotationRange "+u}};k.push(v)}j.replaceAnnotations(i,k)}},showSelection:function(g,j,i,k,m){if(typeof g==="number"){if(typeof j!=="number")j=g;this.moveSelection(g,j)}else if(typeof i==="number"){g=this.getModel().getLineStart(i-1);if(typeof k==="number")g+=k;if(typeof m!=="number")m=0;this.moveSelection(g,g+m)}},setInput:function(g,j,i,k){this._title=g;if(this._textView)if(k){this._undoStack.markClean();this.checkDirty()}else{if(j)this._textView.setText(j);else if(i!==
null&&i!==undefined){this._textView.setText(i);this._textView.getModel().setLineDelimiter("auto");this._highlightCurrentLine(this._textView.getSelection())}this._undoStack.reset();this.checkDirty();this._textView.focus()}this.onInputChanged({type:"InputChanged",title:g,message:j,contents:i,contentsSaved:k})},onInputChanged:function(g){return this.dispatchEvent(g)},onGotoLine:function(g,j,i){if(this._textView){var k=this.getModel(),m=k.getLineStart(g),o=0;if(i===undefined)i=0;if(typeof j==="string"){g=
k.getLine(g).indexOf(j);if(g!==-1){o=g;i=o+j.length}}else{o=j;j=k.getLineEnd(g)-m;o=Math.min(o,j);i=Math.min(i,j)}this.moveSelection(m+o,m+i)}},onDirtyChanged:function(g){return this.dispatchEvent(g)},getTitle:function(){return this._title}};a.EventTarget.addMixin(d.prototype);f={Animation:function(){function g(j){this.options=j}g.prototype.play=function(){function j(){s=s===-1?(new Date).getTime():s;var q=((new Date).getTime()-s)/i;if(q<1){q=k(q);w=v+q*t;m(w)}else{clearInterval(u);o()}}var i=typeof this.options.duration===
"number"?this.options.duration:350,k=this.options.easing||this.defaultEasing,m=this.options.onAnimate||function(){},o=this.options.onEnd||function(){},v=this.options.curve[0],t=this.options.curve[1]-v,w,u,s=-1;u=setInterval(j,typeof this.options.rate==="number"?this.options.rate:20)};g.prototype.defaultEasing=function(j){return Math.sin(j*(Math.PI/2))};return g}(),bind:function(g){var j=this,i=Array.prototype.slice.call(arguments,1);if(i.length)return function(){return arguments.length?j.apply(g,
i.concat(Array.prototype.slice.call(arguments))):j.apply(g,i)};return function(){return arguments.length?j.apply(g,arguments):j.call(g)}}};if(!Function.prototype.bind)Function.prototype.bind=f.bind;return{Editor:d,util:f}});
define("orion/syntaxchecker",["dojo"],function(c){return{SyntaxChecker:function(){function e(a,b){this.registry=a;this.editor=b}e.prototype={checkSyntax:function(a,b,d,f){function g(i,k){function m(q,x,A){q=x.getProperty("contentType");return o.isSomeExtensionOf(A,q).then(function(D){return D?x:null})}for(var o=i.getService("orion.file.contenttypes"),v=i.getServiceReferences("orion.edit.validator"),t=[],w=0;w<v.length;w++){var u=v[w],s=u.getProperty("pattern");if(u.getProperty("contentType"))t.push(m(i,
u,k));else if(s&&(new RegExp(s)).test(b)){s=new c.Deferred;s.callback(u);t.push(s)}}return(new c.DeferredList(t)).then(function(q){for(var x=[],A=0;A<q.length;A++){var D=q[A][1];D!==null&&x.push(D)}return x})}if(a)if(!d){var j=this;g(this.registry,a).then(function(i){for(var k=function(v){return v.problems||v.errors},m=[],o=0;o<i.length;o++)m.push(j.registry.getService(i[o]).checkSyntax(b,f).then(k));(new c.DeferredList(m)).then(function(v){var t=[];for(o=0;o<v.length;o++){var w=v[o]&&v[o][1];if(w){j._fixup(w);
t=t.concat(w)}}j.registry.getService("orion.core.marker")._setProblems(t)})})}},_fixup:function(a){for(var b=this.editor.getModel(),d=0;d<a.length;d++){var f=a[d];f.description=f.description||f.reason;f.severity=f.severity||"error";f.start=typeof f.start==="number"?f.start:f.character;f.end=typeof f.end==="number"?f.end:f.start+1;var g=b.getLine(f.line-1,false).length;f.start=Math.max(1,f.start);f.start=Math.min(f.start,g);f.end=Math.min(f.end,g);f.end=Math.max(f.start,f.end)}}};return e}()}});
define("orion/breadcrumbs",["require","dojo","orion/util"],function(c,e,a){function b(d){this._init(d)}b.prototype={_init:function(d){var f=d.container;if(typeof f==="string")f=e.byId(f);if(!f)throw"no parent container";this._container=f;e.removeClass(f,"currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._firstSegmentName=d.firstSegmentName;this._makeHref=d.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var d;
if(this._resource&&this._resource.Parents){d=document.createElement("a");if(this._makeHref)this._makeHref(d,"");else d.href=c.toUrl("navigate/table.html")+"#"}else d=document.createElement("span");e.place(document.createTextNode(this._firstSegmentName),d,"only");return d}return null},render:function(){var d=this._container,f=e.byId(this._id);if(f)e.empty(f);else{f=document.createElement("span");f.id=this._id;d.appendChild(f)}var g;if(g=this.getNavigatorRootSegment()){e.addClass(g,"breadcrumb");f.appendChild(g);
if(this._resource&&this._resource.Parents){g=document.createElement("span");e.place(document.createTextNode(" >> "),g,"only");this.path+="/";e.addClass(g,"breadcrumb");f.appendChild(g)}else{g.href="";e.removeClass(g,"breadcrumb");e.addClass(g,"currentLocation");a.forceLayout(d);return}}if(this._resource){if(this._resource.Parents)for(var j=this._resource.Parents,i=j.length;--i>=0;){g=document.createElement("a");e.addClass(g,"breadcrumb");e.place(document.createTextNode(j[i].Name),g,"only");this.path+=
j[i].Name;if(this._makeHref)this._makeHref(g,j[i].ChildrenLocation);else g.href=c.toUrl("navigate/table.html")+"#"+j[i].ChildrenLocation;f.appendChild(g);g=document.createElement("span");e.place(document.createTextNode(" >> "),g,"only");this.path+="/";e.addClass(g,"breadcrumb");f.appendChild(g)}g=document.createElement("span");e.place("<br>"+this._resource.Name,g,"only");e.addClass(g,"currentLocation");this.path+=this._resource.Name;f.appendChild(g)}if(f.childNodes.length===0){g=document.createElement("a");
e.place(document.createTextNode(document.title),g,"only");e.addClass(g,"breadcrumb");e.addClass(g,"currentLocation");f.appendChild(g)}a.forceLayout(d)}};b.prototype.constructor=b;return{BreadCrumbs:b}});
define("orion/searchAndReplace/textSearcher",["require","dojo","dijit","orion/commands","orion/editor/regex","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(c,e,a,b,d){var f=f||{};f.TextSearcher=function(){function g(j,i,k,m){this._commandService=j;this._undoStack=i;this._textSearchAdaptor=k;this._wrapSearch=this._ignoreCase=true;this._wholeWord=false;this._incremental=true;this._useRegExp=false;this._findAfterReplace=true;this._reverse=false;this.isMac=navigator.platform.indexOf("Mac")!==
-1;this._searchRange=null;this._searchOnRange=false;this._lastSearchString="";this.setOptions(m)}g.prototype={_createActionTable:function(){var j=this;this._commandService.openParameterCollector("pageNavigationActions",function(i){var k=document.createElement("input");k.type="text";k.name="Find:";k.id="localSearchFindWith";k.placeholder="Find With";k.onkeyup=function(m){return j._handleKeyUp(m)};k.onkeydown=function(m){return j._handleKeyDown(m,true)};i.appendChild(k);k=document.createElement("span");
e.addClass(k,"parameters");k.id="localSearchFindCommands";i.appendChild(k);k=document.createElement("input");k.type="text";k.name="ReplaceWith:";k.id="localSearchReplaceWith";k.placeholder="Replace With";e.addClass(k,"searchCmdGroupMargin");k.onkeydown=function(m){return j._handleKeyDown(m,false)};i.appendChild(k);k=document.createElement("span");e.addClass(k,"parameters");k.id="localSearchReplaceCommands";i.appendChild(k);k=document.createElement("span");k.id="localSearchOtherCommands";e.addClass(k,
"parameters");i.appendChild(k);k=document.createElement("span");e.addClass(k,"parameters");i.appendChild(k);(i=a.byId("searchOptMenu"))&&i.destroy();i=new a.Menu({style:"display: none;",id:"searchOptMenu"});i.addChild(new a.CheckedMenuItem({label:"Case sensitive",checked:!j._ignoreCase,onChange:function(m){j.setOptions({ignoreCase:!m})}}));i.addChild(new a.CheckedMenuItem({label:"Wrap search",checked:j._wrapSearch,onChange:function(m){j.setOptions({wrapSearch:m})}}));i.addChild(new a.CheckedMenuItem({label:"Incremental search",
checked:j._incremental,onChange:function(m){j.setOptions({incremental:m})}}));i.addChild(new a.CheckedMenuItem({label:"Regular expression",checked:j._useRegExp,onChange:function(m){j.setOptions({useRegExp:m})}}));i.addChild(new a.CheckedMenuItem({label:"Find after replace",checked:j._findAfterReplace,onChange:function(m){j.setOptions({findAfterReplace:m})}}));i=new a.form.DropDownButton({label:"Options",dropDown:i});e.addClass(i.domNode,"parametersMenu");e.place(i.domNode,k,"last")})},visible:function(){return document.getElementById("localSearchFindWith")?
true:false},_handleKeyUp:function(j){this._incremental&&!this._keyUpHandled&&!e.isIE&&this.findNext(true,null,true,j.target);this._keyUpHandled=false;return true},_handleKeyDown:function(j,i){var k=this.isMac?j.metaKey:j.ctrlKey;if(k&&j.keyCode===70){this._keyUpHandled=i;j.stopPropagation&&j.stopPropagation();j.cancelBubble=true;return false}if(k&&j.keyCode===75||j.keyCode===13){j.stopPropagation&&j.stopPropagation();j.cancelBubble=true;this.findNext(!j.shiftKey,null,false,k&&j.keyCode===75?null:
j.target);this._keyUpHandled=i;return false}if(k&&j.keyCode===82){j.stopPropagation&&j.stopPropagation();j.cancelBubble=true;i||this.replace(e.isIE?null:function(){j.target.focus()});this._keyUpHandled=i;return false}if(j.keyCode===27){this.closeUI();this._keyUpHandled=i;return false}return true},closeUI:function(){if(this.visible()){this._commandService.closeParameterCollector();this._textSearchAdaptor.adaptCloseToolBar()}},buildToolBar:function(j){this._keyUpHandled=true;var i=document.getElementById("localSearchFindWith");
if(this.visible()){if(j.length>0)i.value=j;window.setTimeout(function(){i.select();i.focus()},10)}else{this._createActionTable();i=document.getElementById("localSearchFindWith");i.value=j;window.setTimeout(function(){i.select();i.focus()},10);var k=this;j=new b.Command({tooltip:"Go to next",imageClass:"core-sprite-move_down",id:"orion.search.findNext",groupId:"orion.searchGroup",callback:function(){k.findNext(true)}});var m=new b.Command({tooltip:"Go to previous",imageClass:"core-sprite-move_up",
id:"orion.search.findPrev",groupId:"orion.searchGroup",callback:function(){k.findNext(false)}}),o=new b.Command({name:"Replace",image:c.toUrl("images/replace.gif"),id:"orion.search.replace",groupId:"orion.searchGroup",callback:function(){k.replace()}}),v=new b.Command({name:"Replace All",image:c.toUrl("images/replaceAll.gif"),id:"orion.search.replaceAll",groupId:"orion.searchGroup",callback:function(){k.replaceAll()}});this._commandService.addCommand(j,"dom");this._commandService.addCommand(m,"dom");
this._commandService.addCommand(o,"dom");this._commandService.addCommand(v,"dom");this._commandService.registerCommandContribution("orion.search.findNext",1,"localSearchFindCommands");this._commandService.registerCommandContribution("orion.search.findPrev",2,"localSearchFindCommands");this._commandService.registerCommandContribution("orion.search.replace",1,"localSearchReplaceCommands");this._commandService.registerCommandContribution("orion.search.replaceAll",2,"localSearchReplaceCommands");this._commandService.renderCommands("localSearchFindCommands",
"dom",k,k,"button");this._commandService.renderCommands("localSearchReplaceCommands","dom",k,k,"button")}},_findString:function(j,i,k,m,o,v){if(o){if(j){i=i.split("").reverse().join("");k=k.split("").reverse().join("")}m=i.length-m-1;m=i.indexOf(k,m);if(m===-1){if(v&&j)return this._findString(false,i,k,i.length-1,o,v)}else return{index:i.length-k.length-m,length:k.length}}else{m=i.indexOf(k,m);if(m===-1){if(v&&j)return this._findString(false,i,k,0)}else return{index:m,length:k.length}}return null},
getAdaptor:function(){return this._textSearchAdaptor},setOptions:function(j){if(j){if(j.ignoreCase===true||j.ignoreCase===false)this._ignoreCase=j.ignoreCase;if(j.wrapSearch===true||j.wrapSearch===false)this._wrapSearch=j.wrapSearch;if(j.wholeWord===true||j.wholeWord===false)this._wholeWord=j.wholeWord;if(j.incremental===true||j.incremental===false)this._incremental=j.incremental;if(j.useRegExp===true||j.useRegExp===false)this._useRegExp=j.useRegExp;if(j.findAfterReplace===true||j.findAfterReplace===
false)this._findAfterReplace=j.findAfterReplace;if(j.reverse===true||j.reverse===false)this._reverse=j.reverse;if(j.toolBarId)this._toolBarId=j.toolBarId;if(j.searchRange)this._searchRange=j.searchRange;if(j.searchOnRange===true||j.searchOnRange===false)this._searchOnRange=j.searchOnRange}},findNext:function(j,i,k,m){this.setOptions({reverse:!j});var o=document.getElementById("localSearchFindWith");k=this._textSearchAdaptor.getSearchStartIndex(k?true:!j);if(this.visible())return this.findOnce(i?i:
o.value,k,m&&!e.isIE?function(){m.focus()}:null);else if(this._lastSearchString&&this._lastSearchString.length>0){i=this._prepareFind(i?i:this._lastSearchString,k);return this._doFind(i.text,i.searchStr,i.startIndex,!j,this._wrapSearch)}},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},replace:function(j){this.startUndo();this._textSearchAdaptor.adaptReplace(document.getElementById("localSearchReplaceWith").value,
j);this.endUndo();var i=document.getElementById("localSearchFindWith");if(this._findAfterReplace&&i.value.length>0){i=this._prepareFind(i.value,this._textSearchAdaptor.getSearchStartIndex(false));this._doFind(i.text,i.searchStr,i.startIndex,false,this._wrapSearch,j)}},_prepareFind:function(j,i){var k;if(this._searchOnRange&&this._searchRange){k=this._textSearchAdaptor.getText().substring(this._searchRange.start,this._searchRange.end);i-=this._searchRange.start}else k=this._textSearchAdaptor.getText();
if(this._ignoreCase){j=j.toLowerCase();k=k.toLowerCase()}if(i<0)i=0;return{text:k,searchStr:j,startIndex:i}},_doFind:function(j,i,k,m,o,v){if(!i||i.length===0)return null;this._lastSearchString=i;if(this._useRegExp){var t=d.parse("/"+i+"/");if(t){i=t.pattern;t=t.flags;t+=this._ignoreCase&&t.indexOf("i")===-1?"i":"";result=this._findRegExp(true,j,i,t,k,m,o)}}else result=this._findString(true,j,i,k,m,o);result?this._textSearchAdaptor.adaptFind(result.index,result.index+result.length,m,v,this._replacingAll):
this._textSearchAdaptor.adaptFind(-1,-1,m,null,this._replacingAll);return result},findOnce:function(j,i,k){j=this._prepareFind(j,i);return this._doFind(j.text,j.searchStr,j.startIndex,this._reverse,this._wrapSearch,k)},replaceAll:function(){var j=document.getElementById("localSearchFindWith").value;if(j&&j.length>0){this._replacingAll=true;this._textSearchAdaptor.adaptReplaceAllStart(true);window.setTimeout(e.hitch(this,function(){for(var i=0,k=0;;){var m=this._prepareFind(j,i);if(!this._doFind(m.text,
m.searchStr,m.startIndex,false,false))break;k++;k===1&&this.startUndo();this._textSearchAdaptor.adaptReplace(document.getElementById("localSearchReplaceWith").value);i=this._textSearchAdaptor.getSearchStartIndex(true,true)}k>0&&this.endUndo();this._textSearchAdaptor.adaptReplaceAllEnd(i>0,k);this._replacingAll=false}),100)}},_findRegExp:function(j,i,k,m,o,v,t){if(!k)return null;m=m||"";m+=(m.indexOf("g")===-1?"g":"")+(m.indexOf("m")===-1?"m":"");j=new RegExp(k,m);m=k=null;if(v)for(;;)if(k=j.exec(i)){if(!(k.index<=
o)){if(!t)return m;if(m)return m;o=i.length-1}m={index:k.index,length:k[0].length}}else return m;else{k=j.exec(i.substring(o));if(!k&&t){o=0;k=j.exec(i.substring(o))}return k&&{index:k.index+o,length:k[0].length}}}};return g}();return f});
define("orion/searchAndReplace/orionTextSearchAdaptor",[],function(){var c=c||{};c.OrionTextSearchAdaptor=function(){function e(a){this.setEditor(a)}e.prototype={setEditor:function(a){this._editor=a},getText:function(){return this._editor.getText()},getSearchStartIndex:function(a,b){var d=this._editor.getCaretOffset();if(a){a=this._editor.getSelection();var f=a.end>a.start?a.end-a.start:0;if(!b)return d-f-1>0?d-f-1:0;return a.end>0?a.end:0}return d>0?d:0},adaptCloseToolBar:function(){this._editor.getTextView().focus()},
adaptReplaceAllStart:function(){this._editor.reportStatus("");this._editor.reportStatus("Replacing all...","progress")},adaptReplaceAllEnd:function(a,b){this._editor.reportStatus("","progress");a?this._editor.reportStatus("Replaced "+b+" matches"):this._editor.reportStatus("Nothing replaced","error")},adaptFind:function(a,b,d,f,g){if(a===-1)g||this._editor.reportStatus("Not found","error");else{g||this._editor.reportStatus("");this._editor.moveSelection(a,b,f)}},adaptReplace:function(a){var b=this._editor.getSelection();
this._editor.setText(a,b.start,b.end);this._editor.setSelection(b.start,b.start+a.length,true)}};return e}();return c});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function c(e,a,b){this.serviceRegistry=e;this.editor=a;this.contentType=b;this.contentTypeService=e.getService("orion.file.contenttypes");this.serviceReferences={};var d=this;this.listener={onServiceAdded:function(f,g){d._onServiceAdded(f,g)},onServiceRemoved:function(f,g){d._onServiceRemoved(f,g)}};this.serviceRegistry.addEventListener("serviceAdded",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("serviceRemoved",
this.listener.onServiceRemoved);this._init()}c.prototype={_init:function(){var e=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){e._wire(e.serviceRegistry)})},_wire:function(e){e=e.getServiceReferences("orion.edit.model");for(var a=0;a<e.length;a++)this._wireServiceReference(e[a])},_wireServiceReference:function(e){var a=e.getProperty("contentType");if(typeof a!==undefined&&a!==null){var b=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
a).then(function(d){d&&b._wireService(e,b.serviceRegistry.getService(e))})}},_wireService:function(e,a){var b=e.getProperty("types"),d=this.editor.getTextView();if(b){for(var f=0;f<b.length;f++){var g=b[f],j=a["on"+g];j&&this._wireServiceMethod(e,a,j,d,g)}this._initService(a,d)}},_wireServiceMethod:function(e,a,b,d,f){a=function(g){b(g).then()};e=e.getServiceId();this.serviceReferences[e]=this.serviceReferences[e]||[];this.serviceReferences[e].push([d,f,a]);d.addEventListener(f,a)},_onServiceRemoved:function(e){e=
e.getServiceId();var a=this.serviceReferences[e];if(a){for(var b=0;b<a.length;b++){var d=a[b];d[0].removeEventListener(d[1],d[2])}delete this.serviceReferences[e]}},_onServiceAdded:function(e){e.getName()==="orion.edit.model"&&this._wireServiceReference(e)},_initService:function(e,a){var b=e.onModelChanging;if(typeof b==="function"){a=a.getModel();var d=a.getText();a={type:"Changing",text:d,start:0,removedCharCount:0,addedCharCount:d.length,removedLineCount:0,addedLineCount:a.getLineCount()};b.call(e,
a)}}};return{Dispatcher:c}});
define("examples/textview/textStyler",["i18n!orion/textview/nls/messages","orion/textview/annotations"],function(c,e){function a(h,l){this.keywords=h;this.whitespacesVisible=l;this.setText("")}function b(){a.call(this,null,true)}function d(h){a.call(this,null,h)}function f(){a.call(this,null,false)}function g(h,l,n){this.commentStart="/*";this.commentEnd="*/";var p=[];switch(l){case "java":p=i;break;case "js":p=j;break;case "css":p=k;break}this.whitespacesVisible=false;this.detectHyperlinks=true;
this.highlightCaretLine=false;this.detectTasks=this.foldingEnabled=true;this._scanner=new a(p,this.whitespacesVisible);this._firstScanner=new f;this._commentScanner=new d(this.whitespacesVisible);this._whitespaceScanner=new b;if(l==="css"){this._scanner.isCSS=true;this._firstScanner.isCSS=true}this.view=h;this.annotationModel=n;this._bracketAnnotations=undefined;var r=this;this._listener={onChanged:function(y){r._onModelChanged(y)},onDestroy:function(y){r._onDestroy(y)},onLineStyle:function(y){r._onLineStyle(y)},
onSelection:function(y){r._onSelection(y)}};l=h.getModel();l.getBaseModel?l.getBaseModel().addEventListener("Changed",this._listener.onChanged):h.addEventListener("ModelChanged",this._listener.onChanged);h.addEventListener("Selection",this._listener.onSelection);h.addEventListener("Destroy",this._listener.onDestroy);h.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();h.redrawLines()}var j=["break","case","class","catch","continue","const","debugger",
"default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"],i=["abstract","boolean","break","byte","case","catch","char","class","continue","default","do","double","else","extends","false","final","finally","float","for","if","implements",
"import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","void","volatile","while"],k=["alignment-adjust","alignment-baseline","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility",
"background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat",
"border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group",
"box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust",
"drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex-align","flex-flow","flex-inline-pack","flex-order","flex-pack","float","float-offset","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","grid-columns","grid-rows","hanging-punctuation","height","hyphenate-after","hyphenate-before","hyphenate-character","hyphenate-lines","hyphenate-resource","hyphens","icon","image-orientation",
"image-rendering","image-resolution","inline-box-align","left","letter-spacing","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","mark","mark-after","mark-before","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height",
"min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","phonemes","pitch","pitch-range","play-during","position",
"presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-emphasis","text-height","text-indent","text-justify","text-outline",
"text-shadow","text-transform","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-pitch-range","voice-rate","voice-stress","voice-volume","volume","white-space","white-space-collapse","widows","width","word-break","word-spacing","word-wrap","z-index"],m={styleClass:"token_singleline_comment"},
o={styleClass:"token_multiline_comment"},v={styleClass:"token_doc_comment"},t={styleClass:"token_doc_html_markup"},w={styleClass:"token_task_tag"},u={styleClass:"token_doc_tag"},s={styleClass:"token_string"},q={styleClass:"token_keyword"},x={styleClass:"token_space"},A={styleClass:"token_tab"},D={styleClass:"line_caret"};a.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},
getDataLength:function(){return this.offset-this.startOffset},_default:function(h){var l=this.keywords;switch(h){case 32:case 9:if(this.whitespacesVisible)return h===32?9:8;do h=this._read();while(h===32||h===9);this._unread(h);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return h;default:var n=this.isCSS;if(97<=h&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57||45===h&&n){var p=this.offset-1;do h=this._read();while(97<=h&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57||45===
h&&n);this._unread(h);if(l.length>0){h=this.text.substring(p,this.offset);for(n=0;n<l.length;n++)if(this.keywords[n]===h)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(h){h!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var h=this._read();switch(h){case -1:return null;case 47:h=this._read();if(!this.isCSS)if(h===47)for(;;){h=this._read();if(h===-1||h===10||h===13){this._unread(h);
return 4}}if(h===42){h=this._read();var l=5;if(h===42)l=6;for(;;){for(;h===42;){h=this._read();if(h===47)return l}if(h===-1){this._unread(h);return l}h=this._read()}}this._unread(h);return 1;case 39:for(;;){h=this._read();switch(h){case 39:return 3;case 13:case 10:case -1:this._unread(h);return 3;case 92:this._read();break}}break;case 34:for(;;){h=this._read();switch(h){case 34:return 3;case 13:case 10:case -1:this._unread(h);return 3;case 92:this._read();break}}break;default:return this._default(h)}}},
setText:function(h){this.text=h;this.startOffset=this.offset=0}};b.prototype=new a(null);b.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var h=this._read();switch(h){case -1:return null;case 32:return 9;case 9:return 8;default:do h=this._read();while(!(h===32||h===9||h===-1));this._unread(h);return 1}}};d.prototype=new a(null);d.prototype.setType=function(h){this._type=h};d.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var h=this._read();switch(h){case -1:return null;
case 32:case 9:if(this.whitespacesVisible)return h===32?9:8;do h=this._read();while(h===32||h===9);this._unread(h);return 7;case 60:if(this._type===6){do h=this._read();while(!(h===62||h===-1));if(h===62)return 10}return 1;case 64:if(this._type===6){do h=this._read();while(97<=h&&h<=122||65<=h&&h<=90||h===95||48<=h&&h<=57);this._unread(h);return 11}return 1;case 84:if((h=this._read())===79)if((h=this._read())===68)if((h=this._read())===79){h=this._read();if(!(97<=h&&h<=122||65<=h&&h<=90||h===95||
48<=h&&h<=57)){this._unread(h);return 12}}this._unread(h);default:do h=this._read();while(!(h===32||h===9||h===-1||h===60||h===64||h===84));this._unread(h);return 1}}};f.prototype=new a(null);f.prototype._default=function(h){for(;;){h=this._read();switch(h){case 47:case 34:case 39:case -1:this._unread(h);return 1}}};g.prototype={getClassNameForToken:function(h){switch(h){case "singleLineComment":return m.styleClass;case "multiLineComment":return o.styleClass;case "docComment":return v.styleClass;
case "docHtmlComment":return t.styleClass;case "tasktag":return w.styleClass;case "doctag":return u.styleClass;case "string":return s.styleClass;case "keyword":return q.styleClass;case "space":return x.styleClass;case "tab":return A.styleClass;case "caretLine":return D.styleClass}return null},destroy:function(){var h=this.view;if(h){var l=h.getModel();l.getBaseModel?l.getBaseModel().removeEventListener("Changed",this._listener.onChanged):h.removeEventListener("ModelChanged",this._listener.onChanged);
h.removeEventListener("Selection",this._listener.onSelection);h.removeEventListener("Destroy",this._listener.onDestroy);h.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(h){this.highlightCaretLine=h},setWhitespacesVisible:function(h){this.whitespacesVisible=h;this._scanner.whitespacesVisible=h;this._commentScanner.whitespacesVisible=h},setDetectHyperlinks:function(h){this.detectHyperlinks=h},setFoldingEnabled:function(h){this.foldingEnabled=
h},setDetectTasks:function(h){this.detectTasks=h},_binarySearch:function(h,l,n,p,r){var y;if(p===undefined)p=-1;if(r===undefined)r=h.length;for(;r-p>1;){y=Math.floor((r+p)/2);if(l<=h[y].start)r=y;else if(n&&l<h[y].end){r=y;break}else p=y}return r},_computeComments:function(){var h=this.view.getModel();if(h.getBaseModel)h=h.getBaseModel();this.comments=this._findComments(h.getText())},_computeFolding:function(){if(this.foldingEnabled){var h=this.view.getModel();if(h.getBaseModel){var l=this.annotationModel;
if(l){l.removeAnnotations("orion.annotation.folding");for(var n=[],p=h.getBaseModel(),r=this.comments,y=0;y<r.length;y++){var B=r[y];(B=this._createFoldingAnnotation(h,p,B.start,B.end))&&n.push(B)}l.replaceAnnotations(null,n)}}}},_createFoldingAnnotation:function(h,l,n,p){var r=l.getLineAtOffset(n);l=l.getLineAtOffset(p);if(r===l)return null;return new e.FoldingAnnotation(h,"orion.annotation.folding",n,p,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",
{styleClass:"annotation collapsed"})},_computeTasks:function(h,l,n){if(this.detectTasks){var p=this.annotationModel;if(p){var r=this.view.getModel(),y=r;if(r.getBaseModel)y=r.getBaseModel();var B=p.getAnnotations(l,n);for(r=[];B.hasNext();){var z=B.next();z.type==="orion.annotation.task"&&r.push(z)}B=[];z=this._commentScanner;z.setText(y.getText(l,n));for(var E;E=z.nextToken();){var G=z.getStartOffset()+l;if(E===12){E=y.getLineEnd(y.getLineAtOffset(G));if(h!==4)E=Math.min(E,n-this.commentEnd.length);
B.push({start:G,end:E,type:"orion.annotation.task",title:y.getText(G,E),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"},rangeStyle:{styleClass:"annotationRange task"}})}}p.replaceAnnotations(r,B)}}},_getLineStyle:function(h){if(this.highlightCaretLine){var l=this.view,n=l.getModel();l=l.getSelection();if(l.start===l.end&&n.getLineAtOffset(l.start)===h)return D}return null},_getStyles:function(h,l,n){if(h.getBaseModel)n=
h.mapOffset(n);for(var p=n+l.length,r=[],y=n,B=this.comments,z=this._binarySearch(B,n,true);z<B.length;z++){if(B[z].start>=p)break;var E=B[z].start,G=B[z].end;y<E&&this._parse(l.substring(y-n,E-n),y,r);var M=B[z].type===6?v:o;if(this.whitespacesVisible||this.detectHyperlinks){y=Math.max(y,E);E=Math.min(p,G);this._parseComment(l.substring(y-n,E-n),y,r,M,B[z].type)}else r.push({start:E,end:G,style:M});y=G}y<p&&this._parse(l.substring(y-n,p-n),y,r);if(h.getBaseModel)for(l=0;l<r.length;l++){n=r[l].end-
r[l].start;r[l].start=h.mapOffset(r[l].start,true);r[l].end=r[l].start+n}return r},_parse:function(h,l,n){var p=this._scanner;for(p.setText(h);h=p.nextToken();){var r=p.getStartOffset()+l,y=null;switch(h){case 2:y=q;break;case 3:if(this.whitespacesVisible){this._parseString(p.getData(),r,n,s);continue}else y=s;break;case 6:this._parseComment(p.getData(),r,n,v,h);continue;case 4:this._parseComment(p.getData(),r,n,m,h);continue;case 5:this._parseComment(p.getData(),r,n,o,h);continue;case 8:if(this.whitespacesVisible)y=
A;break;case 9:if(this.whitespacesVisible)y=x;break}n.push({start:r,end:p.getOffset()+l,style:y})}},_parseComment:function(h,l,n,p,r){var y=this._commentScanner;y.setText(h);for(y.setType(r);h=y.nextToken();){r=y.getStartOffset()+l;var B=p;switch(h){case 8:if(this.whitespacesVisible)B=A;break;case 9:if(this.whitespacesVisible)B=x;break;case 10:B=t;break;case 11:B=u;break;case 12:B=w;break;default:if(this.detectHyperlinks)B=this._detectHyperlinks(y.getData(),r,n,B)}B&&n.push({start:r,end:y.getOffset()+
l,style:B})}},_parseString:function(h,l,n,p){var r=this._whitespaceScanner;for(r.setText(h);h=r.nextToken();){var y=r.getStartOffset()+l,B=p;switch(h){case 8:if(this.whitespacesVisible)B=A;break;case 9:if(this.whitespacesVisible)B=x;break}B&&n.push({start:y,end:r.getOffset()+l,style:B})}},_detectHyperlinks:function(h,l,n,p){var r=null,y;if((y=h.indexOf("://"))>0){r=h;for(var B=y;B>0;){y=r.charCodeAt(B-1);if(!(97<=y&&y<=122||65<=y&&y<=90||45===y||48<=y&&y<=57))break;B--}if(B>0){y="\"\"''(){}[]<>".indexOf(r.substring(B-
1,B));if(y!==-1&&(y&1)===0&&(y=r.lastIndexOf("\"\"''(){}[]<>".substring(y+1,y+2)))!==-1){var z=y;y=this._clone(p);y.tagName="A";y.attributes={href:r.substring(B,z)};n.push({start:l,end:l+B,style:p});n.push({start:l+B,end:l+z,style:y});n.push({start:l+z,end:l+h.length,style:p});return null}}}else if(h.toLowerCase().indexOf("bug#")===0)r="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(h.substring(4),10);if(r){y=this._clone(p);y.tagName="A";y.attributes={href:r};return y}return p},_clone:function(h){if(!h)return h;
var l={};for(var n in h)if(h.hasOwnProperty(n))l[n]=h[n];return l},_findComments:function(h,l){l=l||0;var n=this._firstScanner;n.setText(h);for(var p=[];h=n.nextToken();){if(h===5||h===6){var r={start:n.getStartOffset()+l,end:n.getOffset()+l,type:h};p.push(r);this._computeTasks(h,n.getStartOffset()+l,n.getOffset()+l)}h===4&&this._computeTasks(h,n.getStartOffset()+l,n.getOffset()+l)}return p},_findMatchingBracket:function(h,l){var n="{}()[]<>",p=h.getText(l,l+1),r=n.indexOf(p,0);if(r===-1)return-1;
var y;y=r&1?n.substring(r-1,r):n.substring(r+1,r+2);var B=h.getLineAtOffset(l);n=h.getLine(B);var z=h.getLineStart(B),E=h.getLineEnd(B);n=this._findBrackets(p,y,n,z,z,E);for(E=0;E<n.length;E++){z=n[E]>=0?1:-1;if(n[E]*z===l){l=1;if(r&1){for(E--;E>=0;E--){z=n[E]>=0?1:-1;l+=z;if(l===0)return n[E]*z}for(B-=1;B>=0;){n=h.getLine(B);z=h.getLineStart(B);E=h.getLineEnd(B);n=this._findBrackets(p,y,n,z,z,E);for(r=n.length-1;r>=0;r--){z=n[r]>=0?1:-1;l+=z;if(l===0)return n[r]*z}B--}}else{for(E++;E<n.length;E++){z=
n[E]>=0?1:-1;l+=z;if(l===0)return n[E]*z}B+=1;for(r=h.getLineCount();B<r;){n=h.getLine(B);z=h.getLineStart(B);E=h.getLineEnd(B);n=this._findBrackets(p,y,n,z,z,E);for(E=0;E<n.length;E++){z=n[E]>=0?1:-1;l+=z;if(l===0)return n[E]*z}B++}}break}}return-1},_findBrackets:function(h,l,n,p,r,y){var B=[];h=h.charCodeAt(0);l=l.charCodeAt(0);for(var z=r,E=this._scanner,G,M=this.comments,H=this._binarySearch(M,r,true);H<M.length;H++){if(M[H].start>=y)break;G=M[H].start;var N=M[H].end;if(z<G)for(E.setText(n.substring(z-
r,G-r));G=E.nextToken();)if(G===h)B.push(E.getStartOffset()+z-r+p);else G===l&&B.push(-(E.getStartOffset()+z-r+p));z=N}if(z<y)for(E.setText(n.substring(z-r,y-r));G=E.nextToken();)if(G===h)B.push(E.getStartOffset()+z-r+p);else G===l&&B.push(-(E.getStartOffset()+z-r+p));return B},_onDestroy:function(){this.destroy()},_onLineStyle:function(h){if(h.textView===this.view)h.style=this._getLineStyle(h.lineIndex);h.ranges=this._getStyles(h.textView.getModel(),h.lineText,h.lineStart)},_onSelection:function(h){var l=
h.oldValue,n=h.newValue,p=this.view;h=p.getModel();var r;if(this.highlightCaretLine){var y=h.getLineAtOffset(l.start);r=h.getLineAtOffset(n.start);var B=n.start===n.end;l=l.start===l.end;if(!(y===r&&l&&B)){l&&p.redrawLines(y,y+1);if((y!==r||!l)&&B)p.redrawLines(r,r+1)}}if(this.annotationModel){l=this._bracketAnnotations;var z,E;if(n.start===n.end&&(E=p.getCaretOffset())>0){E=E-1;if(h.getBaseModel){E=h.mapOffset(E);h=h.getBaseModel()}h=this._findMatchingBracket(h,E);if(h!==-1)z=[{start:h,end:h+1,type:"orion.annotation.matchingBracket",
title:c.matchingBracket,html:"<div class='annotationHTML matchingBracket'></div>",overviewStyle:{styleClass:"annotationOverview matchingBracket"},rangeStyle:{styleClass:"annotationRange matchingBracket"}},{start:E,end:E+1,type:"orion.annotation.currentBracket",title:c.currentBracket,html:"<div class='annotationHTML currentBracket'></div>",overviewStyle:{styleClass:"annotationOverview currentBracket"},rangeStyle:{styleClass:"annotationRange currentBracket"}}]}this._bracketAnnotations=z;this.annotationModel.replaceAnnotations(l,
z)}},_onModelChanged:function(h){var l=h.start,n=h.removedCharCount,p=h.addedCharCount-n,r=this.view;h=r.getModel();var y=h.getBaseModel?h.getBaseModel():h;n=l+n;var B=y.getCharCount(),z=this.comments.length,E=y.getLineStart(y.getLineAtOffset(l)),G=this._binarySearch(this.comments,E,true),M=this._binarySearch(this.comments,n,false,G-1,z);if(G<z&&this.comments[G].start<=E&&E<this.comments[G].end){E=this.comments[G].start;if(E>l)E+=p}else E=G===z&&z>0&&B-p===this.comments[z-1].end?this.comments[z-1].start:
E;var H;if(M<z){H=this.comments[M].end;if(H>l)H+=p;M+=1}else{M=z;H=B}var N;B=this._findComments(y.getText(E,H),E);for(z=G;z<this.comments.length;z++){N=this.comments[z];if(N.start>l)N.start+=p;if(N.start>l)N.end+=p}var L=M-G!==B.length;if(!L)for(z=0;z<B.length;z++){N=this.comments[G+z];var R=B[z];if(N.start!==R.start||N.end!==R.end||N.type!==R.type){L=true;break}}z=[G,M-G].concat(B);Array.prototype.splice.apply(this.comments,z);if(L){z=E;N=H;if(h!==y){z=h.mapOffset(z,true);N=h.mapOffset(N,true)}r.redrawRange(z,
N)}if(this.foldingEnabled&&y!==h&&this.annotationModel){r=this.annotationModel;G=r.getAnnotations(E,H);E=[];for(H=[];G.hasNext();){N=G.next();if(N.type==="orion.annotation.folding"){H.push(N);for(z=0;z<B.length;z++)if(N.start===B[z].start&&N.end===B[z].end)break;if(z===B.length){E.push(N);N.expand()}else{z=N.start;M=N.end;if(z>l)z-=p;if(M>l)M-=p;if(z<=l&&l<M&&z<=n&&n<M){z=y.getLineAtOffset(N.start);M=y.getLineAtOffset(N.end);if(z!==M){if(!N.expanded){N.expand();r.modifyAnnotation(N)}}else r.removeAnnotation(N)}}}}l=
[];for(z=0;z<B.length;z++){N=B[z];for(p=0;p<H.length;p++)if(H[p].start===N.start&&H[p].end===N.end)break;if(p===H.length)(N=this._createFoldingAnnotation(h,y,N.start,N.end))&&l.push(N)}r.replaceAnnotations(E,l)}}};return{TextStyler:g}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(c){function e(b,d,f){this.initialize(b);this.grammar=this.copy(d);this.externalGrammars=f?this.copy(f):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var a={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(b){return b[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(b){function d(k,
m){throw new Error('Unsupported regex feature "'+k+'": "'+m[0]+'" at index: '+m.index+" in "+m.input);}function f(k){for(var m="",o=false,v=k.length,t=0;t<v;){var w=k[t];if(!o&&w==="#")for(;t<v&&w!=="\r"&&w!=="\n";)w=k[++t];else if(!o&&/\s/.test(w))for(;t<v&&/\s/.test(w);)w=k[++t];else{if(w==="\\"){m+=w;if(!/\s/.test(k[t+1])){m+=k[t+1];t+=1}}else{if(w==="[")o=true;else if(w==="]")o=false;m+=w}t+=1}}return m}var g="",j;b=a.processGlobalFlag("x",b,function(k){return f(k)});b=a.processGlobalFlag("i",
b,function(k){g+="i";return k});for(j=0;j<this.unsupported.length;j++){var i;if(i=this.unsupported[j].regex.exec(b))d(this.unsupported[j].func(i),i)}return new RegExp(b,g)},processGlobalFlag:function(b,d,f){function g(i,k){var m=0,o=i.length,v=-1;for(k=k;k<o&&v===-1;k++)switch(i[k]){case "\\":k++;break;case "(":m++;break;case ")":m--;if(m===0)v=k;break}return v}var j="(?"+b+")";b="(?"+b+":";if(d.substring(0,j.length)===j)return f(d.substring(j.length));else if(d.substring(0,b.length)===b){j=g(d,0);
if(j<d.length-1)throw new Error("Only a "+b+") group that encloses the entire regex is supported in: "+d);return f(d.substring(b.length,j))}return d},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,d,f){f=typeof f==="undefined"?true:false;b=b.source.split(/(\\\d+)/g);for(var g=[],j=0;j<b.length;j++){var i=b[j],k=/\\(\d+)/.exec(i);if(k){i=d[k[1]]||"";g.push(f?c.escape(i):i)}else g.push(i)}return new RegExp(g.join(""))},groupify:function(b,d){var f=b.source,
g=f.length,j=[],i=0,k=[],m=1,o=1,v=[];b={};for(var t={},w=0;w<g;w++){var u=j[j.length-1],s=f[w];switch(s){case "(":if(u===4){j.pop();v.push(")");k[k.length-1].end=w}var q=w+2<g?f[w+1]+""+f[w+2]:null;if(q==="?:"||q==="?="||q==="?!"){var x;if(q==="?:")x=1;else{x=3;i++}j.push(x);k.push({start:w,end:-1,type:x});v.push(s);v.push(q);w+=q.length}else{j.push(2);k.push({start:w,end:-1,type:2,oldNum:m,num:o});v.push(s);if(i===0)t[o]=null;b[m]=o;m++;o++}break;case ")":u=j.pop();u===3&&i--;k[k.length-1].end=
w;v.push(s);break;case "*":case "+":case "?":case "}":var A=s,D=f[w-1];q=w-1;if(s==="}"){for(x=w-1;f[x]!=="{"&&x>=0;x--);D=f[x-1];q=x-1;A=f.substring(x,w+1)}x=k[k.length-1];if(D===")"&&(x.type===2||x.type===4)){v.splice(x.start,0,"(");v.push(A);v.push(")");s={start:x.start,end:v.length-1,type:4,num:x.num};for(D=0;D<k.length;D++){u=k[D];if(u.type===2||u.type===4)if(u.start>=x.start&&u.end<=q){u.start+=1;u.end+=1;u.num+=1;if(u.type===2)b[u.oldNum]=u.num}}k.push(s);o++;break}default:if(s!=="|"&&u!==
2&&u!==4)if(i===0){j.push(4);k.push({start:w,end:-1,type:4,num:o});v.push("(");t[o]=null;o++}v.push(s);if(s==="\\"){v.push(f[w+1]);w+=1}break}}for(;j.length;){j.pop();v.push(")")}f=new RegExp(v.join(""));g={};d=d||b;for(var h in d)if(d.hasOwnProperty(h))g[h]="\\"+d[h];f=this.getSubstitutedRegex(f,g,false);return[f,b,t]},complexCaptures:function(b){if(!b)return false;for(var d in b)if(b.hasOwnProperty(d))if(d!=="0")return true;return false}};e.prototype={initialize:function(b){this.textView=b;var d=
this;this._listener={onModelChanged:function(f){d.onModelChanged(f)},onDestroy:function(f){d.onDestroy(f)},onLineStyle:function(f){d.onLineStyle(f)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);b.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView){this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged);this.textView.removeEventListener("Destroy",
this._listener.onDestroy);this.textView.removeEventListener("LineStyle",this._listener.onLineStyle);this.textView=null}this._listener=this._tree=this._styles=this.grammar=null},copy:function(b){return JSON.parse(JSON.stringify(b))},preprocess:function(b){for(b=[b];b.length!==0;){var d=b.pop();if(!(d._resolvedRule&&d._typedRule)){d._resolvedRule=this._resolve(d);d._typedRule=this._createTypedRule(d);this.addStyles(d.name);this.addStyles(d.contentName);this.addStylesForCaptures(d.captures);this.addStylesForCaptures(d.beginCaptures);
this.addStylesForCaptures(d.endCaptures);d._resolvedRule!==d&&b.push(d._resolvedRule);if(d.patterns)for(var f=0;f<d.patterns.length;f++)b.push(d.patterns[f])}}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var d=b.split("."),f=0;f<d.length;f++)this._styles[b].push(d.slice(0,f+1).join("-"))}},addStylesForCaptures:function(b){for(var d in b)b.hasOwnProperty(d)&&this.addStyles(b[d].name)},ContainerRule:function(){function b(d){this.rule=d;this.subrules=d.patterns}b.prototype.valueOf=
function(){return"aa"};return b}(),BeginEndRule:function(){function b(d){this.rule=d;this.beginRegex=a.toRegExp(d.begin);this.endRegex=a.toRegExp(d.end);this.subrules=d.patterns||[];this.endRegexHasBackRef=a.hasBackReference(this.endRegex);var f=a.complexCaptures(d.captures);d=a.complexCaptures(d.beginCaptures)||a.complexCaptures(d.endCaptures);if(this.isComplex=f||d){f=a.groupify(this.beginRegex);this.beginRegex=f[0];this.beginOld2New=f[1];this.beginConsuming=f[2];f=a.groupify(this.endRegex,this.beginOld2New);
this.endRegex=f[0];this.endOld2New=f[1];this.endConsuming=f[2]}}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(d){this.rule=d;this.matchRegex=a.toRegExp(d.match);if(this.isComplex=a.complexCaptures(d.captures)){d=a.groupify(this.matchRegex);this.matchRegex=d[0];this.matchOld2New=d[1];this.matchConsuming=d[2]}}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?
new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var d=b;if(b.include){if(b.begin||b.end||b.match)throw new Error('Unexpected regex pattern in "include" rule '+b.include);b=b.include;if(b[0]==="#"){d=this.grammar.repository&&this.grammar.repository[b.substring(1)];if(!d)throw new Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")d=this.grammar;else if(b==="$base")throw new Error('Include "$base" is not supported');else{d=this._allGrammars[b];
if(!d)for(var f=0;f<this.externalGrammars.length;f++){var g=this.externalGrammars[f];if(g.scopeName===b){this.preprocess(g);d=this._allGrammars[b]=g;break}}}}return d},ContainerNode:function(){function b(d,f){this.parent=d;this.rule=f;this.children=[];this.end=this.start=null}b.prototype.addChild=function(d){this.children.push(d)};b.prototype.valueOf=function(){var d=this.rule;return"ContainerNode { "+(d.include||"")+" "+(d.name||"")+(d.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(d,
f,g){this.parent=d;this.rule=f;this.children=[];this.setStart(g);this.endMatch=this.end=null;this.endRegexSubstituted=f.endRegexHasBackRef?a.getSubstitutedRegex(f.endRegex,g):null}b.prototype.addChild=function(d){this.children.push(d)};b.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};b.prototype.setStart=function(d){this.start=d.index;this.beginMatch=d};b.prototype.setEnd=function(d){if(d&&typeof d==="object"){this.endMatch=d;this.end=d.index+d[0].length}else{this.endMatch=
null;this.end=d}};b.prototype.shiftStart=function(d){this.start+=d;this.beginMatch.index+=d};b.prototype.shiftEnd=function(d){this.end+=d;if(this.endMatch)this.endMatch.index+=d};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return b}(),push:function(b,d){if(d)for(var f=d.length;f>0;)b.push(d[--f])},exec:function(b,d,f){if(d=b.exec(d))d.index+=f;b.lastIndex=0;return d},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,
d,f){if(b instanceof this.BeginEndNode){var g=b.rule;b=b.endRegexSubstituted||g.endRegex;if(!b)return null;return this.exec(b,d,f)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,false,0)},onModelChanged:function(b){var d=b.addedCharCount,f=b.removedCharCount;b=b.start;if(this._tree){var g=this.textView.getModel(),j=g.getCharCount();g=g.getLineEnd(g.getLineAtOffset(b)-1);var i=this.getFirstDamaged(g,
g);g=g===-1?0:g;d=i?this.parse(i,true,g,b,d,f):j;this.textView.redrawRange(g,d)}else this.initialParse()},getFirstDamaged:function(b,d){if(b<0)return this._tree;for(var f=[this._tree],g=null;f.length;){var j=f.pop();if(!j.parent||this.isDamaged(j,b,d)){if(j instanceof this.BeginEndNode)g=j;for(var i=0;i<j.children.length;i++)f.push(j.children[i])}}return g||this._tree},isDamaged:function(b,d,f){return b.start<=f&&b.end>d},parse:function(b,d,f,g,j,i){var k=this.textView.getModel(),m=k.getLineStart(k.getLineCount()-
1),o=k.getCharCount(),v=this.getInitialExpected(b,f),t=-1;if(d){b.repaired=true;b.endNeedsUpdate=true;t=b.children[b.children.length-1];var w=j-i;t=t?k.getLineEnd(k.getLineAtOffset(t.end+w)):-1;g=k.getLineEnd(k.getLineAtOffset(g+i));t=Math.max(t,g)}t=t===-1?o:t;g=v;var u=b;w=false;for(var s=f,q=-1;u&&(!d||s<t);){var x=this.getNextMatch(k,u,s);x||(s=s>=m?o:k.getLineStart(k.getLineAtOffset(s)+1));var A=x&&x.match,D=x&&x.rule,h=x&&x.isEnd;if(x&&x.isSub){s=this.afterMatch(A);if(D instanceof this.BeginEndRule){w=
true;if(d&&D===g.rule&&u===g.parent){u=g;u.setStart(A);u.repaired=true;u.endNeedsUpdate=true;u=u;g=this.getNextExpected(g,"begin")}else{if(d){this.prune(u,g);d=false}A=new this.BeginEndNode(u,D,A);u.addChild(A);u=A}}}else if(h||s===o){if(u instanceof this.BeginEndNode)if(A){w=true;q=Math.max(q,u.end);u.setEnd(A);s=this.afterMatch(A);if(d&&u===g&&u.parent===g.parent){u.repaired=true;delete u.endNeedsUpdate;g=this.getNextExpected(g,"end")}else if(d){this.prune(u,g);d=false}}else{u.setEnd(o);delete u.endNeedsUpdate}u=
u.parent}if(d&&s>=t&&!w){this.prune(b,v);d=false}}this.removeUnrepairedChildren(b,d,f);this.cleanup(d,b,f,t,o,j,i);return d?Math.max(q,s):s},removeUnrepairedChildren:function(b,d,f){if(d){d=b.children;for(var g=-1,j=0;j<d.length;j++){var i=d[j];if(!i.repaired&&this.isDamaged(i,f,Number.MAX_VALUE)){g=j;break}}if(g!==-1)b.children.length=g}},cleanup:function(b,d,f,g,j,i,k){if(b){b=i-k;j=this.getIntersecting(g-b+1,j);d=this.getIntersecting(f,g);for(f=0;f<j.length;f++){g=j[f];if(!g.repaired&&g instanceof
this.BeginEndNode){g.shiftEnd(b);g.shiftStart(b)}}for(f=0;f<d.length;f++){g=d[f];g.repaired&&g.endNeedsUpdate&&g.shiftEnd(b);delete g.endNeedsUpdate;delete g.repaired}}else{d=this.getIntersecting(f,g);for(f=0;f<d.length;f++)delete d[f].repaired}},getNextMatch:function(b,d,f,g){var j=b.getLineAtOffset(f);j=b.getLineEnd(j);var i=b.getText(f,j),k=[],m=[];b=[];j=[];for(this.push(k,d.rule.subrules);k.length;){var o=k.length?k.pop():null;o=o&&o._resolvedRule._typedRule;if(o instanceof this.ContainerRule&&
m.indexOf(o)===-1){m.push(o);this.push(k,o.subrules)}else if(!(o&&g&&!o.matchRegex)){var v=o&&this.exec(o.matchRegex||o.beginRegex,i,f);if(v){b.push(v);j.push(o)}}}k=Number.MAX_VALUE;m=-1;for(o=0;o<b.length;o++){v=b[o];if(v.index<k){k=v.index;m=o}}if(!g)if(f=this.getEndMatch(d,i,f)){g=d.rule.applyEndPatternLast;if(m===-1||f.index<k||!g&&f.index===k)return{isEnd:true,rule:d.rule,match:f}}return m===-1?null:{isSub:true,rule:j[m],match:b[m]}},getInitialExpected:function(b,d){var f,g;if(b===this._tree)for(f=
0;f<b.children.length;f++){g=b.children[f];if(g.start>=d)return g}else if(b instanceof this.BeginEndNode)if(b.endMatch){var j=b.endMatch.index;for(f=0;f<b.children.length;f++){g=b.children[f];if(g.start>=d)break}if(g&&g.start<j)return g}return b},getNextExpected:function(b,d){if(d==="begin")return(d=b.children[0])?d:b;else if(d==="end")if(d=b.parent)return(b=d.children[d.children.indexOf(b)+1])?b:d;return null},prune:function(b,d){if(d.parent===b)b.children.length=d.getIndexInParent();else if(b instanceof
this.BeginEndNode){b.endMatch=null;b.end=null}if(b.parent)b.parent.children.length=b.getIndexInParent()+1},onLineStyle:function(b){function d(k,m){return k.start-m.start}this._tree||this.initialParse();var f=b.lineStart,g=this.textView.getModel(),j=g.getLineEnd(b.lineIndex),i=g.getLineEnd(g.getLineAtOffset(f)-1);i=this.getFirstDamaged(i,i);f=this.getLineScope(g,i,f,j);b.ranges=this.toStyleRanges(f);b.ranges.sort(d)},getLineScope:function(b,d,f,g){for(var j=f,i=this.getInitialExpected(d,f),k=[],m=
[];d&&j<g;){var o=this.getNextMatch(b,d,j);if(!o)break;var v=o&&o.match,t=o&&o.rule,w=o&&o.isSub;o=o&&o.isEnd;v.index!==j&&m.push({start:j,end:v.index,node:d});if(w){j=this.afterMatch(v);if(t instanceof this.BeginEndRule){this.addBeginScope(k,v,t);d=i;i=this.getNextExpected(i,"begin")}else this.addMatchScope(k,v,t)}else if(o){j=this.afterMatch(v);this.addEndScope(k,v,t);i=this.getNextExpected(i,"end");d=d.parent}}j<g&&m.push({start:j,end:g,node:d});b=this.getInheritedLineScope(m,f,g);return k.concat(b)},
getInheritedLineScope:function(b){for(var d=[],f=0;f<b.length;f++)for(var g=b[f],j=g.node;j;){var i=j.rule.rule,k=i.name;if(i=i.contentName||k){this.addScopeRange(d,g.start,g.end,i);break}j=j.parent}return d},addBeginScope:function(b,d,f){var g=f.rule;this.addCapturesScope(b,d,g.beginCaptures||g.captures,f.isComplex,f.beginOld2New,f.beginConsuming)},addEndScope:function(b,d,f){var g=f.rule;this.addCapturesScope(b,d,g.endCaptures||g.captures,f.isComplex,f.endOld2New,f.endConsuming)},addMatchScope:function(b,
d,f){var g=f.rule,j=g.name;(g=g.captures)?this.addCapturesScope(b,d,g,f.isComplex,f.matchOld2New,f.matchConsuming):this.addScope(b,d,j)},addScope:function(b,d,f){f&&b.push({start:d.index,end:this.afterMatch(d),scope:f})},addScopeRange:function(b,d,f,g){g&&b.push({start:d,end:f,scope:g})},addCapturesScope:function(b,d,f,g,j,i){if(f)if(g){g={1:0};for(var k=0,m=1;d[m]!==undefined;m++){if(i[m]!==undefined)k+=d[m].length;if(d[m+1]!==undefined)g[m+1]=k}i=d.index;for(k=1;f[k];k++){m=f[k].name;var o=j[k],
v=i+g[o];typeof d[o]!=="undefined"&&this.addScopeRange(b,v,v+d[o].length,m)}}else this.addScope(b,d,f[0]&&f[0].name)},getIntersecting:function(b,d){for(var f=[],g=this._tree?[this._tree]:[];g.length;){var j=g.pop(),i=false;if(j instanceof this.ContainerNode)i=true;else if(this.isDamaged(j,b,d)){i=true;f.push(j)}if(i){i=j.children.length;for(var k=0;k<i;k++)g.push(j.children[k])}}return f.reverse()},toStyleRanges:function(b){for(var d=[],f=0;f<b.length;f++){var g=b[f],j=this._styles[g.scope];if(!j)throw new Error("styles not found for "+
g.scope);j=j.join(" ");d.push({start:g.start,end:g.end,style:{styleClass:j}})}return d}};return{RegexUtil:a,TextMateStyler:e}});
define("orion/editor/asyncStyler",["i18n!orion/editor/nls/messages"],function(c){function e(b){return b.getName()==="orion.edit.highlighter"&&b.getProperty("type")==="highlighter"}function a(b,d,f){this.initialize(b,d,f);this.lineStyles=[]}a.prototype={initialize:function(b,d,f){this.textView=b;this.serviceRegistry=d;this.annotationModel=f;this.services=[];var g=this;this.listener={onModelChanging:function(i){g.onModelChanging(i)},onModelChanged:function(i){g.onModelChanged(i)},onDestroy:function(i){g.onDestroy(i)},
onLineStyle:function(i){g.onLineStyle(i)},onStyleReady:function(i){g.onStyleReady(i)},onServiceAdded:function(i,k){g.onServiceAdded(i,k)},onServiceRemoved:function(i,k){g.onServiceRemoved(i,k)}};b.addEventListener("ModelChanging",this.listener.onModelChanging);b.addEventListener("ModelChanged",this.listener.onModelChanged);b.addEventListener("Destroy",this.listener.onDestroy);b.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("serviceAdded",this.listener.onServiceAdded);
d.addEventListener("serviceRemoved",this.listener.onServiceRemoved);b=d.getServiceReferences("orion.edit.highlighter");for(f=0;f<b.length;f++){var j=b[f];e(j)&&this.addServiceListener(d.getService(j))}},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView){this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging);this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged);this.textView.removeEventListener("Destroy",this.listener.onDestroy);
this.textView.removeEventListener("LineStyle",this.listener.onLineStyle);this.textView=null}if(this.services){for(var b=0;b<this.services.length;b++)this.removeServiceListener(this.services[b]);this.services=null}if(this.serviceRegistry){this.serviceRegistry.removeEventListener("serviceAdded",this.listener.onServiceAdded);this.serviceRegistry.removeEventListener("onServiceRemoved",this.listener.onServiceRemoved);this.serviceRegistry=null}this.lineStyles=this.listener=null},onModelChanging:function(b){this.startLine=
this.textView.getModel().getLineAtOffset(b.start)},onModelChanged:function(b){var d=this.startLine;if(b.addedLineCount||b.removedLineCount)Array.prototype.splice.apply(this.lineStyles,[d,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},onStyleReady:function(b){var d=b.lineStyles||b.style;b=Number.MAX_VALUE;var f=-1,g=this.textView.getModel();for(var j in d)if(d.hasOwnProperty(j)){this.lineStyles[j]=d[j];b=Math.min(b,j);f=Math.max(f,j)}b=Math.max(b,0);f=Math.min(f,g.getLineCount());
if(d=this.annotationModel){for(var i=d.getAnnotations(g.getLineStart(b),g.getLineEnd(f)),k=[];i.hasNext();){var m=i.next();m.type==="orion.annotation.highlightError"&&k.push(m)}i=[];for(m=b;m<=f;m++){j=m;var o=this.lineStyles[j];o=o&&o.errors;j=g.getLineStart(j);if(o)for(var v=0;v<o.length;v++){var t=o[v];i.push({start:t.start+j,end:t.end+j,type:"orion.annotation.highlightError",title:c.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}})}}d.replaceAnnotations(k,
i)}this.textView.redrawLines(b,f+1)},onLineStyle:function(b){function d(g,j){for(var i=g.length,k=[],m=0;m<i;m++){var o=g[m];k.push({start:o.start+j,end:o.end+j,style:o.style})}return k}var f=this.lineStyles[b.lineIndex];if(f)if(f.ranges)b.ranges=d(f.ranges,b.lineStart);else if(f.style)b.style=f.style},_getEmptyStyle:function(b){for(var d=[],f=0;f<b;f++)d.push(null);return d},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var d=this.services[b];
d.setContentType&&d.setContentType(this.contentType)}},onServiceAdded:function(b,d){e(b)&&this.addServiceListener(d)},onServiceRemoved:function(b,d){this.services.indexOf(d)!==-1&&this.removeServiceListener(d)},addServiceListener:function(b){b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady);this.services.push(b);b.setContentType&&this.contentType&&b.setContentType(this.contentType)},removeServiceListener:function(b){b.removeEventListener("orion.edit.highlighter.styleReady",
this.listener.onStyleReady);b=this.services.indexOf(b);b!==-1&&this.services.splice(b,1)}};return{AsyncStyler:a}});
define("examples/textview/textStylerOptions",[],function(){function c(e){this._styler=e;this._view=this._styler.view;var a=this;this._listener={onLoad:function(b){a._onLoad(b)},onStorage:function(b){a._onStorage(b)}};if(this._view){this._view.isLoaded()?this._updateStylesheet():this._view.addEventListener("Load",this._listener.onLoad);window.addEventListener("storage",this._listener.onStorage,false)}}c.prototype={_getSetting:function(e,a){for(var b=JSON.parse(localStorage.getItem("JavaScript Editor")),
d,f=0;f<b.length;f++)if(b[f].label===e)for(var g=0;g<b[f].data.length;g++)if(b[f].data[g].label===a){d=b[f].data[g].value;break}return d},_getStyleSheet:function(e){function a(m,o){if(m=k.getClassNameForToken(m)){var v=i._getSetting(o,"Color");o=i._getSetting(o,"Weight").toLowerCase();b.push("."+e+" ."+m+" {");b.push("\tcolor: "+v+";");b.push("\tfont-weight: "+o+";");b.push("}")}}var b=[];b.push("");var d=this._getSetting("Font","Family").toLowerCase();d=d==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':
"monospace";var f=this._getSetting("Font","Size"),g=this._getSetting("Font","Color"),j=this._getSetting("Font","Background");b.push("."+e+" {");b.push("\tfont-family: "+d+";");b.push("\tfont-size: "+f+";");b.push("\tcolor: "+g+";");b.push("\tbackground-color: "+j+";");b.push("}");b.push("."+e+" .view {");b.push("\tbackground-color: "+j+";");b.push("}");b.push("."+e+" .ruler {");b.push("\tbackground-color: "+j+";");b.push("}");var i=this,k=this._styler;if(k.getClassNameForToken){a("keyword","Keyword Types");
a("string","String Types");a("singleLineComment","Comment Types");a("multiLineComment","Comment Types");a("docComment","Comment Types");a("docHtmlComment","Comment Types")}return b.join("\n")},_updateStylesheet:function(){if(localStorage.getItem("JavaScript Editor")){var e=this._view,a={stylesheet:null,themeClass:null};e.getOptions(a);var b=a.stylesheet;b||(b=[]);b instanceof Array||(b=[b]);for(var d=0;d<b.length;d++)if(b[d].indexOf("/* Orion Editor User Preference CSS (key) */")===0){b.splice(d,
1);break}if(d=a.themeClass){if(d=d.replace("userTheme",""))d+=" ";d+="userTheme"}else d="userTheme";b.push("/* Orion Editor User Preference CSS (key) */"+this._getStyleSheet("userTheme"));a.stylesheet=b;a.themeClass=d;e.setOptions(a)}},_onLoad:function(){this._updateStylesheet();this._view.removeEventListener("Load",this._listener.onLoad)},_onStorage:function(e){e.key==="JavaScript Editor"&&this._updateStylesheet()}};return{TextStylerOptions:c}});
define("orion/highlight",["dojo","examples/textview/textStyler","orion/editor/textMateStyler","orion/editor/asyncStyler","examples/textview/textStylerOptions"],function(c,e,a,b,d){function f(j,i,k,m,o,v){function t(D,h){var l=D.getProperty("contentType"),n=D.getProperty("fileTypes");if(l)return i.isSomeExtensionOf(k,l).then(function(p){return p?D:null});else if(h&&n&&n.indexOf(h)!==-1){h=new c.Deferred;h.callback(D);return h}return null}function w(D){var h=null;switch(D&&D.id){case "text.javascript":case "text.json":h=
new e.TextStyler(m,"js",o);break;case "text.java":h=new e.TextStyler(m,"java",o);break;case "text.css":h=new e.TextStyler(m,"css",o);break}h&&new d.TextStylerOptions(h);return h}var u=w(k);if(u){v=new c.Deferred;v.callback(u);return v}u=v&&v.split(".").pop().toLowerCase();v=j.getServiceReferences("orion.edit.highlighter");for(var s=[],q=[],x=0;x<v.length;x++){var A=v[x];A.getProperty("type")==="grammar"&&s.push(A.getProperty("grammar"));(A=t(A,u))&&q.push(A)}return(new c.DeferredList(q)).then(function(D){for(var h,
l=D.length-1;l>=0;l--){var n=D[l][1];if(n){h=n;break}}var p;if(h){D=h.getProperty("type");if(D==="highlighter"){p=new b.AsyncStyler(m,j,o);p.setContentType(k)}else if(D==="grammar"||typeof D==="undefined"){h=h.getProperty("grammar");p=new a.TextMateStyler(m,h,s)}}return p})}function g(j){this.serviceRegistry=j;this.styler=null}g.prototype={setup:function(j,i,k,m){if(this.styler){this.styler.destroy&&this.styler.destroy();this.styler=null}var o=this;return f(this.serviceRegistry,this.serviceRegistry.getService("orion.file.contenttypes"),
j,i,k,m).then(function(v){return o.styler=v})},getStyler:function(){return this.styler}};return{createStyler:f,SyntaxHighlighter:g}});
define("dojox/layout/ToggleSplitter",["dojo","dijit","dijit/layout/BorderContainer"],function(c,e){c.declare("dojox.layout.ToggleSplitter",[e.layout._Splitter],{open:true,closedThreshold:5,openSize:"",_closedSize:"0",templateString:'<div class="dijitSplitter dojoxToggleSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_onMouseDown" tabIndex="0" role="separator"><div dojoAttachPoint="toggleNode" class="dijitSplitterThumb dojoxToggleSplitterIcon"></div></div>',postCreate:function(){this._started=
false;this.inherited(arguments);var a=this.region;c.addClass(this.domNode,"dojoxToggleSplitter"+a.charAt(0).toUpperCase()+a.substring(1));this.connect(this,"onDblClick","_toggleMe")},startup:function(){this.inherited(arguments);var a=this.child.domNode,b=c.style(a,this.horizontal?"height":"width");c.forEach(["toggleSplitterOpen","toggleSplitterClosedThreshold","toggleSplitterOpenSize"],function(d){var f=d.substring(14);f=f.charAt(0).toLowerCase()+f.substring(1);if(d in this.child)this[f]=this.child[d]},
this);if(!this.openSize)this.openSize=this.open?b+"px":"75px";this._openStyleProps=this._getStyleProps(a,true);this._started=true;this.set("open",this.open);return this},_onMouseUp:function(){c.disconnect(this._onMoveHandle);c.disconnect(this._onUpHandle);delete this._onMoveHandle;delete this._onUpHandle;delete this._startPosn},_onPrelimMouseMove:function(a){if(Math.abs((this._startPosn||0)-(this.horizontal?a.clientY:a.clientX))>=3){c.disconnect(this._onMoveHandle);this._startDrag(a)}},_onMouseDown:function(a){if(this.open){if(!this._onUpHandle)this._onUpHandle=
c.connect(c.body(),"onmouseup",this,"_onMouseUp");if(!this._onMoveHandle){this._startPosn=this.horizontal?a.clientY:a.clientX;this._onMoveHandle=c.connect(c.body(),"onmousemove",this,"_onPrelimMouseMove")}}},_handleOnChange:function(){var a=this.child.domNode,b;b=this.horizontal?"height":"width";if(this.open){var d=c.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);d[b]=this._openStyleProps&&this._openStyleProps[b]?this._openStyleProps[b]:this.openSize;c.style(a,
d);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{d=c.getComputedStyle(a);b=this._getStyleProps(a,true,d);d=this._getStyleProps(a,false,d);this._openStyleProps=b;c.style(a,d)}this._setStateClass();this.container._started&&this.container._layoutChildren(this.region)},_getStyleProps:function(a,b,d){d||(d=c.getComputedStyle(a));var f={},g=this.horizontal?"height":"width";f.visibility=b?d.visibility:"hidden";f[g]=b?a.style[g]||d[g]:this._closedSize;var j=["Top","Right","Bottom","Left"];
c.forEach(["padding","margin","border"],function(i){for(var k=0;k<j.length;k++){var m=i+j[k];if(i=="border")i+="Width";if(undefined!==d[m])f[m]=b?d[m]:0}});return f},_setStateClass:function(){if(this.open){c.removeClass(this.domNode,"dojoxToggleSplitterClosed");c.addClass(this.domNode,"dojoxToggleSplitterOpen");c.removeClass(this.toggleNode,"dojoxToggleSplitterIconClosed");c.addClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}else{c.addClass(this.domNode,"dojoxToggleSplitterClosed");c.removeClass(this.domNode,
"dojoxToggleSplitterOpen");c.addClass(this.toggleNode,"dojoxToggleSplitterIconClosed");c.removeClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}},_setOpenAttr:function(a){if(this._started){this.open=a;this._handleOnChange(a,true);this[this.open?"onOpen":"onClose"](this.child)}},onOpen:function(){},onClose:function(){},_toggleMe:function(a){a&&c.stopEvent(a);this.set("open",!this.open)},_onKeyPress:function(){this.inherited(arguments)}});c.extend(e._Widget,{toggleSplitterOpen:true,toggleSplitterClosedThreshold:5,
toggleSplitterOpenSize:""})});
define("orion/widgets/eWebBorderContainer",["dojo","dijit","dijit/layout/BorderContainer","dojox/layout/ToggleSplitter"],function(c,e){c.declare("orion.widgets.eWebBorderContainer",e.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredLeftPaneWidth:function(){var a=this.getSizeCookie();return a<=0?c.position(this.getRightPane()).w*0.25:a},isLeftPaneOpen:function(){var a=this.getSplitter("left");if(a)return a.open;return false},getLeftPane:function(){if(this._left)return this._left;for(var a=
this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&(a[b].region==="leading"||a[b].region==="left"))return this._left=a[b].domNode},getHidingPane:function(){return this.getLeftPane()},getRightPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&a[b].region==="center")return this._center=a[b].domNode},getSizeCookie:function(){var a=this.getSplitter("left");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var b=this.getSplitter("left");
if(b)return b.setSizeCookie(a)},toggleLeftPaneState:function(){var a=this.getSplitter("left");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._left||!this._center)for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&a[b].region==="center")this._center=a[b].domNode;else if(a[b].region&&(a[b].region==="leading"||a[b].region==="left"))this._left=a[b].domNode;var d=this._left,f=this._center,g=c.position(d).w,j=this.isLeftPaneOpen(),
i;i=j?0:this.getPreferredLeftPaneWidth();j||this.toggleLeftPaneState();var k=d.style.overflow,m=f.style.overflow;(new c.Animation({node:d,duration:300,curve:[1,100],onAnimate:c.hitch(this,function(o){d.style.width=g+(i-g)*o/100+"px";d.style.overflow="hidden";f.style.overflow="hidden";this.layout()}),onEnd:c.hitch(this,function(){f.style.overflow=m;d.style.overflow=k;this.toggleCallback&&this.toggleCallback.apply();j?this.toggleLeftPaneState():this.setSizeCookie(null)})})).play()}});c.declare("orion.widgets.eWebSplitter",
dojox.layout.ToggleSplitter,{postCreate:function(){this.inherited(arguments);this.connect(this.toggleNode,"onmousedown","_onThumbMouseDown");this.connect(this.toggleNode,"onmouseover","_onThumbMouseOver");this.connect(this.domNode,"onmouseover","_onMouseOver");this.connect(this.toggleNode,"onmouseout","_onThumbMouseOut");this._openStateCookieName=this.container.id+"_"+this.region+"_open"},startup:function(){this.inherited(arguments);if(this.container.persist){var a=c.cookie(this._openStateCookieName);
if(a==="true")this.container.getHidingPane().style.width=this.getSizeCookie()+"px";else{a==="false"?this.set("open",false):this.set("open",true);this._handleOnChange()}}else{this.set("open",true);this._handleOnChange()}return this},_handleOnChange:function(){var a=this.child.domNode,b;b=this.horizontal?"height":"width";if(this.open){var d=c.mixin({display:"block",visibility:"visible"},this._openStyleProps);d[b]=this._openStyleProps&&this._openStyleProps[b]?this._openStyleProps[b]:this.openSize;c.style(a,
d);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{d=c.getComputedStyle(a);b=this._getStyleProps(a,true,d);d=this._getStyleProps(a,false,d);this._openStyleProps=b;c.style(a,d)}this._setStateClass();if(this.container._started){a=0;if(this.open&&this.openSize)a=parseInt(this.openSize.replace("px",""),10);this.container._layoutChildren(this.region,a)}},_removeFocusVisual:function(a){c.stopEvent(a)},_onMouseDown:function(a){this.open?this._startDrag(a):this._removeFocusVisual(a)},_onMouseOver:function(){this.domNode.style.cursor=
this.open?"e-resize":"default"},_onThumbMouseDown:function(a){a.stopPropagation();this._removeFocusVisual(a);this.container.toggle()},_onThumbMouseOver:function(){this.toggleNode.style.backgroundColor="#AAAAAA"},_onThumbMouseOut:function(){this.toggleNode.style.backgroundColor="#DDDDDD"},_toggleMe:function(){},getSizeCookie:function(){if(this.container.persist){var a=c.cookie(this._cookieName);if(a)return parseInt(a.replace("px",""),10)}return 0},setSizeCookie:function(){if(this.container.persist)c.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},toggleHidingPaneState:function(){this.set("open",!this.open);this.container.getHidingPane().style.visibility=this.open?"visible":"hidden";if(this.container.persist)c.cookie(this._openStateCookieName,this.open?"true":"false",{expires:365})}});c.declare("orion.widgets.eWebBorderContainerReverse",e.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredRightPaneWidth:function(){var a=this.getSizeCookie();
return a<=0?c.position(this.getLeftPane()).w*0.25:a},isRightPaneOpen:function(){var a=this.getSplitter("right");if(a)return a.open;return false},getRightPane:function(){if(this._right)return this._right;for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&(a[b].region==="trailing"||a[b].region==="right"))return this._right=a[b].domNode},getHidingPane:function(){return this.getRightPane()},getLeftPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&
a[b].region==="center")return this._center=a[b].domNode},getSizeCookie:function(){var a=this.getSplitter("right");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var b=this.getSplitter("right");if(b)return b.setSizeCookie(a)},toggleRightPaneState:function(){var a=this.getSplitter("right");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._right||!this._center)for(var a=this.getChildren(),b=0;b<a.length;b++)if(a[b].region&&
a[b].region==="center")this._center=a[b].domNode;else if(a[b].region&&(a[b].region==="trailing"||a[b].region==="right"))this._right=a[b].domNode;var d=this._right,f=this._center,g=c.position(d).w,j=this.isRightPaneOpen(),i;i=j?0:this.getPreferredRightPaneWidth();j||this.toggleRightPaneState();var k=d.style.overflow,m=f.style.overflow;(new c.Animation({node:d,duration:300,curve:[1,100],onAnimate:c.hitch(this,function(o){d.style.width=g+(i-g)*o/100+"px";d.style.overflow="hidden";f.style.overflow="hidden";
this.layout()}),onEnd:c.hitch(this,function(){f.style.overflow=m;d.style.overflow=k;this.toggleCallback&&this.toggleCallback.apply();j?this.toggleRightPaneState():this.setSizeCookie(null)})})).play()}})});
define("edit/setup",["require","dojo","orion/selection","orion/status","orion/progress","orion/dialogs","orion/commands","orion/util","orion/favorites","orion/fileClient","orion/operationsClient","orion/searchClient","orion/globalCommands","orion/outliner","orion/problems","orion/editor/contentAssist","orion/editorCommands","orion/editor/editorFeatures","orion/editor/editor","orion/syntaxchecker","orion/breadcrumbs","orion/textview/textView","orion/textview/textModel","orion/textview/projectionTextModel",
"orion/textview/keyBinding","orion/searchAndReplace/textSearcher","orion/searchAndReplace/orionTextSearchAdaptor","orion/edit/dispatcher","orion/contentTypes","orion/PageUtil","orion/highlight","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane","orion/widgets/eWebBorderContainer"],function(c,e,a,b,d,f,g,j,i,k,m,o,v,t,w,u,s,q,x,A,D,h,l,n,p,r,y,B,z,E,G){var M=M||{};M.setUpEditor=function(H,N,L){function R(S,W){for(var aa=H.getServiceReferences("orion.edit.outliner"),
da=[],ca=0;ca<aa.length;ca++){var la=aa[ca],ga=la.getProperty("contentType"),ma=la.getProperty("pattern"),$=false;if(ga)$=ga.some(function(ea){return V.isExtensionOf(S,ea)});else if(ma&&(new RegExp(ma)).test(W))$=true;$&&da.push(la)}P.setOutlineProviders(da);fa.setOutlineProviders(da)}var T=window.document,C,F,K,P,V;T.body.style.visibility="visible";e.parser.parse();(function(){C=new a.Selection(H);var S=new m.OperationsClient(H);K=new b.StatusReportingService(H,S,"statusPane","notifications","notificationArea");
new d.ProgressService(H,S);new f.DialogService(H);F=new g.CommandService({serviceRegistry:H,selection:C});new w.ProblemService(H);P=new t.OutlineService({serviceRegistry:H,preferences:N});new i.FavoritesService({serviceRegistry:H});V=new z.ContentTypeService(H)})();var X=dijit.byId("topContainer"),Y=e.byId("outline"),ia=e.byId("editor"),ba=e.byId("searchFloat"),ja=new G.SyntaxHighlighter(H),ha=new k.FileClient(H),ka=new o.Searcher({serviceRegistry:H,commandService:F,fileService:ha}),na,J={lastFilePath:"",
setInput:function(S,W){function aa($){try{$=JSON.parse($.responseText);return $.Message}catch(ea){}return $.responseText}if(S&&S[0]!=="#")S="#"+S;var da=E.matchResourceParameters(S),ca=da.resource;if(da.line)da.line=parseInt(da.line,10);if(ca){if(ca===this.lastFilePath)W.showSelection(da.start,da.end,da.line,da.offset,da.length);else{W.getTextView()||W.installTextView();var la=setTimeout(function(){W.setInput(ca,"Fetching "+ca,null)},800),ga=e.hitch(this,function($,ea){if(ea){this._fileMetadata=ea;
v.setPageTarget(ea,H,F,function(){if(ea.Parents&&ea.Parents.length>0)return ha.read(ea.Parents[0].Location,true)},ea);v.generateDomCommandsInBanner(F,W);this.setTitle(ea.Location);this._contentType=V.getFileContentType(ea)}else{this._fileMetadata=null;this.setTitle(ca);this._contentType=V.getFilenameContentType(this.getTitle())}ja.setup(this._contentType,W.getTextView(),W.getAnnotationModel(),ca).then(e.hitch(this,function(){var oa=ja.getStyler();W.setFoldingEnabled(oa&&oa.foldingEnabled);W.highlightAnnotations();
R(this._contentType,S);na||(na=new B.Dispatcher(H,W,this._contentType));W.setInput(ca,null,$);W.showSelection(da.start,da.end,da.line,da.offset,da.length)}));clearTimeout(la)}),ma=e.hitch(this,function($){var ea=$[0][0],oa=ea?$[0][1]:null,ra=$[1][0],sa=ra?$[1][1]:null;clearTimeout(la);if(!ea){ea=$[0][1];console.error("HTTP status code: ",ea.status);oa="An error occurred: "+aa(ea)}if(!ra){ea=$[1][1];console.error("Error loading file metadata: "+aa(ea))}ga(oa,sa)});(new e.DeferredList([ha.read(ca),
ha.read(ca,true)])).then(ma,ma)}this.lastFilePath=ca}else W.setInput("No File Selected","",null)},getInput:function(){return this.lastFilePath},setTitle:function(S){var W=S.lastIndexOf("/"),aa=S;if(W!==-1){aa=aa.substring(W+1);if(S.charAt(0)==="*")aa="*"+aa}this._lastTitle=aa;window.document.title=aa;if(W=e.byId("location")){e.empty(W);ka.setLocationByMetaData(this._fileMetadata,{index:"first"});aa=ha.fileServiceName(this._fileMetadata&&this._fileMetadata.Location);new D.BreadCrumbs({container:"location",
resource:this._fileMetadata,firstSegmentName:aa});if(S.charAt(0)==="*")e.create("b",null,W,"last").innerHTML="*"}},getTitle:function(){return this._lastTitle},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},setDirty:function(S){if(S)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},hashChanged:function(){this._lastHash||
this.getInput();var S=this.getInput();C.setSelections("#"+e.hash());var W=e.hash(),aa=this.getInput();S=E.matchResourceParameters("#"+S).resource!==E.matchResourceParameters("#"+aa).resource;aa=E.matchResourceParameters("#"+aa).resource===E.matchResourceParameters("#"+W).resource;if(!S&&!aa)e.hash(this._lastHash);else{S&&e.hash(W);this._lastHash=W}},shouldGoToURI:function(S,W){if(S.isDirty()){S=E.matchResourceParameters("#"+this.lastFilePath).resource;W=E.matchResourceParameters(W).resource;if(S!==
W)return window.confirm("There are unsaved changes.  Do you still want to navigate away?")}return true}},I={handlers:[],addHandler:function(S){this.handlers.push(S)},cancel:function(){for(var S=false,W=0;W<this.handlers.length;W++)S=this.handlers[W].cancel()||S;return S},isActive:function(){for(var S=0;S<this.handlers.length;S++)if(this.handlers[S].isActive())return true;return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){return false}},O=null;L||(O=function(S){var W=
new u.ContentAssist(S,"contentassist");W.addEventListener("show",function(){for(var aa=J.getContentType(),da=S.getTitle(),ca=H.getServiceReferences("orion.edit.contentAssist"),la=[],ga=0;ga<ca.length;ga++){var ma=ca[ga],$=ma.getProperty("contentType"),ea=ma.getProperty("pattern");if($&&V.isSomeExtensionOf(aa,$)||ea&&(new RegExp(ea)).test(da))la.push(H.getService(ma))}W.setProviders(la)});return W});var Q=new q.AnnotationFactory,U=new x.Editor({textViewFactory:function(){return new h.TextView({parent:ia,
model:new n.ProjectionTextModel(new l.TextModel),stylesheet:[c.toUrl("orion/textview/textview.css"),c.toUrl("orion/textview/rulers.css"),c.toUrl("examples/textview/textstyler.css"),c.toUrl("css/default-theme.css"),c.toUrl("orion/textview/annotations.css")],tabSize:4,readonly:L})},undoStackFactory:new s.UndoCommandFactory(H,F,"pageActions"),textDNDFactory:new q.TextDNDFactory,annotationFactory:Q,foldingRulerFactory:new q.FoldingRulerFactory,lineNumberRulerFactory:new q.LineNumberRulerFactory,contentAssistFactory:O,
keyBindingFactory:function(S,W,aa,da){var ca=new q.TextActions(S,aa,new r.TextSearcher(F,aa,new y.OrionTextSearchAdaptor));W.push(ca);ca=new q.LinkedMode(S);W.push(ca);aa=new q.SourceCodeActions(S,aa,da,ca);W.push(aa);(new s.EditorCommandFactory(H,F,ha,J,"pageActions",L,"pageNavigationActions")).generateEditorCommands(S);W.push(I);S.getTextView().setKeyBinding(new p.KeyBinding("h",true),"Search Files");S.getTextView().setAction("Search Files",function(){window.setTimeout(function(){var la=S.getTextView(),
ga=la.getSelection(),ma="";if(ga.end>ga.start)ma=la.getText().substring(ga.start,ga.end);if(ma.length<=0)ma=prompt("Enter search term:",ma);if(ma){e.connect(T,"onkeypress",e.hitch(this,function($){if($.charOrCode===e.keys.ESCAPE)ba.style.display="none"}));I.addHandler({isActive:function(){return ba.style.display==="block"},cancel:function(){if(this.isActive()){ba.style.display="none";return true}return false}});e.place(T.createTextNode("Searching for occurrences of "),ba,"last");la=e.create("b",null,
ba,"last");e.place(T.createTextNode('"'+ma+'"...'),la,"only");ba.style.display="block";ma=ka.createSearchQuery(ma,null,"Name",true);la=ka.defaultRenderer.makeRenderFunction(ba,false);ka.search(ma,J.getInput(),la)}},0);return true});S.getTextView().setKeyBinding(new p.KeyBinding("o",true),"Toggle Outliner");S.getTextView().setAction("Toggle Outliner",function(){X.toggle();return true})},statusReporter:function(S,W){if(W==="progress")K.setProgressMessage(S);else W==="error"?K.setErrorMessage(S):K.setMessage(S)},
domNode:ia});H.getService("orion.core.marker").addEventListener("problemsChanged",function(S){U.showProblems(S)});U.addEventListener("DirtyChanged",function(){J.setDirty(U.isDirty())});H.getService("orion.page.selection").addEventListener("selectionChanged",function(S){J.shouldGoToURI(U,S)&&J.setInput(S,U)});e.subscribe("/dojo/hashchange",J,function(){J.hashChanged(U)});J.setInput(e.hash(),U);v.generateBanner("banner",H,F,N,ka,U,U,I);v.generateDomCommandsInBanner(F,U);var Z=new A.SyntaxChecker(H,
U);U.addEventListener("InputChanged",function(S){Z.checkSyntax(J.getContentType(),S.title,S.message,S.contents)});var fa=new t.Outliner({parent:Y,serviceRegistry:H,outlineService:H.getService("orion.edit.outline"),commandService:F,selectionService:C});U.addEventListener("InputChanged",function(){P.emitOutline(U.getText(),U.getTitle())});e.connect(fa,"setSelectedProvider",function(S){P.setProvider(S);P.emitOutline(U.getText(),U.getTitle())});window.onbeforeunload=function(){if(U.isDirty())return"There are unsaved changes."};
X.setToggleCallback(function(){U.getTextView().redrawLines()});T.onkeydown=function(S){S=S||window.event;if(S.ctrlKey&&S.keyCode===79){X.toggle();if(T.all)S.keyCode=0;else{S.preventDefault();S.stopPropagation()}}}};return M});define("edit/edit",["dojo","orion/bootstrap","./setup"],function(c,e,a){c.addOnLoad(function(){e.startup().then(function(b){a.setUpEditor(b.serviceRegistry,b.preferences,false)})})});