/*

 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) 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) 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, 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) 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, 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
 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) 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: 
 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: 
 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) 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
 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) 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 d(a,b,c){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var e=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],g=0,j;j=e[g++];)console[j]||function(){var s=j+"";console[s]="log"in console?function(){var v=Array.apply({},arguments);v.unshift(s+":");console.log(v.join(" "))}:function(){};console[s]._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 c=="undefined")c={_scopeName:"dojox"};if(!i._scopeArgs)i._scopeArgs=[a,b,c];i.global=this;i.config={isDebug:false,debugAtAllCosts:false};if(e=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var k in e)i.config[k]=e[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,w={};for(g in{toString:1}){m=[];break}a._extraNames=m=m||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];o=m.length;a._mixin=function(s,v){var u,t,q;for(u in v){t=v[u];
if(!(u in s)||s[u]!==t&&(!(u in w)||w[u]!==t))s[u]=t}if(o&&v)for(q=0;q<o;++q){u=m[q];t=v[u];if(!(u in s)||s[u]!==t&&(!(u in w)||w[u]!==t))s[u]=t}return s};a.mixin=function(s){s||(s={});for(var v=1,u=arguments.length;v<u;v++)i._mixin(s,arguments[v]);return s};a._getProp=function(s,v,u){u=u||i.global;for(var t=0,q;u&&(q=s[t]);t++){if(t==0&&i._scopeMap[q])q=i._scopeMap[q];u=q in u?u[q]:v?(u[q]={}):undefined}return u};a.setObject=function(s,v,u){var t=s.split(".");s=t.pop();return(u=i._getProp(t,true,
u))&&s?(u[s]=v):undefined};a.getObject=function(s,v,u){return i._getProp(s.split("."),v,u)};a.exists=function(s,v){return i.getObject(s,false,v)!==undefined};a.eval=function(s){return i.global.eval?i.global.eval(s):eval(s)};i.deprecated=i.experimental=function(){}})();return{dojo:a,dijit:b,dojox:c}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=d();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var f=d();dojo=f.dojo;dijit=f.dijit;dojox=f.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(d,f){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],b,c;for(b=0;b<a.length;){c=a[b++];f[c]=function(s){return function(){console.warn("dojo."+s+" not available when using an AMD loader.")}}(c)}var e=function(s){var v=[],u;for(u=0;u<s.length;)v.push(s[u++]);
return v},g=function(s,v){return v?typeof v=="string"?function(){s[v]()}:function(){v.call(s)}:s};f.ready=f.addOnLoad=function(s,v){d.ready(v?g(s,v):s)};f.addOnLoad(function(){f.postLoad=f.config.afterOnLoad=true});if(a=f.config.addOnLoad)f.addOnLoad[a instanceof Array?"apply":"call"](f,a);var j=f._loaders=[],i=function(){var s=j.slice(0);for(Array.prototype.splice.apply(j,[0,j.length]);s.length;)s.shift().call()};j.unshift=function(){Array.prototype.unshift.apply(j,e(arguments));d.ready(i)};j.splice=
function(){Array.prototype.splice.apply(j,e(arguments));d.ready(i)};var k=f._unloaders=[];f.unloaded=function(){for(;k.length;)k.pop().call()};f._onto=function(s,v,u){s.push(u?g(v,u):v)};f._modulesLoaded=function(){};f.loadInit=function(s){s()};var m=function(s){return s.replace(/\./g,"/")};f.getL10nName=function(s,v,u){u=u?u.toLowerCase():f.locale;s="i18n!"+m(s);return/root/i.test(u)?s+"/nls/"+v:s+"/nls/"+u+"/"+v};f.requireLocalization=function(s,v,u){if(d.vendor!="altoviso.com")u=!u||u.toLowerCase()===
f.locale?"root":u;return d(f.getL10nName(s,v,u))};f.i18n={getLocalization:f.requireLocalization,normalizeLocale:function(s){s=s?s.toLowerCase():f.locale;if(s=="root")s="ROOT";return s}};var o=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,w=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;f._Url=function(){for(var s=arguments,v=[s[0]],u=1;u<s.length;u++)if(s[u]){var t=new f._Url(s[u]+"");v=new f._Url(v[0]+"");if(t.path==""&&!t.scheme&&!t.authority&&!t.query){if(t.fragment!=
null)v.fragment=t.fragment;t=v}else if(!t.scheme){t.scheme=v.scheme;if(!t.authority){t.authority=v.authority;if(t.path.charAt(0)!="/"){v=(v.path.substring(0,v.path.lastIndexOf("/")+1)+t.path).split("/");for(var q=0;q<v.length;q++)if(v[q]==".")if(q==v.length-1)v[q]="";else{v.splice(q,1);q--}else if(q>0&&!(q==1&&v[0]=="")&&v[q]==".."&&v[q-1]!="..")if(q==v.length-1){v.splice(q,1);v[q-1]=""}else{v.splice(q-1,2);q-=2}t.path=v.join("/")}}}v=[];t.scheme&&v.push(t.scheme,":");t.authority&&v.push("//",t.authority);
v.push(t.path);t.query&&v.push("?",t.query);t.fragment&&v.push("#",t.fragment)}this.uri=v.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(w);this.user=u[3]||null;this.password=u[4]||null;this.host=u[6]||u[7];this.port=u[9]||null}};f._Url.prototype.toString=function(){return this.uri};f.moduleUrl=function(s,v){if(!s)return null;
s=m(s)+(v?"/"+v:"");v="";var u=s.match(/(.+)(\.[^\/]*)$/);if(u){s=u[1];v=u[2]}return new f._Url(d.nameToUrl(s,v))};return f});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(d){if(typeof window!="undefined"){d.isBrowser=true;d._name="browser";(function(){var a=d;if(document&&document.getElementsByTagName)for(var b=document.getElementsByTagName("script"),c=/dojo(\.xd)?\.js(\W|$)/i,e=0;e<b.length;e++){var g=b[e].getAttribute("src");if(g){var j=g.match(c);if(j){if(!a.config.baseUrl)a.config.baseUrl=g.substring(0,j.index);if(b=b[e].getAttribute("djConfig")||b[e].getAttribute("data-dojo-config")){b=
eval("({ "+b+" })");for(var i in b)d.config[i]=b[i]}break}}}a.baseUrl=a.config.baseUrl;i=navigator;b=i.userAgent;c=i.appVersion;e=parseFloat(c);if(b.indexOf("Opera")>=0)a.isOpera=e;if(b.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=c.indexOf("Konqueror")>=0?e:0;a.isWebKit=parseFloat(b.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(b.split("Chrome/")[1])||undefined;a.isMac=c.indexOf("Macintosh")>=0;if((g=Math.max(c.indexOf("WebKit"),c.indexOf("Safari"),0))&&!d.isChrome){a.isSafari=parseFloat(c.split("Version/")[1]);
if(!a.isSafari||parseFloat(c.substr(g+7))<=419.3)a.isSafari=2}if(b.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=e;if(a.isMoz)a.isFF=parseFloat(b.split("Firefox/")[1]||b.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(c.split("MSIE ")[1])||undefined;if((b=document.documentMode)&&b!=5&&Math.floor(a.isIE)!=b)a.isIE=b}if(d.isIE&&window.location.protocol==="file:")d.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
d.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,t;if(!d.isIE||!d.config.ieForceActiveXXhr)try{u=new XMLHttpRequest}catch(q){}if(!u)for(var x=0;x<3;++x){var B=a._XMLHTTP_PROGIDS[x];try{u=new ActiveXObject(B)}catch(D){t=D}if(u){a._XMLHTTP_PROGIDS=[B];break}}if(!u)throw new Error("XMLHTTP not available: "+t);return u};a._isDocumentOk=function(u){u=u.status||0;var t=location.protocol;
return u>=200&&u<300||u==304||u==1223||!u&&(t=="file:"||t=="chrome:"||t=="chrome-extension:"||t=="app:")};var k=window.location+"";var m=(i=document.getElementsByTagName("base"))&&i.length>0;a._getText=function(u,t){var q=a._xhrObj();if(!m&&d._Url)u=(new d._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(B){if(t)return null;throw B;}return q.responseText};var o=window,w=function(u,t){var q=o.attachEvent||o.addEventListener;u=o.attachEvent?u:u.substring(2);q(u,function(){t.apply(o,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var u=a._windowUnloaders;u.length;)u.pop()();a=null};var s=0;a.addOnWindowUnload=function(u,t){a._onto(a._windowUnloaders,u,t);if(!s){s=1;w("onunload",a.windowUnloaded)}};var v=0;a.addOnUnload=
function(u,t){a._onto(a._unloaders,u,t);if(!v){v=1;w("onbeforeunload",d.unloaded)}}})();d._initFired=false;d._loadInit=function(){if(d._scrollIntervalId){clearInterval(d._scrollIntervalId);d._scrollIntervalId=0}if(!d._initFired){d._initFired=true;!d.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",d._loadInit);d._inFlightCount==0&&d._modulesLoaded()}};if(!d.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",d._loadInit,false);window.addEventListener("load",
d._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",d._loadInit);if(!d.config.skipIeDomLoaded&&self===self.top)d._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");d._loadInit()}}catch(a){}},30)}if(d.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,c=1,e=document.createStyleSheet();if(d.isIE>=8){b=
1;c=a.length}for(;b<c;++b)e.addRule("v\\:"+a[b],"behavior:url(#default#VML); display:inline-block")})()}catch(f){}}(function(){var a=d.config.modulePaths;if(a)for(var b in a)d.registerModulePath(b,a[b])})();d.config.isDebug&&d.require("dojo._firebug.firebug");if(d.config.debugAtAllCosts){d.require("dojo._base._loader.loader_debug");d.require("dojo.i18n")}return d});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(d){return dojo=d});
define("dojo/_base/lang",["dojo/lib/kernel"],function(d){(function(){var f=Object.prototype.toString;d.isString=function(i){return typeof i=="string"||i instanceof String};d.isArray=function(i){return i&&(i instanceof Array||typeof i=="array")};d.isFunction=function(i){return f.call(i)==="[object Function]"};d.isObject=function(i){return i!==undefined&&(i===null||typeof i=="object"||d.isArray(i)||d.isFunction(i))};d.isArrayLike=function(i){return i&&i!==undefined&&!d.isString(i)&&!d.isFunction(i)&&
!(i.tagName&&i.tagName.toLowerCase()=="form")&&(d.isArray(i)||isFinite(i.length))};d.isAlien=function(i){return i&&!d.isFunction(i)&&/\{\s*\[native code\]\s*\}/.test(String(i))};d.extend=function(i){for(var k=1,m=arguments.length;k<m;k++)d._mixin(i.prototype,arguments[k]);return i};d._hitchArgs=function(i,k){var m=d._toArray(arguments,2),o=d.isString(k);return function(){var w=d._toArray(arguments),s=o?(i||d.global)[k]:k;return s&&s.apply(i||this,m.concat(w))}};d.hitch=function(i,k){if(arguments.length>
2)return d._hitchArgs.apply(d,arguments);if(!k){k=i;i=null}if(d.isString(k)){i=i||d.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||[])}};d.delegate=d._delegate=function(){function i(){}return function(k,m){i.prototype=k;k=new i;i.prototype=null;m&&d._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};d._toArray=d.isIE?function(i){return(i.item?b:a).apply(this,arguments)}:a;d.partial=function(){return d.hitch.apply(d,[null].concat(d._toArray(arguments)))};var c=d._extraNames,e=c.length,g={};d.clone=function(i){if(!i||typeof i!="object"||d.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,w;if(d.isArray(i)){k=
[];m=0;for(o=i.length;m<o;++m)m in i&&k.push(d.clone(i[m]))}else k=i.constructor?new i.constructor:{};for(w in i){o=i[w];if(!(w in k)||k[w]!==o&&(!(w in g)||g[w]!==o))k[w]=d.clone(o)}if(e)for(m=0;m<e;++m){w=c[m];o=i[w];if(!(w in k)||k[w]!==o&&(!(w in g)||g[w]!==o))k[w]=o}return k};d.trim=String.prototype.trim?function(i){return i.trim()}:function(i){return i.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var j=/\{([^\}]+)\}/g;d.replace=function(i,k,m){return i.replace(m||j,d.isFunction(k)?k:function(o,
w){return d.getObject(w,false,k)})}})();return d});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var f=function(b,c,e){return[typeof b=="string"?b.split(""):b,c||d.global,typeof e=="string"?new Function("item","index","array",e):e]},a=function(b,c,e,g){var j=f(c,g,e);c=j[0];e=0;for(g=c.length;e<g;++e){var i=!!j[2].call(j[1],c[e],e,c);if(b^i)return i}return b};d.mixin(d,{indexOf:function(b,c,e,g){var j=1,i=b.length||0,k=0;if(g){k=i-1;j=i=-1}if(e!=undefined)k=e;if(g&&k>i||k<i)for(;k!=i;k+=j)if(b[k]==c)return k;
return-1},lastIndexOf:function(b,c,e){return d.indexOf(b,c,e,true)},forEach:function(b,c,e){if(b&&b.length){var g=f(b,e,c);b=g[0];c=0;for(e=b.length;c<e;++c)g[2].call(g[1],b[c],c,b)}},every:function(b,c,e){return a(true,b,c,e)},some:function(b,c,e){return a(false,b,c,e)},map:function(b,c,e,g){var j=f(b,e,c);b=j[0];c=g?new g:[];e=0;for(g=b.length;e<g;++e)c.push(j[2].call(j[1],b[e],e,b));return c},filter:function(b,c,e){var g=f(b,e,c);b=g[0];c=[];e=0;for(var j=b.length;e<j;++e)g[2].call(g[1],b[e],e,
b)&&c.push(b[e]);return c}})})();return d});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(d){(function(){function f(l,n){throw new Error("declare"+(n?" "+n:"")+": "+l);}function a(l,n){for(var p=[],r=[{cls:0,refs:[]}],y={},A=1,z=l.length,E=0,G,M,H,N,L;E<z;++E){if(G=l[E])x.call(G)!="[object Function]"&&f("mixin #"+E+" is not a callable constructor.",n);else f("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]};++A}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(--A;L=H.refs,L.length==1;){H=L[0];if(!H||--H.count){H=0;break}p.push(H.cls);--A}if(H){E=0;for(z=L.length;E<z;++E){H=L[E];--H.count||r.push(H)}}}A&&f("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,A,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)||f("can't deduce a name to call inherited()",this.declaredClass);E=this.constructor._meta;A=E.bases;M=H.p;if(r!=h){if(H.c!==z){M=0;G=A[0];E=G._meta;if(E.hidden[r]!==z){(y=E.chains)&&typeof y[r]=="string"&&f("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=A[++M]);M=G?M:-1}}if(G=A[++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=A[++M])}}p=G&&p||q[r]}else{if(H.c!==z){M=0;if((E=A[0]._meta)&&E.ctor!==z){y=E.chains;if(!y||y.constructor!=="manual")f("calling chained constructor with inherited",this.declaredClass);for(;G=A[++M];)if((E=G._meta)&&E.ctor===z)break;M=G?M:-1}}for(;G=A[++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 c(l,n){if(typeof l=="string")return this.inherited(l,n,true);return this.inherited(l,true)}function e(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,A=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<A;++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],A,z;z=l.length;var E;if(!(this instanceof p.callee))return v(p);if(n&&(y&&y.preamble||this.preamble)){E=new Array(l.length);E[0]=p;for(A=0;;){if(y=p[0])if(y=y.preamble)p=
y.apply(this,p)||p;y=l[A].prototype;if(y=y.hasOwnProperty("preamble")&&y.preamble)p=y.apply(this,p)||p;if(++A==z)break;E[A]=p}}for(A=z-1;A>=0;--A){y=l[A];if(y=(z=y._meta)?z.ctor:y)y.apply(this,E?E[A]: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 v(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 v(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 w(l,n,p){return function(){var r,y,A=0,z=1;if(p){A=n.length-1;z=-1}for(;r=n[A];A+=z){y=r._meta;(r=(y?y.hidden:r.prototype)[l])&&r.apply(this,arguments)}}}function s(l){B.prototype=l.prototype;l=new B;B.prototype=null;return l}function v(l){var n=l.callee,p=s(n);n.apply(p,l);return p}var u=d,t=u._mixin,q=Object.prototype,x=q.toString,
B=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,A,z,E,G,M,H=1,N=n;if(x.call(n)=="[object Array]"){G=a(n,l);A=G[0];H=G.length-A;n=G[H]}else{G=[0];if(n)if(x.call(n)=="[object Function]"){A=n._meta;G=G.concat(A?A.bases:n)}else f("base class is not a callable constructor.",l);else n!==null&&f("unknown base class. Did you use dojo.require to pull it in?",l)}if(n)for(y=H-1;;--y){r=s(n);if(!y)break;A=G[y];(A._meta?g:t)(r,A.prototype);z=new Function;
z.superclass=n;z.prototype=r;n=r.constructor=z}else r={};j(r,p);A=p.constructor;if(A!==q.constructor){A.nom=h;r.constructor=A}for(y=H-1;y;--y)if((A=G[y]._meta)&&A.chains)M=t(M||{},A.chains);if(r["-chains-"])M=t(M||{},r["-chains-"]);A=!M||!M.hasOwnProperty(h);G[0]=z=M&&M.constructor==="manual"?o(G):G.length==1?m(p.constructor,A):k(G,A);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=c;r.inherited=b;
r.isInstanceOf=e;if(l){r.declaredClass=l;u.setObject(l,z)}if(M)for(E in M)if(r[E]&&typeof M[E]=="string"&&E!=h){A=r[E]=w(E,G,M[E]==="after");A.nom=E}return z};u.safeMixin=j})();return d.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(d){d._listener={getDispatcher:function(){return function(){var f=Array.prototype,a=arguments.callee,b=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var c;b=[].concat(b);for(c in b)c in f||b[c].apply(this,arguments);return a}},add:function(f,a,b){f=f||d.global;var c=f[a];if(!c||!c._listeners){var e=d._listener.getDispatcher();e.target=c;e._listeners=[];c=f[a]=e}return c._listeners.push(b)},remove:function(f,a,b){(f=(f||
d.global)[a])&&f._listeners&&b--&&delete f._listeners[b]}};d.connect=function(){var f=arguments,a=[],b=0;a.push(d.isString(f[0])?null:f[b++],f[b++]);var c=f[b+1];a.push(d.isString(c)||d.isFunction(c)?f[b++]:null,f[b++]);for(c=f.length;b<c;b++)a.push(f[b]);return d._connect.apply(this,a)};d._connect=function(f,a,b,c){var e=d._listener;b=e.add(f,a,d.hitch(b,c));return[f,a,b,e]};d.disconnect=function(f){if(f&&f[0]!==undefined){d._disconnect.apply(this,f);delete f[0]}};d._disconnect=function(f,a,b,c){c.remove(f,
a,b)};d._topics={};d.subscribe=function(f,a,b){return[f,d._listener.add(d._topics,f,d.hitch(a,b))]};d.unsubscribe=function(f){f&&d._listener.remove(d._topics,f[0],f[1])};d.publish=function(f,a){if(f=d._topics[f])f.apply(this,a||[])};d.connectPublisher=function(f,a,b){var c=function(){d.publish(f,arguments)};return b?d.connect(a,b,c):d.connect(a,c)};return d.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(d){(function(){var f=function(){},a=Object.freeze||function(){},b=function(){var c,e,g,j,i=false,k=function(){};return function(m){if(i)if(c){e.next={task:m,next:null};e=e.next}else e=c={task:m,next:null};else{i=true;do try{for(;m;){m();if(g){if(c)e.next=g;else c=g;e=j}if(c){g=c.next;j=e;m=c.task;c=e=null}else m=null}i=false}catch(o){m=k;console.error(o)}while(i)}}}();d.Deferred=function(c){function e(v){if(i)throw new Error("This deferred has already been resolved");
j=v;i=true;b(g)}function g(){for(var v;!v&&o;){var u=o;o=o.next;if(v=u.progress==f)i=false;var t=k?u.error:u.resolved;if(t)try{var q=t(j);if(q&&typeof q.then==="function")q.then(d.hitch(u.deferred,"resolve"),d.hitch(u.deferred,"reject"),d.hitch(u.deferred,"progress"));else{t=v&&q===undefined;if(v&&!t)k=q instanceof Error;u.deferred[t&&k?"reject":"resolve"](t?j:q)}}catch(x){u.deferred.reject(x)}else k?u.deferred.reject(j):u.deferred.resolve(j)}}var j,i,k,m,o,w=this.promise={};this.resolve=this.callback=
function(v){this.fired=0;this.results=[v,null];e(v)};this.reject=this.errback=function(v){k=true;this.fired=1;e(v);this.results=[null,v];if(!v||v.log!==false)(d.config.deferredOnError||function(u){console.error(u)})(v)};this.progress=function(v){for(var u=o;u;){var t=u.progress;t&&t(v);u=u.next}};this.addCallbacks=function(v,u){this.then(v,u,f);return this};this.then=w.then=function(v,u,t){var q=t==f?this:new d.Deferred(w.cancel);v={resolved:v,error:u,progress:t,deferred:q};if(o)m=m.next=v;else o=
m=v;i&&b(g);return q.promise};var s=this;this.cancel=w.cancel=function(){if(!i){var v=c&&c(s);if(!i){v instanceof Error||(v=new Error(v));v.log=false;s.reject(v)}}};a(w)};d.extend(d.Deferred,{addCallback:function(){return this.addCallbacks(d.hitch.apply(d,arguments))},addErrback:function(){return this.addCallbacks(null,d.hitch.apply(d,arguments))},addBoth:function(){var c=d.hitch.apply(d,arguments);return this.addCallbacks(c,c)},fired:-1})})();d.when=function(f,a,b,c){if(f&&typeof f.then==="function")return f.then(a,
b,c);return a(f)};return d.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(d){d.fromJson=function(f){return eval("("+f+")")};d._escapeString=function(f){return('"'+f.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};d.toJsonIndentStr="\t";d.toJson=function(f,a,b){if(f===undefined)return"undefined";var c=typeof f;if(c=="number"||c=="boolean")return f+"";if(f===null)return"null";if(d.isString(f))return d._escapeString(f);var e=
arguments.callee,g;b=b||"";var j=a?b+d.toJsonIndentStr:"";g=f.__json__||f.json;if(d.isFunction(g)){g=g.call(f);if(f!==g)return e(g,a,j)}if(f.nodeType&&f.cloneNode)throw new Error("Can't serialize DOM nodes");g=a?" ":"";var i=a?"\n":"";if(d.isArray(f))return"["+d.map(f,function(w){w=e(w,a,j);if(typeof w!="string")w="undefined";return i+j+w}).join(","+g)+i+b+"]";if(c=="function")return null;c=[];var k;for(k in f){var m,o;if(typeof k=="number")m='"'+k+'"';else if(typeof k=="string")m=d._escapeString(k);
else continue;o=e(f[k],a,j);typeof o=="string"&&c.push(i+j+m+":"+g+o)}return"{"+c.join(","+g)+i+b+"}"};return d});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(d){(function(){d.Color=function(f){f&&this.setColor(f)};d.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:d.config.transparentColor||[255,255,255]};d.extend(d.Color,
{r:255,g:255,b:255,a:1,_set:function(f,a,b,c){this.r=f;this.g=a;this.b=b;this.a=c},setColor:function(f){if(d.isString(f))d.colorFromString(f,this);else if(d.isArray(f))d.colorFromArray(f,this);else{this._set(f.r,f.g,f.b,f.a);f instanceof d.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"#"+d.map(["r","g","b"],function(f){f=this[f].toString(16);return f.length<
2?"0"+f:f},this).join("")},toCss:function(f){var a=this.r+", "+this.g+", "+this.b;return(f?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});d.blendColors=function(f,a,b,c){var e=c||new d.Color;d.forEach(["r","g","b","a"],function(g){e[g]=f[g]+(a[g]-f[g])*b;if(g!="a")e[g]=Math.round(e[g])});return e.sanitize()};d.colorFromRgb=function(f,a){return(f=f.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&d.colorFromArray(f[1].split(/\s*,\s*/),a)};d.colorFromHex=function(f,
a){var b=a||new d.Color,c=f.length==4?4:8,e=(1<<c)-1;f=Number("0x"+f.substr(1));if(isNaN(f))return null;d.forEach(["b","g","r"],function(g){var j=f&e;f>>=c;b[g]=c==4?17*j:j});b.a=1;return b};d.colorFromArray=function(f,a){a=a||new d.Color;a._set(Number(f[0]),Number(f[1]),Number(f[2]),Number(f[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};d.colorFromString=function(f,a){var b=d.Color.named[f];return b&&d.colorFromArray(b,a)||d.colorFromRgb(f,a)||d.colorFromHex(f,a)}})();return d.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(d){d.doc=window.document||null;d.body=function(){return d.doc.body||d.doc.getElementsByTagName("body")[0]};d.setContext=function(f,a){d.global=f;d.doc=a};d.withGlobal=function(f,a,b,c){var e=d.global;try{d.global=f;return d.withDoc.call(null,f.document,a,b,c)}finally{d.global=e}};d.withDoc=function(f,a,b,c){var e=d.doc,g=d._bodyLtr,j=d.isQuirks;try{d.doc=f;delete d._bodyLtr;d.isQuirks=d.doc.compatMode=="BackCompat";if(b&&typeof a=="string")a=
b[a];return a.apply(b,c||[])}finally{d.doc=e;delete d._bodyLtr;if(g!==undefined)d._bodyLtr=g;d.isQuirks=j}};return d});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(d){(function(){var f=d._event_listener={add:function(i,k,m){if(i){k=f._normalizeEventName(k);m=f._fixCallback(k,m);if(!d.isIE&&(k=="mouseenter"||k=="mouseleave")){var o=m;k=k=="mouseenter"?"mouseover":"mouseout";m=function(w){if(!d.isDescendant(w.relatedTarget,i))return o.call(this,w)}}i.addEventListener(k,m,false);return m}},remove:function(i,k,m){if(i){k=f._normalizeEventName(k);if(!d.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,f._fixEvent(m,this))}},_fixEvent:function(i){switch(i.type){case "keypress":f._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}};d.fixEvent=function(i,k){return f._fixEvent(i,k)};d.stopEvent=function(i){i.preventDefault();i.stopPropagation()};var a=d._listener;d._connect=function(i,k,m,o,w){w=i&&(i.nodeType||i.attachEvent||i.addEventListener)?w?2:1:0;m=[d._listener,f,a][w].add(i,k,d.hitch(m,o));return[i,k,m,w]};d._disconnect=function(i,k,m,o){[d._listener,f,a][o].remove(i,k,m)};d.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:d.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:d.isMac&&!d.isAIR?d.isSafari?91:224:17};var b=d.isMac?"metaKey":"ctrlKey";d.isCopyKey=function(i){return i[b]};d.mouseButtons=d.isIE<9||d.isIE&&d.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(d.isIE){var c=function(i,k){try{return i.keyCode=k}catch(m){return 0}},e=d._listener,g=d._ieListenersName="_"+d._scopeName+"_listeners";if(!d.config._allow_leaks){a=e=d._ie_listener={handlers:[],add:function(i,k,m){i=i||d.global;var o=i[k];if(!o||!o[g]){var w=d._getIeDispatcher();w.target=o&&j.push(o)-1;w[g]=[];o=i[k]=w}return o[g].push(j.push(m)-1)},remove:function(i,k,m){k=(i=(i||d.global)[k])&&i[g];if(i&&k&&
m--){delete j[k[m]];delete k[m]}}};var j=e.handlers}d.mixin(f,{add:function(i,k,m){if(i){k=f._normalizeEventName(k);if(k=="onkeypress"){var o=i.onkeydown;if(!o||!o[g]||!o._stealthKeydownHandle){var w=f.add(i,"onkeydown",f._stealthKeyDown);o=i.onkeydown;o._stealthKeydownHandle=w;o._stealthKeydownRefs=1}else o._stealthKeydownRefs++}return e.add(i,k,f._fixCallback(m))}},remove:function(i,k,m){k=f._normalizeEventName(k);e.remove(i,k,m);if(k=="onkeypress"){k=i.onkeydown;if(--k._stealthKeydownRefs<=0){e.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=d.isIE<6||k.compatMode=="BackCompat"?k.body:k.documentElement;var m=d._getIeDocumentElementOffset();
i.pageX=i.clientX+d._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(d.isIE<9||d.isQuirks){i.stopPropagation=f._stopPropagation;i.preventDefault=f._preventDefault}return f._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;f._setKeyChar(i);
break}return i},_stealthKeyDown:function(i){var k=i.currentTarget.onkeypress;if(k&&k[g]){var m=i.keyCode,o=(m!=13||d.isIE>=9&&!d.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=f._punctMap[o]||o;m=f._synthesizeEvent(i,{type:"keypress",faux:true,charCode:o});k.call(i.currentTarget,m);if(d.isIE<9||d.isIE&&d.isQuirks)i.cancelBubble=
m.cancelBubble;i.returnValue=m.returnValue;c(i,m.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&c(this,0);this.returnValue=false}});d.stopEvent=d.isIE<9||d.isQuirks?function(i){i=i||window.event;f._stopPropagation.call(i);f._preventDefault.call(i)}:d.stopEvent}f._synthesizeEvent=function(i,k){k=d.mixin({},i,k);f._setKeyChar(k);k.preventDefault=function(){i.preventDefault()};k.stopPropagation=function(){i.stopPropagation()};
return k};d.isOpera&&d.mixin(f,{_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 f._synthesizeEvent(i,{charCode:k})}return i}});if(d.isWebKit){f._add=f.add;f._remove=f.remove;d.mixin(f,{add:function(i,k,m){if(i){var o=f._add(i,k,m);if(f._normalizeEventName(k)=="keypress")o._stealthKeyDownHandle=f._add(i,"keydown",function(w){var s=w.keyCode,v=s!=13&&s!=32&&(s<48||s>90)&&(s<96||s>111)&&(s<186||
s>192)&&(s<219||s>222);if(v||w.ctrlKey){v=v?0:s;if(w.ctrlKey)if(s==3||s==13)return;else if(v>95&&v<106)v-=48;else if(!w.shiftKey&&v>=65&&v<=90)v+=32;else v=f._punctMap[v]||v;s=f._synthesizeEvent(w,{type:"keypress",faux:true,charCode:v});m.call(w.currentTarget,s)}});return o}},remove:function(i,k,m){if(i){m._stealthKeyDownHandle&&f._remove(i,"keydown",m._stealthKeyDownHandle);f._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 f._synthesizeEvent(i,
{charCode:k,faux:true})}return i}})}})();if(d.isIE){d._ieDispatcher=function(f,a){var b=Array.prototype,c=d._ie_listener.handlers,e=f.callee,g=e[d._ieListenersName];e=(e=c[e.target])&&e.apply(a,f);g=[].concat(g);for(var j in g){var i=c[g[j]];!(j in b)&&i&&i.apply(a,f)}return e};d._getIeDispatcher=function(){return new Function(d._scopeName+"._ieDispatcher(arguments, this)")};d._event_listener._fixCallback=function(f){var a=d._event_listener._fixEvent;return function(b){return f.call(this,a(b,this))}}}return d.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(d){try{document.execCommand("BackgroundImageCache",false,true)}catch(f){}d.byId=d.isIE?function(a,b){if(typeof a!="string")return a;var c=b||d.doc;if((b=c.getElementById(a))&&(b.attributes.id.value==a||b.id==a))return b;else{var e=c.all[a];if(!e||e.nodeName)e=[e];for(var g=0;b=e[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||d.doc).getElementById(a):
a)||null};(function(){var a=d.byId,b=null,c;d.addOnWindowUnload(function(){b=null});d._destroyElement=d.destroy=function(C){C=a(C);try{var F=C.ownerDocument;if(!b||c!=F){b=F.createElement("div");c=F}b.appendChild(C.parentNode?C.parentNode.removeChild(C):C);b.innerHTML=""}catch(J){}};d.isDescendant=function(C,F){try{C=a(C);for(F=a(F);C;){if(C==F)return true;C=C.parentNode}}catch(J){}return false};d.setSelectable=function(C,F){C=a(C);if(d.isMozilla)C.style.MozUserSelect=F?"":"none";else if(d.isKhtml||
d.isWebKit)C.style.KhtmlUserSelect=F?"auto":"none";else if(d.isIE){F=C.unselectable=F?"":"on";d.query("*",C).forEach("item.unselectable = '"+F+"'")}};var e=function(C,F){var J=F.parentNode;J&&J.insertBefore(C,F)},g=function(C,F){var J=F.parentNode;if(J)J.lastChild==F?J.appendChild(C):J.insertBefore(C,F.nextSibling)};d.place=function(C,F,J){F=a(F);if(typeof C=="string")C=/^\s*</.test(C)?d._toDom(C,F.ownerDocument):a(C);if(typeof J=="number"){var Q=F.childNodes;!Q.length||Q.length<=J?F.appendChild(C):
e(C,Q[J<0?0:J])}else switch(J){case "before":e(C,F);break;case "after":g(C,F);break;case "replace":F.parentNode.replaceChild(C,F);break;case "only":d.empty(F);F.appendChild(C);break;case "first":if(F.firstChild){e(C,F.firstChild);break}default:F.appendChild(C)}return C};d.boxModel="content-box";if(d.isIE)d.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var j;j=d.isWebKit?function(C){var F;if(C.nodeType==1){var J=C.ownerDocument.defaultView;F=J.getComputedStyle(C,null);if(!F&&
C.style){C.style.display="";F=J.getComputedStyle(C,null)}}return F||{}}:d.isIE?function(C){return C.nodeType==1?C.currentStyle:{}}:function(C){return C.nodeType==1?C.ownerDocument.defaultView.getComputedStyle(C,null):{}};d.getComputedStyle=j;d._toPixelValue=d.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 J=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=F;F=style.pixelLeft}catch(Q){F=0}style.left=
C;runtimeStyle.left=J}return F}:function(C,F){return parseFloat(F)||0};var i=d._toPixelValue,k=function(C,F){try{return C.filters.item("DXImageTransform.Microsoft.Alpha")}catch(J){return F?{}:null}};d._getOpacity=d.isIE<9?function(C){try{return k(C).Opacity/100}catch(F){return 1}}:function(C){return j(C).opacity};d._setOpacity=d.isIE<9?function(C,F){var J=F*100,Q=F==1;C.style.zoom=Q?"":1;if(k(C))k(C,1).Opacity=J;else{if(Q)return F;C.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
J+")"}k(C,1).Enabled=!Q;C.nodeName.toLowerCase()=="tr"&&d.query("> td",C).forEach(function(T){d._setOpacity(T,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/,w=function(C,F,J){F=F.toLowerCase();if(d.isIE){if(J=="auto"){if(F=="height")return C.offsetHeight;if(F=="width")return C.offsetWidth}if(F=="fontweight")switch(J){case 700:return"bold";case 400:default:return"normal"}}F in m||(m[F]=o.test(F));return m[F]?i(C,J):J},
s=d.isIE?"styleFloat":"cssFloat",v={cssFloat:s,styleFloat:s,"float":s};d.style=function(C,F,J){var Q=a(C),T=arguments.length,U=F=="opacity";F=v[F]||F;if(T==3)return U?d._setOpacity(Q,J):(Q.style[F]=J);if(T==2&&U)return d._getOpacity(Q);U=j(Q);if(T==2&&typeof F!="string"){for(var W in F)d.style(C,W,F[W]);return U}return T==1?U:w(Q,F,U[F]||Q.style[F])};d._getPadExtents=function(C,F){F=F||j(C);var J=i(C,F.paddingLeft),Q=i(C,F.paddingTop);return{l:J,t:Q,w:J+i(C,F.paddingRight),h:Q+i(C,F.paddingBottom)}};
d._getBorderExtents=function(C,F){F=F||j(C);var J=F.borderLeftStyle!="none"?i(C,F.borderLeftWidth):0,Q=F.borderTopStyle!="none"?i(C,F.borderTopWidth):0;return{l:J,t:Q,w:J+(F.borderRightStyle!="none"?i(C,F.borderRightWidth):0),h:Q+(F.borderBottomStyle!="none"?i(C,F.borderBottomWidth):0)}};d._getPadBorderExtents=function(C,F){var J=F||j(C);F=d._getPadExtents(C,J);C=d._getBorderExtents(C,J);return{l:F.l+C.l,t:F.t+C.t,w:F.w+C.w,h:F.h+C.h}};d._getMarginExtents=function(C,F){F=F||j(C);var J=i(C,F.marginLeft),
Q=i(C,F.marginTop),T=i(C,F.marginRight);C=i(C,F.marginBottom);if(d.isWebKit&&F.position!="absolute")T=J;return{l:J,t:Q,w:J+T,h:Q+C}};d._getMarginBox=function(C,F){var J=F||j(C);F=d._getMarginExtents(C,J);var Q=C.offsetLeft-F.l,T=C.offsetTop-F.t,U=C.parentNode;if(d.isMoz){var W=parseFloat(J.left);J=parseFloat(J.top);if(!isNaN(W)&&!isNaN(J)){Q=W;T=J}else if(U&&U.style){W=j(U);if(W.overflow!="visible"){U=d._getBorderExtents(U,W);Q+=U.l;T+=U.t}}}else if(d.isOpera||d.isIE>7&&!d.isQuirks)if(U){U=d._getBorderExtents(U);
Q-=U.l;T-=U.t}return{l:Q,t:T,w:C.offsetWidth+F.w,h:C.offsetHeight+F.h}};d._getMarginSize=function(C,F){C=a(C);F=d._getMarginExtents(C,F||j(C));C=C.getBoundingClientRect();return{w:C.right-C.left+F.w,h:C.bottom-C.top+F.h}};d._getContentBox=function(C,F){var J=F||j(C);F=d._getPadExtents(C,J);J=d._getBorderExtents(C,J);var Q=C.clientWidth;if(Q){C=C.clientHeight;J.w=J.h=0}else{Q=C.offsetWidth;C=C.offsetHeight}if(d.isOpera){F.l+=J.l;F.t+=J.t}return{l:F.l,t:F.t,w:Q-F.w-J.w,h:C-F.h-J.h}};d._getBorderBox=
function(C,F){var J=F||j(C);F=d._getPadExtents(C,J);C=d._getContentBox(C,J);return{l:C.l-F.l,t:C.t-F.t,w:C.w+F.w,h:C.h+F.h}};d._setBox=function(C,F,J,Q,T,U){U=U||"px";C=C.style;if(!isNaN(F))C.left=F+U;if(!isNaN(J))C.top=J+U;if(Q>=0)C.width=Q+U;if(T>=0)C.height=T+U};d._isButtonTag=function(C){return C.tagName=="BUTTON"||C.tagName=="INPUT"&&(C.getAttribute("type")||"").toUpperCase()=="BUTTON"};d._usesBorderBox=function(C){var F=C.tagName;return d.boxModel=="border-box"||F=="TABLE"||d._isButtonTag(C)};
d._setContentSize=function(C,F,J,Q){if(d._usesBorderBox(C)){Q=d._getPadBorderExtents(C,Q);if(F>=0)F+=Q.w;if(J>=0)J+=Q.h}d._setBox(C,NaN,NaN,F,J)};d._setMarginBox=function(C,F,J,Q,T,U){var W=U||j(C);U=d._usesBorderBox(C)?u:d._getPadBorderExtents(C,W);if(d.isWebKit)if(d._isButtonTag(C)){var aa=C.style;if(Q>=0&&!aa.width)aa.width="4px";if(T>=0&&!aa.height)aa.height="4px"}W=d._getMarginExtents(C,W);if(Q>=0)Q=Math.max(Q-U.w-W.w,0);if(T>=0)T=Math.max(T-U.h-W.h,0);d._setBox(C,F,J,Q,T)};var u={l:0,t:0,w:0,
h:0};d.marginBox=function(C,F){C=a(C);var J=j(C);return!F?d._getMarginBox(C,J):d._setMarginBox(C,F.l,F.t,F.w,F.h,J)};d.contentBox=function(C,F){C=a(C);var J=j(C);return!F?d._getContentBox(C,J):d._setContentSize(C,F.w,F.h,J)};d._docScroll=function(){var C=d.global;return"pageXOffset"in C?{x:C.pageXOffset,y:C.pageYOffset}:(C=d.isQuirks?d.doc.body:d.doc.documentElement,{x:d._fixIeBiDiScrollLeft(C.scrollLeft||0),y:C.scrollTop||0})};d._isBodyLtr=function(){return"_bodyLtr"in d?d._bodyLtr:(d._bodyLtr=(d.body().dir||
d.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};d._getIeDocumentElementOffset=function(){var C=d.doc.documentElement;if(d.isIE<8){var F=C.getBoundingClientRect(),J=F.left;F=F.top;if(d.isIE<7){J+=C.clientLeft;F+=C.clientTop}return{x:J<0?0:J,y:F<0?0:F}}else return{x:0,y:0}};d._fixIeBiDiScrollLeft=function(C){var F=d.isIE;if(F&&!d._isBodyLtr()){var J=d.isQuirks,Q=J?d.doc.body:d.doc.documentElement;if(F==6&&!J&&d.global.frameElement&&Q.scrollHeight>Q.clientHeight)C+=Q.clientLeft;return F<8||
J?C+Q.clientWidth-Q.scrollWidth:-C}return C};d._abs=d.position=function(C,F){C=a(C);var J=d.body(),Q=J.parentNode;C=C.getBoundingClientRect();C={x:C.left,y:C.top,w:C.right-C.left,h:C.bottom-C.top};if(d.isIE){Q=d._getIeDocumentElementOffset();C.x-=Q.x+(d.isQuirks?J.clientLeft+J.offsetLeft:0);C.y-=Q.y+(d.isQuirks?J.clientTop+J.offsetTop:0)}else if(d.isFF==3){J=j(Q);C.x-=i(Q,J.marginLeft)+i(Q,J.borderLeftWidth);C.y-=i(Q,J.marginTop)+i(Q,J.borderTopWidth)}if(F){F=d._docScroll();C.x+=F.x;C.y+=F.y}return C};
d.coords=function(C,F){C=a(C);var J=j(C);J=d._getMarginBox(C,J);F=d.position(C,F);J.x=F.x;J.y=F.y;return J};var t={"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:d.isIE,value:1},B=function(C){return q[C.toLowerCase()]||C},D=function(C,F){return(C=C.getAttributeNode&&C.getAttributeNode(F))&&
C.specified};d.hasAttr=function(C,F){var J=F.toLowerCase();return x[t[J]||F]||D(a(C),q[J]||F)};var h={},l=0,n=d._scopeName+"attrid",p={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};d.attr=function(C,F,J){C=a(C);var Q=arguments.length;if(Q==2&&typeof F!="string"){for(var T in F)d.attr(C,T,F[T]);return C}var U=F.toLowerCase();T=t[U]||F;var W=x[T];U=q[U]||F;if(Q==3){if(T=="style"&&typeof J!="string")d.style(C,J);else if(T=="innerHTML")if(d.isIE&&C.tagName.toLowerCase()in p){d.empty(C);
C.appendChild(d._toDom(J,C.ownerDocument))}else C[T]=J;else if(d.isFunction(J)){Q=d.attr(C,n);if(!Q){Q=l++;d.attr(C,n,Q)}h[Q]||(h[Q]={});if(W=h[Q][T])d.disconnect(W);else try{delete C[T]}catch(aa){}h[Q][T]=d.connect(C,T,J)}else if(W||typeof J=="boolean")C[T]=J;else C.setAttribute(U,J);return C}J=C[T];if(W&&typeof J!="undefined")return J;if(T!="href"&&(typeof J=="boolean"||d.isFunction(J)))return J;return D(C,U)?C.getAttribute(U):null};d.removeAttr=function(C,F){a(C).removeAttribute(B(F))};d.getNodeProp=
function(C,F){C=a(C);var J=F.toLowerCase(),Q=t[J]||F;if(Q in C&&Q!="href")return C[Q];F=q[J]||F;return D(C,F)?C.getAttribute(F):null};d.create=function(C,F,J,Q){var T=d.doc;if(J){J=a(J);T=J.ownerDocument}if(typeof C=="string")C=T.createElement(C);F&&d.attr(C,F);J&&d.place(C,J,Q);return C};d.empty=d.isIE?function(C){C=a(C);for(var F;F=C.lastChild;)d.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\:]+)/,A={},z=0,E="__"+d._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("></")+">"}d._toDom=function(C,F){F=F||d.doc;var J=F[E];if(!J){F[E]=J=++z+"";A[J]=F.createElement("div")}C+="";var Q=C.match(y),T=Q?Q[1].toLowerCase():"";J=A[J];if(Q&&r[T]){Q=
r[T];J.innerHTML=Q.pre+C+Q.post;for(C=Q.length;C;--C)J=J.firstChild}else J.innerHTML=C;if(J.childNodes.length==1)return J.removeChild(J.firstChild);for(C=F.createDocumentFragment();F=J.firstChild;)C.appendChild(F);return C};var H="className";d.hasClass=function(C,F){return(" "+a(C)[H]+" ").indexOf(" "+F+" ")>=0};var N=/\s+/,L=[""],P={},S=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||""};d.addClass=function(C,F){C=a(C);
F=S(F);var J=C[H],Q;J=J?" "+J+" ":" ";Q=J.length;for(var T=0,U=F.length,W;T<U;++T)if((W=F[T])&&J.indexOf(" "+W+" ")<0)J+=W+" ";if(Q<J.length)C[H]=J.substr(1,J.length-2)};d.removeClass=function(C,F){C=a(C);var J;if(F!==undefined){F=S(F);J=" "+C[H]+" ";for(var Q=0,T=F.length;Q<T;++Q)J=J.replace(" "+F[Q]+" "," ");J=d.trim(J)}else J="";if(C[H]!=J)C[H]=J};d.replaceClass=function(C,F,J){C=a(C);P.className=C.className;d.removeClass(P,J);d.addClass(P,F);if(C.className!==P.className)C.className=P.className};
d.toggleClass=function(C,F,J){if(J===undefined)J=!d.hasClass(C,F);d[J?"addClass":"removeClass"](C,F)}})();return d});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(d){(function(){var f=Array.prototype,a=f.slice,b=f.concat,c=function(s,v,u){s.sort||(s=a.call(s,0));u=u||this._NodeListCtor||d._NodeListCtor;s.constructor=u;d._mixin(s,u.prototype);s._NodeListCtor=u;return v?s._stash(v):s},e=function(s,v,u){v=[0].concat(a.call(v,0));u=u||d.global;return function(t){v[0]=t;return s.apply(u,v)}},g=function(s,v){return function(){this.forEach(e(s,
arguments,v));return this}},j=function(s,v){return function(){return this.map(e(s,arguments,v))}},i=function(s,v,u){return function(){var t=arguments,q=e(s,t,u);if(v.call(u||d.global,t))return this.map(q);this.forEach(q);return this}},k=function(s){return s.length==1&&typeof s[0]=="string"},m=function(s){var v=s.parentNode;v&&v.removeChild(s)};d.NodeList=function(){return c(Array.apply(null,arguments))};var o=d._NodeListCtor=d.NodeList,w=o.prototype;o._wrap=w._wrap=c;o._adaptAsMap=j;o._adaptAsForEach=
g;o._adaptAsFilter=function(s,v){return function(){return this.filter(e(s,arguments,v))}};o._adaptWithCondition=i;d.forEach(["slice","splice"],function(s){var v=f[s];w[s]=function(){return this._wrap(v.apply(this,arguments),s=="slice"?this:null)}});d.forEach(["indexOf","lastIndexOf","every","some"],function(s){var v=d[s];w[s]=function(){return v.apply(d,[this].concat(a.call(arguments,0)))}});d.forEach(["attr","style"],function(s){w[s]=i(d[s],k)});d.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(s){w[s]=g(d[s])});d.extend(d.NodeList,{_normalize:function(s,v){var u=s.parse===true?true:false;if(typeof s.template=="string"){var t=s.templateFunc||d.string&&d.string.substitute;s=t?t(s.template,s):s}t=typeof s;if(t=="string"||t=="number"){s=d._toDom(s,v&&v.ownerDocument);s=s.nodeType==11?d._toArray(s.childNodes):[s]}else if(d.isArrayLike(s))d.isArray(s)||(s=d._toArray(s));else s=[s];if(u)s._runParse=true;return s},_cloneNode:function(s){return s.cloneNode(true)},
_place:function(s,v,u,t){if(!(v.nodeType!=1&&u=="only")){v=v;for(var q,x=s.length,B=x-1;B>=0;B--){var D=t?this._cloneNode(s[B]):s[B];if(s._runParse&&d.parser&&d.parser.parse){q||(q=v.ownerDocument.createElement("div"));q.appendChild(D);d.parser.parse(q);for(D=q.firstChild;q.firstChild;)q.removeChild(q.firstChild)}B==x-1?d.place(D,v,u):v.parentNode.insertBefore(D,v);v=D}}},_stash:function(s){this._parent=s;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var s=
d.isArray(this)?this:a.call(this,0),v=d.map(arguments,function(u){return u&&!d.isArray(u)&&(typeof NodeList!="undefined"&&u.constructor===NodeList||u.constructor===this._NodeListCtor)?a.call(u,0):u});return this._wrap(b.apply(s,v),this)},map:function(s,v){return this._wrap(d.map(this,s,v),this)},forEach:function(s,v){d.forEach(this,s,v);return this},coords:j(d.coords),position:j(d.position),place:function(s,v){var u=d.query(s)[0];return this.forEach(function(t){d.place(t,u,v)})},orphan:function(s){return(s?
d._filterQueryResult(this,s):this).forEach(m)},adopt:function(s,v){return d.query(s).place(this[0],v)._stash(this)},query:function(s){if(!s)return this;var v=this.map(function(u){return d.query(s,u).filter(function(t){return t!==undefined})});return this._wrap(b.apply([],v),this)},filter:function(s){var v=arguments,u=this,t=0;if(typeof s=="string"){u=d._filterQueryResult(this,v[0]);if(v.length==1)return u._stash(this);t=1}return this._wrap(d.filter(u,v[t],v[t+1]),this)},addContent:function(s,v){s=
this._normalize(s,this[0]);for(var u=0,t;t=this[u];u++)this._place(s,t,v,u>0);return this},instantiate:function(s,v){var u=d.isFunction(s)?s:d.getObject(s);v=v||{};return this.forEach(function(t){new u(v,t)})},at:function(){var s=new this._NodeListCtor;d.forEach(arguments,function(v){if(v<0)v=this.length+v;this[v]&&s.push(this[v])},this);return s._stash(this)}});o.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];d.forEach(o.events,function(s){var v="on"+s;w[v]=function(u,t){return this.connect(v,u,t)}})})();return d.NodeList});
(function(){var d=function(a){var b=a.trim,c=a.forEach,e=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(K){K+=">~+".indexOf(K.slice(-1))>=0?" * ":" ";for(var I=function(oa,pa){return b(K.slice(oa,pa))},O=[],R=-1,V=-1,X=-1,$=-1,Y=-1,ba=-1,ha=-1,ja="",ia="",ma,ga=0,qa=K.length,ea=null,ka=null,ra=function(){if(ha>=0){var oa=ha==ga?null:I(ha,ga);
ea[">~+".indexOf(oa)<0?"tag":"oper"]=oa;ha=-1}},sa=function(){if(ba>=0){ea.id=I(ba,ga).replace(/\\/g,"");ba=-1}},ta=function(){if(Y>=0){ea.classes.push(I(Y+1,ga).replace(/\\/g,""));Y=-1}},na=function(){sa();ra();ta()},ua=function(){na();$>=0&&ea.pseudos.push({name:I($+1,ga)});ea.loops=ea.pseudos.length||ea.attrs.length||ea.classes.length;ea.oquery=ea.query=I(ma,ga);ea.otag=ea.tag=ea.oper?null:ea.tag||"*";if(ea.tag)ea.tag=ea.tag.toUpperCase();if(O.length&&O[O.length-1].oper){ea.infixOper=O.pop();ea.query=
ea.infixOper.query+" "+ea.query}O.push(ea);ea=null};ja=ia,ia=K.charAt(ga),ga<qa;ga++)if(ja!="\\"){if(!ea){ma=ga;ea={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return k?this.otag:this.tag}};ha=ga}if(R>=0)if(ia=="]"){if(ka.attr)ka.matchFor=I(X||R+1,ga);else ka.attr=I(R+1,ga);if(R=ka.matchFor)if(R.charAt(0)=='"'||R.charAt(0)=="'")ka.matchFor=R.slice(1,-1);ea.attrs.push(ka);ka=null;R=X=-1}else{if(ia=="="){X="|~^$*".indexOf(ja)>=0?ja:"";ka.type=X+ia;ka.attr=
I(R+1,ga-X.length);X=ga+1}}else if(V>=0){if(ia==")"){if($>=0)ka.value=I(V+1,ga);$=V=-1}}else if(ia=="#"){na();ba=ga+1}else if(ia=="."){na();Y=ga}else if(ia==":"){na();$=ga}else if(ia=="["){na();R=ga;ka={}}else if(ia=="("){if($>=0){ka={name:I($+1,ga),value:null};ea.pseudos.push(ka)}V=ga}else ia==" "&&ja!=ia&&ua()}return O},w=function(K,I){if(!K)return I;if(!I)return K;return function(){return K.apply(window,arguments)&&I.apply(window,arguments)}},s=function(K,I){I=I||[];K&&I.push(K);return I},v=function(K){return 1==
K.nodeType},u=function(K,I){if(!K)return"";if(I=="class")return K.className||"";if(I=="for")return K.htmlFor||"";if(I=="style")return K.style.cssText||"";return(k?K.getAttribute(I):K.getAttribute(I,2))||""},t={"*=":function(K,I){return function(O){return u(O,K).indexOf(I)>=0}},"^=":function(K,I){return function(O){return u(O,K).indexOf(I)==0}},"$=":function(K,I){return function(O){O=" "+u(O,K);return O.lastIndexOf(I)==O.length-I.length}},"~=":function(K,I){var O=" "+I+" ";return function(R){return(" "+
u(R,K)+" ").indexOf(O)>=0}},"|=":function(K,I){var O=" "+I+"-";return function(R){R=" "+u(R,K);return R==I||R.indexOf(O)==0}},"=":function(K,I){return function(O){return u(O,K)==I}}},q=typeof g().firstChild.nextElementSibling=="undefined",x=!q?"nextElementSibling":"nextSibling",B=!q?"previousElementSibling":"previousSibling",D=q?v:m,h=function(K){for(;K=K[B];)if(D(K))return false;return true},l=function(K){for(;K=K[x];)if(D(K))return false;return true},n=function(K){var I=K.parentNode,O=0,R=I[i],
V=K._i||-1,X=I._l||-1;if(!R)return-1;R=R.length;if(X==R&&V>=0&&X>=0)return V;I._l=R;V=-1;for(I=I.firstElementChild||I.firstChild;I;I=I[x])if(D(I)){I._i=++O;if(K===I)V=O}return V},p=function(K){return!(n(K)%2)},r=function(K){return n(K)%2},y={checked:function(){return function(K){return!!("checked"in K?K.checked:K.selected)}},"first-child":function(){return h},"last-child":function(){return l},"only-child":function(){return function(K){if(!h(K))return false;if(!l(K))return false;return true}},empty:function(){return function(K){var I=
K.childNodes;for(K=K.childNodes.length-1;K>=0;K--){var O=I[K].nodeType;if(O===1||O==3)return false}return true}},contains:function(K,I){K=I.charAt(0);if(K=='"'||K=="'")I=I.slice(1,-1);return function(O){return O.innerHTML.indexOf(I)>=0}},not:function(K,I){K=o(I)[0];I={el:1};if(K.tag!="*")I.tag=1;if(!K.classes.length)I.classes=1;var O=z(K,I);return function(R){return!O(R)}},"nth-child":function(K,I){K=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:K(I[0]):1,R=I[1]?K(I[1]):0,V=0,X=-1;if(O>0)if(R<0)R=R%O&&O+R%O;else{if(R>0){if(R>=O)V=R-R%O;R%=O}}else if(O<0){O*=-1;if(R>0){X=R;R%=O}}if(O>0)return function(Y){Y=n(Y);return Y>=V&&(X<0||Y<=X)&&Y%O==R};else I=R}var $=K(I);return function(Y){return n(Y)==$}}},A=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(K){var I=K.toLowerCase();if(I=="class")K="className";return function(O){return k?O.getAttribute(K):O[K]||O[I]}}:function(K){return function(I){return I&&I.getAttribute&&I.hasAttribute(K)}},
z=function(K,I){if(!K)return m;I=I||{};var O=null;"el"in I||(O=w(O,v));if(!("tag"in I))if(K.tag!="*")O=w(O,function(R){return R&&R.tagName==K.getTag()});"classes"in I||c(K.classes,function(R,V){var X=new RegExp("(?:^|\\s)"+R+"(?:\\s|$)");O=w(O,function($){return X.test($.className)});O.count=V});"pseudos"in I||c(K.pseudos,function(R){var V=R.name;if(y[V])O=w(O,y[V](V,R.value))});"attrs"in I||c(K.attrs,function(R){var V,X=R.attr;if(R.type&&t[R.type])V=t[R.type](X,R.matchFor);else if(X.length)V=A(X);
if(V)O=w(O,V)});if(!("id"in I))if(K.id)O=w(O,function(R){return!!R&&R.id==K.id});O||"default"in I||(O=m);return O},E=function(K){return function(I,O,R){for(;I=I[x];)if(!(q&&!v(I))){if((!R||da(I,R))&&K(I))O.push(I);break}return O}},G=function(K){return function(I,O,R){for(I=I[x];I;){if(D(I)){if(R&&!da(I,R))break;K(I)&&O.push(I)}I=I[x]}return O}},M=function(K){K=K||m;return function(I,O,R){for(var V=0,X=I[i];I=X[V++];)if(D(I)&&(!R||da(I,R))&&K(I,V))O.push(I);return O}},H=function(K,I){for(K=K.parentNode;K;){if(K==
I)break;K=K.parentNode}return!!K},N={},L=function(K){var I=N[K.query];if(I)return I;var O=K.infixOper;O=O?O.oper:"";var R=z(K,{el:1}),V="*"==K.tag,X=g().getElementsByClassName;if(O){X={el:1};if(V)X.tag=1;R=z(K,X);if("+"==O)I=E(R);else if("~"==O)I=G(R);else if(">"==O)I=M(R)}else if(K.id){R=!K.loops&&V?m:z(K,{el:1,id:1});I=function(Y,ba){var ha=a.byId(K.id,Y.ownerDocument||Y);if(ha&&R(ha))if(9==Y.nodeType)return s(ha,ba);else if(H(ha,Y))return s(ha,ba)}}else if(X&&/\{\s*\[native code\]\s*\}/.test(String(X))&&
K.classes.length&&!j){R=z(K,{el:1,classes:1,id:1});var $=K.classes.join(" ");I=function(Y,ba,ha){ba=s(0,ba);for(var ja,ia=0,ma=Y.getElementsByClassName($);ja=ma[ia++];)R(ja,Y)&&da(ja,ha)&&ba.push(ja);return ba}}else if(!V&&!K.loops)I=function(Y,ba,ha){ba=s(0,ba);for(var ja=0,ia=Y.getElementsByTagName(K.getTag());Y=ia[ja++];)da(Y,ha)&&ba.push(Y);return ba};else{R=z(K,{el:1,tag:1,id:1});I=function(Y,ba,ha){ba=s(0,ba);for(var ja,ia=0,ma=Y.getElementsByTagName(K.getTag());ja=ma[ia++];)R(ja,Y)&&da(ja,
ha)&&ba.push(ja);return ba}}return N[K.query]=I},P=function(K,I){K=s(K);for(var O,R,V=I.length,X,$,Y=0;Y<V;Y++){$=[];O=I[Y];R=K.length-1;if(R>0){X={};$.nozip=true}R=L(O);for(var ba=0;O=K[ba];ba++)R(O,$,X);if(!$.length)break;K=$}return $},S={},C={},F=function(K){var I=o(b(K));if(I.length==1){var O=L(I[0]);return function(R){if(R=O(R,new e))R.nozip=true;return R}}return function(R){return P(R,I)}},J=navigator.userAgent;J=a.isWebKit&&J.indexOf("WebKit/")>0&&parseFloat(J.split("WebKit/")[1])>528;var Q=
a.isIE?"commentStrip":"nozip",T=!!g().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||J),U=/n\+\d|([^ ])?([>~+])([^ =])?/g,W=function(K,I,O,R){return O?(I?I+" ":"")+O+(R?" "+R:""):K},aa=function(K,I){K=K.replace(U,W);if(T){var O=C[K];if(O&&!I)return O}if(O=S[K])return O;O=K.charAt(0);var R=-1==K.indexOf(" ");if(K.indexOf("#")>=0&&R)I=true;if(T&&!I&&">~+".indexOf(O)==-1&&(!a.isIE||K.indexOf(":")==-1)&&!(j&&K.indexOf(".")>=0)&&K.indexOf(":contains")==-1&&K.indexOf(":checked")==-1&&K.indexOf("|=")==
-1){var V=">~+".indexOf(K.charAt(K.length-1))>=0?K+" *":K;return C[K]=function($){try{if(!(9==$.nodeType||R))throw"";var Y=$.querySelectorAll(V);Y[Q]=true;return Y}catch(ba){return aa(K,true)($)}}}else{var X=K.split(/\s*,\s*/);return S[K]=X.length<2?F(K):function($){for(var Y=0,ba=[],ha;ha=X[Y++];)ba=ba.concat(F(ha)($));return ba}}},Z=0,ca=a.isIE?function(K){return k?K.getAttribute("_uid")||K.setAttribute("_uid",++Z)||Z:K.uniqueID}:function(K){return K._uid||(K._uid=++Z)},da=function(K,I){if(!I)return 1;
K=ca(K);if(!I[K])return I[K]=1;return 0},fa="_zipIdx",la=function(K){if(K&&K.nozip)return e._wrap?e._wrap(K):K;var I=new e;if(!K||!K.length)return I;K[0]&&I.push(K[0]);if(K.length<2)return I;Z++;if(a.isIE&&k){var O=Z+"";K[0].setAttribute(fa,O);for(var R=1,V;V=K[R];R++){K[R].getAttribute(fa)!=O&&I.push(V);V.setAttribute(fa,O)}}else if(a.isIE&&K.commentStrip)try{for(R=1;V=K[R];R++)v(V)&&I.push(V)}catch(X){}else{if(K[0])K[0][fa]=Z;for(R=1;V=K[R];R++){K[R][fa]!=Z&&I.push(V);V[fa]=Z}}return I};a.query=
function(K,I){e=a._NodeListCtor;if(!K)return new e;if(K.constructor==e)return K;if(typeof K!="string")return new e(K);if(typeof I=="string"){I=a.byId(I);if(!I)return new e}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((K=aa(K)(I))&&K.nozip&&!e._wrap)return K;return la(K)};a.query.pseudos=y;a._filterQueryResult=function(K,I,O){var R=
new a._NodeListCtor,V=o(I);V=V.length==1&&!/[^\w#\.]/.test(I)?z(V[0]):function(Y){return dojo.query(I,O).indexOf(Y)!=-1};for(var X=0,$;$=K[X];X++)V($)&&R.push($);return R}},f=function(){acme={trim:function(e){e=e.replace(/^\s+/,"");for(var g=e.length-1;g>=0;g--)if(/\S/.test(e.charAt(g))){e=e.substring(0,g+1);break}return e},forEach:function(e,g,j){if(e&&e.length)for(var i=0,k=e.length;i<k;++i)g.call(j||window,e[i],i,e)},byId:function(e,g){return typeof e=="string"?(g||document).getElementById(e):
e},doc:document,NodeList:Array};var a=navigator,b=a.userAgent;a=a.appVersion;var c=parseFloat(a);acme.isOpera=b.indexOf("Opera")>=0?c:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?c: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(e){return e};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){d(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");d(this.queryPortability||this.acme||dojo)}else d(this.queryPortability||
this.acme||f())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(d){(function(){function f(q,x,B){if(B!==null){var D=q[x];if(typeof D=="string")q[x]=[D,B];else if(a.isArray(D))D.push(B);else q[x]=B}}var a=d,b=a.config;d.fieldToObject=function(q){var x=null;if(q=a.byId(q)){var B=q.name,D=(q.type||"").toLowerCase();if(B&&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};d.formToObject=function(q){var x={};a.forEach(d.byId(q).elements,function(B){var D=B.name,h=(B.type||"").toLowerCase();if(D&&h&&"file|submit|image|reset|button|".indexOf(h)==-1&&!B.disabled){f(x,D,a.fieldToObject(B));if(h=="image")x[D+".x"]=x[D+".y"]=x[D].x=x[D].y=0}});return x};d.objectToQuery=function(q){var x=encodeURIComponent,B=[],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++)B.push(n+x(l[p]));
else B.push(n+x(l))}}return B.join("&")};d.formToQuery=function(q){return a.objectToQuery(a.formToObject(q))};d.formToJson=function(q,x){return a.toJson(a.formToObject(q),x)};d.queryToObject=function(q){var x={};q=q.split("&");var B=decodeURIComponent;a.forEach(q,function(D){if(D.length){var h=D.split("=");D=B(h.shift());h=B(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};d._blockAsync=false;var c=a._contentHandlers=d.contentHandlers={text:function(q){return q.responseText},
json:function(q){return a.fromJson(q.responseText||null)},"json-comment-filtered":function(q){d.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("/*"),B=q.lastIndexOf("*/");if(x==-1||B==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(q.substring(x+2,B))},javascript:function(q){return a.eval(q.responseText)},xml:function(q){var x=q.responseXML;if(a.isIE&&(!x||!x.documentElement)){var B=function(D){return"MSXML"+D+".DOMDocument"};B=["Microsoft.XMLDOM",B(6),B(4),B(3),B(2)];a.some(B,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)?c["json-comment-filtered"](q):
c.json(q)}};d._ioSetArgs=function(q,x,B,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(B,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 A=q.handle;A&&a.isFunction(A)&&p.addBoth(function(z){return A.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 e=function(q){q.canceled=true;var x=q.ioArgs.xhr,B=typeof x.abort;
if(B=="function"||B=="object"||B=="unknown")x.abort();q=q.ioArgs.error;if(!q){q=new Error("xhr cancelled");q.dojoType="cancel"}return q},g=function(q){q=c[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")}},w=function(){var q=(new Date).getTime();if(!a._blockAsync)for(var x=0,B;x<k.length&&
(B=k[x]);x++){var D=B.dfd,h=function(){if(!D||D.canceled||!B.validCheck(D)){k.splice(x--,1);m-=1}else if(B.ioCheck(D)){k.splice(x--,1);B.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(d.config.debugAtAllCosts)h.call(this);else try{h.call(this)}catch(l){D.errback(l)}}o(D);if(!k.length){clearInterval(i);i=null}};d._ioCancelAll=function(){try{a.forEach(k,function(x){try{x.dfd.cancel()}catch(B){}})}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,B,D){var h=q.ioArgs.args;if(h.timeout)q.startTime=(new Date).getTime();k.push({dfd:q,validCheck:x,ioCheck:B,resHandle:D});i||(i=setInterval(w,50));h.sync&&w()};var s="application/x-www-form-urlencoded",v=function(q){return q.ioArgs.xhr.readyState},u=function(q){return 4==q.ioArgs.xhr.readyState},
t=function(q){var x=q.ioArgs.xhr;if(a._isDocumentOk(x))q.callback(q);else{var B=new Error("Unable to load "+q.ioArgs.url+" status:"+x.status);B.status=x.status;B.responseText=x.responseText;q.errback(B)}};d._ioAddQueryToUrl=function(q){if(q.query.length){q.url+=(q.url.indexOf("?")==-1?"?":"&")+q.query;q.query=null}};d.xhr=function(q,x,B){var D=a._ioSetArgs(x,e,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&&!B||"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||s);if(!x.headers||!("X-Requested-With"in x.headers))l.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(D);if(d.config.debugAtAllCosts)l.send(h.query);else try{l.send(h.query)}catch(p){h.error=p;D.cancel()}a._ioWatch(D,v,u,t);return D};d.xhrGet=function(q){return a.xhr("GET",q)};d.rawXhrPost=d.xhrPost=function(q){return a.xhr("POST",q,true)};d.rawXhrPut=d.xhrPut=function(q){return a.xhr("PUT",q,true)};d.xhrDelete=function(q){return a.xhr("DELETE",q)}})();return d.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(d){(function(){var f=d._mixin;d._Line=function(j,i){this.start=j;this.end=i};d._Line.prototype.getValue=function(j){return(this.end-this.start)*j+this.start};d.Animation=function(j){f(this,j);if(d.isArray(this.curve))this.curve=new d._Line(this.curve[0],this.curve[1])};d._Animation=d.Animation;d.extend(d.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(d.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=d.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,c={run:function(){}};d.extend(d.Animation,{_startTimer:function(){if(!this._timer){this._timer=d.connect(c,"run",this,"_cycle");a++}b||(b=setInterval(d.hitch(c,"run"),this.rate))},_stopTimer:function(){if(this._timer){d.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(b);b=null;a=0}}});var e=d.isIE?function(j){var i=j.style;if(!i.width.length&&d.style(j,"width")=="auto")i.width="auto"}:function(){};d._fade=function(j){j.node=d.byId(j.node);
var i=f({properties:{}},j);j=i.properties.opacity={};j.start=!("start"in i)?function(){return+d.style(i.node,"opacity")||0}:i.start;j.end=i.end;j=d.animateProperty(i);d.connect(j,"beforeBegin",d.partial(e,i.node));return j};d.fadeIn=function(j){return d._fade(f({end:1},j))};d.fadeOut=function(j){return d._fade(f({end:0},j))};d._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 d.Color)k.tempColor=
new d.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 d.Color)i[k]=d.blendColors(o,m.end,j,m.tempColor).toCss();else d.isArray(o)||(i[k]=(m.end-o)*j+o+(k!="opacity"?m.units||"px":0))}return i};d.animateProperty=function(j){var i=j.node=d.byId(j.node);if(!j.easing)j.easing=d._defaultEasing;j=new d.Animation(j);d.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(d.isFunction(o))o=o(i);o=k[m]=f({},d.isObject(o)?o:{end:o});if(d.isFunction(o.start))o.start=o.start(i);if(d.isFunction(o.end))o.end=o.end(i);var w=m.toLowerCase().indexOf("color")>=0,s=function(v,u){var t={height:v.offsetHeight,width:v.offsetWidth}[u];if(t!==undefined)return t;t=d.style(v,u);return u=="opacity"?+t:w?t:parseFloat(t)};if("end"in o){if(!("start"in o))o.start=s(i,m)}else o.end=s(i,m);if(w){o.start=new d.Color(o.start);o.end=new d.Color(o.end)}else o.start=
m=="opacity"?+o.start:parseFloat(o.start)}this.curve=new g(k)});d.connect(j,"onAnimate",d.hitch(d,"style",j.node));return j};d.anim=function(j,i,k,m,o,w){return d.animateProperty({node:j,duration:k||d.Animation.prototype.duration,properties:i,easing:m,onEnd:o}).play(w||0)}})();return d.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(d){return d});
define("orion/serviceregistry",["dojo"],function(d){function f(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 d.Deferred;try{var w=j[m].apply(j,Array.prototype.slice.call(arguments));d.when(w,d.hitch(o,o.resolve),d.hitch(o,
o.reject),d.hitch(o,o.progress))}catch(s){o.reject(s)}return o}throw new Error("Service was unregistered");}}(k)}function c(){this._namedlisteners={}}function e(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new c;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)}}}f.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]}};f.prototype.constructor=f;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;c.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}}};c.prototype.constructor=c;e.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 f(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 c});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)}};e.prototype.constructor=e;return{ServiceReference:f,ServiceRegistration:a,Service:b,EventTarget:c,ServiceRegistry:e}});define("dijit",["dojo"],function(d){return dijit=d._dijit||{}});
define("orion/commonHTMLFragments",["require"],function(d){var f='<div id="staticBanner" class="layoutBlock topRowBanner"><a id="home" class="layoutLeft logo" href="'+d.toUrl("index.html")+'"><img src="'+d.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>';
d='<div class="layoutLeft pageActions" id="pageActions"></div><div class="layoutLeft pageActions" id="selectionTools"></div><img class="layoutRight progressPane" src="'+d.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:f,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:d}});
define("dojo/hash",["dojo"],function(d){(function(){function f(o,w){w=o.indexOf(w);return w>=0?o.substring(w+1):""}function a(){return f(location.href,"#")}function b(){d.publish("/dojo/hashchange",[a()])}function c(){if(a()!==j){j=a();b()}}function e(o){if(i)if(i.isTransitioning())setTimeout(d.hitch(null,e,o),m);else{var w=i.iframe.location.href,s=w.indexOf("?");i.iframe.location.replace(w.substring(0,s)+"?"+o)}else{location.replace("#"+o);!k&&c()}}function g(){function o(){j=a();v=x?j:f(B.href,
"?");u=false;t=null}var w=document.createElement("iframe"),s=d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html");d.config.useXDomain&&!d.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");w.id="dojo-hash-iframe";w.src=s+"?"+a();w.style.display="none";document.body.appendChild(w);this.iframe=d.global["dojo-hash-iframe"];
var v,u,t,q,x,B=this.iframe.location;this.isTransitioning=function(){return u};this.pollLocation=function(){if(!x)try{var D=f(B.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===t){o();b()}else{setTimeout(d.hitch(this,this.pollLocation),0);return}else if(!(j===l&&(x||v===D)))if(j!==l){j=l;u=true;t=l;w.src=s+"?"+t;x=false;setTimeout(d.hitch(this,this.pollLocation),
0);return}else if(!x){location.href="#"+B.search.substring(1);o();b()}setTimeout(d.hitch(this,this.pollLocation),m)};o();setTimeout(d.hitch(this,this.pollLocation),m)}d.hash=function(o,w){if(!arguments.length)return a();if(o.charAt(0)=="#")o=o.substring(1);if(w)e(o);else location.href="#"+o;return o};var j,i,k,m=d.config.hashPollFrequency||100;d.addOnLoad(function(){if("onhashchange"in d.global&&(!d.isIE||d.isIE>=8&&document.compatMode!="BackCompat"))k=d.connect(d.global,"onhashchange",b);else if(document.addEventListener){j=
a();setInterval(c,m)}else if(document.attachEvent)i=new g})})();return d.hash});
(function(){var d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],f=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=[];define("text",["require","exports","module"],function(){var c,e,g;if(typeof window!=="undefined"&&window.navigator&&window.document)e=function(j,i){var k=c.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");e=function(j,i){i(g.readFileSync(j,"utf8"))}}else if(typeof Packages!=="undefined")e=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,w="";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)}w=
String(m.toString())}finally{k.close()}i(w)};return c={version:"0.24.0",strip:function(j){if(j){j=j.replace(f,"");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=d[i];try{j=new ActiveXObject(k)}catch(m){}if(j){d=
[k];break}}if(!j)throw new Error("require.getXhr(): XMLHttpRequest not available");return j},get:e,load:function(j,i,k,m){var o=false,w=j.indexOf("."),s=j.substring(0,w),v=j.substring(w+1,j.length);w=v.indexOf("!");if(w!==-1){o=v.substring(w+1,v.length);o=o==="strip";v=v.substring(0,w)}i=i.nameToUrl(s,"."+v);c.get(i,function(u){u=o?c.strip(u):u;if(m.isBuild&&m.inlineText)b[j]=u;k(u)})},write:function(j,i,k){if(i in b){var m=c.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(d,f){f.getObject("i18n",true,f);f.i18n.getLocalization=f.i18n.getLocalization||function(a,b,c){c=f.i18n.normalizeLocale(c);var e=c.split("-"),g=[a,"nls",b].join(".");if(typeof f.global.require!=="undefined"){var j=d("i18n!"+[a.replace(/\./g,"/"),"nls",b].join("/"));(f._loadedModules[g]=f._loadedModules[g]||{})[e.join("_")]=j.root||j}if(g=f._loadedModules[g]){var i;for(j=e.length;j>0;j--){var k=e.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="+c);};f.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():f.locale;if(a=="root")a="ROOT";return a};f.i18n._requireLocalization=function(a,b,c,e){c=f.i18n.normalizeLocale(c);var g=[a,"nls",b].join("."),j="";if(e){for(var i=e.split(","),k=0;k<i.length;k++)if(c.indexOf(i[k])==0)if(i[k].length>j.length)j=i[k];j||(j="ROOT")}i=e?j:c;var m=f._loadedModules[g];k=null;if(m){if(f.config.localizationComplete&&
m._built)return;k=i.replace(/-/g,"_");k=f._loadedModules[g+"."+k]}if(!k){m=f.provide(g);var o=f._getModuleSymbols(a).concat("nls").join("/"),w;f.i18n._searchLocalePath(i,e,function(s){var v=s.replace(/-/g,"_"),u=g+"."+v,t=false;if(f._loadedModules[u])t=true;else{f.provide(u);u=[o];s!="ROOT"&&u.push(s);u.push(b);s=u.join("/")+".js";t=f._loadPath(s,null,function(q){q=q.root||q;var x=function(){};x.prototype=w;m[v]=new x;for(var B in q)m[v][B]=q[B]})}if(t&&m[v])w=m[v];else m[v]=w;if(e)return true})}if(e&&
c!=j)m[c.replace(/-/g,"_")]=m[j.replace(/-/g,"_")]};(function(){var a=f.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var b=f.i18n._requireLocalization;f.i18n._requireLocalization=function(c,e,g,j){b(c,e,g,j);if(!g)for(g=0;g<a.length;g++)b(c,e,a[g],j)}}})();f.i18n._searchLocalePath=function(a,b,c){a=f.i18n.normalizeLocale(a);var e=a.split("-");a=[];for(var g=e.length;g>0;g--)a.push(e.slice(0,g).join("-"));a.push(false);b&&a.reverse();for(b=a.length-1;b>=0;b--)if(c(a[b]||"ROOT"))break};f.i18n._preloadLocalizations=
function(a,b){function c(j){j=f.i18n.normalizeLocale(j);f.i18n._searchLocalePath(j,true,function(i){for(var k=0;k<b.length;k++)if(b[k]==i){f.require(a+"_"+i);return true}return false})}c();for(var e=f.config.extraLocale||[],g=0;g<e.length;g++)c(e[g])};return f.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(d){d.getObject("window",true,d);d.window.getBox=function(){var f=d.doc.compatMode=="BackCompat"?d.body():d.doc.documentElement,a=d._docScroll();return{w:f.clientWidth,h:f.clientHeight,l:a.x,t:a.y}};d.window.get=function(f){if(d.isIE&&window!==document.parentWindow){f.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=f._parentWindow;f._parentWindow=null;return a}return f.parentWindow||f.defaultView};d.window.scrollIntoView=function(f,
a){try{f=d.byId(f);var b=f.ownerDocument||d.doc,c=b.body||d.body(),e=b.documentElement||c.parentNode,g=d.isIE,j=d.isWebKit;if((!(d.isMoz||g||j||d.isOpera)||f==c||f==e)&&typeof f.scrollIntoView!="undefined")f.scrollIntoView(false);else{var i=b.compatMode=="BackCompat",k=g>=9&&f.ownerDocument.parentWindow.frameElement?e.clientHeight>0&&e.clientWidth>0&&(c.clientHeight==0||c.clientWidth==0||c.clientHeight>e.clientHeight||c.clientWidth>e.clientWidth)?e:c:i?c:e;b=j?c:k;var m=k.clientWidth,o=k.clientHeight,
w=!d._isBodyLtr(),s=a||d.position(f),v=f.parentNode;a=function(y){return g<=6||g&&i?false:d.style(y,"position").toLowerCase()=="fixed"};if(!a(f))for(;v;){if(v==c)v=b;var u=d.position(v),t=a(v);if(v==b){u.w=m;u.h=o;if(b==e&&g&&w)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=d._getPadBorderExtents(v);u.w-=q.w;u.h-=q.h;u.x+=q.l;u.y+=q.t;var x=v.clientWidth,B=u.w-x;if(x>0&&B>0){u.w=x;u.x+=w&&(g||v.clientLeft>q.l)?B:0}x=v.clientHeight;B=u.h-x;if(x>0&&B>0)u.h=x}if(t){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=s.x-u.x,h=s.y-Math.max(u.y,0),l=D+s.w-u.w,n=h+s.h-u.h;if(l*D>0){var p=Math[D<0?"max":"min"](D,l);if(w&&(g==8&&!i||g>=9))p=-p;s.x+=v.scrollLeft;v.scrollLeft+=p;s.x-=v.scrollLeft}if(n*h>0){s.y+=v.scrollTop;v.scrollTop+=Math[h<0?"max":"min"](h,n);s.y-=v.scrollTop}v=v!=b&&!t&&v.parentNode}}}catch(r){console.error("scrollIntoView: "+r);f.scrollIntoView(false)}};return d.window});
define("dijit/_base/manager",["dojo","dijit"],function(d,f){d.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||d.global;var c=0,e;for(e in this._hash)a.call(b,this._hash[e],c++,this._hash);return this},
filter:function(a,b){b=b||d.global;var c=new f.WidgetSet,e=0,g;for(g in this._hash){var j=this._hash[g];a.call(b,j,e++,this._hash)&&c.add(j)}return c},byId:function(a){return this._hash[a]},byClass:function(a){var b=new f.WidgetSet,c,e;for(c in this._hash){e=this._hash[c];e.declaredClass==a&&b.add(e)}return b},toArray:function(){var a=[];for(var b in this._hash)a.push(this._hash[b]);return a},map:function(a,b){return d.map(this.toArray(),a,b)},every:function(a,b){b=b||d.global;var c=0,e;for(e in this._hash)if(!a.call(b,
this._hash[e],c++,this._hash))return false;return true},some:function(a,b){b=b||d.global;var c=0,e;for(e in this._hash)if(a.call(b,this._hash[e],c++,this._hash))return true;return false}});(function(){f.registry=new f.WidgetSet;var a=f.registry._hash,b=d.attr,c=d.hasAttr,e=d.style;f.byId=function(k){return typeof k=="string"?a[k]:k};var g={};f.getUniqueId=function(k){var m;do m=k+"_"+(k in g?++g[k]:(g[k]=0));while(a[m]);return f._scopeName=="dijit"?m:f._scopeName+"_"+m};f.findWidgets=function(k){function m(w){for(w=
w.firstChild;w;w=w.nextSibling)if(w.nodeType==1){var s=w.getAttribute("widgetId");if(s)(s=a[s])&&o.push(s);else m(w)}}var o=[];m(k);return o};f._destroyAll=function(){f._curFocus=null;f._prevFocus=null;f._activeStack=[];d.forEach(f.findWidgets(d.body()),function(k){if(!k._destroyed)if(k.destroyRecursive)k.destroyRecursive();else k.destroy&&k.destroy()})};d.isIE&&d.addOnWindowUnload(function(){f._destroyAll()});f.byNode=function(k){return a[k.getAttribute("widgetId")]};f.getEnclosingWidget=function(k){for(;k;){var m=
k.getAttribute&&k.getAttribute("widgetId");if(m)return a[m];k=k.parentNode}return null};var j=f._isElementShown=function(k){var m=e(k);return m.visibility!="hidden"&&m.visibility!="collapsed"&&m.display!="none"&&b(k,"type")!="hidden"};f.hasDefaultTabStop=function(k){switch(k.nodeName.toLowerCase()){case "a":return c(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(w){try{m=k.contentWindow.document.body}catch(s){return false}}return m.contentEditable=="true"||m.firstChild&&m.firstChild.contentEditable=="true";default:return k.contentEditable=="true"}};var i=f.isTabNavigable=function(k){return b(k,"disabled")?false:c(k,"tabIndex")?b(k,"tabIndex")>=0:f.hasDefaultTabStop(k)};f._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 w,s,v,u,t,q,x={},B=function(D){d.query("> *",D).forEach(function(h){if(!(d.isIE&&h.scopeName!=="HTML"||!j(h))){if(i(h)){var l=b(h,"tabIndex");if(!c(h,"tabIndex")||l==0){w||(w=h);s=h}else if(l>0){if(!v||l<u){u=l;v=h}if(!t||l>=q){q=l;t=h}}l=m(h);if(d.attr(h,"checked")&&l)x[l]=h}h.nodeName.toUpperCase()!="SELECT"&&B(h)}})};j(k)&&B(k);return{first:o(w),last:o(s),lowest:o(v),highest:o(t)}};f.getFirstInTabbingOrder=function(k){k=f._getTabNavigable(d.byId(k));return k.lowest?
k.lowest:k.first};f.getLastInTabbingOrder=function(k){k=f._getTabNavigable(d.byId(k));return k.last?k.last:k.highest};f.defaultDuration=d.config.defaultDuration||200})();return f});
define("dojo/Stateful",["dojo"],function(d){d.declare("dojo.Stateful",null,{postscript:function(f){f&&d.mixin(this,f)},get:function(f){return this[f]},set:function(f,a){if(typeof f==="object"){for(var b in f)this.set(b,f[b]);return this}b=this[f];this[f]=a;this._watchCallbacks&&this._watchCallbacks(f,b,a);return this},watch:function(f,a){var b=this._watchCallbacks;if(!b){var c=this;b=this._watchCallbacks=function(g,j,i,k){var m=function(o){if(o){o=o.slice();for(var w=0,s=o.length;w<s;w++)try{o[w].call(c,
g,j,i)}catch(v){console.error(v)}}};m(b["_"+g]);k||m(b["*"])}}if(!a&&typeof f==="function"){a=f;f="*"}else f="_"+f;var e=b[f];if(typeof e!=="object")e=b[f]=[];e.push(a);return{unwatch:function(){e.splice(d.indexOf(e,a),1)}}}});return d.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(d,f){(function(){d.declare("dijit._WidgetBase",d.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,b){this.create(a,b)},create:function(a,b){this.srcNodeRef=
d.byId(b);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;d._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=f.getUniqueId(this.declaredClass.replace(/\./g,"_"));f.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(c,e){if(e.params&&c in e.params||e[c])e.set(c,e[c])};for(var b in this.attributeMap)a(b,this);d.forEach(this._getSetterAttributes(),function(c){c in this.attributeMap||a(c,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var b=a._setterAttrs=[],c,e=a.prototype;for(var g in e)if(d.isFunction(e[g])&&(c=g.match(/^_set([a-zA-Z]*)Attr$/))&&
c[1])b.push(c[1].charAt(0).toLowerCase()+c[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||d.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(d.map(a,function(b){return b+"Rtl"})));d.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=d.forEach,c=d.unsubscribe;b(this._connects,function(e){b(e,d.disconnect)});b(this._subscribes,function(e){c(e)});b(this._supportingWidgets||[],function(e){if(e.destroyRecursive)e.destroyRecursive();else e.destroy&&e.destroy()});this.destroyRendering(a);f.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?d.removeAttr(this.domNode,
"widgetId"):d.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||d.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){d.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){d.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var b=this[this.attributeMap.style||"domNode"];if(d.isObject(a))d.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 c=this.attributeMap[a];d.forEach(d.isArray(c)?c:[c],function(e){var g=this[e.node||e||"domNode"];switch(e.type||"attribute"){case "attribute":if(d.isFunction(b))b=d.hitch(this,b);e=e.attribute?e.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;d.attr(g,e,b);break;case "innerText":g.innerHTML="";g.appendChild(d.doc.createTextNode(b));break;case "innerHTML":g.innerHTML=
b;break;case "class":d.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 c in a)this.set(c,a[c]);return this}c=this._getAttrNames(a);if(this[c.s])var e=this[c.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,b);this._set(a,b)}return e||this},_attrPairNames:{},_getAttrNames:function(a){var b=this._attrPairNames;if(b[a])return b[a];
var c=a.charAt(0).toUpperCase()+a.substr(1);return b[a]={n:a+"Node",s:"_set"+c+"Attr",g:"_get"+c+"Attr"}},_set:function(a,b){var c=this[a];this[a]=b;this._watchCallbacks&&this._created&&b!==c&&this._watchCallbacks(a,c,b)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?d.query("[widgetId]",this.containerNode).map(f.byNode):[]},getChildren:function(){return this.containerNode?f.findWidgets(this.containerNode):
[]},connect:function(a,b,c){a=[d._connect(a,b,this,c)];this._connects.push(a);return a},disconnect:function(a){for(var b=0;b<this._connects.length;b++)if(this._connects[b]==a){d.forEach(a,d.disconnect);this._connects.splice(b,1);return}},subscribe:function(a,b){a=d.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){d.unsubscribe(a);this._subscribes.splice(b,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":d._isBodyLtr()},placeAt:function(a,b){a.declaredClass&&a.addChild?a.addChild(this,b):d.place(this.domNode,a,b);return this}})})();return f._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(d,f){d.mixin(f,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return f.getBookmark().isCollapsed},getBookmark:function(){var a,b,c=d.doc.selection,e=f._curFocus;if(d.global.getSelection){if(c=d.global.getSelection())if(c.isCollapsed){if(a=e?e.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!e.type||e.type.toLowerCase()=="text")){c={start:e.selectionStart,end:e.selectionEnd,node:e,pRange:true};
return{isCollapsed:c.end<=c.start,mark:c}}}a={isCollapsed:true};if(c.rangeCount)a.mark=c.getRangeAt(0).cloneRange()}else{b=c.getRangeAt(0);a={isCollapsed:false,mark:b.cloneRange()}}}else if(c){a=e?e.tagName:"";a=a.toLowerCase();if(e&&a&&(a=="button"||a=="textarea"||a=="input"))if(c.type&&c.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{b=c.createRange();return{isCollapsed:b.text&&b.text.length?false:true,mark:{range:b,pRange:true}}}a={};try{b=c.createRange();a.isCollapsed=!(c.type==
"Text"?b.htmlText.length:b.length)}catch(g){a.isCollapsed=true;return a}if(c.type.toUpperCase()=="CONTROL")if(b.length){a.mark=[];c=0;for(e=b.length;c<e;)a.mark.push(b.item(c++))}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=d.doc;if(a=a.mark)if(d.global.getSelection){var c=d.global.getSelection();if(c&&c.removeAllRanges)if(a.pRange){c=a.node;c.selectionStart=
a.start;c.selectionEnd=a.end}else{c.removeAllRanges();c.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(b.selection&&a){var e;if(a.pRange)e=a.range;else if(d.isArray(a)){e=b.body.createControlRange();d.forEach(a,function(g){e.addElement(g)})}else{e=b.body.createTextRange();e.moveToBookmark(a)}e.select()}},getFocus:function(a,b){a=!f._curFocus||a&&d.isDescendant(f._curFocus,a.domNode)?f._prevFocus:f._curFocus;return{node:a,bookmark:a==f._curFocus&&d.withGlobal(b||
d.global,f.getBookmark),openedForWindow:b}},focus:function(a){if(a){var b="node"in a?a.node:a,c=a.bookmark;a=a.openedForWindow;var e=c?c.isCollapsed:false;if(b){var g=b.tagName.toLowerCase()=="iframe"?b.contentWindow:b;if(g&&g.focus)try{g.focus()}catch(j){}f._onFocusNode(b)}if(c&&d.withGlobal(a||d.global,f.isCollapsed)&&!e){a&&a.focus();try{d.withGlobal(a||d.global,f.moveToBookmark,null,[c])}catch(i){}}}},_activeStack:[],registerIframe:function(a){return f.registerWin(a.contentWindow,a)},unregisterIframe:function(a){f.unregisterWin(a)},
registerWin:function(a,b){var c=function(m){f._justMouseDowned=true;setTimeout(function(){f._justMouseDowned=false},0);d.isIE&&m&&m.srcElement&&m.srcElement.parentNode==null||f._onTouchNode(b||m.target||m.srcElement,"mouse")},e=d.isIE?a.document.documentElement:a.document;if(e)if(d.isIE){a.document.body.attachEvent("onmousedown",c);var g=function(m){m.srcElement.tagName.toLowerCase()!="#document"&&f.isTabNavigable(m.srcElement)?f._onFocusNode(b||m.srcElement):f._onTouchNode(b||m.srcElement)};e.attachEvent("onactivate",
g);var j=function(m){f._onBlurNode(b||m.srcElement)};e.attachEvent("ondeactivate",j);return function(){a.document.detachEvent("onmousedown",c);e.detachEvent("onactivate",g);e.detachEvent("ondeactivate",j);e=null}}else{e.body.addEventListener("mousedown",c,true);var i=function(m){f._onFocusNode(b||m.target)};e.addEventListener("focus",i,true);var k=function(m){f._onBlurNode(b||m.target)};e.addEventListener("blur",k,true);return function(){e.body.removeEventListener("mousedown",c,true);e.removeEventListener("focus",
i,true);e.removeEventListener("blur",k,true);e=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){f._prevFocus=f._curFocus;f._curFocus=null;if(!f._justMouseDowned){f._clearActiveWidgetsTimer&&clearTimeout(f._clearActiveWidgetsTimer);f._clearActiveWidgetsTimer=setTimeout(function(){delete f._clearActiveWidgetsTimer;f._setStack([]);f._prevFocus=null},100)}},_onTouchNode:function(a,b){if(f._clearActiveWidgetsTimer){clearTimeout(f._clearActiveWidgetsTimer);delete f._clearActiveWidgetsTimer}var c=
[];try{for(;a;){var e=d.attr(a,"dijitPopupParent");if(e)a=f.byId(e).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===d.body())break;a=d.window.get(a.ownerDocument).frameElement}else{var g=a.getAttribute&&a.getAttribute("widgetId"),j=g&&f.byId(g);j&&!(b=="mouse"&&j.get("disabled"))&&c.unshift(g);a=a.parentNode}}}catch(i){}f._setStack(c,b)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){f._onTouchNode(a);if(a!=f._curFocus){if(f._curFocus)f._prevFocus=f._curFocus;f._curFocus=a;d.publish("focusNode",
[a])}}},_setStack:function(a,b){var c=f._activeStack;f._activeStack=a;for(var e=0;e<Math.min(c.length,a.length);e++)if(c[e]!=a[e])break;for(var g,j=c.length-1;j>=e;j--)if(g=f.byId(c[j])){g._focused=false;g.set("focused",false);g._hasBeenBlurred=true;g._onBlur&&g._onBlur(b);d.publish("widgetBlur",[g,b])}for(j=e;j<a.length;j++)if(g=f.byId(a[j])){g._focused=true;g.set("focused",true);g._onFocus&&g._onFocus(b);d.publish("widgetFocus",[g,b])}}});d.addOnLoad(function(){var a=f.registerWin(window);d.isIE&&
d.addOnWindowUnload(function(){f.unregisterWin(a);a=null})});return f});
define("dojo/AdapterRegistry",["dojo"],function(d){d.AdapterRegistry=function(f){this.pairs=[];this.returnWrappers=f||false};d.extend(d.AdapterRegistry,{register:function(f,a,b,c,e){this.pairs[e?"unshift":"push"]([f,a,b,c])},match:function(){for(var f=0;f<this.pairs.length;f++){var a=this.pairs[f];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(f){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
f){this.pairs.splice(a,1);return true}return false}});return d.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(d,f){f.getViewport=function(){return d.window.getBox()};f.placeOnScreen=function(a,b,c,e){c=d.map(c,function(g){var j={corner:g,pos:{x:b.x,y:b.y}};if(e){j.pos.x+=g.charAt(1)=="L"?e.x:-e.x;j.pos.y+=g.charAt(0)=="T"?e.y:-e.y}return j});return f._place(a,c)};f._place=function(a,b,c,e){var g=d.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")d.body().appendChild(a);var j=null;
d.some(b,function(k){var m=k.corner,o=k.pos,w=0,s={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(c){w=c(a,k.aroundCorner,m,s,e);w=typeof w=="undefined"?0:w}var v=a.style,u=v.display,t=v.visibility;v.visibility="hidden";v.display="";var q=d.marginBox(a);v.display=u;v.visibility=t;v=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);t=Math.min(g.l+g.w,m.charAt(1)=="L"?v+q.w:o.x);o=Math.min(g.t+g.h,m.charAt(0)=="T"?u+q.h:o.y);t=
t-v;o=o-u;w+=q.w-t+(q.h-o);if(j==null||w<j.overflow)j={corner:m,aroundCorner:k.aroundCorner,x:v,y:u,w:t,h:o,overflow:w,spaceAvailable:s};return!w});j.overflow&&c&&c(a,j.aroundCorner,j.corner,j.spaceAvailable,e);b=d._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};f.placeOnScreenAroundNode=function(a,b,c,e){b=d.byId(b);b=d.position(b,true);return f._placeOnScreenAroundRect(a,b.x,b.y,b.w,b.h,c,e)};f.placeOnScreenAroundRectangle=function(a,b,c,e){return f._placeOnScreenAroundRect(a,
b.x,b.y,b.width,b.height,c,e)};f._placeOnScreenAroundRect=function(a,b,c,e,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:e),y:c+(m.charAt(0)=="T"?0:g)}});return f._place(a,k,i,{w:e,h:g})};f.placementRegistry=new d.AdapterRegistry;f.placementRegistry.register("node",function(a,b){return typeof b=="object"&&typeof b.offsetWidth!="undefined"&&typeof b.offsetHeight!="undefined"},f.placeOnScreenAroundNode);f.placementRegistry.register("rect",function(a,
b){return typeof b=="object"&&"x"in b&&"y"in b&&"width"in b&&"height"in b},f.placeOnScreenAroundRectangle);f.placeOnScreenAroundElement=function(){return f.placementRegistry.match.apply(f.placementRegistry,arguments)};f.getPopupAroundAlignment=function(a,b){var c={};d.forEach(a,function(e){switch(e){case "after":c[b?"BR":"BL"]=b?"BL":"BR";break;case "before":c[b?"BL":"BR"]=b?"BR":"BL";break;case "below-alt":b=!b;case "below":c[b?"BL":"BR"]=b?"TL":"TR";c[b?"BR":"BL"]=b?"TR":"TL";break;case "above-alt":b=
!b;case "above":default:c[b?"TL":"TR"]=b?"BL":"BR";c[b?"TR":"TL"]=b?"BR":"BL";break}});return c};return f});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(d,f){f.getDocumentWindow=function(a){return d.window.get(a)};return f});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(d,f){f.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var b=a.declaredClass?a._popupWrapper:a.parentNode&&d.hasClass(a.parentNode,"dijitPopup"),c=a.domNode||a;if(!b){b=d.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},d.body());b.appendChild(c);c=c.style;c.display="";c.visibility="";c.position="";c.top="0px";if(a.declaredClass){a._popupWrapper=
b;d.connect(a,"destroy",function(){d.destroy(b);delete a._popupWrapper})}}return b},moveOffScreen:function(a){a=this._createWrapper(a);d.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);d.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,c=a.popup,e=a.orient||((a.parent?a.parent.isLeftToRight():d._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||!d.isDescendant(a.parent.domNode,b[b.length-1].widget.domNode));)f.popup.close(b[b.length-1].widget);var i=this._createWrapper(c);d.attr(i,{id:j,style:{zIndex:this._beginZIndex+b.length},"class":"dijitPopup "+(c.baseClass||c["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(d.isIE||d.isMoz)if(!c.bgIframe)c.bgIframe=
new f.BackgroundIframe(i);e=g?f.placeOnScreenAroundElement(i,g,e,c.orient?d.hitch(c,"orient"):null):f.placeOnScreen(i,a,e=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);i.style.display="";i.style.visibility="visible";c.domNode.style.visibility="visible";g=[];g.push(d.connect(i,"onkeypress",this,function(k){if(k.charOrCode==d.keys.ESCAPE&&a.onCancel){d.stopEvent(k);a.onCancel()}else if(k.charOrCode===d.keys.TAB){d.stopEvent(k);(k=this.getTopPopup())&&k.onCancel&&k.onCancel()}}));c.onCancel&&
g.push(d.connect(c,"onCancel",a.onCancel));g.push(d.connect(c,c.onExecute?"onExecute":"onChange",this,function(){var k=this.getTopPopup();k&&k.onExecute&&k.onExecute()}));b.push({widget:c,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:g});c.onOpen&&c.onOpen(e);return e},close:function(a){for(var b=this._stack;a&&d.some(b,function(j){return j.widget==a})||!a&&b.length;){var c=b.pop(),e=c.widget,g=c.onClose;e.onClose&&e.onClose();d.forEach(c.handlers,d.disconnect);
e&&e.domNode&&this.hide(e);g&&g()}}};f._frames=new (function(){var a=[];this.pop=function(){var b;if(a.length){b=a.pop();b.style.display=""}else{if(d.isIE<9){b="<iframe src='"+(d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";b=d.doc.createElement(b)}else{b=d.create("iframe");b.src='javascript:""';b.className="dijitBackgroundIframe";d.style(b,"opacity",0.1)}b.tabIndex=
-1;f.setWaiRole(b,"presentation")}return b};this.push=function(b){b.style.display="none";a.push(b)}});f.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(d.isIE||d.isMoz){var b=this.iframe=f._frames.pop();a.appendChild(b);if(d.isIE<7||d.isQuirks){this.resize(a);this._conn=d.connect(a,"onresize",this,function(){this.resize(a)})}else d.style(b,{width:"100%",height:"100%"})}};d.extend(f.BackgroundIframe,{resize:function(a){this.iframe&&d.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){d.disconnect(this._conn);this._conn=null}if(this.iframe){f._frames.push(this.iframe);delete this.iframe}}});return f.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(d,f){f.scrollIntoView=function(a,b){d.window.scrollIntoView(a,b)};return f.scrollIntoView});
define("dojo/uacss",["dojo"],function(d){(function(){var f=d.doc.documentElement,a=d.isIE,b=d.isOpera,c=Math.floor,e=d.isFF,g=d.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:c(a)==6,dj_ie7:c(a)==7,dj_ie8:c(a)==8,dj_ie9:c(a)==9,dj_quirks:d.isQuirks,dj_iequirks:a&&d.isQuirks,dj_opera:b,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:c(e)==3};a["dj_"+g]=true;var j="";for(var i in a)if(a[i])j+=i+" ";f.className=d.trim(f.className+" "+j);d._loaders.unshift(function(){if(!d._isBodyLtr()){var k=
"dj_rtl dijitRtl "+j.replace(/ /g,"-rtl ");f.className=d.trim(f.className+" "+k)}})})();return d});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(d,f){return f});
define("dijit/_base/typematic",["dojo","dijit"],function(d,f){f.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(d.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,b,c,e,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=c;this._count=this._currentTimeout=-1;this._callback=d.hitch(b,e);this._fireEventAndReload();this._evt=d.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,c,e,g,j,i){if(b.keyCode){b.charOrCode=b.keyCode;d.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);d.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[d.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)){d.stopEvent(k);f.typematic.trigger(k,
c,a,e,b,g,j,i)}else f.typematic._obj==b&&f.typematic.stop()}),d.connect(a,"onkeyup",this,function(){f.typematic._obj==b&&f.typematic.stop()})]},addMouseListener:function(a,b,c,e,g,j){var i=d.connect;return[i(a,"mousedown",this,function(k){d.stopEvent(k);f.typematic.trigger(k,b,a,c,a,e,g,j)}),i(a,"mouseup",this,function(k){d.stopEvent(k);f.typematic.stop()}),i(a,"mouseout",this,function(k){d.stopEvent(k);f.typematic.stop()}),i(a,"mousemove",this,function(k){k.preventDefault()}),i(a,"dblclick",this,
function(k){d.stopEvent(k);if(d.isIE){f.typematic.trigger(k,b,a,c,a,e,g,j);setTimeout(d.hitch(this,f.typematic.stop),50)}})]},addListener:function(a,b,c,e,g,j,i,k){return this.addKeyListener(b,c,e,g,j,i,k).concat(this.addMouseListener(a,e,g,j,i,k))}};return f.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(d,f){f.wai={onload:function(){var a=d.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(d.config.blankGif||d.moduleUrl("dojo","resources/blank.gif"))+'");'}},d.body()),b=d.getComputedStyle(a);if(b){var c=b.backgroundImage;d[b.borderTopColor==b.borderRightColor||c!=null&&(c=="none"||c=="url(invalid-url:)")?"addClass":"removeClass"](d.body(),
"dijit_a11y");if(d.isIE)a.outerHTML="";else d.body().removeChild(a)}}};if(d.isIE||d.isMoz)d._loaders.unshift(f.wai.onload);d.mixin(f,{hasWaiRole:function(a,b){a=this.getWaiRole(a);return b?a.indexOf(b)>-1:a.length>0},getWaiRole:function(a){return d.trim((d.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,b){d.attr(a,"role",b)},removeWaiRole:function(a,b){var c=d.attr(a,"role");if(c)if(b){b=d.trim((" "+c+" ").replace(" "+b+" "," "));d.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,c){a.setAttribute("aria-"+b,c)},removeWaiState:function(a,b){a.removeAttribute("aria-"+b)}});return f});
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(d,f){return f._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(d,f){d.connect(d,"_connect",function(a,b){a&&d.isFunction(a._onConnect)&&a._onConnect(b)});f._connectOnUseEventHandler=function(){};f._lastKeyDownNode=null;d.isIE?function(){var a=function(b){f._lastKeyDownNode=b.srcElement};d.doc.attachEvent("onkeydown",a);d.addOnWindowUnload(function(){d.doc.detachEvent("onkeydown",a)})}():d.doc.addEventListener("keydown",function(a){f._lastKeyDownNode=a.target},true);(function(){d.declare("dijit._Widget",
f._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:f._connectOnUseEventHandler,onDblClick:f._connectOnUseEventHandler,onKeyDown:f._connectOnUseEventHandler,onKeyPress:f._connectOnUseEventHandler,onKeyUp:f._connectOnUseEventHandler,onMouseDown:f._connectOnUseEventHandler,onMouseMove:f._connectOnUseEventHandler,onMouseOut:f._connectOnUseEventHandler,
onMouseOver:f._connectOnUseEventHandler,onMouseLeave:f._connectOnUseEventHandler,onMouseEnter:f._connectOnUseEventHandler,onMouseUp:f._connectOnUseEventHandler,create:function(){this._deferredConnects=d.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==f._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&&d.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,b){d.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,b)},attr:function(a){if(d.config.isDebug){var b=
arguments.callee._ach||(arguments.callee._ach={}),c=(arguments.callee.caller||"unknown caller").toString();if(!b[c]){d.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+c,"","2.0");b[c]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,b,c){var e=d._connect,g=this.inherited(arguments,[a,b=="ondijitclick"?"onclick":b,c]);if(b=="ondijitclick")if(d.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var j=d.hitch(this,c);g.push(e(a,"onkeydown",this,function(i){if((i.keyCode==d.keys.ENTER||i.keyCode==d.keys.SPACE)&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){f._lastKeyDownNode=i.target;"openDropDown"in this&&a==this._buttonNode||i.preventDefault()}}),e(a,"onkeyup",this,function(i){if((i.keyCode==d.keys.ENTER||i.keyCode==d.keys.SPACE)&&i.target==f._lastKeyDownNode&&!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey){f._lastKeyDownNode=null;return j(i)}}))}return g},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return f._Widget});
define("dojo/string",["dojo"],function(d){d.getObject("string",true,d);d.string.rep=function(f,a){if(a<=0||!f)return"";for(var b=[];;){a&1&&b.push(f);if(!(a>>=1))break;f+=f}return b.join("")};d.string.pad=function(f,a,b,c){b||(b="0");f=String(f);a=d.string.rep(b,Math.ceil((a-f.length)/b.length));return c?f+a:a+f};d.string.substitute=function(f,a,b,c){c=c||d.global;b=b?d.hitch(c,b):function(e){return e};return f.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(e,g,j){e=d.getObject(g,false,
a);if(j)e=d.getObject(j,false,c).call(c,e,g);return b(e,g).toString()})};d.string.trim=String.prototype.trim?d.trim:function(f){f=f.replace(/^\s+/,"");for(var a=f.length-1;a>=0;a--)if(/\S/.test(f.charAt(a))){f=f.substring(0,a+1);break}return f};return d.string});
define("dojo/date/stamp",["dojo"],function(d){d.getObject("date.stamp",true,d);d.date.stamp.fromISOString=function(f,a){if(!d.date.stamp._isoRegExp)d.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var b=d.date.stamp._isoRegExp.exec(f);f=null;if(b){b.shift();b[1]&&b[1]--;if(b[6])b[6]*=1E3;if(a){a=new Date(a);d.forEach(d.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(g){return a["get"+
g]()}),function(g,j){b[j]=b[j]||g})}f=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)f.setFullYear(b[0]||1970);var c=0,e=b[7]&&b[7].charAt(0);if(e!="Z"){c=(b[8]||0)*60+(Number(b[9])||0);if(e!="-")c*=-1}if(e)c-=f.getTimezoneOffset();c&&f.setTime(f.getTime()+c*6E4)}return f};d.date.stamp.toISOString=function(f,a){var b=function(j){return j<10?"0"+j:j};a=a||{};var c=[],e=a.zulu?"getUTC":"get",g="";if(a.selector!="time"){g=f[e+"FullYear"]();g=["0000".substr((g+"").length)+
g,b(f[e+"Month"]()+1),b(f[e+"Date"]())].join("-")}c.push(g);if(a.selector!="date"){g=[b(f[e+"Hours"]()),b(f[e+"Minutes"]()),b(f[e+"Seconds"]())].join(":");e=f[e+"Milliseconds"]();if(a.milliseconds)g+="."+(e<100?"0":"")+b(e);if(a.zulu)g+="Z";else if(a.selector!="time"){f=f.getTimezoneOffset();a=Math.abs(f);g+=(f>0?"-":"+")+b(Math.floor(a/60))+":"+b(a%60)}c.push(g)}return c.join("T")};return d.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(d){d.parser=new (function(){function f(i){if(e.isString(i))return"string";if(typeof i=="number")return"number";if(typeof i=="boolean")return"boolean";if(e.isFunction(i))return"function";if(e.isArray(i))return"array";if(i instanceof Date)return"date";if(i instanceof e._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(e.isFunction(i)){i=i.toString();i=e.trim(i.substring(i.indexOf("{")+1,i.length-1))}try{return i===""||i.search(/[^\w\.]+/i)!=-1?new Function(i):e.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 e.date.stamp.fromISOString(i)}case "url":return e.baseUrl+i;default:return e.fromJson(i)}}function b(i,k){for(var m in i)if(m.charAt(0)!=
"_")m in g||(k[m]=f(i[m]));return k}function c(i,k){var m=j[i];if(m){if(!k&&!m.params)m.params=b(m.cls.prototype,{})}else{i=e.getObject(i);m=null;if(!i)return null;k||(m=b(i.prototype,{}));m={cls:i,params:m}}return m}var e=d,g={},j={};e.connect(e,"extend",function(){j={}});this._functionFromScript=function(i,k){var m="",o="";(k=i.getAttribute(k+"args")||i.getAttribute("args"))&&e.forEach(k.split(/\s*,\s*/),function(w,s){m+="var "+w+" = arguments["+s+"]; "});(k=i.getAttribute("with"))&&k.length&&e.forEach(k.split(/\s*,\s*/),
function(w){m+="with("+w+"){";o+="}"});return new Function(m+i.innerHTML+o)};this.instantiate=function(i,k,m){var o=[];k=k||{};m=m||{};var w=(m.scope||e._scopeName)+"Type",s="data-"+(m.scope||e._scopeName)+"-";e.forEach(i,function(v){if(v){var u,t,q,x,B,D;if(v.node){u=v.node;t=v.type;D=v.fastpath;x=(q=v.clsInfo||t&&c(t,D))&&q.cls;B=v.scripts}else{u=v;B=(x=(q=(t=w in k?k[w]:u.getAttribute(w))&&c(t))&&q.cls)&&(x._noScript||x.prototype._noScript)?[]:e.query("> script[type^='dojo/']",u)}if(!q)throw new Error("Could not load class '"+
t);var h={};m.defaults&&e._mixin(h,m.defaults);v.inherited&&e._mixin(h,v.inherited);if(D){if((q=u.getAttribute(s+"props"))&&q.length)try{q=e.fromJson.call(m.propsThis,"{"+q+"}");e._mixin(h,q)}catch(l){throw new Error(l.toString()+" in data-dojo-props='"+q+"'");}if(q=u.getAttribute(s+"attach-point"))h.dojoAttachPoint=q;if(q=u.getAttribute(s+"attach-event"))h.dojoAttachEvent=q;d.mixin(h,k)}else{v=u.attributes;for(var n in q.params){t=n in k?{value:k[n],specified:true}:v.getNamedItem(n);if(!(!t||!t.specified&&
(!d.isIE||n.toLowerCase()!="value"))){t=t.value;switch(n){case "class":t="className"in k?k.className:u.className;break;case "style":t="style"in k?k.style:u.style&&u.style.cssText}var p=q.params[n];h[n]=typeof t=="string"?a(t,p):t}}}var r=[],y=[];e.forEach(B,function(z){u.removeChild(z);var E=z.getAttribute(s+"event")||z.getAttribute("event"),G=z.getAttribute("type");z=e.parser._functionFromScript(z,s);if(E)if(G=="dojo/connect")r.push({event:E,func:z});else h[E]=z;else y.push(z)});var A=(B=x.markupFactory||
x.prototype&&x.prototype.markupFactory)?B(h,u,x):new x(h,u);o.push(A);(x=u.getAttribute(s+"id")||u.getAttribute("jsId"))&&e.setObject(x,A);e.forEach(r,function(z){e.connect(A,z.event,null,z.func)});e.forEach(y,function(z){z.call(A)})}});k._started||e.forEach(o,function(v){if(!m.noStart&&v&&d.isFunction(v.startup)&&!v._started&&(!v.getParent||!v.getParent()))v.startup()});return o};this.parse=function(i,k){function m(u,t){var q=d.clone(u.inherited);d.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,B=!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=B&&D.getAttribute(w+"type");h=l?l:B&&D.getAttribute(o);l=l==h;if(h){h={type:h,fastpath:l,clsInfo:c(h,l),node:D,scripts:[],inherited:q};t.push(h);m(h,t)}else if(x&&D.nodeName.toLowerCase()=="script")(h=D.getAttribute("type"))&&/^dojo\/\w/i.test(h)&&x.push(D);else B&&m({node:D,inherited:q},
t)}}if(!k&&i&&i.rootNode){k=i;i=k.rootNode}else i=i;i=i?d.byId(i):d.body();k=k||{};var o=(k.scope||e._scopeName)+"Type",w="data-"+(k.scope||e._scopeName)+"-",s={};if(k&&k.inherited)for(var v in k.inherited)if(k.inherited[v])s[v]=k.inherited[v];v=[];m({node:i,inherited:s},v);return this.instantiate(v,k&&k.template?{template:true}:null,k)}});(function(){var f=function(){d.config.parseOnLoad&&d.parser.parse()};d.getObject("dijit.wai.onload")===d._loaders[0]?d._loaders.splice(1,0,f):d._loaders.unshift(f)})();
return d.parser});
define("dojo/cache",["dojo"],function(d){var f={};d.cache=function(a,b,c){if(typeof a=="string")var e=d.moduleUrl(a,b);else{e=a;c=b}e=e.toString();var g=c;if(c!=undefined&&!d.isString(c))g="value"in c?c.value:undefined;c=c&&c.sanitize?true:false;if(typeof g=="string")g=f[e]=c?d.cache._sanitize(g):g;else if(g===null)delete f[e];else{if(!(e in f)){g=undefined;if(d.isFunction(require)&&d.isString(a))try{var j=(a?a.replace(/\./g,"/")+"/":"")+b;g=require("text!"+j)}catch(i){}if(typeof g==="undefined")g=
d._getText(e);f[e]=c?d.cache._sanitize(g):g}g=f[e]}return g};d.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 d.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(d,f){d.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,c=this;return d.string.substitute(a,this,function(e,g){if(g.charAt(0)=="!")e=d.getObject(g.substr(1),false,c);if(typeof e==
"undefined")throw new Error(b+" template:"+g);if(e==null)return"";return g.charAt(0)=="!"?e:e.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=f._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),b;if(d.isString(a)){b=d._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=
d.parser.parse(b,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=f.findWidgets(b);this._attachTemplateNodes(a,function(c,e){return c[e]})}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,w){return o.getAttribute(w)};for(var c=d.isArray(a)?a:a.all||a.getElementsByTagName("*"),
e=d.isArray(a)?0:-1;e<c.length;e++){var g=e==-1?a:c[e];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(d.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=d.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"))&&f.setWaiRole(g,j);(j=b(g,"waiState"))&&d.forEach(j.split(/\s*,\s*/),function(o){if(o.indexOf("-")!=-1){o=o.split("-");f.setWaiState(g,o[0],o[1])}})}}},startup:function(){d.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){d.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];d.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});f._Templated._templateCache={};f._Templated.getCachedTemplate=function(a,b,c){var e=f._Templated._templateCache,g=b||a,j=e[g];if(j){try{if(!j.ownerDocument||j.ownerDocument==d.doc)return j}catch(i){}d.destroy(j)}b||(b=d.cache(a,{sanitize:true}));b=d.string.trim(b);if(c||b.match(/\$\{([^\}]+)\}/g))return e[g]=b;else{a=d._toDom(b);if(a.nodeType!=1)throw new Error("Invalid template: "+b);return e[g]=a}};d.isIE&&d.addOnWindowUnload(function(){var a=
f._Templated._templateCache;for(var b in a){var c=a[b];typeof c=="object"&&d.destroy(c);delete a[b]}});d.extend(f._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return f._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(d,f){d.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);d.forEach(["onmouseenter","onmouseleave","onmousedown"],function(b){this.connect(this.domNode,b,"_cssMouseEvent")},this);d.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(b){this.watch(b,d.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(d.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(b)});break}},_setStateClass:function(){function a(i){b=
b.concat(d.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 c=this.stateNode||this.domNode,e={};d.forEach(c.className.split(" "),function(i){e[i]=true});"_stateClasses"in this&&d.forEach(this._stateClasses,
function(i){delete e[i]});d.forEach(b,function(i){e[i]=true});var g=[];for(var j in e)g.push(j);c.className=g.join(" ");this._stateClasses=b},_trackMouseState:function(a,b){function c(){var m="disabled"in i&&i.disabled||"readonly"in i&&i.readonly;d.toggleClass(a,b+"Hover",e&&!g&&!m);d.toggleClass(a,b+"Active",g&&!m);d.toggleClass(a,b+"Focused",j&&!m)}var e=false,g=false,j=false,i=this,k=d.hitch(this,"connect",a);k("onmouseenter",function(){e=true;c()});k("onmouseleave",function(){g=e=false;c()});
k("onmousedown",function(){g=true;c()});k("onmouseup",function(){g=false;c()});k("onfocus",function(){j=true;c()});k("onblur",function(){j=false;c()});this.watch("disabled",c);this.watch("readOnly",c)}});return f._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(d,f){d.declare("dijit.form._FormWidget",[f._Widget,f._Templated,f._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:d.delegate(f._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);d.attr(this.focusNode,"disabled",a);this.valueNode&&d.attr(this.valueNode,"disabled",a);f.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
d.forEach(d.isArray(a)?a:[a],function(b){b=this[b];d.isWebKit||f.hasDefaultTabStop(b)?b.setAttribute("tabIndex","-1"):b.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){d.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&d.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&d.style(this.domNode,"display")!="none"},focus:function(){this.disabled||f.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(d.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){d.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){d.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&d.mouseButtons.isLeft(a)&&this.isFocusable())var b=this.connect(d.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(b)})}});d.declare("dijit.form._FormValueWidget",
f.form._FormWidget,{readOnly:false,attributeMap:d.delegate(f.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){d.attr(this.focusNode,"readOnly",a);f.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(d.isIE<9||d.isIE&&d.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==d.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var b;if(d.isIE){a.preventDefault();b=document.createEventObject();b.keyCode=d.keys.ESCAPE;b.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
b)}}},_layoutHackIE7:function(){if(d.isIE==7)for(var a=this.domNode,b=a.parentNode,c=a.firstChild||a,e=c.style.filter,g=this;b&&b.clientHeight==0;){(function(){var j=g.connect(b,"onscroll",function(){g.disconnect(j);c.style.filter=(new Date).getMilliseconds();setTimeout(function(){c.style.filter=e},0)})})();b=b.parentNode}}});return f.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(d,f){d.declare("dijit.form.TextBox",f.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:d.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:d.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:d.delegate(f.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==f.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=d.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,c){var e;if(a!==undefined){e=this.filter(a);if(typeof c!="string")c=e!==null&&(typeof e!="number"||!isNaN(e))?this.filter(this.format(e,this.constraints)):""}if(c!=null&&c!=undefined&&(typeof c!="number"||!isNaN(c))&&this.textbox.value!=c){this.textbox.value=c;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[e,b])},displayedValue:"",getDisplayedValue:function(){d.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){d.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 d.keys.SHIFT:case d.keys.ALT:case d.keys.CTRL:case d.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(){d.isIE&&setTimeout(d.hitch(this,function(){var a=d.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var b=this.domNode.getElementsByTagName("INPUT");if(b)for(var c=0;c<b.length;c++)b[c].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(d.isMoz||d.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=d.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&&d.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(d.isIE){b=d.doc.selection.createRange();b=b.parentElement()==this.textbox&&
b.text.length==0}else b=this.textbox.selectionStart==this.textbox.selectionEnd;b&&f.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});f.selectInputText=function(a,b,c){var e=d.global,g=d.doc;a=d.byId(a);if(isNaN(b))b=0;if(isNaN(c))c=a.value?a.value.length:0;f.focus(a);if(g.selection&&d.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",b);a.moveEnd("character",c-b);a.select()}}else e.getSelection&&a.setSelectionRange&&a.setSelectionRange(b,c)};return f.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(d,f){d.declare("dijit._MasterTooltip",[f._Widget,f._Templated],{duration:f.defaultDuration,templateString:d.cache("dijit","templates/Tooltip.html"),postCreate:function(){d.body().appendChild(this.domNode);this.bgIframe=new f.BackgroundIframe(this.domNode);this.fadeIn=d.fadeIn({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,"_onShow")});this.fadeOut=d.fadeOut({node:this.domNode,
duration:this.duration,onEnd:d.hitch(this,"_onHide")})},show:function(a,b,c,e){if(!(this.aroundNode&&this.aroundNode===b)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;f.placeOnScreenAroundElement(this.domNode,b,f.getPopupAroundAlignment(c&&c.length?c:f.Tooltip.defaultPosition,!e),d.hitch(this,"orient"));d.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=b}}},orient:function(a,b,c,
e,g){this.connectorNode.style.top="";var j=e.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+"-"+c];this.domNode.style.width="auto";var i=d.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+d.style(this.domNode,"paddingLeft")+d.style(this.domNode,"paddingRight");this.domNode.style.width=m+"px"}}if(c.charAt(0)=="B"&&b.charAt(0)=="B"){a=d.marginBox(a);b=this.connectorNode.offsetHeight;if(a.h>e.h){this.connectorNode.style.top=e.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(d.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}}});f.showTooltip=function(a,b,c,e){if(!f._masterTT)f._masterTT=
new f._MasterTooltip;return f._masterTT.show(a,b,c,e)};f.hideTooltip=function(a){if(!f._masterTT)f._masterTT=new f._MasterTooltip;return f._masterTT.hide(a)};d.declare("dijit.Tooltip",f._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){d.forEach(this._connections||[],function(c){d.forEach(c,d.hitch(this,"disconnect"))},this);var b=d.isArrayLike(a)?a:a?[a]:[];this._connections=d.map(b,function(c){return(c=d.byId(c))?[this.connect(c,"onmouseenter","_onTargetMouseEnter"),
this.connect(c,"onmouseleave","_onTargetMouseLeave"),this.connect(c,"onfocus","_onTargetFocus"),this.connect(c,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=b},addTarget:function(a){a=a.id||a;d.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=d.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
d.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;d.forEach(d.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(d.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}f.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){f.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)}});f.Tooltip.defaultPosition=["after","before"];return f.Tooltip});
(function(){function d(b,c,e,g,j,i){if(c[b]){e.push(b);if(c[b]===true||c[b]===1)g.push(j+b+"/"+i)}}function f(b,c,e,g,j){c=g+c+"/"+j;require._fileExists(b.nameToUrl(c,null))&&e.push(c)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(b,c,e,g){g=g||{};var j=a.exec(b),i=j[1],k=j[4],m=j[5],o=k.split("-"),w=[],s={},v,u,t="";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){w.push(b);f(c,"root",w,i,m);for(v=0;u=o[v];v++){t+=(t?"-":"")+u;f(c,t,w,i,m)}c(w);e()}else c([b],function(q){var x=[];d("root",q,x,w,i,m);for(v=0;u=o[v];v++){t+=(t?"-":"")+u;d(t,q,x,w,i,m)}c(w,function(){var B,D;for(B=x.length-1;B>-1&&(u=x[B]);B--){D=q[u];if(D===true||D===1)D=c(i+u+"/"+m);require.mixin(s,D)}e(s)})})}})})();
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(d,f){d.declare("dijit.form.ValidationTextBox",f.form.TextBox,{templateString:d.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="",c=this.disabled||this.isValid(a);if(c)this._maskValidSubsetError=true;var e=this._isEmpty(this.textbox.value),g=!c&&a&&this._isValidSubset();this._set("state",c?"":((!this._hasBeenBlurred||a)&&e||g)&&this._maskValidSubsetError?
"Incomplete":"Error");f.setWaiState(this.focusNode,"invalid",c?"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(e)b=this.getPromptMessage(a);this.set("message",b);return c},displayMessage:function(a){f.hideTooltip(this.domNode);a&&this._focused&&f.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(e){switch(e.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":b+=e;break;case ")":b+="|$)";break;
default:b+="(?:"+e+"|$)";break}});try{"".search(b)}catch(c){b=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+b+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=d.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);f.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)}});d.declare("dijit.form.MappedTextBox",f.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=d.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});d.declare("dijit.form.RangeBoundTextBox",f.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,c=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){c=this.constraints.max;c=this.compare(a,typeof c!="number"||c>0?c:0);c=typeof c=="number"&&c>0}return b||c},_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=d.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?f.setWaiState(this.focusNode,"valuemin",this.constraints.min):f.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?f.setWaiState(this.focusNode,"valuemax",this.constraints.max):f.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){f.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return f.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(d,f){function a(q){var x="",B=navigator.platform.indexOf("Mac")!==-1;if(q.mod1)x+=B?"Cmd+":"Ctrl+";if(q.mod2)x+="Shift+";if(q.mod3)x+="Alt+";if(q.mod4&&B)x+="Ctrl+";if(q.alphaKey)return x+q.alphaKey;for(var D in d.keys)if(typeof(d.keys[D]==="number"))if(d.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 B=d.byId(x);if(!B)if(B=f.byId(x))B=B.domNode;x=B?B:null}if(x){x=d.position(x);q._setStyleAttr("left:"+(x.x+16)+"px !important;");q._setStyleAttr("top:"+(x.y+16)+"px !important;")}q.show()}
function c(q,x,B,D,h,l,n,p,r){n=function(A){return function(z){var E=f.byId(q),G=E.get("value");if(A&&z.keyCode===d.keys.ESCAPE){B&&d.style(x,"display","inline");E.destroyRecursive();l&&l()}else if(!(A&&z.keyCode!==d.keys.ENTER)){if(!E.isValid()||!r&&G===D)B&&d.style(x,"display","inline");else h(G);E.destroyRecursive();l&&l()}}};var y=new f.form.ValidationTextBox({id:q,required:true,value:D||""});d.place(y.domNode,x,"after");d.addClass(y.domNode,"userEditBoxPrompt");B&&d.style(x,"display","none");
d.connect(y,"onKeyDown",n(true));d.connect(y,"onBlur",n(false));window.setTimeout(function(){y.focus();if(D){var A=d.byId(q),z=p?D.indexOf(p):-1;z>0?f.selectInputText(A,0,z):A.select()}},0)}function e(q){var x=window.navigator.platform.indexOf("Mac")!==-1;return x&&q.metaKey||!x&&q.ctrlKey}function g(q,x){if(x&&e(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 B in x)x[B].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(B){var D=B.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);B.put("projects",h)})}function w(q){return typeof q.textContent!=="undefined"?q.textContent:q.innerText}function s(q){return w(document.createTextNode(q))}
function v(q,x){if(typeof q.textContent!=="undefined")q.textContent=x;else q.innerText=x}function u(q,x,B,D,h,l,n,p){h=h||x+"heading";l=l||x+"commands";d.place('<div class="toolComposite" id="'+x+'"><div class="layoutLeft" id="'+x+'"><span style: "inline-block;" id="'+h+'">'+B+'</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?d.addClass(x,"auxpaneHeading"):d.addClass(x,"paneHeading");n&&n.renderCommands(d.byId(l),"dom",p,p,"button");return d.byId(x)}function t(q){if(typeof q==="string")q=d.byId(q);for(;q;){var x=f.byId(q.id);if(x&&typeof x.layout==="function"){x.layout();return}q=q.parentNode}}return{getUserKeyString:a,openDialog:b,getUserText:c,openInNewWindow:e,followLink:g,makeRelative:j,makeFullPath:i,isAtRoot:k,processNavigatorParent:m,
rememberSuccessfulTraversal:o,getText:w,safeText:s,setText:v,createPaneHeading:u,forceLayout:t}});
define("orion/PageUtil",["require","exports","module"],function(){function d(f){f=f||window.location.toString();var a={resource:""},b=f.indexOf("#");if(b!==-1){f=f.substring(b+1);if(f.length!==0){f=f.split(",");a.resource=decodeURIComponent(f[0]);for(b=1;b<f.length;b++){var c=f[b].split("="),e=decodeURIComponent(c[0]);c=c.length===2?decodeURIComponent(c[1]):null;if(c!==null&&e!=="resource")a[e]=c}}}return a}return{matchResourceParameters:d}});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(d,f){d.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,b){var c=this.containerNode;if(b&&typeof b=="number"){var e=this.getChildren();if(e&&e.length>=b){c=e[b-1].domNode;b="after"}}d.place(a.domNode,c,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){d.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||!f.byNode(a)));return a&&f.byNode(a)},getIndexOfChild:function(a){return d.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){d.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return f._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(d,f){d.declare("dijit._KeyNavContainer",f._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,b){var c=this._keyNavCodes={},e=d.hitch(this,this.focusPrev),g=d.hitch(this,this.focusNext);d.forEach(a,function(j){c[j]=e});d.forEach(b,function(j){c[j]=g});c[d.keys.HOME]=d.hitch(this,"focusFirstChild");c[d.keys.END]=d.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){d.forEach(this.getChildren(),d.hitch(this,"_startupChild"))},addChild:function(a){f._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();d.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&d.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();d.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 c=this.getChildren(),e=0;e<c.length;e++){a||(a=c[b>0?0:c.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,b)}return null}});return f._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(d,f){d.declare("dijit._Contained",null,{getParent:function(){var a=f.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&&f.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 f._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(d,f){d.declare("dijit.MenuItem",[f._Widget,f._Templated,f._Contained,f._CssStateMixin],{templateString:d.cache("dijit","templates/MenuItem.html"),attributeMap:d.delegate(f._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";d.attr(this.containerNode,"id",a);if(this.accelKeyNode){d.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}f.setWaiState(this.domNode,"labelledby",a);d.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);d.stopEvent(a)},onClick:function(){},focus:function(){try{d.isIE==8&&this.containerNode.focus();f.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){d.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){d.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){d.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){f.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;d.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return f.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(d,f){d.declare("dijit.PopupMenuItem",f.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=d.query("*",this.srcNodeRef);f.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.popup=f.byNode(a)}d.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&d.style(this.arrowWrapper,"visibility","");f.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return f.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(d,f){d.declare("dijit.CheckedMenuItem",f.MenuItem,{templateString:d.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){d.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);f.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 f.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(d,f){d.declare("dijit.MenuSeparator",[f._Widget,f._Templated,f._Contained],{templateString:d.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);d.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return f.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(d,f){d.declare("dijit._MenuBase",[f._Widget,f._Templated,f._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){d.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(d.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;f.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);f.popup.close(this.currentPopup)}b.parentMenu=this;b.from_item=a;var c=this;f.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(){c.focusChild(a);c._cleanUp();a._setSelected(true);c.focusedChild=a},onExecute:d.hitch(this,"_cleanUp")});this.currentPopup=b;b.connect(b.domNode,"onmouseenter",d.hitch(c,"_onPopupHover"));if(b.focus)b._focus_timer=setTimeout(d.hitch(b,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;d.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;d.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){f._curFocus&&d.isDescendant(f._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();f.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()}});d.declare("dijit.Menu",f._MenuBase,{constructor:function(){this._bindings=[]},templateString:d.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(d.body()):d.forEach(this.targetNodeIds,this.bindDomNode,this);var a=d.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);
d.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else d.stopEvent(a);break}},_iframeContentWindow:function(a){return d.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&d.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&d.doc.frames[a.name]&&d.doc.frames[a.name].document||
null},bindDomNode:function(a){a=d.byId(a);var b;if(a.tagName.toLowerCase()=="iframe"){var c=a,e=this._iframeContentWindow(c);b=d.withGlobal(e,d.body)}else b=a==d.body()?d.doc.documentElement:a;var g={node:a,iframe:c};d.attr(a,"_dijitMenu"+this.id,this._bindings.push(g));var j=d.hitch(this,function(i){return[d.connect(i,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(k){d.stopEvent(k);this._scheduleOpen(k.target,c,{x:k.pageX,y:k.pageY})}),d.connect(i,"onkeydown",this,function(k){if(k.shiftKey&&
k.keyCode==d.keys.F10){d.stopEvent(k);this._scheduleOpen(k.target,c)}})]});g.connects=b?j(b):[];if(c){g.onloadHandler=d.hitch(this,function(){var i=this._iframeContentWindow(c);b=d.withGlobal(i,d.body);g.connects=j(b)});c.addEventListener?c.addEventListener("load",g.onloadHandler,false):c.attachEvent("onload",g.onloadHandler)}},unBindDomNode:function(a){var b;try{b=d.byId(a)}catch(c){return}a="_dijitMenu"+this.id;if(b&&d.hasAttr(b,a)){var e=d.attr(b,a)-1,g=this._bindings[e];d.forEach(g.connects,d.disconnect);
var j=g.iframe;if(j)j.removeEventListener?j.removeEventListener("load",g.onloadHandler,false):j.detachEvent("onload",g.onloadHandler);d.removeAttr(b,a);delete this._bindings[e]}},_scheduleOpen:function(a,b,c){if(!this._openTimer)this._openTimer=setTimeout(d.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:b,coords:c})}),1)},_openMyself:function(a){function b(){m.refocus&&f.focus(o);f.popup.close(m)}var c=a.target,e=a.iframe;if(a=a.coords){if(e){c=d.position(e,true);var g=
this._iframeContentWindow(e);g=d.withGlobal(g,"_docScroll",d);var j=d.getComputedStyle(e),i=d._toPixelValue,k=(d.isIE&&d.isQuirks?0:i(e,j.paddingLeft))+(d.isIE&&d.isQuirks?i(e,j.borderLeftWidth):0);e=(d.isIE&&d.isQuirks?0:i(e,j.paddingTop))+(d.isIE&&d.isQuirks?i(e,j.borderTopWidth):0);a.x+=c.x+k-g.x;a.y+=c.y+e-g.y}}else{a=d.position(c,true);a.x+=10;a.y+=10}var m=this,o=f.getFocus(this);f.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);f.popup.close(this)}},uninitialize:function(){d.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return f.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(d,f){d.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)){d.stopEvent(a);this._docHandler=this.connect(d.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var b=this.dropDown,c=false;if(a&&this._opened){var e=d.position(this._buttonNode,true);if(!(a.pageX>=e.x&&a.pageX<=e.x+e.w)||!(a.pageY>=e.y&&a.pageY<=e.y+e.h)){for(e=a.target;e&&!c;)if(d.hasClass(e,"dijitPopup"))c=true;else e=e.parentNode;if(c){e=a.target;if(b.onItemClick){for(var g;e&&!(g=f.byNode(e));)e=e.parentNode;g&&g.onClick&&g.getParent&&g.getParent().onItemClick(g,a)}return}}}this._opened&&b.focus&&b.autoFocus!==false&&window.setTimeout(d.hitch(b,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&d.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";d.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,c=a.target;if(b&&this._opened&&b.handleKey)if(b.handleKey(a)===false){d.stopEvent(a);return}if(b&&this._opened&&a.charOrCode==d.keys.ESCAPE){this.closeDropDown();d.stopEvent(a)}else if(!this._opened&&(a.charOrCode==d.keys.DOWN_ARROW||(a.charOrCode==d.keys.ENTER||a.charOrCode==" ")&&((c.tagName||"").toLowerCase()!=="input"||c.type&&c.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;d.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(d.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(f._curFocus&&this.dropDown&&d.isDescendant(f._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(d.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,b=a.domNode,c=this._aroundNode||this.domNode,e=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="";d.style(b,g);g=this.maxHeight;if(g==-1){g=d.window.getBox();var j=d.position(c,false);g=Math.floor(Math.max(j.y,g.h-(j.y+j.h)))}a.startup&&
!a._started&&a.startup();f.popup.moveOffScreen(a);j=d._getMarginSize(b);var i=g&&j.h>g;d.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=c.offsetWidth;else if(this.autoWidth)j.w=Math.max(j.w,c.offsetWidth);else delete j.w;d.isFunction(a.resize)?a.resize(j):d.marginBox(b,j)}a=f.popup.open({parent:this,popup:a,around:c,orient:f.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){e.closeDropDown(true)},onCancel:function(){e.closeDropDown(true)},onClose:function(){d.attr(e._popupStateNode,"popupActive",false);d.removeClass(e._popupStateNode,"dijitHasDropDownOpen");e._opened=false}});d.attr(this._popupStateNode,"popupActive","true");d.addClass(e._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();f.popup.close(this.dropDown);this._opened=false}}});
return f._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(d,f){d.declare("dijit.form.Button",f.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:d.cache("dijit.form","templates/Button.html"),attributeMap:d.delegate(f.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 c=f.byNode(b);if(c&&typeof c._onSubmit=="function"){c._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);d.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&&d.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){d.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=d.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){d.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});d.declare("dijit.form.DropDownButton",[f.form.Button,f._Container,f._HasDropDown],{baseClass:"dijitDropDownButton",templateString:d.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
d.query("*",this.srcNodeRef);f.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=d.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=f.byNode(a);delete this.dropDownContainer}this.dropDown&&f.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=d.connect(a,"onLoad",this,function(){d.disconnect(b);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});d.declare("dijit.form.ComboButton",f.form.DropDownButton,{templateString:d.cache("dijit.form","templates/ComboButton.html"),attributeMap:d.mixin(d.clone(f.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==d.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){f.focus(this._popupStateNode);d.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==d.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){f.focus(this.titleNode);d.stopEvent(a)}},focus:function(a){this.disabled||f.focus(a=="start"?this.titleNode:this._popupStateNode)}});
d.declare("dijit.form.ToggleButton",f.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:d.mixin(d.clone(f.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,b){this._set("checked",a);d.attr(this.focusNode||this.domNode,"checked",a);f.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,b)},setChecked:function(a){d.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 f.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(d,f){return f.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(d,f){d.declare("dijit.layout._LayoutWidget",[f._Widget,f._Container,f._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);d.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(d.isIE?
this.domNode:d.global,"onresize",function(){this.resize()})}}},resize:function(a,b){var c=this.domNode;if(a){d.marginBox(c,a);if(a.t)c.style.top=a.t+"px";if(a.l)c.style.left=a.l+"px"}b=b||{};d.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=d.mixin(d.marginBox(c),b);a=d.getComputedStyle(c);var e=d._getMarginExtents(c,a),g=d._getBorderExtents(c,a);b=this._borderBox={w:b.w-(e.w+g.w),h:b.h-(e.h+g.h)};e=d._getPadExtents(c,a);this._contentBox={l:d._toPixelValue(c,a.paddingLeft),t:d._toPixelValue(c,a.paddingTop),
w:b.w-e.w,h:b.h-e.h};this.layout()},layout:function(){},_setupChild:function(a){d.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){d.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});f.layout.marginBox2contentBox=function(a,b){var c=d.getComputedStyle(a),e=d._getMarginExtents(a,
c),g=d._getPadBorderExtents(a,c);return{l:d._toPixelValue(a,c.paddingLeft),t:d._toPixelValue(a,c.paddingTop),w:b.w-(e.w+g.w),h:b.h-(e.h+g.h)}};(function(){var a=function(c){return c.substring(0,1).toUpperCase()+c.substring(1)},b=function(c,e){var g=c.resize?c.resize(e):d.marginBox(c.domNode,e);if(g)d.mixin(c,g);else{d.mixin(c,d.marginBox(c.domNode));d.mixin(c,e)}};f.layout.layoutChildren=function(c,e,g,j,i){e=d.mixin({},e);d.addClass(c,"dijitLayoutContainer");g=d.filter(g,function(k){return k.region!=
"center"&&k.layoutAlign!="client"}).concat(d.filter(g,function(k){return k.region=="center"||k.layoutAlign=="client"}));d.forEach(g,function(k){var m=k.domNode,o=k.region||k.layoutAlign,w=m.style;w.left=e.l+"px";w.top=e.t+"px";w.position="absolute";d.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=e.w;b(k,m);e.h-=k.h;if(o=="top")e.t+=k.h;else w.top=e.t+e.h+"px"}else if(o=="left"||o=="right"){m.h=e.h;b(k,m);e.w-=k.w;if(o==
"left")e.l+=k.w;else w.left=e.l+e.w+"px"}else if(o=="client"||o=="center")b(k,e)})}})();return f.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(d,f){d.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){d.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=f._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(d.isIE?this.domNode:d.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=d.query("> *",this.containerNode).filter(function(e){return e.tagName!=="SCRIPT"}),b=a.filter(function(e){return d.hasAttr(e,"data-dojo-type")||d.hasAttr(e,"dojoType")||d.hasAttr(e,"widgetId")}),c=d.filter(b.map(f.byNode),function(e){return e&&
e.domNode&&e.resize});if(a.length==b.length&&c.length==1)this._singleChild=c[0];else delete this._singleChild;d.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&&d.marginBox(this.domNode,
a);var c=this.containerNode;if(c===this.domNode){b=b||{};d.mixin(b,a||{});if(!("h"in b)||!("w"in b))b=d.mixin(d.marginBox(c),b);this._contentBox=f.layout.marginBox2contentBox(c,b)}else this._contentBox=d.contentBox(c);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||d.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else d.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"&&!d.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 f.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(d){d.getObject("html",true,d);(function(){var f=0;d.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};d.html._emptyNode=d.empty;d.html._setNodeContent=function(a,b){d.empty(a);if(b){if(typeof b=="string")b=d._toDom(b,a.ownerDocument);if(!b.nodeType&&d.isArrayLike(b))for(var c=b.length,e=0;e<b.length;e=c==b.length?e+1:0)d.place(b[e],a,"last");else d.place(b,a,"last")}return a};d.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:d._scopeName,startup:true,constructor:function(a,b){d.mixin(this,a||{});b=this.node=d.byId(this.node||b);if(!this.id)this.id=["Setter",b?b.id||b.tagName:"",f++].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=d.html._setNodeContent(a,this.content)}catch(b){var c=this.onContentError(b);try{a.innerHTML=c}catch(e){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+e.message,e)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){d.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}d.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(d.isString(a)){if(this.cleanContent)a=d.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={},c;for(c in a)c in b||(this[c]=a[c])},_parse:function(){var a=this.node;try{var b={};d.forEach(["dir","lang","textDir"],
function(e){if(this[e])b[e]=this[e]},this);this.parseResults=d.parser.parse({rootNode:a,noStart:!this.startup,inherited:b,scope:this.parserScope})}catch(c){this._onError("Content",c,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,b,c){a=this["on"+a+"Error"].call(this,b);if(c)console.error(c,b);else a&&d.html._setNodeContent(this.node,a,true)}});d.html.set=function(a,b,c){if(undefined==b){console.warn("dojo.html.set: no cont argument provided, using empty string");b=""}return c?(new d.html._ContentSetter(d.mixin(c,
{content:b,node:a}))).set():d.html._setNodeContent(a,b,true)}})();return d.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(d,f){d.declare("dijit.layout.ContentPane",[f._Widget,f.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:d._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:d.delegate(f._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,b){if((!a||!a.template)&&b&&!("href"in a)&&!("content"in a)){var c=d.doc.createDocumentFragment();for(b=d.byId(b);b.firstChild;)c.appendChild(b.firstChild);a=d.delegate(a,{content:c})}this.inherited(arguments,[a,b])},postMixInProperties:function(){this.inherited(arguments);var a=d.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=d.string.substitute(this.loadingMessage,a);this.errorMessage=d.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";d.attr(this.domNode,"role")||f.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&d.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&d.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){d.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 d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.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){d.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 d.Deferred(d.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(d.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 d.Deferred(d.hitch(this,"cancel"));this.onLoadDeferred.addCallback(d.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"};d.isObject(this.ioArgs)&&d.mixin(b,this.ioArgs);var c=this._xhrDfd=(this.ioMethod||d.xhrGet)(b);c.addCallback(function(e){try{a._isDownloaded=true;a._setContent(e,false);a.onDownloadEnd()}catch(g){a._onError("Content",g)}delete a._xhrDfd;return e});c.addErrback(function(e){c.canceled||a._onError("Download",e);delete a._xhrDfd;return e});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;d.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive()});if(a){d.forEach(a.parseResults,
function(b){b.destroyRecursive&&b.domNode&&b.domNode.parentNode==d.body()&&b.destroyRecursive()});delete a.parseResults}d.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,b){this.destroyDescendants();var c=this._contentSetter;if(!(c&&c instanceof d.html._ContentSetter))c=this._contentSetter=new d.html._ContentSetter({node:this.containerNode,_onError:d.hitch(this,this._onError),onContentError:d.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 e=d.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});c.set(d.isObject(a)&&a.domNode?a.domNode:a,e);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!b){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,b,c){this.onLoadDeferred.errback(b);a=this["on"+a+"Error"].call(this,b);if(c)console.error(c,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 f.layout.ContentPane});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(d,f){d.declare("dijit.form._FormMixin",null,{state:"",reset:function(){d.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return d.every(d.map(this.getDescendants(),function(b){b._hasBeenBlurred=true;var c=b.disabled||!b.validate||b.validate();if(!c&&!a){d.window.scrollIntoView(b.containerNode||b.domNode);b.focus();a=true}return c}),function(b){return b})},setValues:function(a){d.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var b={};d.forEach(this.getDescendants(),function(j){if(j.name)(b[j.name]||(b[j.name]=[])).push(j)});for(var c in b)if(b.hasOwnProperty(c)){var e=b[c],g=d.getObject(c,false,a);if(g!==undefined){d.isArray(g)||(g=[g]);if(typeof e[0].checked=="boolean")d.forEach(e,function(j){j.set("value",d.indexOf(g,j.value)!=-1)});else e[0].multiple?e[0].set("value",g):d.forEach(e,function(j,
i){j.set("value",g[i])})}}},getValues:function(){d.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};d.forEach(this.getDescendants(),function(b){var c=b.name;if(!(!c||b.disabled)){var e=b.get("value");if(typeof b.checked=="boolean")if(/Radio/.test(b.declaredClass))if(e!==false)d.setObject(c,e,a);else{e=d.getObject(c,false,a);e===undefined&&d.setObject(c,null,a)}else{b=d.getObject(c,false,a);
if(!b){b=[];d.setObject(c,b,a)}e!==false&&b.push(e)}else{b=d.getObject(c,false,a);if(typeof b!="undefined")d.isArray(b)?b.push(e):d.setObject(c,[b,e],a);else d.setObject(c,e,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=d.map(this._descendants,function(b){return b.get("state")||""});return d.indexOf(a,"Error")>=0?"Error":d.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){d.forEach(this._childConnections||
[],d.hitch(this,"disconnect"));d.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}:d.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var c=this._childConnections=[],e=this._childWatches=[];d.forEach(d.filter(this._descendants,function(j){return j.validate}),function(j){d.forEach(["state","disabled"],function(i){e.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)};d.forEach(d.filter(this._descendants,function(j){return j.onChange}),function(j){c.push(b.connect(j,"onChange",g));e.push(j.watch("disabled",g))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,b,c){this.onValidStateChange(c=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return f.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(d,f){d.declare("dijit._DialogMixin",null,{attributeMap:f._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=f._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return f._DialogMixin});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(d,f){d.declare("dijit.TooltipDialog",[f.layout.ContentPane,f._Templated,f.form._FormMixin,f._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:d.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,c){a="dijitTooltipAB"+(c.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(c.charAt(0)=="T"?"Below":"Above");d.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);f.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,c=d.keys;a.charOrCode===c.TAB&&this._getFocusItems(this.containerNode);var e=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==c.ESCAPE){setTimeout(d.hitch(this,"onCancel"),0);d.stopEvent(a)}else if(b==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){e||f.focus(this._lastFocusItem);d.stopEvent(a)}else if(b==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){e||f.focus(this._firstFocusItem);d.stopEvent(a)}else a.charOrCode===
c.TAB&&a.stopPropagation()}});return f.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(d,f,a,b,c){function e(t,q,x,B,D){this.commandService=t;this.handler=q;this.items=x;this.userData=B;this.command=D;if(D.parameters)this.parameters=D.parameters.makeCopy();this.id=D.id}function g(t){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups=
{};this._ungrouped={};this._topics={};this._activeBindings={};this._urlBindings={};this._init(t);this._parameterCollector=null}function j(t,q,x){f.addClass(q,"commandImage");var B;if(t.imageClass){B=f.create("span",{},q,"last");f.addClass(B,t.spriteClass);f.addClass(B,t.imageClass)}else{B=new Image;B.alt=t.name;B.name=x;B.id=x;B.src=t.image;f.place(B,q,"last")}return B}function i(t){this._init(t)}function k(t,q,x,B,D){this.keyCode=typeof t==="string"?t.toUpperCase().charCodeAt(0):t;this.mod1=q!==
undefined&&q!==null?q:false;this.mod2=x!==undefined&&x!==null?x:false;this.mod3=B!==undefined&&B!==null?B:false;this.mod4=D!==undefined&&D!==null?D:false}function m(t,q){this.token=t;this.parameterName=q}function o(t,q,x,B){this.name=t;this.type=q;this.label=x;this.value=B}function w(t,q,x){this._storeParameters(t);this.options=q;this.optionsRequested=false;this.getParameters=x}e.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()}};e.prototype.constructor=
e;var s=f.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}}),v=f.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(f.hitch(this,
function(){if(this._stillInDocument(this._connectNode))this.pollForMissingTarget();else{this.polling=false;this.close()}}),1E3)},_stillInDocument:function(t){for(;t;){if(t===window.document)return true;t=t.parentNode}return false},postMixInProperties:function(){this.inherited(arguments);this.options.commandParent&&a.byId(this.options.commandParent.id)&&f.connect(this.options.commandParent,"onClose",f.hitch(this,function(){this.close()}))}});g.prototype={_init:function(t){this._registry=t.serviceRegistry;
this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=t.selection;f.connect(window.document,"onkeydown",f.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(t){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(t)){var B=this._activeBindings[x],D=B.invocation;if(D){var h=B.command;if(h.hrefCallback){q(t);t=h.hrefCallback.call(D.handler||window,D);t.then?t.then(function(l){window.open(l)}):
window.open(t);return}else if(h.callback){q(t);window.setTimeout(f.hitch(this,function(){D.parameters&&this.collectsParameters()?this._collectParameters(D):h.callback.call(D.handler||window,D)}),0);return}}}},processURL:function(t){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(t);if(x){var B=this._urlBindings[q],D=B.command,h=B.invocation;if(h&&h.parameters&&D.callback){h.parameters.setValue(x.parameterName,
x.parameterValue);window.setTimeout(f.hitch(this,function(){this._collectParameters(h)}),0);return}}}},findCommand:function(t){return this._objectScope[t]||this._domScope[t]||this._globalScope[t]},runCommand:function(t){var q=this._urlBindings[t];q&&q.command&&q.command.callback&&window.setTimeout(f.hitch(this,function(){this._collectParameters(q.invocation)}),0)},getSelectionService:function(){return this._selection},setParameterCollector:function(t){this._parameterCollector=t},openParameterCollector:function(t,
q){if(this._parameterCollector){this._parameterCollector.close();this._parameterCollector.open(t,q)}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_collectParameters:function(t){var q=false;if(this._parameterCollector){t.parameters.updateParameters(t);q=t.parameters.hasParameters()?this._parameterCollector.collectParameters(t):false}if(!q&&t.parameters.hasParameters()){var x=new a.TooltipDialog({onBlur:function(){a.popup.close(x)}}),
B=f.create("div"),D=this._parameterCollector.getFillFunction(t,function(){a.popup.close(x)})(B);x.set("content",B);B=(B=a.byId(t.domParent.id))?f.position(B.eclipseScopeId,true):f.position(t.domNode,true);if(B.x&&B.y&&B.w){a.popup.open({popup:x,x:B.x+B.w-8,y:B.y+8});window.setTimeout(function(){D.focus();D.select()},0);q=true}}if(!q){t.parameters=null;t.command.callback.call(t.handler,t)}},showKeyBindings:function(t){for(var q in this._activeBindings)this._activeBindings[q]&&this._activeBindings[q].keyBinding&&
this._activeBindings[q].command&&f.place('<span role="listitem">'+b.getUserKeyString(this._activeBindings[q].keyBinding)+" = "+this._activeBindings[q].command.name+"<br></span>",t,"last")},addCommand:function(t,q){switch(q){case "dom":this._domScope[t.id]=t;break;case "object":this._objectScope[t.id]=t;break;case "global":this._globalScope[t.id]=t;break;default:throw"unrecognized command scope "+q;}},addCommandGroup:function(t,q,x,B,D){var h=this._namedGroups;if(B)h=this._createEntryForPath(B);if(h[t]){if(x)h[t].title=
x;if(q)h[t].position=q;if(D)h[t].scopeId=D}else{h[t]={title:x,position:q,children:{},scopeId:D};h.sortedCommands=null}},_createEntryForPath:function(t){var q=this._namedGroups;if(t){t=t.split("/");for(var x=0;x<t.length;x++)if(t[x].length>1){q[t[x]]||(q[t[x]]={position:0,children:{}});q=q[t[x]].children}}return q},registerCommandContribution:function(t,q,x,B,D,h,l){B=!x&&!B?this._ungrouped:this._createEntryForPath(B);B[t]={scopeId:x,position:q};if(h)if(q=this._domScope[t]||this._globalScope[t])this._activeBindings[t]=
{command:q,keyBinding:h,bindingOnly:D};if(l)if(q=this._domScope[t]||this._globalScope[t])this._urlBindings[t]={command:q,urlBinding:l,bindingOnly:D};B.sortedCommands=null},_isLastChildSeparator:function(t,q){if(q==="tool"||q==="button")return t.childNodes.length>0&&f.hasClass(t.childNodes[t.childNodes.length-1],"commandSeparator");if(q==="menu"){t=t.getChildren();return t.length>0&&t[t.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(t,q,x,B,D,h,l,n,p){if(typeof t==="string")t=
f.byId(t);if(t){if(!t.id||t.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,t,q,x,B,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,t,q,x,B,D,h,l,r,n,p);if(D==="tool"||D==="button")this._isLastChildSeparator(t,D)&&t.removeChild(t.childNodes[t.childNodes.length-
1]);else if(D==="menu")if(this._isLastChildSeparator(t,D)){x=t.getChildren()[t.getChildren().length-1];t.removeChild(x);x.destroy()}if(q==="dom"||q==="global")b.forceLayout(t)}else{var y=this;this._selection&&this._selection.getSelections(function(A){y.renderCommands(t,q,A,B,D,h,l,n,p)})}},_render:function(t,q,x,B,D,h,l,n,p,r,y){var A=t.sortedCommands;if(!A){A=[];for(var z in t){var E=t[z];if(E&&typeof E.position==="number"){E.id=z;A.push(E)}}A.sort(function(S,C){return S.position-C.position});t.sortedCommands=
A}for(t=0;t<A.length;t++){var G,M;if(A[t].children){z=A[t];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(A[t].children,G,x,B,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});f.addClass(G.domNode,"commandMenu");f.destroy(G.valueNode);if(z.title==="*"){f.addClass(G.domNode,"textless");new v({connectId:[G.domNode],label:"Actions menu",position:["above","left","right","below"],commandParent:q,commandService:this})}E._setupActivateVisuals(G.domNode,G.focusNode,r,y);f.place(G.domNode,q,"last")}else{G=h+E.id+t;M=new e(this,D,B,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(A[t].children,q,x,B,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(A[t].children,E,x,B,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(A[t].children,
q,x,B,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[A[t].id])?true:false;H=H=null;if(z){if(x==="dom"||x==="global")E=h==="tool"||h==="button"?q.id===A[t].scopeId:h==="menu"?q.eclipseScopeId===A[t].scopeId:false;else if(x==="object")E=!A[t].scopeId;var P=E&&(x==="global"||x==="dom");M=new e(this,D,B,n,z);M.domParent=q;G=E&&(z.visibleWhen?z.visibleWhen(B):true);if(P&&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(P&&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){f.addClass(G.iconNode,"commandImage");G.iconNode.src=z.image}f.place(G.domNode,q,"last");G.eclipseCommand=z;G.eclipseChoices=E;f.connect(G,"onClick",
G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,B,D,n)})}else if(h==="menu"){G=new a.PopupMenuItem({label:z.name,popup:E});q.addChild(G);G.eclipseCommand=z;G.eclipseChoices=E;f.connect(q,"_openPopup",G,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,B,D,n)})}}else if(h==="tool"){G="tool"+z.id+t;z._addTool(q,l,G,M,r,y)}else if(h==="button"){G="button"+z.id+t;z._addButton(q,l,G,M,r,y)}else h==="menu"&&z._addMenuItem(q,M,r,y)}}},whenHidden:function(t,q){t=
typeof t==="string"?t:t.id;if(!this.hidden)this.hidden={};if(this.hidden[t])this.hidden[t].push(q);else this.hidden[t]=[q]},generateSeparatorImage:function(t){t=f.create("span",null,t,"last");f.addClass(t,"core-sprite-sep");f.addClass(t,"imageSprite");f.addClass(t,"commandSeparator");return t}};g.prototype.constructor=g;i.prototype={_init:function(t){this.id=t.id;this.name=t.name;this.tooltip=t.tooltip||t.name;this.callback=t.callback;this.hrefCallback=t.hrefCallback;this.choiceCallback=t.choiceCallback;
this.image=t.image||d.toUrl("images/none.png");this.imageClass=t.imageClass;this.spriteClass=t.spriteClass||"commandSprite";this.visibleWhen=t.visibleWhen;this.parameters=t.parameters},_addTool:function(t,q,x,B,D,h){B.handler=B.handler||this;var l,n;if(this.hrefCallback){l=this._makeLink(B);if(!l)return}else{l=f.create("span",{tabindex:"0",role:"button"});if(q||!this.hasImage()){q=window.document.createTextNode(this.name);f.place(q,l,"last");f.addClass(l,"commandMissingImageButton commandButton")}else{n=
j(this,l,x);this._addAccessibleLabel(l)}this._hookCallback(l,B);this._setupActivateVisuals(l,l,D,h,n?"commandImageOver":"commandButtonOver")}B.domNode=l;B.domParent=t;this.tooltip&&new v({connectId:[l],label:this.tooltip,position:["above","left","right","below"],commandParent:t,commandService:B.commandService});f.place(l,t,"last")},_addButton:function(t,q,x,B,D,h){B.handler=B.handler||this;if(this.hrefCallback){q=this._makeLink(B);if(!q)return}else{q=f.create("span",{tabindex:"0",role:"button"});
this._hookCallback(q,B);var l;if(this.name){f.place(window.document.createTextNode(this.name),q,"last");f.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 v({connectId:[q],label:this.tooltip,position:["above","left","right","below"],commandParent:t,commandService:B.commandService});B.domParent=t;B.domNode=q;f.place(q,t,"last")},_addMenuItem:function(t,q){q.domParent=t.domNode;
var x=new s({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new v({connectId:[x.domNode],label:this.tooltip,commandParent:t,commandService:q.commandService});if(this.hrefCallback){var B=this.hrefCallback.call(q.handler,q);if(B)if(B.then)B.then(f.hitch(this,function(D){x.set("label","<a href='"+D+"'>"+this.name+"</a>")}));else if(B)x.set("label","<a href='"+B+"'>"+this.name+"</a>");else return}else if(this.callback)x.onClick=
this.parameters&&q.collectsParameters()?f.hitch(this,function(){q.commandService._collectParameters(q)}):f.hitch(this,function(){this.callback.call(q.handler,q)});x.eclipseCommand=this;t.addChild(x);if(this.imageClass)f.addClass(x.iconNode,this.spriteClass);else if(this.image){f.addClass(x.iconNode,"commandMenuItem");x.iconNode.src=this.image}q.domNode=x.domNode},_makeLink:function(t){var q=f.create("a",{tabindex:"0"});f.addClass(q,"commandLink");f.place(window.document.createTextNode(this.name),
q,"last");t=this.hrefCallback.call(t.handler,t);if(t.then)t.then(function(x){q.href=x});else if(t)q.href=t;else return null;return q},_hookCallback:function(t,q){f.connect(t,"onclick",this,function(){if(this.parameters&&q.collectsParameters())q.commandService._collectParameters(q);else this.callback&&this.callback.call(q.handler,q)});f.connect(t,"onkeypress",this,function(x){if(x.keyCode===f.keys.ENTER||x.keyCode===f.keys.SPACE)if(this.parameters&&q.collectsParameters())q.commandService._collectParameters(q);
else this.callback&&this.callback.call(q.handler,q)})},_addAccessibleLabel:function(t){var q=this.name||this.tooltip;q&&f.attr(t,"aria-label",q)},_setupActivateVisuals:function(t,q,x,B,D){B&&f.addClass(t,B);var h=function(){D&&f.addClass(this,D);x&&f.addClass(this,x);B&&f.removeClass(this,B)},l=function(){D&&f.removeClass(this,D);x&&f.removeClass(this,x);B&&f.addClass(this,B)};f.connect(t,"onmouseover",t,h);f.connect(q,"onfocus",t,h);f.connect(t,"onmouseout",t,l);f.connect(q,"onblur",t,l)},populateChoicesMenu:function(t,
q,x,B){t.focusedChild=null;f.forEach(t.getChildren(),function(l){t.removeChild(l);l.destroy()});x=this.getChoices(q,x,B);for(B=0;B<x.length;B++){var D=x[B],h;if(D.name){h=new a.MenuItem({label:D.name,iconClass:D.imageClass,onClick:this.makeChoiceCallback(D,q)});if(D.imageClass)f.addClass(h.iconNode,D.spriteClass||"commandSprite");else if(D.image){f.addClass(h.iconNode,"commandImage");h.iconNode.src=D.image}}else h=new a.MenuSeparator;t.addChild(h)}},getChoices:function(t,q,x){if(this.choiceCallback)return this.choiceCallback.call(q,
t,x);return null},makeChoiceCallback:function(t,q){return function(x){t.callback&&t.callback.call(t,q,x)}},hasImage:function(){return this.imageClass||this.image!==d.toUrl("images/none.png")}};i.prototype.constructor=i;var u=window.navigator.platform.indexOf("Mac")!==-1;k.prototype={match:function(t){if(this.keyCode===t.keyCode){if(this.mod1!==(u?t.metaKey:t.ctrlKey))return false;if(this.mod2!==t.shiftKey)return false;if(this.mod3!==t.altKey)return false;if(u&&this.mod4!==t.ctrlKey)return false;return true}return false},
equals:function(t){if(!t)return false;if(this.keyCode!==t.keyCode)return false;if(this.mod1!==t.mod1)return false;if(this.mod2!==t.mod2)return false;if(this.mod3!==t.mod3)return false;if(this.mod4!==t.mod4)return false;return true}};k.prototype.constructor=k;m.prototype={match:function(t){t=c.matchResourceParameters(t);if(typeof t[this.token]!=="undefined"){this.parameterValue=t[this.token];return this}return null}};m.prototype.constructor=m;o.prototype={optionsRequested:function(){return this.optionsRequested}};
o.prototype.constructor=o;w.prototype={_storeParameters:function(t){this.parameterTable=null;if(t){this.parameterTable={};for(var q=0;q<t.length;q++)this.parameterTable[t[q].name]=t[q]}},updateParameters:function(t){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(t))},hasParameters:function(){return this.parameterTable!==null},parameterNamed:function(t){return this.parameterTable[t]},valueFor:function(t){if(t=this.parameterTable[t])return t.value;return null},setValue:function(t,
q){if(t=this.parameterTable[t])t.value=q},forEach:function(t){for(var q in this.parameterTable)this.parameterTable[q].type&&this.parameterTable[q].name&&t(this.parameterTable[q])},makeCopy:function(){var t=[];this.forEach(function(q){q=new o(q.name,q.type,q.label,q.value);t.push(q)});return new w(t,this.options,this.getParameters)}};w.prototype.constructor=w;return{CommandService:g,CommandKeyBinding:k,Command:i,CommandInvocation:e,CommandMenuItem:s,URLBinding:m,ParametersDescription:w,CommandParameter:o,
CommandTooltip:v}});
define("orion/parameterCollectors",["require","dojo","dijit","orion/commands","orion/util","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(d,f,a,b,c){function e(){this._activeContainer=null}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&f.empty(this._activeElements.parameterArea);if(this._activeElements.parameterContainer){f.removeClass(this._activeElements.parameterContainer,"slideActive");f.removeClass(this._activeElements.slideContainer,"slideContainerActive")}this._activeElements.dismissArea&&
f.empty(this._activeElements.dismissArea);this._activeElements.commandNode&&f.removeClass(this._activeElements.commandNode,"activeCommand");c.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=f.byId(g);for(var k=g;k;){if(f.hasClass(k,"toolComposite")){i=k;break}k=k.parentNode}if(f.hasClass(g,"commandMarker"))j.commandNode=
g;if(i){j.slideContainer=f.query(".slideParameters",i)[0];j.parameterContainer=f.query(".slide",i)[0];j.parameterArea=f.query(".parameters",i)[0];j.dismissArea=f.query(".parametersDismiss",i)[0]}return j},open:function(g,j){if(typeof g==="string")g=f.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=f.query("#closebox",this._activeElements.parameterArea);if(g.length===0){g=f.create("span",{id:"closebox",role:"button",tabindex:"0"},this._activeElements.dismissArea||this._activeElements.parameterArea,"last");f.addClass(g,"imageSprite");f.addClass(g,"core-sprite-close");f.addClass(g,"dismiss");g.title="Close";f.connect(g,"onclick",f.hitch(this,function(){this.close(this._activeElements)}));f.connect(g,"onkeypress",f.hitch(this,function(k){k.keyCode===f.keys.ENTER&&this.close(this._activeElements)}))}f.addClass(this._activeElements.slideContainer,
"slideContainerActive");f.addClass(this._activeElements.parameterContainer,"slideActive");c.forceLayout(this._activeElements.parameterContainer);if(i){this._oldFocusNode=window.document.activeElement;window.setTimeout(function(){i.focus();i.select()},0)}this._activeElements.commandNode&&f.addClass(this._activeElements.commandNode,"activeCommand");return true}return false},_collectAndCall:function(g,j){f.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&&f.addClass(g.domNode,"commandMarker");return this.open(g.domNode||g.domParent,this.getFillFunction(g))}return false},getFillFunction:function(g,j){return f.hitch(this,function(i){var k=null,m=f.hitch(this,function(){j?j():this.close(g.domNode)}),o=f.hitch(this,function(v){v.keyCode===f.keys.ENTER&&this._collectAndCall(g,i);if(v.keyCode===f.keys.ESCAPE||v.keyCode===f.keys.ENTER){m();
f.stopEvent(v)}});g.parameters.forEach(function(v){v.label&&f.place(document.createTextNode(v.label),i,"last");var u=f.create("input",{type:v.type},i,"last");f.addClass(u,"parameterInput");f.addClass(u,"parameterInput"+v.type);u.setAttribute("speech","speech");u.setAttribute("x-webkit-speech","x-webkit-speech");u.parameterName=v.name;k||(k=u);if(v.value)u.value=v.value;f.connect(u,"onkeypress",o)});var w=function(v){v._collectAndCall(g,i);m()};if(g.parameters.options){g.parameters.optionsRequested=
false;var s=f.create("span",{role:"button",tabindex:"0"},i,"last");f.place(window.document.createTextNode("More"),s,"last");f.addClass(s,"dismiss");f.connect(s,"onclick",f.hitch(this,function(){g.parameters.optionsRequested=true;w(this)}));f.connect(s,"onkeypress",f.hitch(this,function(v){if(v.keyCode===f.keys.ENTER){g.parameters.optionsRequested=true;w(this)}}))}spacer=f.create("span",null,i,"last");f.addClass(spacer,"dismiss");s=f.create("span",{role:"button",tabindex:"0"},i,"last");f.place(window.document.createTextNode("Submit"),
s,"last");f.addClass(s,"dismiss");f.connect(s,"onclick",f.hitch(this,function(){w(this)}));f.connect(s,"onkeypress",f.hitch(this,function(v){v.keyCode===f.keys.ENTER&&w(this)}));spacer=f.create("span",null,i,"last");f.addClass(spacer,"dismiss");s=f.create("span",{id:"closebox",role:"button",tabindex:"0"},i,"last");f.addClass(s,"imageSprite");f.addClass(s,"core-sprite-close");f.addClass(s,"dismiss");s.title="Close";f.connect(s,"onclick",f.hitch(this,function(){m()}));f.connect(s,"onkeypress",f.hitch(this,
function(v){v.keyCode===f.keys.ENTER&&m()}));return k})}};e.prototype.constructor=e;return{CommandParameterCollector:e}});define("orion/editor/regex",[],function(){function d(a){return a.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function f(a){if(a=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(a))return{pattern:a[1],flags:a[2]};return null}return{escape:d,parse:f}});
define("orion/contentTypes",[],function(){function d(a){function b(k,m,o,w){o=m.filename.indexOf(o)>=0;var s=m.extension.indexOf(w)>=0;if(o||s)if(!k||o&&k.extension.indexOf(w)>=0)return m;return k}for(var c=a&&a.split(".").pop(),e=this.getContentTypes(),g=null,j=0;j<e.length;j++){var i=e[j];if(b(g,i,a,c)===i)g=i}return g}function f(a){function b(c){function e(o){if(o===null||typeof o==="undefined")return[];return o instanceof Array?o:[o]}c=c.getServiceReferences("orion.file.contenttype");for(var g=
{},j=0;j<c.length;j++)for(var i=e(c[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:e(m.extension),filename:e(m.filename)})}return g}this.serviceRegistry=a;this.map=b(a);a.registerService("orion.file.contenttypes",this)}f.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return d.call(this,a.Name)},getFilenameContentType:function(a){return d.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 c={};a&&(a=this.getContentType(a["extends"]));){if(a.id===b.id)return true;if(c[a.id])throw new Error("Cycle: "+a.id);c[a.id]=true}}return false},
isSomeExtensionOf:function(a,b){for(var c=0;c<b.length;c++)if(this.isExtensionOf(a,b[c]))return true;return false}};return{ContentTypeService:f}});
define("orion/URITemplate",["require","exports","module"],function(){function d(m){this._text=m}function f(m,o){if(o==="U")return encodeURIComponent(m).replace(/[!'()*]/g,function(w){return"%"+w.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,w){for(var s=[],v=0;v<m.length;v++)typeof m[v]!==
"undefined"&&s.push(f(m[v],o));return s.join(w)}function b(m,o,w,s){for(var v=Object.keys(m),u=[],t=0;t<v.length;t++)typeof m[v[t]]!=="undefined"&&u.push(f(v[t],o)+w+f(m[v[t]],o));return u.join(s)}function c(m){for(var o=[],w=m.split(","),s=0;s<w.length;s++){var v=w[s].match(k);if(v===null)throw new Error("Bad VarSpec: "+m);o.push({name:v[1],explode:!!v[2],prefix:v[3]?parseInt(v[3],10):-1})}return o}function e(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=c(m)}function g(m){for(var o=[],w=0,s=m.indexOf("{",w);s!==-1;){o.push(new d(m.substring(w,s)));w=m.indexOf("}",s+1);if(w===-1)throw new Error("Invalid template: "+m);o.push(new e(m.substring(s+1,w)));w=w+1;s=m.indexOf("{",w)}o.push(new d(m.substring(w)));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]+))?$/;d.prototype=
{expand:function(){return encodeURI(this._text)}};e.prototype={expand:function(m){for(var o=[],w=0;w<this._varSpecList.length;w++){var s=this._varSpecList[w],v=s.name,u=m[v],t=typeof u;if(t!=="undefined"&&u!==null){var q=o.length===0?this._operator.first:this._operator.sep;if(t==="string"){if(this._operator.named){q+=f(v,"U+R");q+=u.length===0?this._operator.ifemp:"="}if(s.prefix!==-1&&s.prefix<u.length)u=u.substring(0,s.prefix);q+=f(u,this._operator.allow)}else if(Array.isArray(u))if(s.explode)q+=
a(u,this._operator.allow,this._operator.sep);else{if(this._operator.named){q+=f(v,"U+R");q+=u.length===0?this._operator.ifemp:"="}q+=a(u,this._operator.allow,",")}else if(t==="object")if(s.explode)q+=b(u,this._operator.allow,"=",this._operator.sep);else{if(this._operator.named){q+=f(v,"U+R");q+=Object.keys(u).length===0?this._operator.ifemp:"="}q+=b(u,this._operator.allow,",",",")}else throw new Error("bad param type: "+v+" : "+t);o.push(q)}}return o.join("")}};j.prototype={expand:function(m){for(var o=
[],w=0;w<this._templateComponents.length;w++)o.push(this._templateComponents[w].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(d){d.getObject("dnd",true,d);d.dnd.getCopyKeyState=d.isCopyKey;d.dnd._uniqueId=0;d.dnd.getUniqueId=function(){var f;do f=d._scopeName+"Unique"+ ++d.dnd._uniqueId;while(d.byId(f));return f};d.dnd._empty={};d.dnd.isFormElement=function(f){f=f.target;if(f.nodeType==3)f=f.parentNode;return" button textarea input select option ".indexOf(" "+f.tagName.toLowerCase()+" ")>=0};return d.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(d){d.getObject("dnd",true,d);d.dnd.getViewport=d.window.getBox;d.dnd.V_TRIGGER_AUTOSCROLL=32;d.dnd.H_TRIGGER_AUTOSCROLL=32;d.dnd.V_AUTOSCROLL_VALUE=16;d.dnd.H_AUTOSCROLL_VALUE=16;d.dnd.autoScroll=function(f){var a=d.window.getBox(),b=0,c=0;if(f.clientX<d.dnd.H_TRIGGER_AUTOSCROLL)b=-d.dnd.H_AUTOSCROLL_VALUE;else if(f.clientX>a.w-d.dnd.H_TRIGGER_AUTOSCROLL)b=d.dnd.H_AUTOSCROLL_VALUE;if(f.clientY<d.dnd.V_TRIGGER_AUTOSCROLL)c=-d.dnd.V_AUTOSCROLL_VALUE;
else if(f.clientY>a.h-d.dnd.V_TRIGGER_AUTOSCROLL)c=d.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(b,c)};d.dnd._validNodes={div:1,p:1,td:1};d.dnd._validOverflow={auto:1,scroll:1};d.dnd.autoScrollNodes=function(f){for(var a=f.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in d.dnd._validNodes){var b=d.getComputedStyle(a);if(b.overflow.toLowerCase()in d.dnd._validOverflow){var c=d._getContentBox(a,b);b=d.position(a,true);var e=Math.min(d.dnd.H_TRIGGER_AUTOSCROLL,c.w/2),g=Math.min(d.dnd.V_TRIGGER_AUTOSCROLL,
c.h/2),j=f.pageX-b.x,i=f.pageY-b.y,k=b=0;if(d.isWebKit||d.isOpera){j+=d.body().scrollLeft;i+=d.body().scrollTop}if(j>0&&j<c.w)if(j<e)b=-e;else if(j>c.w-e)b=e;if(i>0&&i<c.h)if(i<g)k=-g;else if(i>c.h-g)k=g;c=a.scrollLeft;e=a.scrollTop;a.scrollLeft+=b;a.scrollTop+=k;if(c!=a.scrollLeft||e!=a.scrollTop)return}}try{a=a.parentNode}catch(m){a=null}}d.dnd.autoScroll(f)};return d.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(d){d.declare("dojo.dnd.Mover",null,{constructor:function(f,a,b){this.node=d.byId(f);var c=a.touches?a.touches[0]:a;this.marginBox={l:c.pageX,t:c.pageY};this.mouseButton=a.button;a=this.host=b;f=f.ownerDocument;this.events=[d.connect(f,"onmousemove",this,"onFirstMove"),d.connect(f,"ontouchmove",this,"onFirstMove"),d.connect(f,"onmousemove",this,"onMouseMove"),d.connect(f,"ontouchmove",this,"onMouseMove"),d.connect(f,
"onmouseup",this,"onMouseUp"),d.connect(f,"ontouchend",this,"onMouseUp"),d.connect(f,"ondragstart",d.stopEvent),d.connect(f.body,"onselectstart",d.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(f){d.dnd.autoScroll(f);var a=this.marginBox,b=f.touches?f.touches[0]:f;this.host.onMove(this,{l:a.l+b.pageX,t:a.t+b.pageY},f);d.stopEvent(f)},onMouseUp:function(f){if(d.isWebKit&&d.isMac&&this.mouseButton==2?f.button==0:this.mouseButton==f.button)this.destroy();d.stopEvent(f)},onFirstMove:function(f){var a=
this.node.style,b,c=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=d.marginBox(this.node);b=d.doc.body;var e=d.getComputedStyle(b),g=d._getMarginBox(b,e);e=d._getContentBox(b,e);b=a.l-(e.l-g.l);a=a.t-(e.t-g.t);break}this.marginBox.l=b-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;c&&c.onFirstMove&&c.onFirstMove(this,f);d.disconnect(this.events.shift());d.disconnect(this.events.shift())},
destroy:function(){d.forEach(this.events,d.disconnect);var f=this.host;f&&f.onMoveStop&&f.onMoveStop(this);this.events=this.node=this.host=null}});return d.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(d){d.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(f,a){this.node=d.byId(f);a||(a={});this.handle=a.handle?d.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:d.dnd.Mover;this.events=[d.connect(this.handle,"onmousedown",this,"onMouseDown"),d.connect(this.handle,"ontouchstart",this,"onMouseDown"),d.connect(this.handle,
"ondragstart",this,"onSelectStart"),d.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(f,a){return new d.dnd.Moveable(a,f)},destroy:function(){d.forEach(this.events,d.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(f){if(!(this.skip&&d.dnd.isFormElement(f))){if(this.delay){this.events.push(d.connect(this.handle,"onmousemove",this,"onMouseMove"),d.connect(this.handle,"ontouchmove",this,"onMouseMove"),d.connect(this.handle,"onmouseup",this,
"onMouseUp"),d.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=f.touches?f.touches[0]:f;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(f);d.stopEvent(f)}},onMouseMove:function(f){var a=f.touches?f.touches[0]:f;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(f);this.onDragDetected(f)}d.stopEvent(f)},onMouseUp:function(f){for(var a=0;a<2;++a)d.disconnect(this.events.pop());d.stopEvent(f)},onSelectStart:function(f){if(!this.skip||
!d.dnd.isFormElement(f))d.stopEvent(f)},onDragDetected:function(f){new this.mover(this.node,f,this)},onMoveStart:function(f){d.publish("/dnd/move/start",[f]);d.addClass(d.body(),"dojoMove");d.addClass(this.node,"dojoMoveItem")},onMoveStop:function(f){d.publish("/dnd/move/stop",[f]);d.removeClass(d.body(),"dojoMove");d.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(f,a){this.onMoving(f,a);var b=f.node.style;b.left=a.l+"px";b.top=a.t+"px";this.onMoved(f,a)},onMoving:function(){},
onMoved:function(){}});return d.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(d){d.declare("dojo.dnd.move.constrainedMoveable",d.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(f,a){return new d.dnd.move.constrainedMoveable(a,f)},constructor:function(f,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(f){var a=this.constraintBox=this.constraints.call(this,f);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){f=d._getMarginSize(f.node);a.r-=f.w;
a.b-=f.h}},onMove:function(f,a){var b=this.constraintBox,c=f.node.style;this.onMoving(f,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;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(f,a)}});d.declare("dojo.dnd.move.boxConstrainedMoveable",d.dnd.move.constrainedMoveable,{box:{},markupFactory:function(f,a){return new d.dnd.move.boxConstrainedMoveable(a,f)},constructor:function(f,a){var b=a&&a.box;this.constraints=function(){return b}}});d.declare("dojo.dnd.move.parentConstrainedMoveable",
d.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(f,a){return new d.dnd.move.parentConstrainedMoveable(a,f)},constructor:function(f,a){var b=a&&a.area;this.constraints=function(){var c=this.node.parentNode,e=d.getComputedStyle(c),g=d._getMarginBox(c,e);if(b=="margin")return g;var j=d._getMarginExtents(c,e);g.l+=j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;if(b=="border")return g;j=d._getBorderExtents(c,e);g.l+=j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;if(b=="padding")return g;j=d._getPadExtents(c,e);g.l+=
j.l;g.t+=j.t;g.w-=j.w;g.h-=j.h;return g}}});d.dnd.constrainedMover=d.dnd.move.constrainedMover;d.dnd.boxConstrainedMover=d.dnd.move.boxConstrainedMover;d.dnd.parentConstrainedMover=d.dnd.move.parentConstrainedMover;return d.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(d){(function(){var f=d.dnd.Moveable.prototype.onMove;d.declare("dojo.dnd.TimedMoveable",d.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 d.dnd.TimedMoveable(b,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);f.call(this,a,a._leftTop)}d.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,b){a._leftTop=b;if(!a._timer){var c=this;a._timer=setTimeout(function(){a._timer=null;f.call(c,a,a._leftTop)},this.timeout)}}})})();return d.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(d){d.declare("dojo.fx.Toggler",null,{node:null,showFunc:d.fadeIn,hideFunc:d.fadeOut,showDuration:200,hideDuration:200,constructor:function(f){var a=this;d.mixin(a,f);a.node=f.node;a._showArgs=d.mixin({},f);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=d.mixin({},f);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);d.connect(a.showAnim,"beforeBegin",d.hitch(a.hideAnim,
"stop",true));d.connect(a.hideAnim,"beforeBegin",d.hitch(a.showAnim,"stop",true))},show:function(f){return this.showAnim.play(f||0)},hide:function(f){return this.hideAnim.play(f||0)}});return d.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(d){(function(){var f={_fire:function(c,e){if(this[c])this[c].apply(this,e||[]);return this}},a=function(c){this._index=-1;this._animations=c||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(e){this.duration+=e.duration;if(e.delay)this.duration+=e.delay},this)};d.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.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=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(c,e){if(!this._current)this._current=this._animations[this._index=0];if(!e&&this._current.status()=="playing")return this;var g=d.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),j=d.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),i=d.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);d.disconnect(g);d.disconnect(j);d.disconnect(i)});this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&d.disconnect(this._onEndCtx);this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var c=d.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);d.disconnect(c)});this._current.pause()}return this},gotoPercent:function(c,e){this.pause();var g=this.duration*c;this._current=null;d.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,e);return this},stop:function(c){if(this._current){if(c){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var e=d.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);d.disconnect(e)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&d.disconnect(this._onAnimateCtx);this._onEndCtx&&d.disconnect(this._onEndCtx)}});d.extend(a,f);d.fx.chain=function(c){return new a(c)};
var b=function(c){this._animations=c||[];this._connects=[];this.duration=this._finished=0;d.forEach(c,function(g){var j=g.duration;if(g.delay)j+=g.delay;if(this.duration<j)this.duration=j;this._connects.push(d.connect(g,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var e=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(g){e._connects.push(d.connect(e._pseudoAnimation,g,function(){e._fire(g,
arguments)}))})};d.extend(b,{_doAction:function(c,e){d.forEach(this._animations,function(g){g[c].apply(g,e)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(c,e){var g=this._pseudoAnimation;g[c].apply(g,e)},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(c,e){var g=
this.duration*c;d.forEach(this._animations,function(j){j.gotoPercent(j.duration<g?1:g/j.duration,e)});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(){d.forEach(this._connects,d.disconnect)}});d.extend(b,f);d.fx.combine=function(c){return new b(c)};d.fx.wipeIn=function(c){var e=c.node=d.byId(c.node),g=e.style,j;c=d.animateProperty(d.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=d.style(e,"height");return Math.max(i,1)}},end:function(){return e.scrollHeight}}}},c));d.connect(c,"onEnd",function(){g.height="auto";g.overflow=j});return c};d.fx.wipeOut=function(c){var e=(c.node=d.byId(c.node)).style,g;c=d.animateProperty(d.mixin({properties:{height:{end:1}}},c));d.connect(c,"beforeBegin",function(){g=e.overflow;e.overflow="hidden";e.display=
""});d.connect(c,"onEnd",function(){e.overflow=g;e.height="auto";e.display="none"});return c};d.fx.slideTo=function(c){var e=null,g=null,j=function(i){return function(){var k=d.getComputedStyle(i),m=k.position;e=m=="absolute"?i.offsetTop:parseInt(k.top)||0;g=m=="absolute"?i.offsetLeft:parseInt(k.left)||0;if(m!="absolute"&&m!="relative"){k=d.position(i,true);e=k.y;g=k.x;i.style.position="absolute";i.style.top=e+"px";i.style.left=g+"px"}}}(c.node=d.byId(c.node));j();c=d.animateProperty(d.mixin({properties:{top:c.top||
0,left:c.left||0}},c));d.connect(c,"beforeBegin",c,j);return c}})();return d.fx});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(d,f){d.declare("dijit.DialogUnderlay",[f._Widget,f._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){d.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){d.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,b=this.domNode.style;b.display="none";var c=d.window.getBox();b.top=c.t+"px";b.left=c.l+"px";a.width=c.w+"px";a.height=c.h+"px";b.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new f.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return f.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(d,f){d.declare("dijit._DialogBase",[f._Templated,f.form._FormMixin,f._DialogMixin,f._CssStateMixin],{templateString:d.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:d.delegate(f._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:f.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=d.i18n.getLocalization("dijit","common");d.mixin(this,a);this.inherited(arguments)},
postCreate:function(){d.style(this.domNode,{display:"none",position:"absolute"});d.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&&f._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);f.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
d.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=d.isIE==6?new d.dnd.TimedMoveable(a,{handle:this.titleBar}):new d.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=d.subscribe("/dnd/move/stop",this,"_endDrag")}else d.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":d.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 d.style(this.containerNode,{width:"auto",height:"auto"});var a=d._getMarginSize(this.domNode),b=d.window.getBox();if(a.w>=b.w||a.h>=b.h){var c=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:c,h:a})}else d.style(this.containerNode,{width:c+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!d.hasClass(d.body(),"dojoMove")){var a=this.domNode,b=d.window.getBox(),c=this._relativePosition,e=c?null:d._getBorderBox(a),g=Math.floor(b.l+(c?c.x:(b.w-e.w)/2));b=Math.floor(b.t+(c?c.y:(b.h-e.h)/2));d.style(a,{left:g+"px",top:b+"px"})}},_onKey:function(a){if(a.charOrCode){var b=d.keys,c=a.target;a.charOrCode===b.TAB&&this._getFocusItems(this.domNode);var e=
this._firstFocusItem==this._lastFocusItem;if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===b.TAB){e||f.focus(this._lastFocusItem);d.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===b.TAB&&!a.shiftKey){e||f.focus(this._firstFocusItem);d.stopEvent(a)}else{for(;c;){if(c==this.domNode||d.hasClass(c,"dijitPopup"))if(a.charOrCode==b.ESCAPE)this.onCancel();else return;c=c.parentNode}if(a.charOrCode!==b.TAB)d.stopEvent(a);else if(!d.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(d.connect(window,"onscroll",this,"layout"));this._modalconnects.push(d.connect(window,"onresize",this,function(){var b=d.window.getBox();if(!this._oldViewport||b.h!=this._oldViewport.h||b.w!=this._oldViewport.w){this.layout();this._oldViewport=b}}));this._modalconnects.push(d.connect(this.domNode,
"onkeypress",this,"_onKey"));d.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=d.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:d.hitch(this,function(){f._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:d.hitch(this,function(){if(this.autofocus&&f._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
f.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 d.Deferred(d.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=d.fadeOut({node:this.domNode,duration:this.duration,onEnd:d.hitch(this,function(){this.domNode.style.display="none";f._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;d.forEach(this._modalconnects,d.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){f._underlay&&f._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&d.unsubscribe(this._dndListener);d.forEach(this._modalconnects,d.disconnect);f._DialogLevelManager.hide(this);this.inherited(arguments)}});d.declare("dijit.Dialog",[f.layout.ContentPane,f._DialogBase],{});f._DialogLevelManager={show:function(a,b){var c=f._dialogStack;c[c.length-1].focus=f.getFocus(a);var e=f._underlay;if(!e||e._destroyed)e=f._underlay=new f.DialogUnderlay(b);else e.set(a.underlayAttrs);var g=
c[c.length-1].dialog?c[c.length-1].zIndex+2:950;c.length==1&&e.show();d.style(f._underlay.domNode,"zIndex",g-1);d.style(a.domNode,"zIndex",g);c.push({dialog:a,underlayAttrs:b,zIndex:g})},hide:function(a){var b=f._dialogStack;if(b[b.length-1].dialog==a){b.pop();var c=b[b.length-1];if(b.length==1)f._underlay._destroyed||f._underlay.hide();else{d.style(f._underlay.domNode,"zIndex",c.zIndex-1);f._underlay.set(c.underlayAttrs)}if(a.refocus){b=c.focus;if(!b||c.dialog&&!d.isDescendant(b.node,c.dialog.domNode)){c.dialog._getFocusItems(c.dialog.domNode);
b=c.dialog._firstFocusItem}try{f.focus(b)}catch(e){}}}else{c=d.indexOf(d.map(b,function(g){return g.dialog}),a);c!=-1&&b.splice(c,1)}},isTop:function(a){var b=f._dialogStack;return b[b.length-1].dialog==a}};f._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return f.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(d,f){return f.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(d,f){d.declare("dijit.form.CheckBox",f.form.ToggleButton,{templateString:d.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:d.delegate(f.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);d.attr(this.focusNode,"readOnly",a);f.setWaiState(this.focusNode,
"readonly",a)},_setValueAttr:function(a,b){if(typeof a=="string"){this._set("value",a);d.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");d.attr(this.focusNode,"value",this.value)},_onFocus:function(){this.id&&d.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");this.inherited(arguments)},_onBlur:function(){this.id&&d.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");this.inherited(arguments)},_onClick:function(a){if(this.readOnly){d.stopEvent(a);return false}return this.inherited(arguments)}});d.declare("dijit.form.RadioButton",f.form.CheckBox,{type:"radio",
baseClass:"dijitRadio",_setCheckedAttr:function(a){this.inherited(arguments);if(this._created)if(a){var b=this;d.query("INPUT[type=radio]",this.focusNode.form||d.doc).forEach(function(c){if(c.name==b.name&&c!=b.focusNode&&c.form==b.focusNode.form)(c=f.getEnclosingWidget(c))&&c.checked&&c.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return f.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(d,f){d.declare("dijit.form.Form",[f._Widget,f._Templated,f.form._FormMixin,f.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:d.delegate(f._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;d.attr(this.domNode,"encType",a);if(d.isIE)this.domNode.encoding=a},postCreate:function(){if(d.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);d.stopEvent(a);return false},_onSubmit:function(a){var b=f.form.Form.prototype;if(this.execute!=b.execute||this.onExecute!=
b.onExecute){d.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues())}this.onSubmit(a)===false&&d.stopEvent(a)},onSubmit:function(){return this.isValid()},submit:function(){this.onSubmit()!==false&&this.containerNode.submit()}});return f.form.Form});
define("dojo/data/util/filter",["dojo"],function(d){d.getObject("data.util.filter",true,d);d.data.util.filter.patternToRegExp=function(f,a){for(var b="^",c=null,e=0;e<f.length;e++){c=f.charAt(e);switch(c){case "\\":b+=c;e++;b+=f.charAt(e);break;case "*":b+=".*";break;case "?":b+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":b+="\\";default:b+=c}}b+="$";return a?new RegExp(b,"mi"):new RegExp(b,"m")};return d.data.util.filter});
define("dojo/data/util/sorter",["dojo"],function(d){d.getObject("data.util.sorter",true,d);d.data.util.sorter.basicComparator=function(f,a){var b=-1;if(f===null)f=undefined;if(a===null)a=undefined;if(f==a)b=0;else if(f>a||f==null)b=1;return b};d.data.util.sorter.createSortFunction=function(f,a){function b(o,w,s,v){return function(u,t){u=v.getValue(u,o);t=v.getValue(t,o);return w*s(u,t)}}for(var c=[],e,g=a.comparatorMap,j=d.data.util.sorter.basicComparator,i=0;i<f.length;i++){e=f[i];var k=e.attribute;
if(k){e=e.descending?-1:1;var m=j;if(g){if(typeof k!=="string"&&"toString"in k)k=k.toString();m=g[k]||j}c.push(b(k,e,m,a))}}return function(o,w){for(var s=0;s<c.length;){var v=c[s++](o,w);if(v!==0)return v}return 0}};return d.data.util.sorter});
define("dojo/data/util/simpleFetch",["dojo","dojo/data/util/sorter"],function(d){d.getObject("data.util.simpleFetch",true,d);d.data.util.simpleFetch.fetch=function(f){f=f||{};if(!f.store)f.store=this;var a=this,b=function(e,g){if(g.onError)g.onError.call(g.scope||d.global,e,g)},c=function(e,g){var j=g.abort||null,i=false,k=g.start?g.start:0,m=g.count&&g.count!==Infinity?k+g.count:e.length;g.abort=function(){i=true;j&&j.call(g)};var o=g.scope||d.global;if(!g.store)g.store=a;g.onBegin&&g.onBegin.call(o,
e.length,g);g.sort&&e.sort(d.data.util.sorter.createSortFunction(g.sort,a));if(g.onItem)for(var w=k;w<e.length&&w<m;++w){var s=e[w];i||g.onItem.call(o,s,g)}if(g.onComplete&&!i){w=null;g.onItem||(w=e.slice(k,m));g.onComplete.call(o,w,g)}};this._fetchItems(f,c,b);return f};return d.data.util.simpleFetch});
define("dojo/data/ItemFileReadStore",["dojo","dojo/data/util/filter","dojo/data/util/simpleFetch","dojo/date/stamp"],function(d){d.declare("dojo.data.ItemFileReadStore",null,{constructor:function(f){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=f.url;this._jsonData=f.data;this.data=null;this._datatypeMap=f.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return d.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(f.urlPreventCache!==undefined)this.urlPreventCache=f.urlPreventCache?true:false;if(f.hierarchical!==undefined)this.hierarchical=f.hierarchical?true:false;if(f.clearOnClose)this.clearOnClose=true;if("failOk"in f)this.failOk=f.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(f){if(!this.isItem(f))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(f){if(typeof f!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(f,a,b){f=this.getValues(f,a);return f.length>0?f[0]:b},getValues:function(f,a){this._assertIsItem(f);this._assertIsAttribute(a);
return(f[a]||[]).slice(0)},getAttributes:function(f){this._assertIsItem(f);var a=[];for(var b in f)b!==this._storeRefPropName&&b!==this._itemNumPropName&&b!==this._rootItemPropName&&b!==this._reverseRefMap&&a.push(b);return a},hasAttribute:function(f,a){this._assertIsItem(f);this._assertIsAttribute(a);return a in f},containsValue:function(f,a,b){var c=undefined;if(typeof b==="string")c=d.data.util.filter.patternToRegExp(b,false);return this._containsValue(f,a,b,c)},_containsValue:function(f,a,b,c){return d.some(this.getValues(f,
a),function(e){if(e!==null&&!d.isObject(e)&&c){if(e.toString().match(c))return true}else if(b===e)return true})},isItem:function(f){if(f&&f[this._storeRefPropName]===this)if(this._arrayOfAllItems[f[this._itemNumPropName]]===f)return true;return false},isItemLoaded:function(f){return this.isItem(f)},loadItem:function(f){this._assertIsItem(f.item)},getFeatures:function(){return this._features},getLabel:function(f){if(this._labelAttr&&this.isItem(f))return this.getValue(f,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(f,a,b){var c=this,e=function(k,m){var o=[],w,s;if(k.query){var v;w=k.queryOptions?k.queryOptions.ignoreCase:false;var u={};for(s in k.query){v=k.query[s];if(typeof v==="string")u[s]=d.data.util.filter.patternToRegExp(v,w);else if(v instanceof RegExp)u[s]=v}for(w=0;w<m.length;++w){var t=true,q=m[w];if(q===null)t=false;else for(s in k.query){v=k.query[s];c._containsValue(q,s,v,u[s])||(t=false)}t&&o.push(q)}}else for(w=0;w<m.length;++w){s=m[w];s!==null&&o.push(s)}a(o,
k)};if(this._loadFinished)e(f,this._getItemsArray(f.queryOptions));else{if(this._jsonFileUrl!==this._ccUrl){d.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:f,
filter:e});else{this._loadInProgress=true;var g=d.xhrGet({url:c._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});g.addCallback(function(k){try{c._getItemsFromLoadedData(k);c._loadFinished=true;c._loadInProgress=false;e(f,c._getItemsArray(f.queryOptions));c._handleQueuedFetches()}catch(m){c._loadFinished=true;c._loadInProgress=false;b(m,f)}});g.addErrback(function(k){c._loadInProgress=false;b(k,f)});var j=null;if(f.abort)j=f.abort;f.abort=function(){g&&
g.fired===-1&&g.cancel();j&&j.call(f)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;e(f,this._getItemsArray(f.queryOptions))}catch(i){b(i,f)}else b(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),f)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var f=0;f<this._queuedFetches.length;f++){var a=this._queuedFetches[f],b=a.args;(a=a.filter)?
a(b,this._getItemsArray(b.queryOptions)):this.fetchItemByIdentity(b)}this._queuedFetches=[]}},_getItemsArray:function(f){if(f&&f.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(f){function a(u){return u!==null&&typeof u==="object"&&(!d.isArray(u)||c)&&!d.isFunction(u)&&(u.constructor==Object||d.isArray(u))&&typeof u._reference==="undefined"&&typeof u._type==="undefined"&&typeof u._value==="undefined"&&e.hierarchical}function b(u){e._arrayOfAllItems.push(u);for(var t in u){var q=u[t];
if(q)if(d.isArray(q))for(var x=0;x<q.length;++x){var B=q[x];a(B)&&b(B)}else a(q)&&b(q)}}var c=false,e=this;this._labelAttr=f.label;var g,j;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=f.items;for(g=0;g<this._arrayOfTopLevelItems.length;++g){j=this._arrayOfTopLevelItems[g];if(d.isArray(j))c=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)d.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=f.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=i;for(g=0;g<this._arrayOfAllItems.length;++g){j=this._arrayOfAllItems[g];f=j[i];f=f[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,f))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: ["+f+"]");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: ["+f+"]");}else this._itemsByIdentity[f]=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){f=j[k];for(i=0;i<f.length;++i){m=f[i];if(m!==null&&typeof m=="object"){if("_type"in m&&"_value"in m){var o=m._type,w=this._datatypeMap[o];if(w)if(d.isFunction(w))f[i]=new w(m._value);else if(d.isFunction(w.deserialize))f[i]=w.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(d.isObject(m))for(o=0;o<this._arrayOfAllItems.length;++o){w=this._arrayOfAllItems[o];var s=true;for(var v in m)if(w[v]!=m[v])s=false;if(s)f[i]=w}else f[i]=this._getItemByIdentity(m);if(this.referenceIntegrity){m=f[i];this.isItem(m)&&this._addReferenceToMap(m,j,k)}}else this.isItem(m)&&this.referenceIntegrity&&this._addReferenceToMap(m,
j,k)}}}}},_addReferenceToMap:function(){},getIdentity:function(f){var a=this._features["dojo.data.api.Identity"];if(a===Number)return f[this._itemNumPropName];else if(f=f[a])return f[0];return null},fetchItemByIdentity:function(f){var a,b;if(this._loadFinished){a=this._getItemByIdentity(f.identity);if(f.onItem){b=f.scope?f.scope:d.global;f.onItem.call(b,a)}}else{var c=this;if(this._jsonFileUrl!==this._ccUrl){d.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:f});else{this._loadInProgress=true;b=d.xhrGet({url:c._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});b.addCallback(function(e){var g=f.scope?f.scope:d.global;try{c._getItemsFromLoadedData(e);
c._loadFinished=true;c._loadInProgress=false;a=c._getItemByIdentity(f.identity);f.onItem&&f.onItem.call(g,a);c._handleQueuedFetches()}catch(j){c._loadInProgress=false;f.onError&&f.onError.call(g,j)}});b.addErrback(function(e){c._loadInProgress=false;if(f.onError)f.onError.call(f.scope?f.scope:d.global,e)})}else if(this._jsonData){c._getItemsFromLoadedData(c._jsonData);c._jsonData=null;c._loadFinished=true;a=c._getItemByIdentity(f.identity);if(f.onItem){b=f.scope?f.scope:d.global;f.onItem.call(b,a)}}}},
_getItemByIdentity:function(f){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,f))a=this._itemsByIdentity[f];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,f))a=this._arrayOfAllItems[f];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var f=this._features["dojo.data.api.Identity"];return f===Number?null:[f]},_forceLoad:function(){var f=this;if(this._jsonFileUrl!==this._ccUrl){d.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=d.xhrGet({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true});a.addCallback(function(b){try{if(f._loadInProgress!==true&&!f._loadFinished){f._getItemsFromLoadedData(b);f._loadFinished=true}else if(f._loadInProgress)throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");
}catch(c){console.log(c);throw c;}});a.addErrback(function(b){throw b;})}else if(this._jsonData){f._getItemsFromLoadedData(f._jsonData);f._jsonData=null;f._loadFinished=true}}});d.extend(d.data.ItemFileReadStore,d.data.util.simpleFetch);return d.data.ItemFileReadStore});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(d,f){d.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);d.connect(this,"onKeyPress",d.hitch(this,function(a){a.keyCode===d.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(d.hitch(this,function(){if(d.isDescendant(f._curFocus,
this.domNode))f._curFocus=null;if(d.isDescendant(f._prevFocus,this.domNode))f._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(d,f){d.declare("orion.widgets.NewItemDialog",[f.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.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";d.connect(this.itemURL,"onkeyup",null,d.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(d){d.DeferredList=function(f,a,b,c){var e=[];d.Deferred.call(this);var g=this;f.length===0&&!a&&this.resolve([0,[]]);var j=0;d.forEach(f,function(i,k){function m(o,w){e[k]=[o,w];j++;j===f.length&&g.resolve(e)}i.then(function(o){a?g.resolve([k,o]):m(true,o)},function(o){b?g.reject(o):m(false,o);if(c)return null;throw o;})})};d.DeferredList.prototype=new d.Deferred;d.DeferredList.prototype.gatherResults=function(f){f=new d.DeferredList(f,false,true,false);
f.addCallback(function(a){var b=[];d.forEach(a,function(c){b.push(c[1])});return b});return f};return d.DeferredList});
define("dojo/regexp",["dojo"],function(d){d.getObject("regexp",true,d);d.regexp.escapeString=function(f,a){return f.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(b){if(a&&a.indexOf(b)!=-1)return b;return"\\"+b})};d.regexp.buildGroupRE=function(f,a,b){if(!(f instanceof Array))return a(f);for(var c=[],e=0;e<f.length;e++)c.push(a(f[e]));return d.regexp.group(c.join("|"),b)};d.regexp.group=function(f,a){return"("+(a?"?:":"")+f+")"};return d.regexp});
define("dojo/cookie",["dojo","dojo/regexp"],function(d){d.cookie=function(f,a,b){var c=document.cookie;if(arguments.length==1){var e=c.match(new RegExp("(?:^|; )"+d.regexp.escapeString(f)+"=([^;]*)"));return e?decodeURIComponent(e[1]):undefined}else{b=b||{};c=b.expires;if(typeof c=="number"){var g=new Date;g.setTime(g.getTime()+c*24*60*60*1E3);c=b.expires=g}if(c&&c.toUTCString)b.expires=c.toUTCString();a=encodeURIComponent(a);c=f+"="+a;for(e in b){c+="; "+e;g=b[e];if(g!==true)c+="="+g}document.cookie=
c}};d.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 d.cookie});
define("dijit/tree/TreeStoreModel",["dojo","dijit"],function(d,f){d.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(a){d.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([d.connect(a,
"onNew",this,"onNewItem"),d.connect(a,"onDelete",this,"onDeleteItem"),d.connect(a,"onSet",this,"onSetItem")])},destroy:function(){d.forEach(this.connects,d.disconnect)},getRoot:function(a,b){this.root?a(this.root):this.store.fetch({query:this.query,onComplete:d.hitch(this,function(c){if(c.length!=1)throw new Error(this.declaredClass+": query "+d.toJson(this.query)+" returned "+c.length+" items, but must return exactly one item");this.root=c[0];a(this.root)}),onError:b})},mayHaveChildren:function(a){return d.some(this.childrenAttrs,
function(b){return this.store.hasAttribute(a,b)},this)},getChildren:function(a,b,c){var e=this.store;if(e.isItemLoaded(a)){for(var g=[],j=0;j<this.childrenAttrs.length;j++){var i=e.getValues(a,this.childrenAttrs[j]);g=g.concat(i)}var k=0;this.deferItemLoadingUntilExpand||d.forEach(g,function(o){e.isItemLoaded(o)||k++});k==0?b(g):d.forEach(g,function(o,w){e.isItemLoaded(o)||e.loadItem({item:o,onItem:function(s){g[w]=s;--k==0&&b(g)},onError:c})})}else{var m=d.hitch(this,arguments.callee);e.loadItem({item:a,
onItem:function(o){m(o,b,c)},onError:c})}},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,c){var e={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,c);else(g=this.store.newItem(a,e))&&c!=undefined&&this.pasteItem(g,b,b,false,c)}});else(g=this.store.newItem(a,e))&&c!=undefined&&this.pasteItem(g,b,b,false,c)},pasteItem:function(a,b,c,e,g){var j=this.store,i=this.childrenAttrs[0];b&&d.forEach(this.childrenAttrs,function(m){if(j.containsValue(b,m,a)){if(!e){var o=d.filter(j.getValues(b,m),function(w){return w!=a});j.setValues(b,m,o)}i=m}});if(c)if(typeof g=="number"){var k=j.getValues(c,i).slice();
k.splice(g,0,a);j.setValues(c,i,k)}else j.setValues(c,i,j.getValues(c,i).concat(a))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(a,b){b&&this.getChildren(b.item,d.hitch(this,function(c){this.onChildrenChange(b.item,c)}))},onDeleteItem:function(a){this.onDelete(a)},onSetItem:function(a,b){d.indexOf(this.childrenAttrs,b)!=-1?this.getChildren(a,d.hitch(this,function(c){this.onChildrenChange(a,c)})):this.onChange(a)}});return f.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(d,f){d.declare("dijit.tree.ForestStoreModel",f.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,c){if(a===this.root)this.root.children?b(this.root.children):this.store.fetch({query:this.query,
onComplete:d.hitch(this,function(e){this.root.children=e;b(e)}),onError:c});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:d.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,c,e,g){if(b===this.root)e||this.onLeaveRoot(a);f.tree.TreeStoreModel.prototype.pasteItem.call(this,a,b===this.root?null:b,c===this.root?null:c,e,g);c===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:d.hitch(this,function(b){this.root.children=b;if(a.length!=b.length||d.some(a,function(c,e){return b[e]!=c}))this.onChildrenChange(this.root,b)})})},onNewItem:function(){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(a){d.indexOf(this.root.children,a)!=-1&&this._requeryTop();this.inherited(arguments)},onSetItem:function(){this._requeryTop();this.inherited(arguments)}});return f.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(d){d.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(f,a){this.node=d.byId(f);a||(a={});this.creator=a.creator||null;this.skipForm=a.skipForm;this.parent=a.dropParent&&d.byId(a.dropParent);this.map={};this.current=null;this.containerState="";d.addClass(this.node,"dojoDndContainer");a&&a._skipStartup||this.startup();this.events=[d.connect(this.node,"onmouseover",this,"onMouseOver"),d.connect(this.node,
"onmouseout",this,"onMouseOut"),d.connect(this.node,"ondragstart",this,"onSelectStart"),d.connect(this.node,"onselectstart",this,"onSelectStart")]},creator:function(){},getItem:function(f){return this.map[f]},setItem:function(f,a){this.map[f]=a},delItem:function(f){delete this.map[f]},forInItems:function(f,a){a=a||d.global;var b=this.map,c=d.dnd._empty;for(var e in b)e in c||f.call(a,b[e],e,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return d.query("> .dojoDndItem",this.parent)},
sync:function(){var f={};this.getAllNodes().forEach(function(a){if(a.id){var b=this.getItem(a.id);if(b){f[a.id]=b;return}}else a.id=d.dnd.getUniqueId();b=a.getAttribute("dndType");var c=a.getAttribute("dndData");f[a.id]={data:c||a.innerHTML,type:b?b.split(/\s*,\s*/):["text"]}},this);this.map=f;return this},insertNodes:function(f,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<f.length;++a){var c=this._normalizedCreator(f[a]);
this.setItem(c.node.id,{data:c.data,type:c.type});this.parent.insertBefore(c.node,b)}else for(a=0;a<f.length;++a){c=this._normalizedCreator(f[a]);this.setItem(c.node.id,{data:c.data,type:c.type});this.parent.appendChild(c.node)}return this},destroy:function(){d.forEach(this.events,d.disconnect);this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(f,a){f._skipStartup=true;return new d.dnd.Container(a,f)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var f=this.parent.getElementsByTagName("tbody");if(f&&f.length)this.parent=f[0]}}this.defaultCreator=d.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(f){for(var a=f.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(f);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(f){for(f=
f.relatedTarget;f;){if(f==this.node)return;try{f=f.parentNode}catch(a){f=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(f){if(!this.skipForm||!d.dnd.isFormElement(f))d.stopEvent(f)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(f,a){var b="dojoDnd"+f;f=f.toLowerCase()+"State";d.replaceClass(this.node,b+a,b+this[f]);this[f]=a},_addItemClass:function(f,a){d.addClass(f,
"dojoDndItem"+a)},_removeItemClass:function(f,a){d.removeClass(f,"dojoDndItem"+a)},_getChildByEvent:function(f){if(f=f.target)for(var a=f.parentNode;a;f=a,a=f.parentNode)if(a==this.parent&&d.hasClass(f,"dojoDndItem"))return f;return null},_normalizedCreator:function(f,a){f=(this.creator||this.defaultCreator).call(this,f,a);if(!d.isArray(f.type))f.type=["text"];if(!f.node.id)f.node.id=d.dnd.getUniqueId();d.addClass(f.node,"dojoDndItem");return f}});d.dnd._createNode=function(f){if(!f)return d.dnd._createSpan;
return function(a){return d.create(f,{innerHTML:a})}};d.dnd._createTrTd=function(f){var a=d.create("tr");d.create("td",{innerHTML:f},a);return a};d.dnd._createSpan=function(f){return d.create("span",{innerHTML:f})};d.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};d.dnd._defaultCreator=function(f){f=f.tagName.toLowerCase();var a=f=="tbody"||f=="thead"?d.dnd._createTrTd:d.dnd._createNode(d.dnd._defaultCreatorNodes[f]);return function(b,c){var e=b&&d.isObject(b),g;if(e&&b.tagName&&b.nodeType&&
b.getAttribute){g=b.getAttribute("dndData")||b.innerHTML;e=(e=b.getAttribute("dndType"))?e.split(/\s*,\s*/):["text"];b=b}else{g=e&&b.data?b.data:b;e=e&&b.type?b.type:["text"];b=(c=="avatar"?d.dnd._createSpan:a)(String(g))}if(!b.id)b.id=d.dnd.getUniqueId();return{node:b,data:g,type:e}}};return d.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(d,f){d.getObject("tree",true,d);f.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 c=doc.createRange();c.setStartBefore(a);a=doc.createRange();a.setStartBefore(b);return c.compareBoundaryPoints(c.END_TO_END,
a)}else throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");};d.declare("dijit.tree._dndContainer",null,{constructor:function(a,b){this.tree=a;this.node=a.domNode;d.mixin(this,b);this.map={};this.current=null;this.containerState="";d.addClass(this.node,"dojoDndContainer");this.events=[d.connect(this.node,"onmouseenter",this,"onOverEvent"),d.connect(this.node,"onmouseleave",this,"onOutEvent"),d.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),
d.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),d.connect(this.node,"ondragstart",d,"stopEvent"),d.connect(this.node,"onselectstart",d,"stopEvent")]},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},destroy:function(){d.forEach(this.events,d.disconnect);this.node=this.parent=null},onMouseOver:function(a){this.current=a},onMouseOut:function(){this.current=null},_changeState:function(a,b){var c="dojoDnd"+a;a=a.toLowerCase()+"State";d.replaceClass(this.node,c+b,c+this[a]);
this[a]=b},_addItemClass:function(a,b){d.addClass(a,"dojoDndItem"+b)},_removeItemClass:function(a,b){d.removeClass(a,"dojoDndItem"+b)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}});return f.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(d,f){d.declare("dijit.tree._dndSelector",f.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;f.setWaiState(this.tree.domNode,"multiselect",!this.singular);this.events.push(d.connect(this.tree.domNode,"onmousedown",this,"onMouseDown"),d.connect(this.tree.domNode,"onmouseup",this,"onMouseUp"),d.connect(this.tree.domNode,"onmousemove",this,"onMouseMove"))},singular:false,
getSelectedTreeNodes:function(){var a=[],b=this.selection;for(var c in b)a.push(b[c]);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();d.forEach(this._setDifference(b,a),d.hitch(this,function(c){c.setSelected(false);this.anchor==c&&delete this.anchor;delete this.selection[c.id]}));d.forEach(this._setDifference(a,b),d.hitch(this,function(c){c.setSelected(true);this.selection[c.id]=c}));this._updateSelectionProperties()},_setDifference:function(a,b){d.forEach(b,function(c){c.__exclude__=true});a=d.filter(a,function(c){return!c.__exclude__});d.forEach(b,function(c){delete c.__exclude__});
return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),b=[],c=[];d.forEach(a,function(e){c.push(e);b.push(e.getTreePath())});a=d.map(c,function(e){return e.item});this.tree._set("paths",b);this.tree._set("path",b[0]||[]);this.tree._set("selectedNodes",c);this.tree._set("selectedNode",c[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!=
d.mouseButtons.RIGHT){d.stopEvent(a);var b=this.current,c=d.isCopyKey(a),e=b.id;if(!this.singular&&!a.shiftKey&&this.selection[e])this._doDeselect=true;else{this._doDeselect=false;this.userSelect(b,c,a.shiftKey)}}},onMouseUp:function(a){if(this._doDeselect){this._doDeselect=false;this.userSelect(this.current,d.isCopyKey(a),a.shiftKey)}},onMouseMove:function(){this._doDeselect=false},userSelect:function(a,b,c){if(this.singular)if(this.anchor==a&&b)this.selectNone();else{this.setSelection([a]);this.anchor=
a}else if(c&&this.anchor){c=this.anchor;if(f.tree._compareNodes(this.anchor.rowNode,a.rowNode)<0){b=c;a=a}else{b=a;a=c}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||d.global;for(var c in this.selection)a.call(b,this.getItem(c),c,this)}});return f.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(d,f){d.declare("dijit._TreeNode",[f._Widget,f._Templated,f._Container,f._Contained,f._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,
state:"UNCHECKED",templateString:d.cache("dijit","templates/TreeNode.html"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:d.delegate(f._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&&f.setWaiState(this.labelNode,"expanded",this.isExpanded);
this.setSelected(false)},_setIndentAttr:function(a){var b=Math.max(a,0)*this.tree._nodePixelIndent+"px";d.style(this.domNode,"backgroundPosition",b+" 0px");d.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",b);d.forEach(this.getChildren(),function(c){c.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,c=b.model;if(b._v10Compat&&
a===c.root)a=null;this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,"row","Row")},_applyClassAndStyle:function(a,b,c){var e="_"+b+"Class";b=b+"Node";var g=this[e];this[e]=this.tree["get"+c+"Class"](a,this.isExpanded);d.replaceClass(this[b],this[e]||"",g||"");d.style(this[b],this.tree["get"+c+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();!a||a.rowNode.style.display=="none"?d.addClass(this.domNode,"dijitTreeIsRoot"):
d.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling())},_setExpando:function(a){var b=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],c=["*","-","+","*"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;d.replaceClass(this.expandoNode,b[a],b);this.expandoNodeText.innerHTML=c[a]},expand:function(){if(this._expandDeferred)return this._expandDeferred;this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;f.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)f.setWaiRole(this.containerNode,"group");d.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&f.setWaiState(this.tree.domNode,"expanded","true");var a,b=d.fx.wipeIn({node:this.containerNode,duration:f.defaultDuration,onEnd:function(){a.callback(true)}});a=this._expandDeferred=new d.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;f.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&f.setWaiState(this.tree.domNode,"expanded","false");d.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut)this._wipeOut=d.fx.wipeOut({node:this.containerNode,duration:f.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var b=this.tree,c=b.model,e=[];d.forEach(this.getChildren(),
function(g){f._Container.prototype.removeChild.call(this,g)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;d.forEach(a,function(g){var j=c.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:c.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))e.push(b._expandNode(k))},this);d.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 d.DeferredList(e)},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()}d.forEach(a,function(b){b._updateLayout()})},makeExpandable:function(){this.isExpandable=true;this._setExpando(false)},_onLabelFocus:function(){this.tree._onNodeFocus(this)},setSelected:function(a){f.setWaiState(this.labelNode,"selected",a);
d.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)}});d.declare("dijit.Tree",[f._Widget,f._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],paths:[],
path:[],selectedItems:null,selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:d.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){d.publish(this.id,[d.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 d.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(d.isString(this.dndController))this.dndController=d.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;d.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=d.hitch(this,"mayHaveChildren");if(this.params.getItemChildren)a.getChildren=d.hitch(this,function(b,c,e){this.getItemChildren(this._v10Compat&&b===this.model.root?null:b,c,e)});this.model=new f.tree.ForestStoreModel(a);this.showRoot=Boolean(this.label)},onLoad:function(){},_load:function(){this.model.getRoot(d.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";f.setWaiRole(this.domNode,"presentation");f.setWaiRole(b.labelNode,"presentation");f.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(d.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[d.isString(a)?a:this.model.getIdentity(a)])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var b=this;this._loadDeferred.addCallback(d.hitch(this,function(){var c=d.map(a,function(g){return!g||d.isString(g)?g:b.model.getIdentity(g)}),e=[];d.forEach(c,function(g){e=e.concat(b._itemNodesMap[g]||
[])});this.set("selectedNodes",e)}))},_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=d.filter(j,function(o){return o.getIdentity()==k})[0];if(m)g.length?e._expandNode(m).addCallback(function(){b(g,m.getChildren(),i)}):i.callback(m);else i.errback("Could not expand path at "+k)}function c(g){e.set("selectedNodes",d.map(d.filter(g,function(j){return j[0]}),function(j){return j[1]}))}var e=this;return(new d.DeferredList(d.map(a,
function(g){var j=new d.Deferred;g=d.map(g,function(i){return d.isString(i)?i:e.model.getIdentity(i)});g.length?e._loadDeferred.addCallback(function(){b(g,[e.rootNode],j)}):j.errback("Empty path");return j}))).addCallback(c)},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this._loadDeferred.addCallback(d.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=d.keys,c=f.getEnclosingWidget(a.target);if(c){var e=a.charOrCode;if(typeof e=="string"&&e!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:c,
key:e.toLowerCase()});d.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[e]){this[this._keyHandlerMap[e]]({node:c,
item:c.item,evt:a});d.stopEvent(a)}}}}},_onEnterKey:function(a){this._publish("execute",{item:a.item,node:a.node});this.dndController.userSelect(a.node,d.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 c=this;b.timer=setTimeout(function(){delete c._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 d.isDescendant(a,b.expandoNode)},_onClick:function(a,b){var c=this.isExpandoNode(b.target,a);if(this.openOnClick&&a.isExpandable||c)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)}d.stopEvent(b)},_onDblClick:function(a,b){var c=b.target;c=c==a.expandoNode||c==a.expandoNodeText;if(this.openOnDblClick&&a.isExpandable||
c)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)}d.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 c=a.item,e=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var g=a._expandNodeDeferred=new d.Deferred;b.getChildren(c,function(j){a.unmarkProcessing();j=a.setChildItems(j);var i=e._expandNode(a,true);j.addCallback(function(){i.addCallback(function(){g.callback()})})},function(j){console.error(e,": error loading root children: ",j)});break;default:g=a._expandNodeDeferred=a.expand();this.onOpen(a.item,a);if(c){this._state(c,true);this._saveState()}}return g},focusNode:function(a){f.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 c=this.getLabel(a),e=this.getTooltip(a);d.forEach(b,function(g){g.set({item:a,label:c,tooltip:e});g._updateItemClasses(a)})}},_onItemChildrenChange:function(a,b){(a=this._itemNodesMap[this.model.getIdentity(a)])&&d.forEach(a,function(c){c.setChildItems(b)})},
_onItemDelete:function(a){a=this.model.getIdentity(a);var b=this._itemNodesMap[a];if(b){d.forEach(b,function(c){this.dndController.removeTreeNode(c);var e=c.getParent();e&&e.removeChild(c);c.destroyRecursive()},this);delete this._itemNodesMap[a]}},_initState:function(){if(this.persist){var a=d.cookie(this.cookieName);this._openedItemIds={};a&&d.forEach(a.split(","),function(b){this._openedItemIds[b]=true},this)}},_state:function(a,b){if(!this.persist)return false;var c=this.model.getIdentity(a);if(arguments.length===
1)return this._openedItemIds[c];if(b)this._openedItemIds[c]=true;else delete this._openedItemIds[c]},_saveState:function(){if(this.persist){var a=[];for(var b in this._openedItemIds)a.push(b);d.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&&!d.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},
destroyRecursive:function(){this.destroy()},resize:function(a){a&&d.marginBox(this.domNode,a);this._nodePixelIndent=d._getMarginSize(this.tree.indentDetector).w;if(this.tree.rootNode)this.tree.rootNode.set("indent",this.showRoot?0:-1)},_createTreeNode:function(a){return new f._TreeNode(a)}});return f.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(d,f){d.declare("orion.widgets._ExplorerTreeNode",[f._TreeNode],{templateString:d.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)}});d.declare("orion.widgets.ExplorerTree",
[f.Tree],{selectedNodes:{},postCreate:function(){d.connect(this,"onMouseDown",this._eatSelectionEvent);d.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,c){a.push(c.item)});return a},_getSelectedNodes:function(){var a=[];this._forEachSelectedNode(function(b,c){a.push(c)});
return a},_forEachSelectedNode:function(a){var b=this.selectedNodes;for(var c in b)b.hasOwnProperty(c)&&a(c,b[c])},_createTreeNode:function(a){return new orion.widgets._ExplorerTreeNode(a)},_eatSelectionEvent:function(a){if(d.isCopyKey(a)||a.shiftKey)d.stopEvent(a)},_onClick:function(a,b){var c=b.target,e=c===a.expandoNode||c===a.expandoNodeText;c=c===a.followNode;if(d.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(c)this.onFollowClick(a.item,a,b);else if(this.openOnClick&&a.isExpandable||e)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)}!e&&!c&&this._selectNode(a)}c||d.stopEvent(b)},_onItemDelete:function(a){var b=this._itemNodesMap[this.model.getIdentity(a)];if(b){var c=this;d.forEach(b,function(e){c._removeFromSelection(e)})}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 c(j,i){var k=[];j=j;do{k.push(j);j=e._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 e=this,g=c(a,b);if(g)this._selectNodes(g.reverse(),true);else(g=c(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(e,g){g._destroyed||g.setSelected(false)});this.selectedNodes={};if(a)for(var b=
0;b<a.length;b++){var c=a[b];c.setSelected(true);this._addToSelection(c);this.selectedNode=c}}})});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(d,f,a){d.declare("orion.widgets.DirectoryPrompterDialog",[f.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:d.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||d.style(this.messageCell,{display:"none"})},loadFolderList:function(b){b=a.makeRelative(b);this.treeRoot.Location=b;this.options.fileClient.loadWorkspace(b).then(d.hitch(this,function(c){for(var e in c)this.treeRoot[e]=
c[e];a.processNavigatorParent(this.treeRoot,c.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(c){return c.Name},getIconClass:function(){return"folderItem"}});this.treeWidget.startup();d.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(c,e,g){this.registry=c;this.root=e;this.fileClient=g}b.prototype={destroy:function(){},getRoot:function(c){c(this.root)},mayHaveChildren:function(){return true},getChildren:function(c,e){if(c.children)e(c.children);else if(c.Directory!==undefined&&c.Directory===false)e([]);else c.Location?this.fileClient.fetchChildren(c.ChildrenLocation).then(d.hitch(this,
function(g){for(var j=[],i=0;i<g.length;i++)g[i].Directory&&j.push(g[i]);a.processNavigatorParent(c,j);e(j)})):e([])},getIdentity:function(c){return c.Name?c.Location:"ROOT"},getLabel:function(c){return c.Name},onChildrenChange:function(){}};return b}()});define("dojox",["dojo"],function(d){return dojox=d._dojox||{}});
define("dojox/form/uploader/Base",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(d,f){d.declare("dojox.form.uploader.Base",[f._Widget,f._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){d.stopEvent(a);this.submit(d.formToObject(this.form))})}},supports:function(a){if(!this._hascache){this._hascache={testDiv:d.create("div"),testInput:d.create("input",{type:"file"}),xhr:window.XMLHttpRequest?new XMLHttpRequest:{}};d.style(this._hascache.testDiv,"opacity",0.7)}switch(a){case "FormData":return!!window.FormData;case "sendAsBinary":return!!this._hascache.xhr.sendAsBinary;
case "opacity":return d.style(this._hascache.testDiv,"opacity")==0.7;case "multiple":if(this.force=="flash"||this.force=="iframe")return false;a=d.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,c=Math.round(a/1048576*1E5)/1E5,e=Math.round(a/1073741824*1E5)/1E5,g=a;if(b>
1)g=b.toFixed(1)+" kb";if(c>1)g=c.toFixed(1)+" mb";if(e>1)g=e.toFixed(1)+" gb";return{kb:b,mb:c,gb:e,bytes:a,value:g}}})});
define("dojox/form/Uploader",["dojo","dijit","dojox","dojox/form/uploader/Base"],function(d,f,a){d.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,c=this._getNodePosition(this.domNode);if(!this.btnSize.w||!this.btnSize.h){d.body().appendChild(this.domNode);this._getButtonStyle(this.domNode);b=true}this._setButtonStyle();b&&d.place(this.domNode,c.node,c.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();d.forEach(this._inputs,d.destroy,d);this._inputs=[];this._nameIndex=0;this._createInput()},getFileList:function(){var b=[];this.supports("multiple")?d.forEach(this.inputNode.files,function(c,e){b.push({index:e,name:c.name,size:c.size,type:c.type})},this):d.forEach(this._inputs,function(c,e){b.push({index:e,name:c.value.substring(c.value.lastIndexOf("\\")+1),size:0,type:c.value.substring(c.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);d.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?d.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}d.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();d.style(this.button.domNode,{margin:"0px",display:"block",verticalAlign:"top"});d.style(this.button.domNode.firstChild,{margin:"0px",display:"block"});b||document.body.removeChild(this.domNode)},
_createInput:function(){if(this._inputs.length){d.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=d.create("input",{type:"file",name:b,className:"dojoxInputNode"},this.domNode,"first");this.supports("multiple")&&this.multiple&&d.attr(this.inputNode,"multiple",true);this._inputs.push(this.inputNode);d.style(this.inputNode,{fontSize:this.inputNodeFontSize+"em"});
b=d.marginBox(this.inputNode);d.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=d.hitch(this,function(e){this._cons.push(d.connect(this.inputNode,e,this,function(){this.button._cssMouseEvent({type:e})}))});b("mouseover");b("mouseout");b("mousedown");this._cons.push(d.connect(this.inputNode,"change",this,function(e){this.onChange(this.getFileList(e));!this.supports("multiple")&&
this.multiple&&this._createInput()}));this.button.set("tabIndex",-1);if(this.tabIndex>-1){this.inputNode.tabIndex=this.tabIndex;var c=d.style(this.button.domNode.firstChild,"border");this._cons.push(d.connect(this.inputNode,"focus",this,function(){d.style(this.button.domNode.firstChild,"border","1px dashed #ccc")}));this._cons.push(d.connect(this.inputNode,"blur",this,function(){d.style(this.button.domNode.firstChild,"border",c)}))}},_disconnectButton:function(){d.forEach(this._cons,d.disconnect,
d)}});(function(){a.form.UploaderOrg=a.form.Uploader;var b=[a.form.UploaderOrg];a.form.addUploaderPlugin=function(c){b.push(c);d.declare("dojox.form.Uploader",b,{})}})()});
define("dojox/form/uploader/FileList",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(d,f,a){d.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=f.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(d.hitch(this,function(){this.hideProgress(true)}),1250)})}else{this._upCheckCnt++;setTimeout(d.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;d.style(this.percentBarNode,"width",b.percent)},_hideShowProgress:function(b){var c=this.progressNode,e=function(){d.style(c,"display",b.endDisp)};if(b.ani){d.style(c,"display","block");d.animateProperty({node:c,properties:{height:{start:b.beg,end:b.end,units:"px"}},onEnd:e}).play()}else e()},_onUploaderChange:function(b){this.reset();d.forEach(b,function(c,e){this._addRow(e+
1,this.getFileType(c.name),c.name,c.size)},this)},_addRow:function(b,c,e,g){var j,i=this.listNode.insertRow(-1);j=i.insertCell(-1);d.addClass(j,"dojoxUploaderIndex");j.innerHTML=b;j=i.insertCell(-1);d.addClass(j,"dojoxUploaderIcon");j.innerHTML=c;j=i.insertCell(-1);d.addClass(j,"dojoxUploaderFileName");j.innerHTML=e;j=i.insertCell(-1);d.addClass(j,"dojoxUploaderSize");j.innerHTML=this.convertBytes(g).value;this.rowAmt++}})});
define("dojo/io/iframe",["dojo"],function(d){d.getObject("io",true,d);d.io.iframe={create:function(f,a,b){if(window[f])return window[f];if(window.frames[f])return window.frames[f];var c=null;b=b;if(!b){d.config.useXDomain&&!d.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=d.config.dojoBlankHtmlUrl||d.moduleUrl("dojo",
"resources/blank.html")}c=d.place('<iframe id="'+f+'" name="'+f+'" src="'+b+'" onload="'+a+'" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',d.body());return window[f]=c},setSrc:function(f,a,b){try{if(b){var c;if(c=d.isIE||d.isWebKit?f.contentWindow.document:f.contentWindow)c.location.replace(a);else f.location=a}else if(d.isWebKit)f.location=a;else frames[f.name].location=a}catch(e){console.log("dojo.io.iframe.setSrc: ",e)}},doc:function(f){return f.contentDocument||
f.name&&f.document&&d.doc.getElementsByTagName("iframe")[f.name].contentWindow&&d.doc.getElementsByTagName("iframe")[f.name].contentWindow.document||f.name&&d.doc.frames[f.name]&&d.doc.frames[f.name].document||null},send:function(f){if(!this._frame)this._frame=this.create(this._iframeName,d._scopeName+".io.iframe._iframeOnload();");f=d._ioSetArgs(f,function(a){a.canceled=true;a.ioArgs._callNext()},function(a){var b=null;try{var c=a.ioArgs,e=d.io.iframe,g=e.doc(e._frame),j=c.handleAs;b=g;if(j!="html")if(j==
"xml"){if(d.isIE<9||d.isIE&&d.isQuirks){d.query("a",e._frame.contentWindow.document.documentElement).orphan();var i=e._frame.contentWindow.document.documentElement.innerText;i=i.replace(/>\s+</g,"><");i=d.trim(i);b=d._contentHandlers.xml({responseText:i})}}else{b=g.getElementsByTagName("textarea")[0].value;if(j=="json")b=d.fromJson(b);else if(j=="javascript")b=d.eval(b)}}catch(k){b=k}finally{c._callNext()}return b},function(a,b){b.ioArgs._hasError=true;b.ioArgs._callNext();return a});f.ioArgs._callNext=
function(){if(!this._calledNext){this._calledNext=true;d.io.iframe._currentDfd=null;d.io.iframe._fireNextRequest()}};this._dfdQueue.push(f);this._fireNextRequest();d._ioWatch(f,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 f},_currentDfd:null,_dfdQueue:[],_iframeName:d._scopeName+"IoIframe",_fireNextRequest:function(){try{if(!(this._currentDfd||this._dfdQueue.length==
0)){do var f=this._currentDfd=this._dfdQueue.shift();while(f&&f.canceled&&this._dfdQueue.length);if(!f||f.canceled)this._currentDfd=null;else{var a=f.ioArgs,b=a.args;a._contentToClean=[];var c=d.byId(b.form),e=b.content||{};if(c){if(e){var g=function(v,u){d.create("input",{type:"hidden",name:v,value:u},c);a._contentToClean.push(v)};for(var j in e){var i=e[j];if(d.isArray(i)&&i.length>1){var k;for(k=0;k<i.length;k++)g(j,i[k])}else if(c[j])c[j].value=i;else g(j,i)}}var m=c.getAttributeNode("action"),
o=c.getAttributeNode("method"),w=c.getAttributeNode("target");if(b.url){a._originalAction=m?m.value:null;if(m)m.value=b.url;else c.setAttribute("action",b.url)}if(!o||!o.value)if(o)o.value=b.method?b.method:"post";else c.setAttribute("method",b.method?b.method:"post");a._originalTarget=w?w.value:null;if(w)w.value=this._iframeName;else c.setAttribute("target",this._iframeName);c.target=this._iframeName;d._ioNotifyStart(f);c.submit()}else{g=b.url+(b.url.indexOf("?")>-1?"&":"?")+a.query;d._ioNotifyStart(f);
this.setSrc(this._frame,g,true)}}}}catch(s){f.errback(s)}},_iframeOnload:function(){var f=this._currentDfd;if(f){f=f.ioArgs;var a=d.byId(f.args.form);if(a){for(var b=f._contentToClean,c=0;c<b.length;c++)for(var e=b[c],g=0;g<a.childNodes.length;g++){var j=a.childNodes[g];if(j.name==e){d.destroy(j);break}}f._originalAction&&a.setAttribute("action",f._originalAction);if(f._originalTarget){a.setAttribute("target",f._originalTarget);a.target=f._originalTarget}}f._finished=true}else this._fireNextRequest()}};
return d.io.iframe});
define("dojox/form/uploader/plugins/HTML5",["dojo","dijit","dojox","dojox/form/Uploader"],function(d,f,a){d.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=d.formToObject(b);console.log("form data:",b);this.upload(b)},sendAsBinary:function(b){if(this.getUrl()){var c="---------------------------"+(new Date).getTime(),e=this.createXhr();e.setRequestHeader("Content-Type","multipart/form-data; boundary="+c);(b=this._buildRequestBody(b,c))?e.sendAsBinary(b):this.onError(this.errMsg)}else console.error("No upload url found.",this)},uploadWithFormData:function(b){if(this.getUrl()){var c=new FormData;
d.forEach(this.inputNode.files,function(g){c.append(this.name+"s[]",g)},this);if(b)for(var e in b)c.append(e,b[e]);this.createXhr().send(c)}else console.error("No upload url found.",this)},_xhrProgress:function(b){if(b.lengthComputable){var c={bytesLoaded:b.loaded,bytesTotal:b.total,type:b.type,timeStamp:b.timeStamp};if(b.type=="load"){c.percent="100%";c.decimal=1}else{c.decimal=b.loaded/b.total;c.percent=Math.ceil(b.loaded/b.total*100)+"%"}this.onProgress(c)}},createXhr:function(){var b=new XMLHttpRequest,
c;b.upload.addEventListener("progress",d.hitch(this,"_xhrProgress"),false);b.addEventListener("load",d.hitch(this,"_xhrProgress"),false);b.addEventListener("error",d.hitch(this,function(e){this.onError(e);clearInterval(c)}),false);b.addEventListener("abort",d.hitch(this,function(e){this.onAbort(e);clearInterval(c)}),false);b.onreadystatechange=d.hitch(this,function(){if(b.readyState===4){console.info("COMPLETE");clearInterval(c);this.onComplete(d.eval(b.responseText))}});b.open("POST",this.getUrl());
c=setInterval(d.hitch(this,function(){}),250);return b},_buildRequestBody:function(b,c){var e="";c="--"+c;var g=[];d.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";e+=c+"\r\n";e+="Content-Disposition: form-data; ";e+='name="'+i+'"; ';e+='filename="'+m+'"\r\n';e+="Content-Type: "+this.getMimeType()+"\r\n\r\n";e+=o}catch(w){g.push({index:k,name:m})}},this);if(g.length)if(g.length>=this.inputNode.files.length){this.onError({message:this.errMsg,
filesInError:g});e=false}if(!e)return false;if(b)for(var j in b){e+=c+"\r\n";e+="Content-Disposition: form-data; ";e+='name="'+j+'"\r\n\r\n';e+=b[j]+"\r\n"}e+=c+"--\r\n";return e}});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(d,f,a){d.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);d.stopEvent(b)}},uploadIFrame:function(){this.getUrl();d.io.iframe.send({url:this.getUrl(),
form:this.form,handleAs:"json",error:d.hitch(this,function(b){console.error("HTML Upload Error:"+b.message)}),load:d.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(d){d.getObject("number",true,d);d.number.format=function(f,a){a=d.mixin({},a||{});var b=d.i18n.normalizeLocale(a.locale);b=d.i18n.getLocalization("dojo.cldr","number",b);a.customs=b;b=a.pattern||b[(a.type||"decimal")+"Format"];if(isNaN(f)||Math.abs(f)==Infinity)return null;return d.number._applyPattern(f,b,a)};d.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;d.number._applyPattern=function(f,
a,b){b=b||{};var c=b.customs.group,e=b.customs.decimal;a=a.split(";");var g=a[0];a=a[f<0?1:0]||"-"+g;if(a.indexOf("%")!=-1)f*=100;else if(a.indexOf("\u2030")!=-1)f*=1E3;else if(a.indexOf("\u00a4")!=-1){c=b.customs.currencyGroup||c;e=b.customs.currencyDecimal||e;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=d.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,d.number._formatAbsolute(f,g[0],{decimal:e,group:c,places:b.places,round:b.round}))};d.number.round=function(f,a,b){b=10/(b||10);return(b*+f).toFixed(a)/b};(0.9).toFixed()==0&&function(){var f=d.number.round;d.number.round=function(a,b,c){var e=Math.pow(10,-b||0),g=Math.abs(a);if(!a||g>=e||g*Math.pow(10,b+1)<5)e=0;return f(a,b,c)+(a>0?e:-e)}}();d.number._formatAbsolute=
function(f,a,b){b=b||{};if(b.places===true)b.places=0;if(b.places===Infinity)b.places=6;a=a.split(".");var c=typeof b.places=="string"&&b.places.indexOf(","),e=b.places;if(c)e=b.places.substring(c+1);else if(!(e>=0))e=(a[1]||[]).length;b.round<0||(f=d.number.round(f,e,b.round));f=String(Math.abs(f)).split(".");var g=f[1]||"";if(a[1]||b.places){if(c)b.places=b.places.substring(0,c);c=b.places!==undefined?b.places:a[1]&&a[1].lastIndexOf("0")+1;if(c>g.length)f[1]=d.string.pad(g,c,"0",true);if(e<g.length)f[1]=
g.substr(0,e)}else f[1]&&f.pop();e=a[0].replace(",","");c=e.indexOf("0");if(c!=-1){c=e.length-c;if(c>f[0].length)f[0]=d.string.pad(f[0],c);if(e.indexOf("#")==-1)f[0]=f[0].substr(f[0].length-c)}e=a[0].lastIndexOf(",");var j,i;if(e!=-1){j=a[0].length-e-1;a=a[0].substr(0,e);e=a.lastIndexOf(",");if(e!=-1)i=a.length-e-1}a=[];for(e=f[0];e;){c=e.length-j;a.push(c>0?e.substr(c):e);e=c>0?e.slice(0,c):"";if(i){j=i;delete i}}f[0]=a.reverse().join(b.group||",");return f.join(b.decimal||".")};d.number.regexp=
function(f){return d.number._parseInfo(f).regexp};d.number._parseInfo=function(f){f=f||{};var a=d.i18n.normalizeLocale(f.locale);a=d.i18n.getLocalization("dojo.cldr","number",a);var b=f.pattern||a[(f.type||"decimal")+"Format"],c=a.group,e=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){c=a.currencyGroup||c;e=a.currencyDecimal||e}}a=b.split(";");a.length==1&&a.push("-"+a[0]);a=d.regexp.buildGroupRE(a,function(i){i="(?:"+d.regexp.escapeString(i,
".")+")";return i.replace(d.number._numberPatternRE,function(k){var m={signed:false,separator:f.strict?c:[c,""],fractional:f.fractional,decimal:e,exponent:false};k=k.split(".");var o=f.places;if(k.length==1&&g!=1)k[1]="###";if(k.length==1||o===0)m.fractional=false;else{if(o===undefined)o=f.pattern?k[1].lastIndexOf("0")+1:Infinity;if(o&&f.fractional==undefined)m.fractional=true;if(!f.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"("+d.number._realNumberRegexp(m)+")"})},true);if(j)a=a.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g,function(i,k,m,o){i=d.regexp.escapeString(f[["symbol","currency","displayName"][m.length-1]]||f.currency||"");k=k?"[\\s\\xa0]":"";o=o?"[\\s\\xa0]":"";if(!f.strict){if(k)k+="*";if(o)o+="*";return"(?:"+k+i+o+")?"}return k+i+o});return{regexp:a.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:c,decimal:e,factor:g}};d.number.parse=function(f,a){a=d.number._parseInfo(a);f=(new RegExp("^"+
a.regexp+"$")).exec(f);if(!f)return NaN;var b=f[1];if(!f[1]){if(!f[2])return NaN;b=f[2];a.factor*=-1}b=b.replace(new RegExp("["+a.group+"\\s\\xa0]","g"),"").replace(a.decimal,".");return b*a.factor};d.number._realNumberRegexp=function(f){f=f||{};if(!("places"in f))f.places=Infinity;if(typeof f.decimal!="string")f.decimal=".";if(!("fractional"in f)||/^0/.test(f.places))f.fractional=[true,false];if(!("exponent"in f))f.exponent=[true,false];if(!("eSigned"in f))f.eSigned=[true,false];var a=d.number._integerRegexp(f),
b=d.regexp.buildGroupRE(f.fractional,function(e){var g="";if(e&&f.places!==0){g="\\"+f.decimal;if(f.places==Infinity)g="(?:"+g+"\\d+)?";else g+="\\d{"+f.places+"}"}return g},true),c=d.regexp.buildGroupRE(f.exponent,function(e){if(e)return"([eE]"+d.number._integerRegexp({signed:f.eSigned})+")";return""});a=a+b;if(b)a="(?:(?:"+a+")|(?:"+b+"))";return a+c};d.number._integerRegexp=function(f){f=f||{};if(!("signed"in f))f.signed=[true,false];if("separator"in f){if(!("groupSize"in f))f.groupSize=3}else f.separator=
"";var a=d.regexp.buildGroupRE(f.signed,function(c){return c?"[-+]":""},true),b=d.regexp.buildGroupRE(f.separator,function(c){if(!c)return"(?:\\d+)";c=d.regexp.escapeString(c);if(c==" ")c="\\s";else if(c=="\u00a0")c="\\s\\xa0";var e=f.groupSize,g=f.groupSize2;if(g){c="(?:0|[1-9]\\d{0,"+(g-1)+"}(?:["+c+"]\\d{"+g+"})*["+c+"]\\d{"+e+"})";return e-g>0?"(?:"+c+"|(?:0|[1-9]\\d{0,"+(e-1)+"}))":c}return"(?:0|[1-9]\\d{0,"+(e-1)+"}(?:["+c+"]\\d{"+e+"})*)"},true);return a+b};return d.number});
define("dijit/ProgressBar",["dojo","dijit","text!dijit/templates/ProgressBar.html","dojo/fx","dojo/number","dijit/_Widget","dijit/_Templated"],function(d,f){d.declare("dijit.ProgressBar",[f._Widget,f._Templated],{progress:"0",value:"",maximum:100,places:0,indeterminate:false,label:"",name:"",templateString:d.cache("dijit","templates/ProgressBar.html"),_indeterminateHighContrastImagePath:d.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){d.mixin(this,a||{});a=this.internalProgress;var b=this.domNode,c=1;if(this.indeterminate){f.removeWaiState(b,"valuenow");f.removeWaiState(b,"valuemin");f.removeWaiState(b,"valuemax")}else{if(String(this.progress).indexOf("%")!=
-1){c=Math.min(parseFloat(this.progress)/100,1);this.progress=c*this.maximum}else{this.progress=Math.min(this.progress,this.maximum);c=this.progress/this.maximum}f.setWaiState(b,"describedby",this.labelNode.id);f.setWaiState(b,"valuenow",this.progress);f.setWaiState(b,"valuemin",0);f.setWaiState(b,"valuemax",this.maximum)}this.labelNode.innerHTML=this.report(c);d.toggleClass(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);a.style.width=c*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;":d.number.format(a,{type:"percent",places:this.places,locale:this.lang})},onChange:function(){}});return f.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(d,f){d.declare("orion.widgets.ImportDialog",[f.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.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);d.byId("importDialog.myForm").action=this.options.importLocation;d.byId("importDialog.uploader").url=this.options.importLocation;d.connect(f.byId("importDialog.uploader"),"onError",d.hitch(this,function(){setTimeout(d.hitch(this,function(){this.hide()}),2E3)}));d.connect(f.byId("importDialog.uploader"),
"onComplete",d.hitch(this,function(){setTimeout(d.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(d,f){d.declare("dijit.form.ComboBoxMixin",f._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:d.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(d.isIE){var c=d.doc.selection.createRange().duplicate();a=a.createTextRange();c.move("character",
0);a.move("character",0);try{a.setEndPoint("EndToEnd",c);b=String(a.text).replace(/\r/g,"").length}catch(e){}}return b},_setCaretPos:function(a,b){b=parseInt(b);f.selectInputText(a,b,b)},_setDisabledAttr:function(a){this.inherited(arguments);f.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(d.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==d.keys.SHIFT)){var c=false,e=this.dropDown,g=d.keys,j=null;this._prev_key_backspace=false;this._abortQuery();this.inherited(arguments);if(this._opened)j=e.getHighlightedOption();switch(b){case g.PAGE_DOWN:case g.DOWN_ARROW:case g.PAGE_UP:case g.UP_ARROW:this._opened&&
this._announceOption(j);d.stopEvent(a);break;case g.ENTER:if(j)if(j==e.nextButton){this._nextSearch(1);d.stopEvent(a);break}else{if(j==e.previousButton){this._nextSearch(-1);d.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(e&&(b==e._messages.previousMessage||b==e._messages.nextMessage))break;j&&this._selectOption();if(this._opened){this._lastQuery=
null;this.closeDropDown()}break;case " ":if(j){d.stopEvent(a);this._selectOption();this.closeDropDown()}else c=true;break;case g.DELETE:case g.BACKSPACE:c=this._prev_key_backspace=true;break;default:c=typeof b=="string"||b==229}if(c){this.item=undefined;this.searchTimer=setTimeout(d.hitch(this,"_startSearchFromInput"),1)}}},_autoCompleteText:function(a){var b=this.focusNode;f.selectInputText(b,b.value.length);var c=this.ignoreCase?"toLowerCase":"substr";if(a[c](0).indexOf(this.focusNode.value[c](0))==
0){c=this._getCaretPos(b);if(c+1>b.value.length){b.value=a;f.selectInputText(b,c)}}else{b.value=a;f.selectInputText(b)}},_openResultList:function(a,b){this._fetchHandle=null;if(!(this.disabled||this.readOnly||b.query[this.searchAttr]!=this._lastQuery)){var c=this.dropDown._highlighted_option&&d.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,d.hitch(this,"_getMenuLabelFromItem"));this._showResultList();if(b.direction){if(1==b.direction)this.dropDown.highlightFirstOption();else-1==b.direction&&this.dropDown.highlightLastOption();c&&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();f.setWaiState(this.domNode,"expanded",
"true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return false},closeDropDown:function(){this._abortQuery();if(this._opened){this.inherited(arguments);f.setWaiState(this.domNode,"expanded","false");f.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&&f.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true);this._refreshState()}},_onBlur:function(){this.closeDropDown();this.inherited(arguments)},_setItemAttr:function(a,b,c){c||(c=this.store.getValue(a,this.searchAttr));var e=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):c;this._set("item",a);f.form.ComboBox.superclass._setValueAttr.call(this,e,b,c)},_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);f.setWaiState(this.focusNode,"activedescendant",d.attr(a,"id"));this._autoCompleteText(b)}},_selectOption:function(a){a&&this._announceOption(a.target);this.closeDropDown();this._setCaretPos(this.focusNode,this.focusNode.value.length);
f.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 d.string.substitute(this.queryExpr,[a])},_startSearch:function(a){if(!this.dropDown){var b=this.id+"_popup";this.dropDown=new (d.getObject(this.dropDownClass,false))({onChange:d.hitch(this,this._selectOption),id:b,dir:this.dir});f.removeWaiState(this.focusNode,
"activedescendant");f.setWaiState(this.textbox,"owns",b)}b=d.clone(this.query);this._lastInput=a;this._lastQuery=b[this.searchAttr]=this._getQueryString(a);this.searchTimer=setTimeout(d.hitch(this,function(c,e){this.searchTimer=null;c={queryOptions:{ignoreCase:this.ignoreCase,deep:true},query:c,onBegin:d.hitch(this,"_setMaxOptions"),onComplete:d.hitch(this,"_openResultList"),onError:function(g){e._fetchHandle=null;console.error("dijit.form.ComboBox: "+g);e.closeDropDown()},start:0,count:this.pageSize};
d.mixin(c,e.fetchProperties);this._fetchHandle=e.store.fetch(c);this._nextSearch=this.dropDown.onPage=d.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 f.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=d.query('label[for="'+this.id+'"]');if(a.length){a[0].id=this.id+"_label";f.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 c=(this.ignoreCase?"i":"")+(this.highlightMatch=="all"?"g":""),e=this.queryExpr.indexOf("${0}");b=d.regexp.escapeString(b);return this._escapeHtml(a).replace(new RegExp((e==0?"^":"")+"("+b+")"+(e==this.queryExpr.length-4?"$":""),c),'<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()}});d.declare("dijit.form._ComboBoxMenu",[f._Widget,f._Templated,f._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=d.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 c=d.create("li",{"class":"dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl"),role:"option"});b=b(a);if(b.html)c.innerHTML=b.label;else c.appendChild(d.doc.createTextNode(b.label));if(c.innerHTML=="")c.innerHTML="&nbsp;";c.item=a;return c},createOptions:function(a,b,c){this.previousButton.style.display=b.start==0?"none":"";d.attr(this.previousButton,"id",this.id+"_prev");d.forEach(a,function(g,j){g=this._createOption(g,c);d.attr(g,"id",this.id+j);this.domNode.insertBefore(g,
this.nextButton)},this);var e=false;if(b._maxOptions&&b._maxOptions!=-1)if(b.start+b.count<b._maxOptions)e=true;else{if(b.start+b.count>b._maxOptions&&b.count==a.length)e=true}else if(b.count==a.length)e=true;this.nextButton.style.display=e?"":"none";d.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){d.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;d.addClass(this._highlighted_option,"dijitMenuItemSelected")}},_blurOptionNode:function(){if(this._highlighted_option){d.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)}d.window.scrollIntoView(this._highlighted_option)},highlightFirstOption:function(){var a=this.domNode.firstChild,b=a.nextSibling;this._focusOptionNode(b.style.display=="none"?a:b);d.window.scrollIntoView(this._highlighted_option)},highlightLastOption:function(){this._focusOptionNode(this.domNode.lastChild.previousSibling);d.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)}d.window.scrollIntoView(this._highlighted_option)},_page:function(a){var b=0,c=this.domNode.scrollTop,e=d.style(this.domNode,"height");for(this.getHighlightedOption()||this._highlightNextOption();b<e;){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-c)*(a?-1:1);c=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 d.keys.DOWN_ARROW:this._highlightNextOption();
return false;case d.keys.PAGE_DOWN:this.pageDown();return false;case d.keys.UP_ARROW:this._highlightPrevOption();return false;case d.keys.PAGE_UP:this.pageUp();return false;default:return true}}});d.declare("dijit.form.ComboBox",[f.form.ValidationTextBox,f.form.ComboBoxMixin],{_setValueAttr:function(a,b,c){this._set("item",null);a||(a="");f.form.ValidationTextBox.prototype._setValueAttr.call(this,a,b,c)}});d.declare("dijit.form._ComboBoxDataStore",null,{constructor:function(a){this.root=a;if(a.tagName!=
"SELECT"&&a.firstChild){a=d.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}d.query("> option",a).forEach(function(b){b.innerHTML=d.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 c=d.data.util.filter.patternToRegExp(a.query.name,a.queryOptions.ignoreCase),e=d.query("> option",this.root).filter(function(g){return(g.innerText||g.textContent||"").match(c)});a.sort&&e.sort(d.data.util.sorter.createSortFunction(a.sort,this));b(e,a)},close:function(){},getLabel:function(a){return a.innerHTML},getIdentity:function(a){return d.attr(a,"value")},fetchItemByIdentity:function(a){var b=d.query("> option[value='"+
a.identity+"']",this.root)[0];a.onItem(b)},fetchSelectedItem:function(){var a=this.root,b=a.selectedIndex;return typeof b=="number"?d.query("> option:nth-child("+(b!=-1?b+1:1)+")",a)[0]:null}});d.extend(f.form._ComboBoxDataStore,d.data.util.simpleFetch);return f.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(d,f){localStorage.getItem("orion.sftpConnections")||localStorage.setItem("orion.sftpConnections",JSON.stringify({identifier:"name",label:"name",items:[]}));window.sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"));d.declare("orion.widgets.SFTPConnectionDialog",
[f.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:d.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);d.connect(this.addSFTPConnection,"onClick",null,d.hitch(this,this.onAddConnection))},execute:function(){var a=this.sftpConnectionList.value.split("@");if(a.length===2){var b=a[0],c=a[1].indexOf("/");if(!(c<=0)){var e=a[1].substring(0,c);a=a[1].substring(c);this.options.func(e,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")),c=false,e=0;e<b.items.length;e++)if(b.items[e].name===a.name){c=true;break}if(!c){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(d,f,a,b,c,e,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=[],A=0;A<r.length;A++){var z=r[A],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(A){return c.escape(A)});y=y.map(function(A){return c.escape(A)});r=r.length&&"(*\\.("+r.join("|")+")$)";y=y.length&&"(^("+y.join("|")+")$)";return r&&y?r+"|"+y:r?r:y?y:null}function w(r,y){r=r.getServiceReferences("orion.navigate.openWith");
for(var A=[],z=0;z<r.length;z++){var E=r[z];if(E.getProperty("editor")===y.id){E=E.getProperty("contentType");if(E instanceof Array)A=A.concat(E);else E!==null&&typeof E!=="undefined"&&A.push(E)}}return A}function s(r){for(r=r.getServiceReferences("orion.navigate.openWith.default");0<r.length;)return{editor:r[0].getProperty("editor")};return null}for(var v=m(),u=s(i),t=[],q=0;q<v.length;q++){var x=v[q],B=u&&u.editor===x.id,D=w(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:B?"default":"editor"};B={run:f.hitch(D,D.expand)};t.push({properties:x,service:B})}}return t};j._makeValidationFunction=function(i,k){function m(s){for(var v="^",u=0;u<s.length;u++){var t=s.charAt(u);switch(t){case "?":v+=".";break;case "*":v+=".*";break;default:v+=
t}}v+="$";return new RegExp(v)}function o(s,v,u){var t,q;if(v.indexOf(":")>=0){t=m(v.substring(0,v.indexOf(":")));var x=v.substring(v.indexOf(":")+1);for(q in s)if(t.test(q))if(o(s[q],x,u))return true}t=m(v);for(q in s)if(t.test(q))if(typeof u==="string"){if(m(u).test(s[q]))return true}else if(u===s[q])return true;return false}function w(s,v){for(var u in v)if(!o(s,u,v[u]))return false;return true}return f.hitch(i,function(s){if(typeof k==="function")s=k(s);if(f.isArray(s)){if((this.forceSingleItem||
this.href)&&s.length!==1)return false;if(!this.forceSingleItem&&s.length<1)return false}else s=[s];if(!this.validationProperties)return true;for(var v in s)if(!w(s[v],this.validationProperties))return false;return true})};j._createCommandOptions=function(i,k,m,o,w){var s={name:i.name,image:i.image,id:i.id||i.name,tooltip:i.tooltip,isEditor:i.isEditor};s.visibleWhen=j._makeValidationFunction(i,w);if(o)if(i.href)s.hrefCallback=f.hitch(i,function(v){v=f.isArray(v.items)?v.items[0]:v.items;v=j._cloneItemWithoutChildren(v);
if(k.run)return k.run(v);else if(m)return m.getService(k).run(v)});else s.callback=f.hitch(i,function(v){var u;if(this.forceSingleItem){v=f.isArray()?v.items[0]:v.items;u=j._cloneItemWithoutChildren(v)}else if(f.isArray(v.items)){u=[];for(var t=0;t<v.items.length;t++)u.push(j._cloneItemWithoutChildren(v.items[t]))}else u=j._cloneItemWithoutChildren(v.items);if(k.run)k.run(u);else m&&m.getService(k).run(u)});return s};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 d(a,b,c,e,g){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=b!==undefined&&b!==null?b:false;this.mod2=c!==undefined&&c!==null?c:false;this.mod3=e!==undefined&&e!==null?e:false;this.mod4=g!==undefined&&g!==null?g:false}var f=window.navigator.platform.indexOf("Mac")!==-1;d.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(f?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;
if(this.mod3!==a.altKey)return false;if(f&&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:d}});
define("orion/favorites",["require","dojo","orion/util"],function(d,f,a){function b(c){this._favorites=[];this._searches=[];this._init(c);this._initializeFavorites()}b.prototype={_init:function(c){this._registry=c.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(c){c=
f.isArray(c)?c:[c];for(var e=0;e<c.length;e++){var g=c[e],j=g.ChildrenLocation?g.ChildrenLocation:g.Location;j=a.makeRelative(j);this.addFavorite(g.Name,j,g.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,false,true)},addFavorite:function(c,e,g,j){this._favorites.push({name:c,path:e,directory:g,isFavorite:true,isExternalResource:j});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var e in this._favorites)if(this._favorites[e].path===
c){this._favorites.splice(e,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,e){var g=false;for(var j in this._favorites)if(this._favorites[j].path===c){var i=this._favorites[j];if(i.name!==e){i.name=e;g=true}}if(g){this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(c,e){this._searches.push({name:c,query:e,isSearch:true});this._searches.sort(this._sorter);this._storeSearches();
this._notifyListeners()},hasFavorite:function(c){for(var e in this._favorites)if(this._favorites[e].path===c)return true;return false},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var e;if(!c)return this._favorites;var g="";for(e=0;e<c.length;e++){var j=c.charAt(e);g+=j==="*"?".*":j==="?"?".?":this._SPECIAL_CHARS.indexOf(j)>=0?"\\"+j:j}g+=".*";c=new RegExp(g);g=[];for(e in this._favorites)this._favorites[e].name.search(c)===0&&g.push(this._favorites[e]);return g},removeSearch:function(c){for(var e in this._searches)if(this._searches[e].query===
c){this._searches.splice(e,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(c,e){var g=false;for(var j in this._searches)if(this._searches[j].query===c){var i=this._searches[j];if(i.name!==e){i.name=e;g=true}}if(g){this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()}},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var g,
j=e.get("navigate");if(typeof j==="string")j=JSON.parse(j);if(j)for(g in j){j[g].isFavorite=true;c._favorites.push(j[g])}e=e.get("search");if(typeof e==="string")e=JSON.parse(e);if(e)for(g in e){e[g].isSearch=true;c._searches.push(e[g])}c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("navigate",c)})},_storeSearches:function(){var c=this._searches;
this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){e.put("search",c)})},_sorter:function(c,e){c=c.name.toLowerCase();e=e.name.toLowerCase();return c>e?1:c<e?-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(d,f,a){return f.declare("orion.widgets.OpenResourceDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.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);f.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(f.hitch(this,this.checkSearch),0)});f.connect(this.resourceName,"onKeyPress",this,function(b){if(b.keyCode===
f.keys.ENTER&&this.results){b=f.query("a",this.results);if(b.length>0){window.open(b[0].href);this.hide()}}});f.connect(this,"onKeyPress",this,function(b){var c,e,g,j,i;g=function(m,o,w){return o<m.length-1?m[o+1]:w};var k=function(m,o,w){return o>0?m[o-1]:w};if(b.keyCode===f.keys.DOWN_ARROW||b.keyCode===f.keys.UP_ARROW){e=f.query("a",this.results);c=f.query("a",this.favresults);j=a.getFocus();i=e.indexOf(j.node);j=c.indexOf(j.node);if(b.keyCode===f.keys.DOWN_ARROW)if(j>=0)a.focus(g(c,j,e.length>
0?e[0]:c[0]));else if(i>=0)a.focus(g(e,i,c.length>0?c[0]:e[0]));else{if(e.length>0||c.length>0)a.focus(g(c,-1,e[0]))}else if(j>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(k(c,j,g))}else if(i>=0){g=this.resourceName&&this.resourceName.get("textbox");a.focus(k(e,i,c.length>0?c[c.length-1]:g))}else if(e.length>0)a.focus(e[e.length-1]);else c.length>0&&a.focus(c[c.length-1]);f.stopEvent(b)}});f.connect(this,"onMouseUp",function(b){b.target.focus()});this.populateFavorites()},populateFavorites:function(){f.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(c){if(c.navigator)c=c.navigator;b.searchRenderer.makeRenderFunction(b.favresults,false,f.hitch(b,b.decorateResult),b.showFavoritesImage)(c);c&&c.length>0&&f.place("<hr/>",b.favresults,"last")}},showFavoritesImage:function(b){var c=new Image;f.addClass(c,"commandSprite");f.addClass(c,"core-sprite-makeFavorite");
f.addClass(c,"commandImage");c.src=d.toUrl("images/none.png");c.title="Favorite";b.appendChild(c);f.style(c,"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(f.hitch(this,"checkSearch"),50)},doSearch:function(){var b=this.resourceName&&this.resourceName.get("value"),c=this.showFavorites();this.favService.queryFavorites(b).then(function(g){c(g)});if(b){f.place("<div>Searching&#x2026;</div>",
this.results,"only");var e=this;setTimeout(function(){var g=e.searcher.createSearchQuery(null,b,"Name"),j=e.searchRenderer.makeRenderFunction(e.results,false,f.hitch(e,e.decorateResult));e.searcher.search(g,false,j)},0)}},decorateResult:function(b){var c=this;f.query("a",b).forEach(function(e){f.connect(e,"onmouseup",function(g){!f.mouseButtons.isMiddle(g)&&!f.isCopyKey(g)&&c.hide()});f.connect(e,"onkeyup",c,function(g){g.keyCode===f.keys.ENTER&&c.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(d,f,a){f.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:f.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;f.addClass(this.closeLink,"imageSprite");f.addClass(this.closeLink,"core-sprite-close");f.connect(this.closeLink,"onmouseover",this.closeLink,function(){b.closeLink.style.cursor="pointer"});f.connect(this.closeLink,"onmouseout",this.closeLink,function(){b.closeLink.style.cursor="default"});f.connect(this.closeLink,"onclick",function(){f.hitch(b,b.closeDialog)()})},setPendingAuthentication:function(b){for(var c in this.unauthenticatedServices)delete this.unauthenticatedServices[c].pending;for(c in b)if(this.unauthenticatedServices[b[c].SignInKey])this.unauthenticatedServices[b[c].SignInKey].pending=
true;else if(this.authenticatedServices[b[c].SignInKey]){this.unauthenticatedServices[b[c].SignInKey]=this.authenticatedServices[b[c].SignInKey];this.unauthenticatedServices[b[c].SignInKey].pending=true;delete this.authenticatedServices[b[c].SignInKey]}else this.unauthenticatedServices[b[c].SignInKey]={label:b[c].label,SignInLocation:b[c].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,c,e,g){if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:c,label:e,data:g}}else{this.authenticatedServices[b]&&delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:e,pending:this.unauthenticatedServices[b].pending}:
{authService:c,label:e}}f.hitch(this,this.renderAuthenticatedServices)();f.hitch(this,this.renderUnauthenticatedServices)()},renderAuthenticatedServices:function(){f.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var b=this,c=true;for(var e in this.authenticatedServices){if(!c){var g=f.create("tr",null,this.authenticatedList);f.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)}c=false;g=f.create("tr",{className:"navTableHeading"});var j=this.authenticatedServices[e].authService,i=f.create("td",null,g,"only"),k=f.create("h2",null,i,"only");if(j)if(j.getAuthForm)f.hitch(b,function(w,s){j.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(v){if(b.authenticatedServices[s].label)w.innerHTML=b.authenticatedServices[s].label+"<br>";w.innerHTML+=b.getHostname(v)})})(k,e);else k.innerHTML=this.authenticatedServices[e].label?this.authenticatedServices[e].label:
e;else{var m=this.authenticatedServices[e].SignInLocation;if(this.authenticatedServices[e].label)k.innerHTML=this.authenticatedServices[e].label+"<br>";k.innerHTML+=this.getHostname(m)}f.addClass(i,"LoginWindowLeft");i=f.create("td",{style:"text-align: right"},g,"last");f.addClass(i,"LoginWindowRight");k=this.authenticatedServices[e].data;j=this.authenticatedServices[e].authService;if(!j){f.place(g,this.authenticatedList,"last");return}k.Location&&f.create("a",{href:d.toUrl("profile/user-profile.html")+
"#"+k.Location,innerHTML:"Profile"},i,"last");f.place(document.createTextNode(" "),i,"last");if(j.logout){var o=f.create("a",{innerHTML:"Sign out"},i,"last");f.connect(o,"onmouseover",o,function(){o.style.cursor="pointer"});f.connect(o,"onmouseout",o,function(){o.style.cursor="default"});f.connect(o,"onclick",f.hitch(b,function(w,s){return function(){w.logout().then(f.hitch(b,function(){this.addUserItem(s,w,this.authenticatedServices[s].label);this.isSingleService()&&this.closeDialog();localStorage.removeItem(s)}))}})(j,
e))}f.place(g,this.authenticatedList,"last");i="N/A";if(k&&k.lastlogintimestamp)i=f.date.locale.format(new Date(k.lastlogintimestamp),{formatLength:"short"});k=k.Name&&k.Name.replace(/^\s+|\s+$/g,"")!==""?k.Name:k.login;g=f.create("tr");i=k.length>40?f.create("td",{innerHTML:k.substring(0,30)+"... logged in since "+i,colspan:2,title:k+" logged in since "+i},g,"only"):f.create("td",{innerHTML:k+" logged in since "+i,colspan:2},g,"only");f.addClass(i,"LoginWindowLeft");f.addClass(i,"LoginWindowRight");
f.addClass(i,"LoginWindowComment");f.place(g,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){this.emptyListInfo.style.display=this.unauthenticatedServices.length===0&&this.authenticatedServices.length===0?"":"none";f.empty(this.otherUnauthenticatedList);var b=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var c=true;for(var e in this.unauthenticatedServices){if(!c||!this.isEmpty(this.authenticatedServices)){var g=f.create("tr",
null,this.otherUnauthenticatedList);f.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)}c=false;g=f.create("tr",{className:"navTableHeading"});var j=f.create("td",null,g,"only");f.addClass(j,"LoginWindowLeft");var i=f.create("h2",null,j,"only");j=f.create("td",{style:"text-align: right"},g,"last");f.addClass(j,"LoginWindowRight");var k=this.unauthenticatedServices[e].authService;
if(k)if(k.getAuthForm)f.hitch(b,function(w,s){k.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(v){v.indexOf("?")==-1?f.create("a",{target:"_blank",href:v+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+s,innerHTML:"Sign in"},w,"last"):f.create("a",{target:"_blank",href:v+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+s,innerHTML:"Sign in"},w,"last");if(b.unauthenticatedServices[s].label)i.innerHTML=b.unauthenticatedServices[s].label+
"<br>";i.innerHTML+=b.getHostname(v)})})(j,e);else{if(k.login){f.place(document.createTextNode(this.unauthenticatedServices[e].label?this.unauthenticatedServices[e].label:e),i,"only");var m=f.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},j,"last");f.connect(m,"onmouseover",m,function(){m.style.cursor="pointer"});f.connect(m,"onmouseout",m,function(){m.style.cursor="default"});f.connect(m,"onclick",f.hitch(b,function(w){return function(){w.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[e].SignInLocation;o.indexOf("?")==-1?f.create("a",{target:"_blank",href:o+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+e,innerHTML:"Sign in"},j,"last"):f.create("a",{target:"_blank",href:o+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+e,innerHTML:"Sign in"},j,"last");if(this.unauthenticatedServices[e].label)i.innerHTML=this.unauthenticatedServices[e].label+
"<br>";i.innerHTML+=this.getHostname(o)}f.place(g,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[e].pending){g=f.create("tr");j=f.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},g,"only");f.addClass(j,"LoginWindowLeft");f.addClass(j,"LoginWindowRight");f.create("img",{src:d.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},j,"first");f.place(g,this.otherUnauthenticatedList,"last")}}},
isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(b){for(var c in b)if(b.hasOwnProperty(c))return false;return true},length:function(b){var c=0;for(var e in b)b.hasOwnProperty(e)&&c++;return c},getHostname:function(b){var c=document.createElement("img");c.src=b;b=c.src;c.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(d,f,a){f.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 c=0;for(var e in b)b.hasOwnProperty(e)&&c++;return c},_renderAuthenticatedService:function(b,c,e){var g=this,j=this.authenticatedServices[b].authService;if(j&&j.logout)this.addChild(new a.MenuItem({label:e?"Sign Out "+e:"Sign Out",onClick:f.hitch(this,function(i,k){return function(){i.logout().then(f.hitch(g,function(){this.addUserItem(k,i,this.authenticatedServices[k].label);localStorage.removeItem(k)}))}})(j,b)}),c)},_renderUnauthenticatedService:function(b,
c,e){var g=this,j=this.unauthenticatedServices[b].authService;if(j)if(j.getAuthForm)f.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:e?"<a target='_blank' href="+m+">Sign In To "+e+"</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)}}),c)})})(b);else{if(j.login)this.addChild(new a.MenuItem({label:e?"Sign In To "+e:"Sign In",onClick:f.hitch(g,function(k){return function(){k.login(eclipse.globalCommandUtils.notifyAuthenticationSite)}})(j)}),c)}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:e?"<a target='_blank' href="+i+">Sign In To "+e+"</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)}}),c)}},renderServices:function(){for(var b=this.getChildren(),c=0;c<b.length;c++)this.removeChild(b[c]);if(this.isSingleService())for(c in this.authenticatedServices)this._renderAuthenticatedService(c,0);this.addChild(new a.MenuItem({label:"<a href="+
d.toUrl("settings/settings.html")+">Settings</a>",onKeyDown:function(e){if(e.keyCode===13)window.location=d.toUrl("settings/settings.html")},_onClick:function(e){this.getParent().onItemClick(this,e)}}));this.addChild(new a.MenuItem({label:"<a href="+d.toUrl("operations/list.html")+">Background Operations</a>",onKeyDown:function(e){if(e.keyCode===13)window.location=d.toUrl("operations/list.html")},_onClick:function(e){this.getParent().onItemClick(this,e)}}));this.addChild(new a.MenuSeparator);this.addChild(new a.MenuItem({label:"<a href="+
d.toUrl("help/index.jsp")+">Help</a>",onKeyDown:function(e){if(e.keyCode===13)window.location=d.toUrl("help/index.jsp")},_onClick:function(e){this.getParent().onItemClick(this,e)}}));this.keyAssistFunction&&this.addChild(new a.MenuItem({label:"Keyboard Help",onClick:this.keyAssistFunction}));this.addChild(new a.MenuItem({label:"<a href='"+d.toUrl("help/about.html")+"'>About Orion</a>",onKeyDown:function(e){if(e.keyCode===13)window.location=d.toUrl("help/about.html")},_onClick:function(e){this.getParent().onItemClick(this,
e)}}))},getUserLabel:function(b){if(b.data){var c=b.data.Name&&b.data.Name.replace(/^\s+|\s+$/g,"")!==""?b.data.Name:b.data.login;if(c.length>40)c=c.substring(0,30)+"...";c+=" ("+b.label+")";return c}else return b.label},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,c,e,g){var j=this;if(g){this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b];this.authenticatedServices[b]={authService:c,label:e,data:g}}else{this.authenticatedServices[b]&&
delete this.authenticatedServices[b];this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:c,label:e,pending:this.unauthenticatedServices[b].pending}:{authService:c,label:e}}f.hitch(this,this.renderServices)();if(f.byId("userInfo"))if(this.isSingleService()&&g){e=b=g.Name&&g.Name.replace(/^\s+|\s+$/g,"")!==""?g.Name:g.login;if(e.length>40)e=e.substring(0,30)+"...";f.create("a",{innerHTML:e,href:d.toUrl("profile/user-profile.html")+"#"+g.Location,title:"View profile of "+b,style:"margin-right: 0px"},
f.byId("userInfo"),"only")}else if(this.isSingleService()&&!g)if(c.getAuthForm)f.hitch(this,function(k){c.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;f.create("a",{innerHTML:"Sign In",href:m,title:"Sign In",style:"margin-right: 0px",target:"_blank"},f.byId("userInfo"),"only")})})(b);else{if(c.login){var i=
f.create("a",{innerHTML:"Sign In",title:"Sign In",style:"margin-right: 0px"},f.byId("userInfo"),"only");f.connect(i,"onmouseover",i,function(){i.style.cursor="pointer"});f.connect(i,"onmouseout",i,function(){i.style.cursor="default"});f.connect(i,"onclick",function(){c.login(eclipse.globalCommandUtils.notifyAuthenticationSite)})}}else if(this.hasServices()){i=f.create("a",{innerHTML:"Profiles",style:"margin-right: 0px"},f.byId("userInfo"),"only");f.connect(i,"onmouseover",i,function(){i.style.cursor=
"pointer"});f.connect(i,"onmouseout",i,function(){i.style.cursor="default"});f.connect(i,"onclick",function(){try{a.popup.open({popup:j.options.loginDialog,around:f.byId("userInfo")})}catch(k){}a.focus(j.options.loginDialog.domNode)})}else f.empty(f.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(d,f,a,b,c,e,g,j,i,k){function m(L){var P=document.createElement("a");P.href=L;return P.href}function o(L,P){if(L.getLabel)return L.getLabel();
else{L=new f.Deferred;L.callback(P.properties.name);return L}}function w(){return E}function s(L){(L=L.getService("orion.page.progress"))&&f.hitch(L,L.init)("progressPane")}function v(L){var P=L.getServiceReferences("orion.core.auth");E=[];var S=f.byId("userMenu");if(S){if(!a.byId("logins")){var C=new a.form.DropDownButton({id:"logins",dropDown:z,label:"Options",showLabel:false,alt:"Options"});f.place(C.domNode,S,"only");C.valueNode&&f.destroy(C.valueNode)}for(S=0;S<P.length;S++){C=P[S];var F=L.getService(C);
f.hitch(this,function(J,Q){o(J,Q).then(function(T){J.getKey().then(function(U){E.push(U);J.getUser().then(function(W){A.addUserItem(U,J,T,W);z.addUserItem(U,J,T,W)},function(){A.addUserItem(U,J,T);z.addUserItem(U,J,T,jsonData)});window.addEventListener("storage",function(){if(y[U]!==localStorage.getItem(U)){y[U]=localStorage.getItem(U);J.getUser().then(function(W){A.addUserItem(U,J,T,W);z.addUserItem(U,J,T,W)},function(){A.addUserItem(U,J,T);z.addUserItem(U,J,T)})}},false)})})})(F,C)}}}function u(L){A.setPendingAuthentication(L);
var P;for(P in L)if(L.hasOwnProperty(P)){if(f.byId("userInfo").innerHTML)try{a.popup.open({popup:A,around:f.byId("userInfo")})}catch(S){}else window.setTimeout(function(){try{a.popup.open({popup:A,around:f.byId("userInfo")})}catch(C){}},500);return}a.popup.hide&&a.popup.hide(A);a.popup.close(A)}function t(L){A.authenticatedService(L)}function q(L,P,S,C,F,J,Q){L.closeParameterCollector();if(J=f.byId("pageActions")){f.empty(J);(J=L.renderCommands(J,"dom",S||P,P,"button"))&&J.then?J.then(function(){L.processURL(window.location.href)}):
L.processURL(window.location.href)}if(!Q)if(J=f.byId("pageNavigationActions")){f.empty(J);L.renderCommands(J,"dom",F||S||P,C||P,"button")}}function x(){if(f.byId("relatedLinks")){if(G){G.focusedChild=null;f.forEach(G.getChildren(),function(L){G.removeChild(L);L.destroy()});G.destroy()}return G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"})}}function B(L,P){G||(G=new a.Menu({style:"display: none;",id:"relatedLinksMenu"}));L._addMenuItem(G,P);L=a.byId("related");if((P=f.byId("relatedLinks"))&&
!L){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:G});f.place(L.domNode,P,"only");j.forceLayout(P)}}function D(L,P,S,C,F){var J=L.getServiceReferences("orion.page.link.related");if(!(J.length<=0)){var Q=f.byId("relatedLinks");if(Q){for(var T=x(),U=false,W=0;W<J.length;W++){for(var aa={},Z=J[W].getPropertyNames(),ca=0;ca<Z.length;ca++)aa[Z[ca]]=J[W].getProperty(Z[ca]);if(aa.id)if(f.indexOf(S,aa.id)<0){Z=C.findCommand(aa.id);if(!Z){var da=L.getServiceReferences("orion.navigate.command");
for(ca=0;ca<da.length;ca++)if(da[ca].getProperty("id")===aa.id){aa={};Z=da[ca].getPropertyNames();for(var fa=0;fa<Z.length;fa++)aa[Z[fa]]=da[ca].getProperty(Z[fa]);ca=g._createCommandOptions(aa,da[ca],L,true);Z=new c.Command(ca);break}}if(Z)if(!Z.visibleWhen||Z.visibleWhen(P)){U=true;ca=new c.CommandInvocation(C,P,P,null,Z);Z._addMenuItem(T,ca)}else typeof F==="function"&&window.setTimeout(f.hitch(Z,function(){f.when(F(),f.hitch(this,function(la){la&&P===M&&this.visibleWhen(la)&&B(this,new c.CommandInvocation(C,
la,la,null,this))}))}),0)}}(L=a.byId("related"))&&L.destroy();if(U){L=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:T});f.place(L.domNode,Q,"only")}j.forceLayout(Q)}}}function h(L,P,S){var C=f.byId("globalActions");if(C){f.empty(C);S=(S=f.isArray(S)?S[0]:S)||P||{};L.renderCommands(C,"global",S,P,"tool")}}function l(L){H=L}function n(L,P,S,C,F){M=L;D(P,L,H,S,C);N=F}function p(L,P,S,C,F,J,Q,T){function U(){var I=P.getService("orion.core.favorite");if(!I){I=new k.FavoritesService({serviceRegistry:P});
I=P.getService("orion.core.favorite")}if(N&&N.Location)I.hasFavorite(N.ChildrenLocation||N.Location).then(function(R){if(R)P.getService("orion.page.message").setMessage(N.Name+" is already a favorite.",2E3);else{I.makeFavorites([N]);P.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(R){if(R)P.getService("orion.page.message").setMessage(O+" is already a favorite.",
2E3);else{I.addFavoriteUrl(O);P.getService("orion.page.message").setMessage(O+" has been added to the favorites list.",2E3)}})}}var W,aa=f.byId(L);if(!aa)throw"could not find banner parent, id was "+L;f.place(b.topHTMLFragment,aa,"only");if(L=f.byId("pageToolbar")){f.place(b.toolbarHTMLFragment,L,"only");f.addClass(L,"toolComposite")}else{L=f.create("div",{id:"pageToolbar","class":"toolbar toolComposite layoutBlock"},"titleArea","after");f.place(b.toolbarHTMLFragment,L,"only")}S.setParameterCollector(new e.CommandParameterCollector);
f.place('<div id="keyAssist" style="display: none" class="keyAssistFloat" role="list" aria-atomic="true" aria-live="assertive"></div>',document.body,"last");if(L=f.byId("primaryNav")){C=P.getServiceReferences("orion.page.link");for(var Z=0;Z<C.length;Z++){W={};for(var ca=C[Z].getPropertyNames(),da=0;da<ca.length;da++)W[ca[da]]=C[Z].getProperty(ca[da]);if(W.href&&W.name){ca=f.create("a",{href:W.href},L,"last");W=document.createTextNode(W.name);f.place(W,ca,"only")}}}var fa=f.byId("search");if(!fa)throw"failed to generate HTML for banner";
f.connect(fa,"onkeypress",function(I){if(I.charOrCode===f.keys.ENTER)if(F){if(fa.value.length>0){I=F.createSearchQuery(fa.value);window.location=d.toUrl("search/search.html")+"#"+I}}else window.alert("Can't search: no search service is available")});if(L=f.byId("pageTitle")){W=document.createTextNode(document.title);f.place(W,L,"last")}if(L=f.byId("pageFavorite")){f.addClass(L,"commandButton");f.connect(L,"onclick",this,function(){U()});f.connect(L,"onkeypress",this,function(I){if(I.keyCode===f.keys.ENTER||
I.keyCode===f.keys.SPACE)U()});f.connect(L,"onmouseover",L,function(){f.addClass(this,"commandButtonOver")});f.connect(L,"onfocus",L,function(){f.addClass(this,"commandButtonOver")});f.connect(L,"onmouseout",L,function(){f.removeClass(this,"commandButtonOver")});f.connect(L,"onblur",L,function(){f.removeClass(this,"commandButtonOver")});new c.CommandTooltip({connectId:[L],label:"Add this page to the favorites list",position:["below","left","right","above"],commandParent:aa,commandService:S})}L=new c.Command({name:"Make Favorite",
tooltip:"Add to the favorites list",imageClass:"core-sprite-makeFavorite",id:"orion.makeFavorite",visibleWhen:function(I){I=f.isArray(I)?I:[I];for(var O=0;O<I.length;O++)if(!I[O].Location)return false;return true},callback:function(I){I=f.isArray(I.items)?I.items:[I.items];for(var O=P.getService("orion.core.favorite"),R=function($){return function(Y){Y?P.getService("orion.page.message").setMessage($.Name+" is already a favorite.",2E3):O.makeFavorites($)}},V=0;V<I.length;V++){var X=I[V];O.hasFavorite(X.ChildrenLocation||
X.Location).then(R(X))}}});S.addCommand(L,"dom");var la=function(I,O,R){var V=O.getService("orion.core.favorite");if(!V){V=new k.FavoritesService({serviceRegistry:O});V=O.getService("orion.core.favorite")}var X=new orion.widgets.OpenResourceDialog({searcher:I,searchRenderer:I.defaultRenderer,favoriteService:V});R&&f.connect(X,"onHide",function(){R.getTextView().focus()});window.setTimeout(function(){X.show()},0)};L=new c.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",
id:"eclipse.openResource",callback:function(){la(F,P,Q)}});if(Q){Q.getTextView().setKeyBinding(new i.KeyBinding("f",true,true,false),"Find File Named...");Q.getTextView().setAction("Find File Named...",function(){la(F,P,Q);return true})}S.addCommand(L,"global");S.registerCommandContribution("eclipse.openResource",100,"globalActions",null,true,new c.CommandKeyBinding("f",true,true));L=new c.Command({name:"Toggle banner and footer",tooltip:"Hide or show the page banner and footer",id:"orion.toggleTrim",
callback:function(){var I=a.byId(aa.parentNode.id);if(I){var O=f.byId("footer");if(aa.style.display==="none"){aa.style.display="block";O.style.display="block"}else{aa.style.display="none";O.style.display="none"}I.layout()}return true}});S.addCommand(L,"global");S.registerCommandContribution("orion.toggleTrim",100,"globalActions",null,true,new c.CommandKeyBinding("m",true,true));if(Q){Q.getTextView().setKeyBinding(new c.CommandKeyBinding("m",true,true),"Toggle Trim");Q.getTextView().setAction("Toggle Trim",
L.callback)}var K=f.byId("keyAssist");f.connect(document,"onkeypress",f.hitch(this,function(I){if(I.charOrCode===f.keys.ESCAPE)K.style.display="none"}));f.connect(document,"onclick",f.hitch(this,function(I){if((I=I.target||I.originalTarget||I.srcElement)&&I.id!=="keyAssist")K.style.display="none"}));Q&&Q.getTextView().addEventListener("MouseDown",function(){K.style.display="none"});T&&T.addHandler({isActive:function(){return K.style.display==="block"},cancel:function(){if(this.isActive()){K.style.display=
"none";return true}return false}});T=new c.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){if(K.style.display==="none"){f.empty(K);if(Q){f.place("<h2>Editor</h2>",K,"last");for(var I=Q.getTextView().getActions(false),O=0;O<I.length;O++)for(var R=I[O],V=Q.getTextView().getKeyBindings(R),X=0;X<V.length;X++)f.place('<span role="listitem">'+j.getUserKeyString(V[X])+" = "+R+"<br></span>",K,"last")}f.place("<h2>Global</h2>",
K,"last");S.showKeyBindings(K);K.style.display="block"}else K.style.display="none";return true}});S.addCommand(T,"global");S.registerCommandContribution("eclipse.keyAssist",100,"globalActions",null,true,new c.CommandKeyBinding(191,false,true));if(Q){L=window.navigator.platform.indexOf("Mac")!==-1;Q.getTextView().setKeyBinding(new c.CommandKeyBinding(191,false,true,!L,L),"Show Keys");Q.getTextView().setAction("Show Keys",T.callback)}z.setKeyAssist(T.callback);h(S,J,M);if(f.indexOf(H,"eclipse.openWith")<
0)(J=P.getService("orion.file.contenttypes"))&&J.getContentTypesMap().then(function(I){I=g._createOpenWithCommands(P,I);for(var O=0;O<I.length;O++){var R=I[O].properties,V=g._createCommandOptions(R,I[O].service,P,true);V=new c.Command(V);V.isEditor=R.isEditor;S.addCommand(V,"object");S.addCommandGroup("eclipse.openWith",1E3,"Open With");S.registerCommandContribution(V.id,O,null,"eclipse.openWith")}});v(P);if(b.bottomHTMLFragment)(J=f.byId("footer"))&&f.place(b.bottomHTMLFragment,J,"only");s(P);j.forceLayout(aa.parentNode);
f.subscribe("/dojo/hashchange",S,function(){S.processURL(window.location.href)})}var r=m(d.toUrl("auth/NotifyAuthentication.html")),y={},A=new orion.widgets.LoginDialog,z=new orion.widgets.UserMenu({loginDialog:A}),E=[],G,M,H=[],N=null;return{generateUserInfo:v,generateRelatedLinks:D,generateDomCommandsInBanner:q,generateBanner:p,notifyAuthenticationSite:r,setPendingAuthentication:u,getAuthenticationIds:w,setPageTarget:n,setPageCommandExclusions:l,authenticatedService:t}});
define("dojo/date",["dojo"],function(d){d.getObject("date",true,d);d.date.getDaysInMonth=function(f){var a=f.getMonth();if(a==1&&d.date.isLeapYear(f))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};d.date.isLeapYear=function(f){f=f.getFullYear();return!(f%400)||!(f%4)&&!!(f%100)};d.date.getTimezoneName=function(f){var a=f.toString(),b="",c=a.indexOf("(");if(c>-1)b=a.substring(++c,a.indexOf(")"));else{c=/([A-Z\/]+) \d{4}$/;if(a=a.match(c))b=a[1];else{a=f.toLocaleString();c=/ ([A-Z\/]+)$/;
if(a=a.match(c))b=a[1]}}return b=="AM"||b=="PM"?"":b};d.date.compare=function(f,a,b){f=new Date(+f);a=new Date(+(a||new Date));if(b=="date"){f.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(b=="time"){f.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(f>a)return 1;if(f<a)return-1;return 0};d.date.add=function(f,a,b){var c=new Date(+f),e=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=f.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";e=true;break;case "week":b*=7;break;case "quarter":b*=3;case "month":e=true;g="Month";break;default:g="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}g&&c["set"+g](c["get"+g]()+b);e&&c.getDate()<f.getDate()&&c.setDate(0);return c};d.date.difference=function(f,a,b){a=a||new Date;b=b||"day";var c=a.getFullYear()-f.getFullYear(),e=1;switch(b){case "quarter":f=f.getMonth();a=a.getMonth();f=Math.floor(f/3)+
1;a=Math.floor(a/3)+1;a+=c*4;e=a-f;break;case "weekday":c=Math.round(d.date.difference(f,a,"day"));b=parseInt(d.date.difference(f,a,"week"));e=c%7;if(e==0)c=b*5;else{var g=0,j=f.getDay();a=a.getDay();b=parseInt(c/7);e=c%7;f=new Date(f);f.setDate(f.getDate()+b*7);f=f.getDay();if(c>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 f+e>5:g=-2}else if(c<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 f+
e<0:g=2}c+=g;c-=b*2}e=c;break;case "year":e=c;break;case "month":e=a.getMonth()-f.getMonth()+c*12;break;case "week":e=parseInt(d.date.difference(f,a,"day")/7);break;case "day":e/=24;case "hour":e/=60;case "minute":e/=60;case "second":e/=1E3;case "millisecond":e*=a.getTime()-f.getTime()}return Math.round(e)};return d.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(d){d.getObject("cldr.supplemental",true,d);d.cldr.supplemental.getFirstDayOfWeek=function(f){f={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}[d.cldr.supplemental._region(f)];return f===undefined?
1:f};d.cldr.supplemental._region=function(f){f=d.i18n.normalizeLocale(f);f=f.split("-");var a=f[1];if(a){if(a.length==4)a=f[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"}[f[0]];return a};d.cldr.supplemental.getWeekend=function(f){var a=d.cldr.supplemental._region(f);f={"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(f===undefined)f=6;if(a===undefined)a=0;return{start:f,end:a}};return d.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(d){d.getObject("date.locale",true,d);(function(){function f(c,e,g,j){return j.replace(/([a-z])\1*/ig,function(i){var k,m,o=i.charAt(0);i=i.length;var w=["abbr","wide","narrow"];switch(o){case "G":k=e[i<4?"eraAbbr":"eraNames"][c.getFullYear()<0?0:1];break;case "y":k=c.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((c.getMonth()+1)/3);m=true;break;case "M":k=c.getMonth();if(i<3){k=k+1;m=true}else{o=["months-format",w[i-3]].join("-");k=e[o][k]}break;case "w":k=d.date.locale._getWeekOfYear(c,0);m=true;break;case "d":k=c.getDate();m=true;break;case "D":k=d.date.locale._getDayOfYear(c);m=true;break;case "E":k=c.getDay();if(i<3){k=k+1;m=true}else{o=["days-format",w[i-3]].join("-");k=e[o][k]}break;case "a":k=c.getHours()<12?"am":"pm";k=g[k]||e["dayPeriods-format-wide-"+
k];break;case "h":case "H":case "K":case "k":m=c.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=c.getMinutes();m=true;break;case "s":k=c.getSeconds();m=true;break;case "S":k=Math.round(c.getMilliseconds()*Math.pow(10,i-3));m=true;break;case "v":case "z":if(k=d.date.locale._getZone(c,true,g))break;i=4;case "Z":k=d.date.locale._getZone(c,false,g);k=[k<=0?"+":"-",d.string.pad(Math.floor(Math.abs(k)/60),2),d.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=d.string.pad(k,i);return k})}function a(c,e,g,j){var i=function(o){return o};e=e||i;g=g||i;j=j||i;var k=c.match(/(''|[^'])+/g),m=c.charAt(0)=="'";d.forEach(k,function(o,w){if(o){k[w]=(m?g:e)(o.replace(/''/g,"'"));m=!m}else k[w]=""});return j(k.join(""))}function b(c,e,g,j){j=d.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="",w="";if(g.strict){if(m>1)o="0{"+(m-1)+"}";if(m>2)w="0{"+(m-2)+"}"}else{o="0?";w="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]|"+w+"[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||e["dayPeriods-format-wide-am"];o=g.pm||e["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=".*"}c&&c.push(i);return"("+k+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}d.date.locale._getZone=
function(c,e){return e?d.date.getTimezoneName(c):c.getTimezoneOffset()};d.date.locale.format=function(c,e){e=e||{};var g=d.i18n.normalizeLocale(e.locale),j=e.formatLength||"short";g=d.date.locale._getGregorianBundle(g);var i=[];c=d.hitch(this,f,c,g,e);if(e.selector=="year")return a(g["dateFormatItem-yyyy"]||"yyyy",c);var k;if(e.selector!="date")(k=e.timePattern||g["timeFormat-"+j])&&i.push(a(k,c));if(e.selector!="time")(k=e.datePattern||g["dateFormat-"+j])&&i.push(a(k,c));return i.length==1?i[0]:
g["dateTimeFormat-"+j].replace(/\{(\d+)\}/g,function(m,o){return i[o]})};d.date.locale.regexp=function(c){return d.date.locale._parseInfo(c).regexp};d.date.locale._parseInfo=function(c){c=c||{};var e=d.i18n.normalizeLocale(c.locale);e=d.date.locale._getGregorianBundle(e);var g=c.formatLength||"short",j=c.datePattern||e["dateFormat-"+g],i=c.timePattern||e["timeFormat-"+g];g=c.selector=="date"?j:c.selector=="time"?i:e["dateTimeFormat-"+g].replace(/\{(\d+)\}/g,function(m,o){return[i,j][o]});var k=[];
return{regexp:a(g,d.hitch(this,b,k,e,c)),tokens:k,bundle:e}};d.date.locale.parse=function(c,e){var g=/[\u200E\u200F\u202A\u202E]/g,j=d.date.locale._parseInfo(e),i=j.tokens,k=j.bundle;c=(new RegExp("^"+j.regexp.replace(g,"")+"$",j.strict?"":"i")).exec(c&&c.replace(g,""));if(!c)return null;var m=["abbr","wide","narrow"],o=[1970,0,1,0,0,0,0],w="";c=d.every(c,function(v,u){if(!u)return true;u=i[u-1];var t=u.length;switch(u.charAt(0)){case "y":if(t!=2&&e.strict)o[0]=v;else if(v<100){v=Number(v);t=""+(new Date).getFullYear();
u=t.substring(0,2)*100;t=Math.min(Number(t.substring(2,4))+20,99);o[0]=v<t?u+v:u-100+v}else{if(e.strict)return false;o[0]=v}break;case "M":if(t>2){u=k["months-format-"+m[t-3]].concat();if(!e.strict){v=v.replace(".","").toLowerCase();u=d.map(u,function(x){return x.replace(".","").toLowerCase()})}v=d.indexOf(u,v);if(v==-1)return false}else v--;o[1]=v;break;case "E":case "e":u=k["days-format-"+m[t-3]].concat();if(!e.strict){v=v.toLowerCase();u=d.map(u,function(x){return x.toLowerCase()})}v=d.indexOf(u,
v);if(v==-1)return false;break;case "D":o[1]=0;case "d":o[2]=v;break;case "a":u=e.am||k["dayPeriods-format-wide-am"];t=e.pm||k["dayPeriods-format-wide-pm"];if(!e.strict){var q=/\./g;v=v.replace(q,"").toLowerCase();u=u.replace(q,"").toLowerCase();t=t.replace(q,"").toLowerCase()}if(e.strict&&v!=u&&v!=t)return false;w=v==t?"p":v==u?"a":"";break;case "K":if(v==24)v=0;case "h":case "H":case "k":if(v>23)return false;o[3]=v;break;case "m":o[4]=v;break;case "s":o[5]=v;break;case "S":o[6]=v}return true});
g=+o[3];if(w==="p"&&g<12)o[3]=g+12;else if(w==="a"&&g==12)o[3]=0;g=new Date(o[0],o[1],o[2],o[3],o[4],o[5],o[6]);e.strict&&g.setFullYear(o[0]);var s=i.join("");j=s.indexOf("d")!=-1;s=s.indexOf("M")!=-1;if(!c||s&&g.getMonth()>o[1]||j&&g.getDate()>o[2])return null;if(s&&g.getMonth()<o[1]||j&&g.getDate()<o[2])g=d.date.add(g,"hour",1);return g}})();(function(){var f=[];d.date.locale.addCustomFormats=function(a,b){f.push({pkg:a,name:b})};d.date.locale._getGregorianBundle=function(a){var b={};d.forEach(f,
function(c){c=d.i18n.getLocalization(c.pkg,c.name,a);b=d.mixin(b,c)},this);return b}})();d.date.locale.addCustomFormats("dojo.cldr","gregorian");d.date.locale.getNames=function(f,a,b,c){var e;c=d.date.locale._getGregorianBundle(c);f=[f,b,a];if(b=="standAlone"){b=f.join("-");e=c[b];if(e[0]==1)e=undefined}f[1]="format";return(e||c[f.join("-")]).concat()};d.date.locale.isWeekend=function(f,a){a=d.cldr.supplemental.getWeekend(a);f=(f||new Date).getDay();if(a.end<a.start){a.end+=7;if(f<a.start)f+=7}return f>=
a.start&&f<=a.end};d.date.locale._getDayOfYear=function(f){return d.date.difference(new Date(f.getFullYear(),0,1,f.getHours()),f)+1};d.date.locale._getWeekOfYear=function(f,a){if(arguments.length==1)a=0;var b=(new Date(f.getFullYear(),0,1)).getDay(),c=(b-a+7)%7;c=Math.floor((d.date.locale._getDayOfYear(f)+c-1)/7);b==a&&c++;return c};return d.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(d,f,a){function b(g,j){if(g.status===403){if(typeof c==="undefined")c=new f.Dialog({title:"Forbidden access"});var i=g.message;if(g.responseText)i=JSON.parse(g.responseText).Message||g.message;c.set("content",i);c.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 v=localStorage.getItem(k.SignInKey);
if(m!==v){window.removeEventListener("storage",o,false);delete e[k.SignInKey];a.setPendingAuthentication(e);a.authenticatedService(k.SignInKey);j&&j()}};window.addEventListener("storage",o,false);if(k.SignInKey){e[k.SignInKey]=k;a.setPendingAuthentication(e)}}catch(w){}else try{return JSON.parse(g.responseText)}catch(s){return{Message:g.Message,HttpCode:g.status}}}var c,e={};d.addOnLoad(function(){window.dojo=d;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:b}});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(d,f,a){function b(k,m){this._name=k;this._providers=m;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function c(k,m){return{get:function(o,w){if(m===0)return null;o=localStorage.getItem(k+o);if(o===null)return null;o=JSON.parse(o);if(w||m===-1||o._expires&&o._expires>(new Date).getTime()){delete o._expires;return o}return null},set:function(o,w){if(m!==0){if(m!==-1)w._expires=(new Date).getTime()+
1E3*m;if(Object.keys(w).length===0)localStorage.removeItem(k+o);else{var s=JSON.stringify(w);localStorage.setItem(k+o,s);delete w._expires}}},remove:function(o){localStorage.removeItem(k+o)}}}function e(k){this._currentPromises={};this._cache=new c("/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 c("/orion/preferences/default",3600)}function j(){this._cache=new c("/orion/preferences/local",-1)}function i(k,m){this._userProvider=new e(k);this._localProvider=new j;m=m||"defaults.pref";if(m.indexOf("://")===-1)m=d.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 f.DeferredList(k)},_scheduleFlush:function(k){this._dirty.indexOf(k)===-1&&this._dirty.push(k);if(!this._flushPending){this._flushPending=true;window.setTimeout(f.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=[],w=0;w<this._providers.length;++w)o.push(this._providers[w].get(this._name,k).then(function(s){return function(v){m._stores[s]=v}}(w)));return(new f.DeferredList(o)).then(function(){m._cached=null;m._getCached()})},flush:function(){this._flush()}};e.prototype={get:function(k,m){if(this._currentPromises[k])return this._currentPromises[k];
var o=new f.Deferred,w=null;if(m)this._cache.remove(k);else w=this._cache.get(k);if(w!==null)o.resolve(w);else{this._currentPromises[k]=o;var s=this;this._service.get(k).then(function(v){s._cache.set(k,v);delete s._currentPromises[k];o.resolve(v)},function(v){if(v.status===401){delete s._currentPromises[k];o.resolve({});a.handleAuthenticationError(v,function(){s.get(k)})}else if(v.status===404){v={};s._cache.set(k,v);delete s._currentPromises[k];o.resolve(v)}else{delete s._currentPromises[k];o.resolve(s._cache.get(k,
true)||{})}})}return o},put:function(k,m){var o=new f.Deferred;this._cache.set(k,m);var w=this;this._service.put(k,m).then(function(){o.resolve()},function(s){s.status===401?a.handleAuthenticationError(s,function(){w._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 f.Deferred,w=null;if(m)this._cache.remove(k);else w=this._cache.get(k);if(w!==null)o.resolve(w);
else{this._currentPromise=o;var s=this;f.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(v){s._cache.set(k,v[k]||{});s._currentPromise=null;o.resolve(v[k]||{})},error:function(v,u){if(u.xhr.status===401){s._currentPromise=null;o.resolve({});o=new f.Deferred;s._currentPromise=o;var t=this;a.handleAuthenticationError(u.xhr,function(){f.xhrGet(t)})}else if(u.xhr.status===404){s._cache.set(k,{});s._currentPromise=null;o.resolve({})}else{s._currentPromise=
null;v=s._cache.get(k,true);v!==null?o.resolve(v[k]||{}):o.resolve({})}}})}return o},put:function(){var k=new f.Deferred;k.resolve();return k}};j.prototype={get:function(k){var m=new f.Deferred;k=this._cache.get(k);k!==null?m.resolve(k):m.resolve({});return m},put:function(k,m){var o=new f.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 w=new b(k,o);return w.sync().then(function(){return w})}};return{PreferencesService:i}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(d,f){var a=a||{};a.Plugin=function(b,c,e){function g(x,B,D,h){if(!o)throw new Error("plugin not connected");var l=u++;t[String(l)]=h;e.postMessage({id:l,serviceId:x,method:B,params:D},o)}function j(x){var B={};if(x.methods)for(var D=0;D<x.methods.length;D++){var h=x.methods[D];B[h]=function(l){return function(){var n=Array.prototype.slice.call(arguments),p=new d.Deferred;m._load().then(function(){g(x.serviceId,
l,n,p)});return p.promise}}(h)}return B}function i(){var x=c.services;if(x)for(var B=0;B<x.length;B++){var D=x[B],h=j(D);q[D.serviceId]=e.registerService(D.type,h,D.properties)}}function k(x){try{if(x.method)if("plugin"===x.method){if(c){if(JSON.stringify(c)!==JSON.stringify(x.params[0])){for(var B in q)if(q.hasOwnProperty(B)){q[B].unregister();delete q[B]}c=x.params[0];i();e.updatePlugin(m)}}else{c=x.params[0];i()}if(!v){v=true;w.resolve(m)}if(s){s.resolve(m);s=null}}else if("dispatchEvent"===x.method){var D=
q[x.serviceId];D.dispatchEvent.apply(D,x.params)}else if("progress"===x.method){var h=t[String(x.requestId)];h.progress.apply(h,x.params)}else throw new Error("Bad response method: "+x.method);else{h=t[String(x.id)];delete t[String(x.id)];x.error?h.reject(x.error):h.resolve(x.result)}}catch(l){console.log(l)}}var m=this,o=null,w=new d.Deferred,s=null,v=false,u=0,t={},q={};this.getLocation=function(){return b};this.getData=function(){return c};this.uninstall=function(){for(var x in q)if(q.hasOwnProperty(x)){q[x].unregister();
delete q[x]}if(o){e.disconnect(o);o=null}e.uninstallPlugin(this)};this.getServiceReferences=function(){var x=[],B;for(B in q)q.hasOwnProperty(B)&&x.push(q[B].getServiceReference());return x};this.update=function(){if(!v)return this._load();var x;if(s===null){x=s=new d.Deferred;e.disconnect(o);o=e.connect(b,k);setTimeout(function(){s===x&&s.reject(new Error("Load timeout for plugin: "+b))},15E3)}return s};this._load=function(x){if(!o){o=e.connect(b,k);setTimeout(function(){if(!v){if(!x){c={};e.updatePlugin(m)}w.reject(new Error("Load timeout for plugin: "+
b))}},15E3)}return w.promise};if(typeof b!=="string")throw new Error("invalid url:"+b);c&&i()};a.PluginRegistry=function(b,c,e){function g(u){if(u.indexOf("://")===-1){var t=document.createElement("a");t.href=u;return t.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 t=0,q=o.length;t<q;t++){var x=o[t];if(u===x.getLocation())return x}return null}
var m=c||localStorage||{},o=[],w=[],s=new f.EventTarget;addEventListener("message",function(u){for(var t=0,q=u.source;t<w.length;t++)if(q===w[t].target){if(typeof w[t].useStructuredClone==="undefined")w[t].useStructuredClone=typeof u.data!=="string";w[t].handler(w[t].useStructuredClone?u.data:JSON.parse(u.data));break}},false);var v={registerService:d.hitch(b,b.registerService),connect:function(u,t){var q=document.createElement("iframe");q.id=u;q.name=u;if(!e){q.style.display="none";q.style.visibility=
"hidden"}q.src=u;document.body.appendChild(q);u={iframe:q,target:q.contentWindow,handler:t,url:u};w.push(u);return u},disconnect:function(u){for(var t=0;t<w.length;t++)if(u===w[t]){w.splice(t,1);try{document.body.removeChild(u.iframe)}catch(q){}break}},uninstallPlugin:function(u){j(u);for(var t=0;t<o.length;t++)if(u===o[t]){o.splice(t,1);s.dispatchEvent("pluginRemoved",u);break}},updatePlugin:function(u){i(u);s.dispatchEvent("pluginUpdated",u)},postMessage:function(u,t){t.target.postMessage(t.useStructuredClone?
u:JSON.stringify(u),t.url)}};this.startup=function(u){for(var t=[],q=0;q<u.length;++q){var x=u[q];x=g(x);var B="plugin."+x,D=m[B]?JSON.parse(m[B]):null;if(D&&D._expires&&D._expires>(new Date).getTime()){if(k(x)===null){delete D._expires;o.push(new a.Plugin(x,D,v))}}else{m[B]="{}";x=new a.Plugin(x,{},v);o.push(x);t.push(x._load(false))}}return new d.DeferredList(t)};this.shutdown=function(){for(var u=0;u<w.length;u++)try{document.body.removeChild(w[u].iframe)}catch(t){}};this.installPlugin=function(u,
t){u=g(u);var q=new d.Deferred,x=k(u);if(x)if(x.getData())q.resolve(x);else{var B=function(D){if(D.getLocation()===u){q.resolve(D);s.removeEventListener("pluginAdded",B)}};s.addEventListener("pluginAdded",B)}else{x=new a.Plugin(u,t,v);o.push(x);if(x.getData()){i(x);s.dispatchEvent("pluginAdded",x);q.resolve(x)}else x._load(true).then(function(){i(x);s.dispatchEvent("pluginAdded",x);q.resolve(x)},function(D){q.reject(D)})}return q.promise};this.getPlugins=function(){for(var u=[],t=0;t<o.length;t++)o[t].getData()&&
u.push(o[t]);return u};this.getPlugin=function(u){if((u=k(u))&&u.getData())return u;return null};this.addEventListener=function(u,t){s.addEventListener(u,t)};this.removeEventListener=function(u,t){s.removeEventListener(u,t)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(d,f,a,b,c){function e(){var g=new a.ServiceRegistry,j=new b.PreferencesService(g),i=new c.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]=d.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]=d.toUrl(k[m]);return i.startup(k)})}).then(function(){f.addOnWindowUnload(function(){i.shutdown()})}).then(function(){return{serviceRegistry:g,preferences:j,pluginRegistry:i}})}return{startup:e}});
define("orion/status",["require","dojo","orion/util"],function(d,f,a){function b(c,e,g,j,i){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.message",this);this._operationsClient=e;this.notificationContainerDomId=i;this.domId=g;this.progressDomId=j||g;this._hookedClose=false}b.prototype={_init:function(){var c=f.byId("closeNotifications");if(c&&!this._hookedClose){f.connect(c,"onclick",this,function(){this.setProgressMessage("");f.removeClass(this.notificationContainerDomId,
"slideContainerActive")});f.connect(c,"onkeypress",this,function(e){if(e.keyCode===f.keys.ENTER||e.keyCode===f.keys.SPACE){this.setProgressMessage("");f.removeClass(this.notificationContainerDomId,"slideContainerActive")}})}},setMessage:function(c,e){this._init();f.place(window.document.createTextNode(c),this.domId,"only");if(typeof e==="number"){var g=this;window.setTimeout(function(){var j=f.byId(g.domId);(typeof j.textContent==="string"?j.textContent:j.innerText)===c&&f.place(window.document.createTextNode(""),
g.domId,"only")},e)}},setErrorMessage:function(c){this._init();var e=c.responseText||c.message||c;try{e=JSON.parse(e)}catch(g){}c=e.Message||e;var j="red";if(e.Severity)switch(e.Severity){case "Warning":j="#FFCC00";break;case "Error":j="red";break;case "Info":case "Ok":j="green";break}e=f.create("span",{style:{color:j}});f.place(window.document.createTextNode(c),e);f.place(e,this.domId,"only")},setProgressMessage:function(c){this._init();var e=f.create("span",{"class":"imageSprite core-sprite-progress"});
f.place(e,this.progressDomId,"only");f.place(window.document.createTextNode(c),this.progressDomId,"last");f.addClass(this.notificationContainerDomId,"progressNormal");c.length>0?f.addClass(this.notificationContainerDomId,"slideContainerActive"):f.removeClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},setProgressResult:function(c){c=c.responseText||c;try{c=JSON.parse(c)}catch(e){}this._init();var g=c.Message||c,j="imageSprite core-sprite-info",
i="progressInfo",k="progressWarning progressError progressNormal";if(c.Severity)switch(c.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=f.create("span",{"class":j});f.place(j,this.progressDomId,"only");if(c.HTML)f.place(g,this.progressDomId,"last");else{f.place(window.document.createTextNode("   "+
g),this.progressDomId,"last");if(i&&this.progressDomId!==this.domId){f.addClass(this.notificationContainerDomId,i);f.removeClass(this.notificationContainerDomId,k)}}f.addClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},showWhile:function(c,e){var g=this;g.setProgressMessage(e);return c.then(function(j){if(j&&j.Location&&j.Message&&j.Running)return f.hitch(g,g._doProgressWhile)(j);g.setProgressMessage("");j&&j.Result&&g.setProgressResult(j.Result);
return j})},_doProgressWhile:function(c){var e=new f.Deferred,g=this;window.setTimeout(function(){g._operationsClient.getOperation(c.Location).then(function(j){e.callback(j)})},2E3);return this.showWhile(e,c.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(d,f,a){f.declare("orion.widgets.OperationsDialog",[a.TooltipDialog],{widgetsInTemplate:true,closable:true,templateString:f.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=d.toUrl("operations/list.html");this._setOperationsVisibility()},setOperations:function(b,c){this._operations=[];c=c||{};this._myOperations=[];if(b.Children)for(var e=0;e<b.Children.length;e++)c[b.Children[e].Id]?this._myOperations.push(b.Children[e]):this._operations.push(b.Children[e]);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(c){}var e={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==e.Message)e.DetailedMessage=b.DetailedMessage;return e},_renderOperations:function(){this._renderOperationsTable(this.myOperationsList,this._myOperations);this._renderOperationsTable(this.operationsList,this._operations)},_renderOperationsTable:function(b,c){f.empty(b);for(var e=0;e<c.length;e++){var g=c[e],j=f.create("tr"),
i=f.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:g.Name},j);i=f.create("div",null,i,"only");link=f.create("span",{innerHTML:g.Name,className:"primaryColumn"},i,"last");f.place(document.createTextNode(g.Name),link,"only");var k=f.create("span",null,i,"first");f.addClass(k,"imageSprite");var m=this.parseProgressResult(g.Result);switch(m.Severity){case "Warning":f.addClass(k,"core-sprite-warning");break;case "Error":f.addClass(k,"core-sprite-error");break;default:if(g.Running===
true)f.addClass(k,"core-sprite-start");else if(g.Canceled===true)f.addClass(k,"core-sprite-stop");else g.Failed===true?f.addClass(k,"core-sprite-error"):f.addClass(k,"core-sprite-ok")}if(m.Message||g.Message){g=m.Message||g.Message;if(m.DetailedMessage&&m.DetailedMessage!=="")g+=": "+m.DetailedMessage;f.create("br",null,i,"last");f.create("span",{className:"secondaryColumn",style:"margin-left: 18px;",innerHTML:g},i,"last")}f.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(d,f,a){function b(c,e){this._serviceRegistry=c;this._serviceRegistration=c.registerService("orion.page.progress",this);this._operationsClient=e;this._initDone=false;this._topicListeners={};this._myOperations={};this._lastIconClass=this._lastOperation=null}b.prototype={init:function(c){if(!this._progressPane){this._progressPane=f.byId(c);this._operationsDialog=new orion.widgets.OperationsDialog;
f.connect(this._progressPane,"onclick",f.hitch(this,this._openOperationsPopup));var e=this;if(new Date-this.getLastListUpdate()>3E5)this._operationsClient.getRunningOperations().then(function(g){f.hitch(e,e._loadOperationsList)(g);window.setTimeout(function(){f.hitch(e,e._checkOperationsChanges())},5E3)},function(g){console.error(g)});else{f.hitch(e,e._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')));window.setTimeout(function(){f.hitch(e,e._checkOperationsChanges())},
5E3)}window.addEventListener("storage",function(g){a.getAuthenticationIds().indexOf(g.key)>=0&&e._operationsClient.getRunningOperations().then(function(j){f.hitch(e,e._loadOperationsList)(j)},function(j){console.error(j)})},false);window.addEventListener("storage",function(g){if(g.key==="orionOperations")f.hitch(e,e._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')))})}},_loadOperationsList:function(c){c.lastClientDate=new Date;if(c.lastClientDate-this.getLastListUpdate()>
3E5){localStorage.setItem("orionOperations",JSON.stringify(c));this._generateOperationsInfo(c)}},getLastListUpdate:function(){var c=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}');return c.lastClientDate?new Date(c.lastClientDate):new Date(0)},_markOperationAsFailed:function(c,e,g){c.Message="Operation status is unknown";c.Running=false;c.Failed=true;c.Result={HttpCode:g?g.xhr.staus:500,Severity:e,Message:e.Message?e.Message:e};this.writeOperation(c)},_checkOperationsChanges:function(){for(var c=
this,e=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=[],j=[],i=0;i<e.Children.length;i++){var k=e.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);f.hitch(this,function(o){m.then(function(w){w.lastClientDate=new Date;f.hitch(c,c.writeOperation)(w)},function(w,s){if(w.status==404){g.push(o);return w}f.hitch(c,c._markOperationAsFailed(e.Children[o],w,s))})})(i)}if(!k.Running&&
new Date-new Date(k.lastClientDate?k.lastClientDate:0)>3E5)g.push(i)}(new f.DeferredList(j)).addBoth(function(){if(g.length>0){e.lastClientDate=new Date;for(var o=g.length-1;o>=0;o--)e.Children.splice(g[o],1);localStorage.setItem("orionOperations",JSON.stringify(e));f.hitch(c,c._generateOperationsInfo)(e)}window.setTimeout(function(){f.hitch(c,c._checkOperationsChanges())},5E3)})},_openOperationsPopup:function(){try{dijit.popup.open({popup:this._operationsDialog,around:this._progressPane})}catch(c){}dijit.focus(this._operationsDialog.domNode)},
_switchIconTo:function(c){this._lastIconClass&&f.removeClass(this._progressPane,this._lastIconClass);this._lastIconClass=c;f.addClass(this._progressPane,this._lastIconClass)},_generateOperationsInfo:function(c){this._operationsDialog.setOperations(c,this._myOperations);if(!c.Children||c.Children.length==0){this._switchIconTo("progressPane_empty");this._progressPane.title="Operations"}else{for(var e="",g=0;g<c.Children.length;g++){var j=c.Children[g];if(this._myOperations[j.Id])if(j.Running==true){e=
"running";break}}if(e===""&&this._lastOperation!=null)if(this._lastOperation.Result)switch(this._operationsDialog.parseProgressResult(this._lastOperation.Result).Severity){case "Warning":if(e!=="error")e="warning";break;case "Error":e="error"}switch(e){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(c,e,g){if(c.Id)this._myOperations[c.Id]=true;var j=e?e:new f.Deferred;this.writeOperation(c);var i=this;if(c&&c.Location&&c.Running==true)window.setTimeout(function(){i._operationsClient.getOperation(c.Location).then(function(k){f.hitch(i,i.followOperation(k,j,c.Location))},function(k,m){f.hitch(i,
i.setProgressResult)({Severity:"Error",Message:k});f.hitch(i,i._markOperationAsFailed(c,k,m));j.errback(k,m)})},2E3);else if(c&&c.Result){i._serviceRegistry.getService("orion.page.message").setProgressMessage("");e=this._operationsDialog.parseProgressResult(c.Result).Severity;if(e=="Error"||e=="Warning"){c.Result.failedOperation={Location:g,Id:c.Id,Name:c.Name};j.callback(c);setTimeout(function(){i._myOperations[c.Id]&&f.hitch(i,i._openOperationsPopup)()},10)}else j.callback(c);!c.Failed&&c.Idempotent==
true&&window.setTimeout(function(){f.hitch(i,i.removeOperation)(g,c.Id)},5E3)}return j},removeOperation:function(c,e){that=this;if(e){if(this._lastOperation!=null&&this._lastOperation.Id===e)this._lastOperation=null;delete this._myOperations[e]}f.hitch(that._operationsClient,that._operationsClient.removeOperation)(c).then(function(){f.hitch(that,that.removeOperationFromTheList)(e)})},removeOperationFromTheList:function(c){if(this._lastOperation!=null&&this._lastOperation.Id===c)this._lastOperation=
null;delete this._myOperations[c];for(var e=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<e.Children.length;g++){var j=e.Children[g];if(j.Id&&j.Id===c){e.Children.splice(g,1);break}}localStorage.setItem("orionOperations",JSON.stringify(e));this._generateOperationsInfo(e)},removeCompletedOperations:function(){for(var c=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),e=c.Children.length-1;e>=0;e--)c.Children[e].Running||c.Children.splice(e,1);
localStorage.setItem("orionOperations",JSON.stringify(c));this._generateOperationsInfo(c)},setProgressResult:function(c){this._serviceRegistry.getService("orion.page.message").setProgressResult(c)},showWhile:function(c,e){e&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(e);var g=this;return c.then(function(j){if(j&&j.Location&&j.Message&&j.Running)return f.hitch(g,g.followOperation)(j,null,j.Location);g._serviceRegistry.getService("orion.page.message").setProgressMessage("");
return j},function(j){f.hitch(g,g.setProgressResult)(j);return j})},followTopic:function(c,e){this._topicListeners[c]||(this._topicListeners[c]=[]);this._topicListeners[c].push(e)},writeOperation:function(c){this._lastOperation=c=JSON.parse(JSON.stringify(c));for(var e=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=0;g<e.Children.length;g++){var j=e.Children[g];if(j.Id&&j.Id===c.Id){e.Children.splice(g,1);break}}!c.Running&&!c.Failed&&delete c.Result;c.lastClientDate=new Date;
e.Children.push(c);e.lastClientDate=new Date;localStorage.setItem("orionOperations",JSON.stringify(e));this._generateOperationsInfo(e)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/operationsClient",["dojo","orion/auth","dojo/DeferredList"],function(d,f){function a(m,o,w){var s=new d.Deferred;m[o].apply(m,w).then(function(v){s.callback(v)},function(v){v.status===401?f.handleAuthenticationError(v,function(){m[o].apply(m,w).then(function(u){s.callback(u)},function(u){s.errback(u)})}):s.errback(v)});return s}function b(m,o){return a(m,"getOperations",[o])}function c(m){this._location=m}function e(){var m=new d.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"),w=0;w<o.length;w++){var s=m.getService(o[w]);this._services[w]=s;s=o[w].getProperty("pattern")||".*";if(s[0]!=="^")s="^"+s;this._patterns[w]=new RegExp(s)}this._getService=function(v){if(!v)return this._services[0];for(var u=0;u<this._patterns.length;++u)if(this._patterns[u].test(v))return this._services[u];return new c(v)}}
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:[]},w=0;w<m.length;w++)if(m[w][0]){if(m[w][1]&&m[w][1].Children)o.Children=o.Children.concat(m[w][1].Children)}else console.error(m[w][1]);return o}function i(m,o,w){var s=this,v={Longpolling:true};if(w)v.LongpollingId=w;a(m,"getOperations",[v]).then(function(u){if(!(w&&s._currentLongpollingIds.indexOf(w)<0)){o(u,w);if(u.LongpollingId){s._currentLongpollingIds.push(u.LongpollingId);
d.hitch(s,i)(m,o,u.LongpollingId)}else d.hitch(s,i)(m,o,w)}},function(u){w&&s._currentLongpollingIds.indexOf(w)<0||("timeout"===u.dojoType?d.hitch(s,i)(m,o,w):setTimeout(function(){d.hitch(s,i)(m,o,w)},2E3))})}function k(m){for(var o=0;o<this._operationListeners.length;o++)this._operationListeners[o](m)}c.prototype={getOperation:e,getOperations:e,removeCompletedOperations:e,removeOperation:e,cancelOperation:e};c.prototype.constructor=c;g.prototype={getOperations:function(){var m=new d.Deferred,o=
[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var w=0;w<this._services.length;w++)o[w]=b(this._services[w]);(new d.DeferredList(o)).then(function(s){m.resolve(j(s))});return m},getRunningOperations:function(){var m=new d.Deferred,o=[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var w=0;w<this._services.length;w++)o[w]=b(this._services[w],{RunningOnly:true});(new d.DeferredList(o)).then(function(s){m.resolve(j(s))});
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 d.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++)d.hitch(this,i)(this._services[m],d.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++)d.hitch(this,i)(this._services[m],d.hitch(this,k))}};g.prototype.constructor=g;return{OperationsClient:g}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(d,f){function a(e,g,j){if(!e[g])throw g+" is not supportted in this file system";var i=new d.Deferred;e[g].apply(e,j).then(function(k){i.callback(k)},function(k){k.status===401?f.handleAuthenticationError(k,function(){e[g].apply(e,j).then(function(m){i.callback(m)},function(m){i.errback(m)})}):i.errback(k)});return i}function b(e,g,j,i){if(!e.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(e,"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(e,"fetchChildren",[g]).then(function(o){for(var w=[],s=0;s<o.length;++s){var v=o[s].Location,u=v;if(o[s].Directory)u=v.substring(0,v.length-1);u=decodeURIComponent(u.substring(u.lastIndexOf("/")+
1));u=i+encodeURIComponent(u);if(o[s].Directory)u+="/";w[s]=b(e,v,j,u)}return new d.DeferredList(w)})})}function c(e,g){function j(t){var q=new d.Deferred;q.reject("No Matching FileService for location:"+t);return q}var i=e.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=[],w=[],s=[],v=[],u={fetchChildren:function(){var t=new d.Deferred;t.resolve(v);return t},createWorkspace:function(){var t=new d.Deferred;t.reject("no file service");return t},
loadWorkspaces:function(){var t=new d.Deferred;t.reject("no file service");return t},loadWorkspace:function(){var t=new d.Deferred;window.setTimeout(function(){t.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"File Servers",Location:"/",Children:v,ChildrenLocation:"/"})},100);return t},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){v[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);w[g]=e.getService(k[g]);s[g]=k[g].getProperty("Name")}this._getServiceIndex=function(t){if(t==="/")return-1;else if(!t||t.length&&t.length===0)return 0;for(var q=0;q<o.length;++q)if(o[q].test(t))return q;throw"No Matching FileService for location:"+t;};this._getService=function(t){t=this._getServiceIndex(t);return t===-1?u:w[t]};this._getServiceName=
function(t){t=this._getServiceIndex(t);return t===-1?u.Name:s[t]}}c.prototype={fileServiceName:function(e){return this._getServiceName(e)},fetchChildren:function(e){return a(this._getService(e),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(e){return a(this._getService(e),"loadWorkspace",arguments)},createProject:function(e){return a(this._getService(e),
"createProject",arguments)},createFolder:function(e){return a(this._getService(e),"createFolder",arguments)},createFile:function(e){return a(this._getService(e),"createFile",arguments)},deleteFile:function(e){return a(this._getService(e),"deleteFile",arguments)},moveFile:function(e,g,j){var i=this._getService(e),k=this._getService(g);if(i===k)return a(i,"moveFile",arguments);var m=e[e.length-1]==="/",o=g;if(o[o.length-1]!=="/")o+="/";if(j)o+=encodeURIComponent(j);else{var w=e;if(m)w=w.substring(0,
w.length-1);o+=w.substring(w.lastIndexOf("/")+1)}if(m&&o[o.length-1]!=="/")o+="/";return b(i,e,k,o).then(function(){return a(i,"deleteFile",[e])})},copyFile:function(e,g){var j=this._getService(e),i=this._getService(g);if(j===i)return a(j,"copyFile",arguments);var k=e[e.length-1]==="/",m=g;if(m[m.length-1]!=="/")m+="/";var o=e;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,e,i,m)},read:function(e){return a(this._getService(e),"read",
arguments)},write:function(e){return a(this._getService(e),"write",arguments)},remoteImport:function(e){return a(this._getService(e),"remoteImport",arguments)},remoteExport:function(e){return a(this._getService(e),"remoteExport",arguments)},search:function(e){return a(this._getService(e),"search",arguments)}};c.prototype.constructor=c;return{FileClient:c}});
define("orion/searchUtils",["require","dojo","orion/editor/regex"],function(d,f,a){var b=b||{};b.searchUtils=b.searchUtils||{};b.searchUtils.parseQueryStr=function(c){var e=c.indexOf("?"),g=c.indexOf("q=");if(e<g&&g>0)c=c.substring(e+1);e=c.split("&");c={queryStr:c,start:0,rows:10,sort:"Path asc",replace:null};for(g=0;g<e.length;g++){var j=e[g].indexOf("q="),i=e[g].indexOf("replace=");if(j>=0)b.searchUtils.parseLocationAndSearchStr(e[g].substring(j+2),c);else if(i>=0)c.replace=e[g].substring(i+8);
else{j=e[g].split("=");if(j.length===2)if(j[0]==="rows")c.rows=parseInt(j[1]);else if(j[0]==="start")c.start=parseInt(j[1]);else if(j[0]==="sort")c.sort=j[1]}}return c};b.searchUtils.copyQueryParams=function(c,e){return{sort:c.sort,rows:c.rows,start:c.start,searchStr:c.searchStr,location:c.location,replace:e?c.replace:null}};b.searchUtils.generateSearchHref=function(c){return d.toUrl("search/search.html")+"#"+b.searchUtils.generateSearchQuery(c)};b.searchUtils.generateSearchQuery=function(c){var e=
"Path asc",g=40,j=0,i="",k="",m="";if(c){if(c.sort)e=c.sort;if(c.rows)g=c.rows;if(c.start)j=c.start;if(c.searchStr){i=c.searchStr;i=i.split(" ").join("")}if(c.location){k=c.location;if(k.length>0&&k[k.length-1]!=="*")k+="*";if(k!=="")k="+Location:"+k}if(c.replace!==null&&c.replace!==undefined)m="&replace="+c.replace}return"?sort="+e+"&rows="+g+"&start="+j+"&q="+i+k+m};b.searchUtils.parseLocationAndSearchStr=function(c,e){var g=c.indexOf("+Location:")>-1;e.location="";e.searchStr=c;if(g){c=c.split("+Location:");
if(c.length===2){g=c[1];if(g.length>0&&g[g.length-1]==="*")g=g.substring(0,g.length-1);e.location=g;e.searchStr=c[0].split(" ").join("")}}e.searchStrTitle=e.searchStr.split("\\").join("");e.inFileQuery=b.searchUtils.generateInFileQuery(e.searchStr)};b.searchUtils.generateInFileQuery=function(c){var e={},g=c.indexOf("*")>-1,j=c.indexOf("?")>-1;if(g)c=c.split("*").join(".*");if(j)c=c.split("?").join(".");if(!g&&!j){e.searchStr=c.split("\\").join("").toLowerCase();e.wildCard=false}else{e.searchStr=c.toLowerCase();
if(g=a.parse("/"+e.searchStr+"/")){c=g.pattern;g=g.flags;g+=g.indexOf("i")===-1?"i":"";e.regExp={pattern:c,flags:g};e.wildCard=true}}e.searchStrLength=e.searchStr.length;return e};b.searchUtils.replaceRegEx=function(c,e,g){return c.replace(new RegExp(e.pattern,e.flags),g)};b.searchUtils.replaceStringLiteral=function(c,e,g){e=a.parse("/"+e+"/gim");return b.searchUtils.replaceRegEx(c,e,g)};b.searchUtils.searchOnelineLiteral=function(c,e,g){var j;j=0;for(var i=false,k=[];;){j=e.indexOf(c.searchStr,j);
if(j<0)break;else{k.push({startIndex:j});i=true;if(g)break;j=j+c.searchStrLength}}if(i)return k;return null};b.searchUtils.findRegExp=function(c,e,g,j){if(!e)return null;g=g||"";g+=(g.indexOf("g")===-1?"g":"")+(g.indexOf("m")===-1?"m":"");var i=null;return(i=(new RegExp(e,g)).exec(c.substring(j)))&&{startIndex:i.index+j,length:i[0].length}};b.searchUtils.searchOnelineRegEx=function(c,e,g){for(var j=0,i=false,k=[];;)if(j=b.searchUtils.findRegExp(e,c.regExp.pattern,c.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(c,e,g,j,i){if(g&&c){var k;k=e.length>0?true:false;for(var m=0;m<c.length;m++){for(var o=c[m],w=false,s=false,v=[],u,t=0,q=0;q<g.children.length;q++)if(g.children[q].lineNumber-1===m){t=q;for(w=0;w<g.children[q].matches.length;w++)g.children[q+w].checked!==false&&v.push(w);s=v.length>0;u=g.children[q].matches;w=true;break}if(w){if(s){v=b.searchUtils.replaceCheckedMatches(o,j,u,v,i);o=
v.replacedStr;for(w=0;w<g.children[t].matches.length;w++)g.children[t+w].newMatches=v.newMatches}else{o=o;for(w=0;w<g.children[t].matches.length;w++)g.children[t+w].newMatches=g.children[t+w].matches}if(k)e[m]=o;else e.push(o)}else k||e.push(o)}}};b.searchUtils.generateMatchContext=function(c,e,g){var j=[],i=c*2+1,k;if(e.length<=i){k=0;c=e.length-1}else{k=g-c;if(k<0){k=0;c=k+i-1}else{c=g+c;if(c>e.length-1){c=e.length-1;k=c-i+1}}}for(i=k;i<=c;i++)j.push({context:e[i],current:i===g});return j};b.searchUtils.searchWithinFile=
function(c,e,g,j,i){g=g.split(j);if(i)e.contents=g;if(e){e.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=c.wildCard?b.searchUtils.searchOnelineRegEx(c,o):b.searchUtils.searchOnelineLiteral(c,o)){var w=k+1;if(i)for(var s=0;s<o.length;s++){var v=s+1;v={parent:e,checked:e.checked,type:"detail",matches:o,lineNumber:w,matchNumber:v,name:m,location:e.location+"-"+w+"-"+v};e.children.push(v)}else{v={parent:e,context:b.searchUtils.generateMatchContext(2,
g,k),checked:e.checked,type:"detail",matches:o,lineNumber:w,name:m,linkLocation:e.linkLocation+",line="+w,location:e.location+"-"+w};e.children.push(v)}j+=o.length}}}e.totalMatches=j}};b.searchUtils.replaceCheckedMatches=function(c,e,g,j,i){i=i;for(var k=0,m="",o=[],w=0;w<g.length;w++){if(k!==g[w].startIndex)m+=c.substring(k,g[w].startIndex);if(g[w].length)i=g[w].length;k=false;for(var s=0;s<j.length;s++)if(j[s]===w){k=true;break}if(k){o.push({startIndex:m.length,length:e.length});m+=e}else{o.push({startIndex:m.length,
length:i});m+=c.substring(g[w].startIndex,g[w].startIndex+i)}k=g[w].startIndex+i}if(k<c.length-1)m+=c.substring(k);return{replacedStr:m,newMatches:o}};b.searchUtils.fullPathNameByMeta=function(c){var e=c.length,g="";if(e>0)for(e=e-1;e>-1;e--)g=g+(g===""?"":"/")+c[e].Name;return g};b.searchUtils.path2FolderName=function(c,e,g){return c.substring(0,c.length-e.length-(g?0:1))};return b.searchUtils});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(d,f){d.declare("dijit.layout.BorderContainer",f.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){d.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var b=a.region;if(b){this.inherited(arguments);d.addClass(a.domNode,this.baseClass+"Pane");var c=this.isLeftToRight();if(b=="leading")b=c?"left":"right";if(b=="trailing")b=c?"right":"left";if(b!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var e=d.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");c=new e({id:a.id+"_splitter",container:this,child:a,region:b,live:this.liveSplitters});c.isSplitter=
true;a._splitterWidget=c;d.place(c.domNode,a.domNode,"after");c.startup()}a.region=b}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var b=a.region,c=a._splitterWidget;if(c){c.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();d.removeClass(a.domNode,this.baseClass+"Pane");d.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
d.style(a.domNode,b=="top"||b=="bottom"?"width":"height","auto")},getChildren:function(){return d.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return d.filter(this.getChildren(),function(b){return b.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=d.getComputedStyle(a);this.pe=d._getPadExtents(a,this.cs);this.pe.r=d._toPixelValue(a,this.cs.paddingRight);this.pe.b=d._toPixelValue(a,this.cs.paddingBottom);
d.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,b){if(this._borderBox&&this._borderBox.h){var c=d.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);c.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 e=[];d.forEach(c,function(g){g=g.pane;e.push(g);g._splitterWidget&&e.push(g._splitterWidget)});
f.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},e,a,b)}},destroyRecursive:function(){d.forEach(this.getChildren(),function(a){var b=a._splitterWidget;b&&b.destroy();delete a._splitterWidget});this.inherited(arguments)}});d.extend(f._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});d.declare("dijit.layout._Splitter",[f._Widget,f._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);d.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=d.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",b=d.marginBox(this.child.domNode)[a],c=d.filter(this.container.getChildren(),function(e){return e.region=="center"})[0];a=d.marginBox(c.domNode)[a];return Math.min(this.child.maxSize,b+a)},_startDrag:function(a){if(!this.cover){this.cover=d.doc.createElement("div");d.addClass(this.cover,"dijitSplitterCover");d.place(this.cover,this.child.domNode,"after")}d.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
d.addClass(this.domNode,"dijitSplitterShadow");d.place(this.fake,this.domNode,"after")}d.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)d.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var b=this._factor,c=this.horizontal,e=c?"pageY":"pageX",g=a[e],j=this.domNode.style;c=c?"h":"w";var i=d.marginBox(this.child.domNode)[c],k=this._computeMaxSize(),m=this.child.minSize||20;c=this.region;var o=c==
"top"||c=="bottom"?"top":"left",w=parseInt(j[o],10),s=this._resize,v=d.hitch(this.container,"_layoutChildren",this.child.id);c=d.doc;this._handlers=(this._handlers||[]).concat([d.connect(c,"onmousemove",this._drag=function(u,t){u=u[e]-g;var q=b*u+i,x=Math.max(Math.min(q,k),m);if(s||t)v(x);j[o]=u+w+b*(x-q)+"px"}),d.connect(c,"ondragstart",d.stopEvent),d.connect(d.body(),"onselectstart",d.stopEvent),d.connect(c,"onmouseup",this,"_stopDrag")]);d.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";d.toggleClass(this.domNode,"dijitSplitterHover",a);d.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&d.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&d.destroy(this.fake);d.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)d.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){d.forEach(this._handlers,d.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var b=this.horizontal,c=1,e=d.keys;switch(a.charOrCode){case b?e.UP_ARROW:e.LEFT_ARROW:c*=-1;case b?e.DOWN_ARROW:e.RIGHT_ARROW:break;default:return}b=d._getMarginSize(this.child.domNode)[b?"h":"w"]+this._factor*c;this.container._layoutChildren(this.child.id,Math.max(Math.min(b,this._computeMaxSize()),
this.child.minSize));d.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});d.declare("dijit.layout._Gutter",[f._Widget,f._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);d.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return f.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchUtils","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(d,f,a,b,c,e){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=e.parseQueryStr(j);try{this._fileService.search(i.location,j).then(function(o){var w=o.responseHeader.params.q;
w=w.substring(w.indexOf("}")+1);k(function(s){for(var v=[],u=0;u<s.response.docs.length;u++){var t=s.response.docs[u];v.push({name:t.Name,path:t.Location,folderName:e.path2FolderName(t.Path,t.Name),directory:t.Directory,lineNumber:t.LineNumber})}return v}(o),w)})}catch(m){this.registry.getService("orion.page.message").setErrorMessage(m)}},handleError:function(j,i){console.error(j);var k=document.createTextNode(j);f.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=f.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 e.generateSearchQuery({sort:k,rows:100,start:0,searchStr:"Name:"+this._luceneEscape(i,true)+j})}return e.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(w,
s){var v=function(){function l(r,y){r.appendChild(document.createTextNode(" - "+(y.folderName?y.folderName:y.path)+" "))}function n(r,y){var A=y.name;if(p.hasOwnProperty(A)){l(r,y);var z=p[A];if(typeof z==="function"){p[A]=null;z()}}else p[A]=function(){l(r,y)}}var p={};return n}(),u=false;f.empty(j);if(w&&w.length>0){for(var t=document.createElement("table"),q=0;q<w.length;q++){var x=w[q],B;if(!u){u=true;if(i){B=t.insertRow(0).insertCell(0);B.innerHTML=i}}B=t.insertRow(-1).insertCell(0);B.colspan=
2;m&&m(B);var D=document.createElement("a");f.place(document.createTextNode(x.name),D);x.LineNumber&&f.place(document.createTextNode(" (Line "+x.LineNumber+")"),D);var h=x.location;if(x.isExternalResource)h=x.path;else{h=x.directory?d.toUrl("navigate/table.html")+"#"+x.path:d.toUrl("edit/edit.html")+"#"+x.path;if(h==="#")h=""}D.setAttribute("href",h);f.style(D,"verticalAlign","middle");B.appendChild(D);v(B,x)}f.place(t,j,"last");typeof k==="function"&&k(j)}if(!u)if(s){w=f.place("<div>No matches found for </div>",
j,"only");w=f.create("b",null,w,"last");f.place(document.createTextNode(s),w,"only");typeof k==="function"&&k(j)}}return o}}};g.prototype.constructor=g;return{Searcher:g}});
define("orion/compare/compare-features",["dojo","dijit","dijit/layout/ContentPane","dijit/layout/BorderContainer"],function(d,f){var a=a||{};a.TwoWayCompareUIFactory=function(){function b(c){this._parentDivID=c.parentDivID;this._commandSpanId=c.commandSpanId;this._showTitle=c.showTitle;this._leftTitle=c.leftTitle;this._rightTitle=c.rightTitle;this._showLineStatus=c.showLineStatus}b.prototype={_createNoWrapTextDiv:function(c,e,g,j){var i=document.createElement("table");i.width="100%";var k=document.createElement("tr");
i.appendChild(k);var m=document.createElement("td");m.noWrap=true;if(g)m.align=g;k.appendChild(m);g=document.createElement("h2");g.id=c;d.place(document.createTextNode(e),g,"only");m.appendChild(g);if(j&&!this._commandSpanId){this._commandSpanId="compare_rightContainerCommands";m=document.createElement("td");m.id=this._commandSpanId;k.appendChild(m);m.noWrap=true;m.align="right";i.align="right"}return i},_createEditorParentDiv:function(c){c=new f.layout.ContentPane({id:c,region:"center"});d.addClass(c.domNode,
"paneScrolled");d.addClass(c.domNode,"compareEditorParent");return c},_createCompareCanvasDiv:function(c){var e=new f.layout.ContentPane({region:"leading",splitter:false});d.addClass(e.domNode,"canvasContainer");var g=document.createElement("canvas");g.id=c;g.width=46;g.height=3E3;d.toggleClass(g,"compareCanvas",true);e.attr("content",g);return e},_appendDomNode:function(c,e){e.placeAt(c)},_createTileDiv:function(c,e,g){c=this._createNoWrapTextDiv(c,e?e:"Compare...","left",g);e=new f.layout.ContentPane({region:"top"});
d.addClass(e.domNode,"titleContainer");e.attr("content",c);return e},_createStatusDiv:function(c){c=this._createNoWrapTextDiv(c,"Line 0 : Col 0","center");var e=new f.layout.ContentPane({region:"bottom"});d.addClass(e.domNode,"statusContainer");e.attr("content",c);return e},_createLeftEditorParentDiv:function(c,e){return this._createEditorParentDiv(c,e)},_createRightEditorParentDiv:function(c,e){var g=new f.layout.BorderContainer({region:"center",gutters:false,design:"headline",liveSplitters:false,
persist:false,splitter:false});d.addClass(g.domNode,"borderContainer");this._appendDomNode(g,this._createCompareCanvasDiv(e));this._appendDomNode(g,this._createEditorParentDiv(c));return g},_createLeftBorder:function(){var c=new f.layout.BorderContainer({region:"leading",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});d.addClass(c.domNode,"leftBorder");if(this._showTitle){this._leftTitleDivId=this._parentDivID+"_left_title_id";this._appendDomNode(c,this._createTileDiv(this._leftTitleDivId,
this._leftTitle,false))}this._leftEditorParentDivId=this._parentDivID+"_left_editor_id";this._appendDomNode(c,this._createLeftEditorParentDiv(this._leftEditorParentDivId));if(this._showLineStatus){this._leftStatusDivId=this._parentDivID+"_left_status_id";this._appendDomNode(c,this._createStatusDiv(this._leftStatusDivId))}return c},_createRightBorder:function(){var c=new f.layout.BorderContainer({region:"center",gutters:false,design:"headline",liveSplitters:false,persist:false,splitter:false});d.addClass(c.domNode,
"rightBorder");if(this._showTitle){this._rightTitleDivId=this._parentDivID+"_right_title_id";this._appendDomNode(c,this._createTileDiv(this._rightTitleDivId,this._rightTitle,true))}this._rightEditorParentDivId=this._parentDivID+"_right_editor_id";this._diffCanvasDivId=this._parentDivID+"_diff_canvas_id";this._appendDomNode(c,this._createRightEditorParentDiv(this._rightEditorParentDivId,this._diffCanvasDivId));if(this._showLineStatus){this._rightStatusDivId=this._parentDivID+"_right_status_id";this._appendDomNode(c,
this._createStatusDiv(this._rightStatusDivId))}return c},buildUI:function(){this._topWidgetId=this._parentDivID+"_topWidget";var c=f.byId(this._topWidgetId);c&&c.destroyRecursive();var e=this._createLeftBorder(),g=this._createRightBorder();c=d.marginBox(this._parentDivID);c=new f.layout.BorderContainer({id:this._topWidgetId,width:c.w,height:c.h,region:"center",gutters:false,design:"headline",liveSplitters:true,persist:false,splitter:true});c.placeAt(this._parentDivID);c.addChild(e);c.addChild(g);
c.startup()},getEditorParentDivId:function(c){return c?this._leftEditorParentDivId:this._rightEditorParentDivId},getTitleDivId:function(c){return c?this._leftTitleDivId:this._rightTitleDivId},getStatusDivId:function(c){return c?this._leftStatusDivId:this._rightStatusDivId},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDivId:function(){return this._diffCanvasDivId}};return b}();return a});
define("orion/compare/diff-parser",[],function(){var d=d||{};d.DiffParser=function(){function f(b,c){this._lineDelimiter=b?b:a?"\r\n":"\n";this._diffLineDelimiter=c?c:this._lineDelimiter;this._DEBUG=false}var a=navigator.platform.indexOf("Win")!==-1;f.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=true;this._diffContentIndex=
1},setLineDelim:function(b){this._diffLineDelimiter=this._lineDelimiter=b},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(b,c,e,g){this._init();if(c==="")return{outPutFile:b,mapper:[]};this._oFileContents=b===""?[]:b.split(this._lineDelimiter);this._diffContents=c.split(this._diffLineDelimiter);c=this._diffContents.length;this._hunkRanges=[];for(var j=0;j<c;j++){var i=this._parseHunkRange(j);i&&this._hunkRanges.push(i)}if(0===this._hunkRanges.length)return{outPutFile:b,
mapper:[]};if(this._DEBUG){console.log("***Diff contents: \n");for(b=0;b<this._diffContents.length;b++)console.log(this._diffContents[b]);console.log("***Hunk ranges: \n");console.log(JSON.stringify(this._hunkRanges))}for(b=0;b<this._hunkRanges.length;b++)this._parseHunkBlock(b);if(this._DEBUG){console.log("***Original Hunk range blocks: \n");console.log(JSON.stringify(this._oBlocks));console.log("***New Hunk range blocks: \n");console.log(JSON.stringify(this._nBlocks))}this._buildMap(e);if(this._DEBUG){console.log("***New Line at end of file(original): \n");
console.log(JSON.stringify(this._oNewLineAtEnd));console.log("***New Line at end of file(new): \n");console.log(JSON.stringify(this._nNewLineAtEnd));console.log("***Mapper: \n");this._logMap();console.log("***Total line number in original file: "+this._oFileContents.length)}if(g===undefined||!g)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var b=0;b<this._deltaMap.length;b++){console.log(JSON.stringify(this._deltaMap[b]));
if(this._deltaMap[b][2]>0){console.log("    **Diff content on change/add: \n");for(var c=0;c<this._deltaMap[b][0];c++)console.log("    "+this._diffContents[this._deltaMap[b][2]+c-1])}}},_logNewFile:function(){for(var b=0;b<this._nFileContents.length;b++)console.log(this._nFileContents[b])},_createBlock:function(b,c,e,g){if(!(g===e&&b===" ")){e=[e,g-e,"s"];if(b==="-")e[2]="r";else if(b==="+")e[2]="a";else if(b==="c")e[2]="c";c.push(e)}},_createMinusBlock:function(b,c,e){var g=this._oBlocks.length;
if(g===0||b!==this._oBlocks[g-1][0]){this._oBlocks.push([b===0?1:b,e]);this._nBlocks.push([c,0,-2])}else this._oBlocks[g-1][1]+=e},_createPlusBlock:function(b,c,e,g){var j=this._nBlocks.length;if(j===0||c!==this._nBlocks[j-1][0]){this._oBlocks.push([b===0?1:b,0]);this._nBlocks.push([c,e,g])}else{this._nBlocks[j-1][1]+=e;this._nBlocks[j-1][2]=g}},_parseHunkBlock:function(b){for(var c=" ",e=this._hunkRanges[b][0]+1,g=b===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[b+1][0],j=
0,i=0,k=this._hunkRanges[b][1],m=this._hunkRanges[b][3],o=e,w=e;w<g;w++)if(0!==this._diffContents[w].length){var s=this._diffContents[w][0];if(s==="\\")if("\\ No newline at end of file"===this._diffContents[w].substring(0,this._diffContents[w].length-1)||"\\ No newline at end of file"===this._diffContents[w]){if(c==="-")this._oNewLineAtEnd=false;else if(c===" ")this._oNewLineAtEnd=this._nNewLineAtEnd=false;else this._nNewLineAtEnd=false;if(w>e&&this._diffContents[w-1][this._diffContents[w-1].length-
1]==="\r")this._diffContents[w-1]=this._diffContents[w-1].substring(0,this._diffContents[w-1].length-1);continue}switch(s){case "-":case "+":case " ":break;default:continue}if(c!==s){if(s==="+")o=w;switch(c){case " ":k=this._hunkRanges[b][1]+j;m=this._hunkRanges[b][3]+i;break;case "-":this._createMinusBlock(k,m,this._hunkRanges[b][1]+j-k);break;case "+":this._createPlusBlock(k,m,this._hunkRanges[b][3]+i-m,o);break;default:}c=s}switch(s){case "-":j++;break;case "+":i++;break;case " ":j++;i++;break}}switch(c){case "-":this._createMinusBlock(k,
m,this._hunkRanges[b][1]+j-k);break;case "+":this._createPlusBlock(k,m,this._hunkRanges[b][3]+i-m,o);break}},_detectConflictes:function(b,c){if(b<0)return false;c=b+c;for(b=b;b<c;b++){var e=this._diffContents[b];if(e.indexOf("<<<<<")>-1||e.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(b){for(var c=this._oBlocks.length,e=this._oFileContents.length,g=0,j=1,i=0;i<c;i++){j=this._oBlocks[i][0]-j;if(j>0){this._deltaMap.push([j,j,0]);g+=j}b&&this._detectConflictes(this._nBlocks[i][2],
this._nBlocks[i][1])?this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1,1]):this._deltaMap.push([this._nBlocks[i][1],this._oBlocks[i][1],this._nBlocks[i][2]+1]);g+=this._oBlocks[i][1];j=this._oBlocks[i][0]+this._oBlocks[i][1]}if(0<e-j){this._deltaMap.push([e-j+1,e-j+1,0]);g+=e-j+1}if(g<e){j=e-g;b=this._deltaMap[this._deltaMap.length-1];if(b[2]===0){b[0]+=j;b[1]+=j}else if(b[2]===-1)this._deltaMap.push([j,j,0]);else if(this._nNewLineAtEnd===this._oNewLineAtEnd)this._deltaMap.push([j,
j,0]);else{if(this._nNewLineAtEnd)b[0]+=j;if(this._oNewLineAtEnd)b[1]+=j}}},_buildNewFile:function(){for(var b=1,c=false,e=this._deltaMap.length,g=0;g<e;g++){c=false;if(this._deltaMap[g][2]===0){for(var j=0;j<this._deltaMap[g][0];j++)this._nFileContents.push(this._oFileContents[b+j-1]);c=true}else if(this._deltaMap[g][2]>0)for(j=0;j<this._deltaMap[g][0];j++)this._nFileContents.push(this._diffContents[this._deltaMap[g][2]+j-1].substring(1));b+=this._deltaMap[g][1]}this._nNewLineAtEnd&&!c&&this._nFileContents.push("")},
_parseHRangeBody:function(b,c){if(0<b.indexOf(",")){var e=b.split(",");b=parseInt(e[0]);e=parseInt(e[1]);c.push(b>=0?b:1);c.push(e>=0?e:1)}else{b=parseInt(b);c.push(b>=0?b:1);c.push(1)}},_parseHunkRange:function(b){var c=this._diffContents[b];if(!(8>c.length))if("@@"===c.substring(0,2)){c=c.substring(2);var e=c.indexOf("@@");if(!(e<0)){c=c.substring(0,e);e=c.indexOf("-");var g=c.indexOf("+");if(!(e<0||g<0)){b=[b];if(e<g){c=c.substring(e+1).split("+");this._parseHRangeBody(c[0],b);this._parseHRangeBody(c[1],
b)}else{c=c.substring(g+1).split("-");this._parseHRangeBody(c[1],b);this._parseHRangeBody(c[0],b)}return b}}}}};return f}();return d});
define("orion/compare/compareUtils",[],function(){var d=d||{};d.compareUtils=d.compareUtils||{};d.compareUtils.lookUpMapper=function(f,a,b){for(var c=0,e=0;e<f.length;e++){var g=f[e][a];if(g===0)g=1;if(b>=c&&b<c+g)return{mapperIndex:e,startFrom:c};if(e===f.length-1)break;c+=f[e][a]}return{mapperIndex:f.length-1,startFrom:c}};d.compareUtils.lookUpLineIndex=function(f,a,b){if(b===0)return 0;for(var c=0,e=0;e<b;e++)c+=f[e][a];return c};d.compareUtils.updateMapper=function(f,a,b,c,e){if(c!==e)if(c>0||
e>0){var g=d.compareUtils.lookUpMapper(f,a,b);if(!(g.mapperIndex<0)){if(c>0){c=c;var j=b-g.startFrom;for(b=g.mapperIndex;b<f.length;b++){j=f[b][a]-j;if(c<=j){f[b][a]-=c;break}f[b][a]-=j;c-=j;j=0}}if(e>0)f[g.mapperIndex][a]+=e}}};d.compareUtils.overlapMapper=function(f,a,b,c,e){f=b+f[a]-1;if(f<b)f=b;if(e<c)e=c;if(f<c||e<b)return false;return true};d.compareUtils.findFirstDiff=function(f,a,b,c){for(var e=0,g=undefined,j=0;j<f.length;j++){if(e>c)break;if(d.compareUtils.overlapMapper(f[j],a,e,b,c)){g=
{mapperIndex:j,startFrom:e};if(f[j][2]!==0)break}e+=f[j][a]}return g};d.compareUtils.matchMapper=function(f,a,b,c){if(f.length===0)return b;var e=b+Math.round((c-b)/3),g=d.compareUtils.findFirstDiff(f,a,b,c),j=f[g.mapperIndex][a]===0?g.startFrom:g.startFrom+f[g.mapperIndex][a]-1,i=d.compareUtils.lookUpLineIndex(f,1-a,g.mapperIndex),k=g.startFrom-b;if(f[g.mapperIndex][2]===0)return i-k;if(e>=g.startFrom&&e<=j)return i-Math.round((c-b)/3);if(e<g.startFrom)return i-k;return(f[g.mapperIndex][1-a]===0?
i:i+f[g.mapperIndex][1-a]-1)-(j-b)};d.compareUtils.getMapperLineCount=function(f){for(var a=0,b=0;b<f.length;b++)a+=Math.max(f[b][0],f[b][1]);return a};d.compareUtils.findNextDiff=function(f,a){var b=0;if(a>=0&&a<f.length-1)b=a+1;for(var c=b;c<f.length;c++)if(f[c][2]!==0)return c;for(c=0;c<b;c++)if(f[c][2]!==0)return c;return a};d.compareUtils.getAnnotationIndex=function(f,a){for(var b=0;b<f.length;b++)if(f[b][0]===a)return b;return-1};d.compareUtils.getAnnotationMapperIndex=function(f,a){return f[a][1]};
d.compareUtils.getAnnotationIndexByMapper=function(f,a){for(var b=0;b<f.length;b++)if(f[b][1]===a)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};d.compareUtils.isMapperConflict=function(f,a){if(a<0)return false;if(!f[a][3])return false;return f[a][3]===1};return d.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(d){var f=f||{};f.CompareRuler=function(){function a(b,c,e){this._location=b||"left";this._overview=c||"page";this._rulerStyle=e;this._editor=null;var g=this;this._listener={onModelChanged:function(j){g._onModelChanged(j)}}}a.prototype={setView:function(b){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=b;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return false},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(b,c){var e=[];for(b=b;b<c;b++){var g=this.getStyle(b);if(g)e[b]={html:this.getHTML(b),style:g}}return e},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(undefined)}};return a}();f.LineNumberCompareRuler=function(){function a(b,c,e,g,j){f.CompareRuler.call(this,c,"page",e);this._oddStyle=g||{style:{backgroundColor:"white"}};this._evenStyle=j||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}a.prototype=new f.CompareRuler;a.prototype.getStyle=function(b){return b===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(b){var c=this._editor.getModel();
if(b===-1)return c.getLineCount();else{if(c.getLineNumber){b=c.getLineNumber(b,this._mapperColumnIndex);if(b===-1)return"";return b+1}return b+1}};a.prototype._onModelChanged=function(b){b=b.start;var c=this._editor.getModel(),e=c.getLineCount(),g=(e+"").length;if(this._numOfDigits!==g){this._numOfDigits=g;this._editor.redrawLines(c.getLineAtOffset(b),e,this)}};return a}();f.CompareAnnotation=function(){function a(){this._currentAnnotationIndex=0}a.prototype={init:function(b,c){this._mapper=b;this._editor=
c;this._currentAnnotationIndex=0},getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},getCurrentMapperIndex:function(){var b=this._editor.getModel().getAnnotations();return b.length===0?-1:b[this._currentAnnotationIndex][1]},matchPositionFromAnnotation:function(b){var c=b;if(b===-1)c=0;else{c=this._editor.getModel();c=d.getAnnotationIndex(c.getAnnotations(),b)}this._currentAnnotationIndex=c},gotoDiff:function(b){this._currentAnnotationIndex=b},nextDiff:function(){var b=this._editor.getModel().getAnnotations();
if(b.length!==0)if(b.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=0;else this._currentAnnotationIndex+=1},prevDiff:function(){var b=this._editor.getModel().getAnnotations();if(b.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=b.length-1;else this._currentAnnotationIndex-=1}};return a}();f.CompareOverviewRuler=function(){function a(b,c){f.CompareRuler.call(this,b,"document",c)}a.prototype=new f.CompareRuler;a.prototype.getStyle=function(b){var c,
e;if(b===undefined){c=this._rulerStyle||{};e=c.style||(c.style={});e.lineHeight="1px";e.fontSize="1px";e.width="14px"}else{c=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};e=c.style||(c.style={});e.cursor="pointer";e.width="8px";e.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=g.getAnnotationH(b);g=g.getLineCount();var j=this._editor.getClientArea();b=Math.floor(j.height*b/g);if(b<2)b=2;e.height=b+"px"}else e.height="3px"}return c};a.prototype.getHTML=function(){return"&nbsp;"};
a.prototype.onClick=function(b){if(b!==undefined){var c=this._editor.getLineHeight(),e=this._editor.getClientArea();c=Math.floor(e.height/c/3);this._editor.setTopIndex(b-c>0?b-c:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();f.TwoWayCompareOverviewRuler=function(){function a(b,c,e,g){this._compareAnnotaion=e;this._onClick=g;f.CompareRuler.call(this,b,"document",c)}a.prototype=new f.CompareRuler;a.prototype.getStyle=
function(b){var c,e;if(b===undefined){c=this._rulerStyle||{};e=c.style||(c.style={});e.lineHeight="1px";e.fontSize="1px";e.width="14px"}else{c=b!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};e=c.style||(c.style={});e.cursor="pointer";e.width="8px";e.left="2px";var g=this._editor.getModel();if(b>=0&&g.getAnnotationH){b=d.getAnnotationIndex(g.getAnnotations(),b);if(b===-1)return null;var j=d.getAnnotationMapperIndex(g.getAnnotations(),b);if(j=d.isMapperConflict(g.getMapper(),j))e.border=
"1px #FF0000 solid";if(b===this._compareAnnotaion.getCurrentAnnotationIndex())e.backgroundColor=j?"red":"blue";b=g.getAnnotationH(b);g=g.getAnnotationLineCount();j=this._editor.getClientArea();g=Math.floor(j.height*b/g);if(g<2)g=2;e.height=g+"px"}else e.height="3px"}return c};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(b){b!==undefined&&this._onClick(b,this)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,
1,this)};return a}();f.CompareMatchRenderer=function(){function a(b){this._canvasDiv=b;this._mapper=undefined;this._initialized=false;this._annotation=new f.CompareAnnotation}a.prototype={init:function(b,c,e){this._initialized=true;this._mapper=b;this._leftEditor=c;this._rightEditor=e;this._annotation.init(b,e);this.render()},getAnnotation:function(){return this._annotation},getCurrentAnnotationIndex:function(){return this._annotation.getCurrentAnnotationIndex()},getCurrentMapperIndex:function(){return this._annotation.getCurrentMapperIndex()},
setOverviewRuler:function(b){this._overviewRuler=b},_setEditorPosition:function(b,c){var e=b.getLineHeight(),g=b.getClientArea();e=Math.floor(g.height/e/3);b.setTopIndex(c-e>0?c-e:0)},_findBaseLine:function(b){var c=b.getLineHeight(),e=b.getClientArea();c=Math.floor(e.height/c/3);return b.getTopIndex()+c},matchPositionFrom:function(b){var c=b?this._leftEditor:this._rightEditor,e=b?this._rightEditor:this._leftEditor,g=c.getTopIndex();c=c.getBottomIndex();b=d.matchMapper(this._mapper,b?0:1,g,c);e.setTopIndex(b)},
matchPositionFromAnnotation:function(b){if(this._initialized){this._annotation.matchPositionFromAnnotation(b);this.positionAnnotation(this._annotation.getCurrentAnnotationIndex())}},positionAnnotation:function(b){var c=this._rightEditor.getModel().getAnnotations();if(c.length!==0){this._setEditorPosition(this._rightEditor,c[b][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(c[b][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();b=this._rightEditor.getTopIndex();
this._rightEditor.redrawLines(b,b+1,this._overviewRuler)}},gotoDiff:function(b){this._annotation.gotoDiff(b);b=this._rightEditor.getTopIndex();this._leftEditor.redrawRange();this._rightEditor.redrawRange();this._rightEditor.redrawLines(b,b+1,this._overviewRuler)},nextDiff:function(){this._annotation.nextDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());this.render()},prevDiff:function(){this._annotation.prevDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());
this.render()},getMapperTextRange:function(b,c,e){var g=b.getModel().getLineIndexFromMapper(c);c=g+this._mapper[c][e]-1;g=b.getModel().getLineStart(g);b=b.getModel().getLineEnd(c,true);return{start:g,end:b}},copyToLeft:function(){var b=this.getCurrentMapperIndex(),c=this.getMapperTextRange(this._rightEditor,b,1);b=this.getMapperTextRange(this._leftEditor,b,0);this._leftEditor.setText(this._rightEditor.getText(c.start,c.end),b.start,b.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},
render:function(){if(this._mapper){var b=this._canvasDiv.getContext("2d");b.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);b.strokeStyle="#AAAAAA";b.lineWidth=1;b.beginPath();var c=this._leftEditor.getTopIndex(),e=this._leftEditor.getBottomIndex(),g=this._rightEditor.getTopIndex(),j=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var i=0,k=0,m=false,o=0;o<this._mapper.length;o++){if(this._mapper[o][2]!==
0)if(d.overlapMapper(this._mapper[o],0,i,c,e)||d.overlapMapper(this._mapper[o],1,k,g,j)){this._renderCurve(o,i,k,this._canvasDiv,b,c,e,g,j);m=true}else if(m)break;i+=this._mapper[o][0];k+=this._mapper[o][1]}b.stroke()}},_renderCurve:function(b,c,e,g,j){var i=this._mapper[b];c=this._leftEditor.getLinePixel(c+i[0]/2)+i[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();e=this._rightEditor.getLinePixel(e+i[1]/2)+i[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();g=g.parentNode.clientWidth;
if(b===this.getCurrentMapperIndex()){j.stroke();j.strokeStyle="#000";j.lineWidth=1;j.beginPath();j.moveTo(0,c);j.bezierCurveTo(g/3,c,g*0.666,e,g,e);j.stroke();j.strokeStyle="#AAAAAA";j.lineWidth=1;j.beginPath()}else{j.moveTo(0,c);j.bezierCurveTo(g/3,c,g*0.666,e,g,e);j.stroke()}},onChanged:function(b){if(b.removedLineCount!==b.addedLineCount)if(b.removedLineCount>0||b.addedLineCount>0)this.render()}};return a}();return f});
define("orion/textview/eventTarget",[],function(){function d(){}d.addMixin=function(f){var a=d.prototype;for(var b in a)if(a.hasOwnProperty(b))f[b]=a[b]};d.prototype={addEventListener:function(f,a,b){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[f];c||(c=this._eventTypes[f]={level:0,listeners:[]});c.listeners.push({listener:a,useCapture:b})},dispatchEvent:function(f){if(this._eventTypes){var a=f.type,b=this._eventTypes[a];if(b){var c=b.listeners;try{b.level++;if(c)for(var e=0,g=
c.length;e<g;e++)if(c[e]){var j=c[e].listener;if(typeof j==="function")j.call(this,f);else j.handleEvent&&typeof j.handleEvent==="function"&&j.handleEvent(f)}}finally{b.level--;if(b.compact&&b.level===0){for(f=c.length-1;f>=0;f--)c[f]||c.splice(f,1);c.length===0&&delete this._eventTypes[a];b.compact=false}}}}},isListening:function(f){if(!this._eventTypes)return false;return this._eventTypes[f]!==undefined},removeEventListener:function(f,a,b){if(this._eventTypes){var c=this._eventTypes[f];if(c){for(var e=
c.listeners,g=0,j=e.length;g<j;g++){var i=e[g];if(i&&i.listener===a&&i.useCapture===b){if(c.level!==0){e[g]=null;c.compact=true}else e.splice(g,1);break}}e.length===0&&delete this._eventTypes[f]}}}};return{EventTarget:d}});
define("orion/compare/compare-inline-model",["orion/textview/eventTarget"],function(d){var f=f||{};f.CompareTextModel=function(){function a(b,c,e){this._model=b;this._mapperColumnIndex=c.columnIndex;this._mapper=c.mapper;var g=this;this._listener={onChanging:function(j){g.onChanging(j)},onChanged:function(j){g.onChanged(j)}};b.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Changed",this._listener.onChanged);this._lineFeeder=e;this.init()}navigator.platform.indexOf("Win");
a.prototype={init:function(b,c){if(b)this._mapper=b;b=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,c);this._dummyLBlock=b.gapBlocks;this._dummyLNumber=b.gapNumber},_getDummyCharCountAt:function(b,c){if(b.blockNumber<0)return 0;for(var e=0,g=0;g<=b.blockNumber;g++){if(g>=this._dummyLBlock.length)break;for(var j=g===b.blockNumber?b.stopAtDelta:this._dummyLBlock[g][1]-1,i=0;i<=j;i++){var k=c?this._lineFeeder.getLineAt(this._dummyLBlock,g,i,true):this._lineFeeder.getLineAt(this._dummyLBlock,
g,i,!(g===b.blockNumber&&i===j));e+=k.length}}return e},lookUpRealIndex:function(b){for(var c=0,e=0,g=0;g<this._dummyLBlock.length;g++){var j=this._dummyLBlock[g][0],i=j+this._dummyLBlock[g][1]-1;if(b<j)break;if(b>=j&&b<=i)return{lineIndex:-1,gapsBefore:c+b-j,lastGapInfo:{blockNumber:g,stopAtDelta:b-j}};e=this._dummyLBlock[g][1];c+=e}return{lineIndex:b-c,gapsBefore:c,lastGapInfo:{blockNumber:g-1,stopAtDelta:e-1}}},getLineType:function(b){return this._lineFeeder.getLineType(b,this._mapperColumnIndex)},
getMapper:function(){return this._mapper},getAnnotations:function(){return this._lineFeeder.getAnnotations()},getAnnotationH:function(b){return this._lineFeeder.getAnnotationH(b)},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(b,c){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(b,c);return this.lookUpRealIndex(b).lineIndex},getCharCount:function(){var b=this._model.getCharCount();if(this._dummyLBlock.length>0)b+=this._getDummyCharCountAt({blockNumber:this._dummyLBlock.length-
1,stopAtDelta:this._dummyLBlock[this._dummyLBlock.length-1][1]-1},true);return b},getLine:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return null;b=this.lookUpRealIndex(b);return b.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,b.lastGapInfo.blockNumber,b.lastGapInfo.stopAtDelta,c):this._model.getLine(b.lineIndex,c)},getLineAtOffset:function(b){if(!(0<=b&&b<=this.getCharCount()))return-1;for(var c=this.getLineCount(),e=0,g=0;e<c;){var j=this.lookUpRealIndex(e);if(j.lineIndex<
0)g+=this._lineFeeder.getLineAt(this._dummyLBlock,j.lastGapInfo.blockNumber,j.lastGapInfo.stopAtDelta,true).length;else{j=this._model.getLine(j.lineIndex,true);g+=j?j.length:0}e++;if(g>b)break}if(e>c)return c-1;return e-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;var g=this.lookUpRealIndex(b);e=0;if(g.lineIndex<0){e+=this._getDummyCharCountAt(g.lastGapInfo,
c);b=b-g.gapsBefore;if(b>0)e+=this._model.getLineEnd(b-1,true)}else{e+=this._getDummyCharCountAt(g.lastGapInfo,true);e+=this._model.getLineEnd(g.lineIndex,c)}return e},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;if(b===0)return 0;return this.getLineEnd(b-1,true)},getText:function(b,c){if(b===c)return this._model.getText(b,c);if(b===undefined)b=0;if(c===undefined)c=this.getCharCount();var e=this.getLineAtOffset(b),g=this.getLineAtOffset(c),j=this.getLineStart(e),i=this.getLineEnd(g,
true),k=this.getLine(e,true);if(!k)return this._model.getText(b,c);if(e===g)return k.substring(b-j,k.length-i+c);j=k.substring(b-j);k=this.getLine(g,true);if(!k)return this._model.getText(b,c);b=k.substring(0,k.length-i+c);c="";for(e=e+1;e<g;e++)c+=this.getLine(e,true);return j+c+b},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b){this._model.setText(b,0,this._model.getCharCount())}};
d.EventTarget.addMixin(a.prototype);return a}();f.DiffLineFeeder=function(){function a(b,c){if(b){this._diffLinesArray=b.array;this._diffLinesArrayIndex=b.index}this._lineDelimeter=c;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(b,c,e){var g=[];this._mapper=b;if(e){this._diffLinesArray=e.array;this._diffLinesArrayIndex=e.index}this._annotations=[];e=b=0;for(var j=1-c,i=0,k=0;k<this._mapper.length;k++){i=this._mapper[k][2]===0?this._mapper[k][c]:this._mapper[k][c]+
this._mapper[k][j];if(this._mapper[k][2]>0){var m=this._mapper[k][c];b+=m;g.push([e+this._mapper[k][j],m,this._mapper[k][2]])}this._mapper[k][2]!==0&&this._annotations.push([e,k,i]);e+=i}return{gapBlocks:g,gapNumber:b}},getLineAt:function(b,c,e,g){c=b[c][2];c+=e-1;e=this._diffLinesArray[c];e===undefined&&console.log(b);e=e.substring(this._diffLinesArrayIndex);if(g)return e+this._lineDelimeter;return e},getLineType:function(b,c){for(var e=0,g=1-c,j=0,i=0;i<this._mapper.length;i++){j=this._mapper[i][2]===
0?this._mapper[i][c]:this._mapper[i][c]+this._mapper[i][g];if(b>=e&&b<e+j){if(this._mapper[i][2]===0)return{type:"unchnaged",mapperIndex:i};else if(this._mapper[i][2]<0)return{type:"removed",mapperIndex:i};else if(this._mapper[i][1]===0)return{type:"added",mapperIndex:i};else if(b<this._mapper[i][g]+e)return{type:"removed",mapperIndex:i};return{type:"added",mapperIndex:i}}e+=j}return{type:"unchnaged",mapperIndex:-1}},getLineNumber:function(b,c){if(this._mapper.length===0)return b;for(var e=0,g=0,
j=1-c,i=0,k=0;k<this._mapper.length;k++){i=this._mapper[k][2]===0?this._mapper[k][c]:this._mapper[k][c]+this._mapper[k][j];if(b>=e&&b<e+i){j=b-e;if(this._mapper[k][2]===0)return g+j;else if(this._mapper[k][2]<0)return c===0?-1:g+j;else if(this._mapper[k][1]===0)return c===0?g+j:-1;else if(b<this._mapper[k][1]+e)return c===0?-1:g+j;return c===0?g+j-this._mapper[k][1]:-1}e+=i;g+=this._mapper[k][c]}return b},getAnnotations:function(){return this._annotations},getAnnotationH:function(b){return this._annotations[b][2]}};
return a}();f.GapLineFeeder=function(){function a(b){this._lineDelimeter=b;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(b,c){var e=[];this._mapper=b;this._annotations=[];for(var g=b=0,j=1-c,i=0;i<this._mapper.length;i++){if(this._mapper[i][c]<this._mapper[i][j]){var k=this._mapper[i][j]-this._mapper[i][c];b+=k;e.push([g+this._mapper[i][c],k,1])}k=Math.max(this._mapper[i][j],this._mapper[i][c]);this._mapper[i][2]!==0&&this._annotations.push([g,i,k]);
g+=k}return{gapBlocks:e,gapNumber:b}},getLineAt:function(b,c,e,g){if(g)return this._lineDelimeter;return""},getLineType:function(b,c){for(var e=0,g=1-c,j=0;j<this._mapper.length;j++){var i=Math.max(this._mapper[j][c],this._mapper[j][g]);if(b>=e&&b<e+i){if(this._mapper[j][2]===0)return"unchnaged";else if(this._mapper[j][2]<0)return"removed";else if(this._mapper[j][1]===0)return"added";else if(b<this._mapper[j][c]+e)return"changed";return"changed_gap"}e+=Math.max(this._mapper[j][c],this._mapper[j][g])}return"unchnaged"},
getAnnotations:function(){return this._annotations},getAnnotationH:function(b){return this._annotations[b][2]}};return a}();return f});
define("orion/compare/compare-2way-model",["orion/compare/compareUtils","orion/textview/eventTarget"],function(d,f){var a=a||{};a.TwoWayCompareModel=function(){function b(c,e){this._model=c;this._mapperColumnIndex=e.columnIndex;this._mapper=e.mapper;var g=this;this._listener={onChanging:function(j){g.onChanging(j)},onChanged:function(j){g.onChanged(j)}};c.addEventListener("Changing",this._listener.onChanging);c.addEventListener("Changed",this._listener.onChanged);this.init()}navigator.platform.indexOf("Win");
b.prototype={init:function(c){this._initing=true;if(c){this._mapper=c;this._annotations=undefined}},getMapper:function(){return this._mapper},getLineType:function(c){var e=d.lookUpMapper(this._mapper,this._mapperColumnIndex,c);if(e.mapperIndex>-1)if(this._mapper[e.mapperIndex][2]!==0){var g=this._mapper[e.mapperIndex][this._mapperColumnIndex];if(g===0)return{type:"top-only",mapperIndex:e.mapperIndex};if(g===1)return{type:"oneline",mapperIndex:e.mapperIndex};if(c===e.startFrom)return{type:"top",mapperIndex:e.mapperIndex};
if(c===e.startFrom+g-1)return{type:"bottom",mapperIndex:e.mapperIndex};return{type:"middle",mapperIndex:e.mapperIndex}}return{type:"unchanged",mapperIndex:e.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===0},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var c=0,e=0;e<this._mapper.length;e++){this._mapper[e][2]!==0&&this._annotations.push([c,e]);c+=this._mapper[e][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(c){this.getAnnotations();
c=this._annotations[c][1];return c===-1?0:this._mapper[c][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(c){return c},getLineIndexFromMapper:function(c){return d.lookUpLineIndex(this._mapper,this._mapperColumnIndex,c)},lookUpMapper:function(c){return d.lookUpMapper(this._mapper,this._mapperColumnIndex,c)},updateMapper:function(c,e,g,j,i){j!==i&&d.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(c),j,i)},getCharCount:function(){return this._model.getCharCount()},
getLine:function(c,e){return this._model.getLine(c,e)},getLineAtOffset:function(c){return this._model.getLineAtOffset(c)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},setLineDelimiter:function(c){this._model.setLineDelimiter(c)},getLineEnd:function(c,e){return this._model.getLineEnd(c,e)},getLineStart:function(c){return this._model.getLineStart(c)},setText:function(c,e,g){this._model.setText(c,e,g)},getText:function(c,
e){return this._model.getText(c,e)},onChanging:function(c){return this.dispatchEvent(c)},onChanged:function(c){if(this._initing)this._initing=false;else this.updateMapper(c.start,c.removedCharCount,c.addedCharCount,c.removedLineCount,c.addedLineCount);return this.dispatchEvent(c)}};f.EventTarget.addMixin(b.prototype);return b}();return a});
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(d){var f=arguments;return d.replace(/\{([^\}]+)\}/g,function(a,b){return f[(b<<0)+1]})}},"pt-br":true});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget"],function(d,f,a){function b(c,e){this.editor=c;this.textView=c.getTextView();this.contentAssistPanel=document.getElementById(e);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 f.KeyBinding(" ",false,false,false,true):new f.KeyBinding(" ",true),d.contentAssist);this.textView.setAction(d.contentAssist,function(){this.showContentAssist(true);return true}.bind(this))},cancel:function(){this.showContentAssist(false)},
isActive:function(){return this.active},isIgnorable:function(c){var e=c.removedCharCount>0&&c.addedCharCount===0,g=this.textView;g=c.start+1<=g.getModel().getCharCount()&&/^\s*$/.test(g.getText(c.start,c.start+1));return c.removedLineCount>0||e&&g},lineUp:function(){if(this.contentAssistPanel){var c=this.getSelectedNode();c===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(c.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var c=
this.getSelectedNode();c===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(c.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var c=this.getSelectedProposal();if(c===null)return false;this.ignoreNextChange=true;this.cancel();this.dispatchEvent({type:"accept",data:{proposal:c,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()}});return true},
setSelected:function(c){for(var e=this.contentAssistPanel.childNodes,g=0;g<e.length;g++){var j=e[g];if(j.className==="selected")j.className="";if(j===c){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 c=this.getSelectedIndex();return c===-1?null:this.contentAssistPanel.childNodes[c]},
getSelectedIndex:function(){for(var c=this.contentAssistPanel.childNodes,e=0;e<c.length;e++)if(c[e].className==="selected")return e;return-1},getSelectedProposal:function(){var c=this.getSelectedIndex();return c===-1?null:this.proposals[c]},click:function(c){this.setSelected(c.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(c,e){if(this.contentAssistPanel){this.dispatchEvent({type:c?"show":"hide",data:null});if(c){var g=e?e.start+e.addedCharCount:this.textView.getCaretOffset();
c=g;for(var j;c>0&&(97<=(j=this.textView.getText(c-1,c).charCodeAt(0))&&j<=122||65<=j&&j<=90||j===95||48<=j&&j<=57);)c--;this.prefix=this.textView.getText(c,g);j=this.textView.getText();c=this.textView.getSelection();c.offset=g;this.getKeywords(this.prefix,j,c).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(c,e,g){var j=document.createElement("div");if(e)j.className="selected";c=document.createTextNode(c);j.appendChild(c,j);g.appendChild(j)},getDisplayString:function(c){if(typeof c==="string")return c;if(c.description&&typeof c.description===
"string")return c.description;return c.proposal},matchesPrefix:function(c){return typeof c==="string"&&c.substr(0,this.prefix.length)===this.prefix},getKeywords:function(c,e,g){function j(t){if(t)k=k.concat(t);++m===w.length&&o.done(k)}function i(){++m===w.length&&o.done(k)}for(var k=[],m=0,o=new this.Promise,w=this.filteredProviders,s=0;s<w.length;s++){var v=w[s],u=v.getKeywords;if(typeof v.computeProposals==="function")u=v.computeProposals;(v=u.apply(v,[c,e,g]))&&v.then?v.then(j,i):j(v)}return o},
Promise:function(){function c(){}c.prototype.then=function(e){this.callback=e;if(this.result){var g=this;setTimeout(function(){g.callback(g.result)},0)}};c.prototype.done=function(e){this.result=e;this.callback&&this.callback(this.result)};return c}(),setProviders:function(c){this.filteredProviders=c}};a.EventTarget.addMixin(b.prototype);return{ContentAssist:b}});
define("orion/textview/undoStack",[],function(){function d(b,c,e){this.offset=b;this.text=c;this.previousText=e}function f(){this.changes=[]}function a(b,c){this.view=b;this.size=c!==undefined?c:100;this.reset();c=b.getModel();if(c.getBaseModel)c=c.getBaseModel();this.model=c;var e=this;this._listener={onChanging:function(g){e._onChanging(g)},onDestroy:function(g){e._onDestroy(g)}};c.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Destroy",this._listener.onDestroy)}d.prototype=
{undo:function(b,c){this._doUndoRedo(this.offset,this.previousText,this.text,b,c)},redo:function(b,c){this._doUndoRedo(this.offset,this.text,this.previousText,b,c)},_doUndoRedo:function(b,c,e,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(c,b,b+e.length);j&&g.setSelection(b,
b+c.length)}};f.prototype={add:function(b){this.changes.push(b)},end:function(b){this.endSelection=b.getSelection();this.endCaret=b.getCaretOffset()},undo:function(b,c){for(var e=this.changes.length-1;e>=0;e--)this.changes[e].undo(b,false);if(c){c=this.startSelection.start;e=this.startSelection.end;b.setSelection(this.startCaret?c:e,this.startCaret?e:c)}},redo:function(b,c){for(var e=0;e<this.changes.length;e++)this.changes[e].redo(b,false);if(c){c=this.endSelection.start;e=this.endSelection.end;
b.setSelection(this.endCaret?c:e,this.endCaret?e:c)}},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,c=this.stack.length;this._undoStart!==undefined&&b++;return{undo:b,redo:c-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 f;this.add(b);this.compoundChange=b;this.compoundChange.start(this.view)},
_commitUndo:function(){if(this._undoStart!==undefined){this._undoType===-1?this.add(new d(this._undoStart,"",this._undoText)):this.add(new d(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 c=b.text,e=b.start,g=b.removedCharCount;b=b.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==
undefined&&!(b===1&&g===0&&this._undoType===1&&e===this._undoStart+this._undoText.length||b===0&&g===1&&this._undoType===-1&&(e+1===this._undoStart||e===this._undoStart)))this._commitUndo();if(!this.compoundChange)if(b===1&&g===0){if(this._undoStart===undefined)this._undoStart=e;this._undoText+=c;this._undoType=1;return}else if(b===0&&g===1){c=this._undoText.length>0&&this._undoStart===e;this._undoStart=e;this._undoType=-1;if(c)this._undoText+=this.model.getText(e,e+g);else this._undoText=this.model.getText(e,
e+g)+this._undoText;return}this.add(new d(e,c,this.model.getText(e,e+g)))}}};return{UndoStack:a}});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/extensionCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(d,f,a,b,c,e){var g={};g.EditorCommandFactory=function(){function j(i,k,m,o,w,s,v){this.serviceRegistry=i;this.commandService=k;this.fileClient=m;this.inputManager=o;this.toolbarId=w;this.pageNavId=v;this.isReadOnly=s}j.prototype={generateEditorCommands:function(i){function k(x){var B=new c.KeyBinding;c.KeyBinding.apply(B,x);return B}
if(!this.isReadOnly){i.getTextView().setKeyBinding(new c.KeyBinding("s",true),"Save");this.inputManager.onSave?i.getTextView().setAction("Save",d.hitch(this,function(){var x=i.getText();this.inputManager.onSave(this.inputManager.getInput(),x,d.hitch(this,function(){i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.hitch(this,function(B){B.log=true}));return true})):i.getTextView().setAction("Save",d.hitch(this,function(){var x=i.getText(),
B={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),x,B).then(d.hitch(this,function(D){this.inputManager.getFileMetadata().ETag=D.ETag;i.setInput(this.inputManager.getInput(),null,x,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),d.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(d.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 f.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 f.CommandKeyBinding("s",true));var m=new f.ParametersDescription([new f.CommandParameter("line","number","Line:")],false);this.commandService.addCommand(new f.Command({name:"Go to Line",tooltip:"Go to specified line number",id:"orion.gotoLine",parameters:m,callback:function(x){var B=i.getModel();if(x.parameters&&x.parameters.valueFor("line"))x=x.parameters.valueFor("line");else{x=B.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 f.CommandKeyBinding("l",true),new f.URLBinding("gotoLine","line"));i.getTextView().setKeyBinding(new c.KeyBinding("l",true),"gotoLine");i.getTextView().setAction("gotoLine",d.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,w=function(x,B,D){D.callback=d.hitch(i,function(h){i=h?h.items||this:this;var l=i.getSelection();h=i.getModel();var n=h.getText();B.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 f.Command(D)},
s=0;s<m.length;s++){for(var v=this.serviceRegistry.getService(m[s]),u={},t=m[s].getPropertyNames(),q=0;q<t.length;q++)u[t[q]]=m[s].getProperty(t[q]);u.forceSingleItem=true;v=w(u,v,b._createCommandOptions(u,m[s],this.serviceRegistry,false,function(){return o.getFileMetadata()}));this.commandService.addCommand(v,"dom");this.commandService.registerCommandContribution(v.id,s,this.toolbarId,"orion.editorActions.contributed");a.generateDomCommandsInBanner(this.commandService,i);if(u.key){t=i.getTextView();
t.setKeyBinding(k(u.key),v.id);t.setAction(v.id,v.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 e.UndoStack(i.getTextView(),200);i.getTextView().setKeyBinding(new c.KeyBinding("z",true),"Undo");i.getTextView().setAction("Undo",function(){k.undo();return true});this.commandService.addCommand(new f.Command({name:"Undo",id:"orion.undo",callback:function(o){o.items.getTextView().invokeAction("Undo")}}),
"dom");var m=navigator.platform.indexOf("Mac")!==-1?new c.KeyBinding("z",true,true):new c.KeyBinding("y",true);i.getTextView().setKeyBinding(m,"Redo");i.getTextView().setAction("Redo",function(){k.redo();return true});this.commandService.addCommand(new f.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 f.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(d){var f=arguments;return d.replace(/\{([^\}]+)\}/g,function(a,b){return f[(b<<0)+1]})}},"pt-br":true,"fr-fr":true});
define("orion/textview/textModel",["orion/textview/eventTarget"],function(d){function f(b,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(b);this.setLineDelimiter(c)}var a=window.navigator.platform.indexOf("Win")!==-1;f.prototype={getCharCount:function(){for(var b=0,c=0;c<this._text.length;c++)b+=this._text[c].length;return b},getLine:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return null;var g=this._lineOffsets[b];if(b+1<e){b=this.getText(g,this._lineOffsets[b+
1]);if(c)return b;c=b.length;for(var j;(j=b.charCodeAt(c-1))===10||j===13;)c--;return b.substring(0,c)}else return this.getText(g)},getLineAtOffset:function(b){var c=this.getCharCount();if(!(0<=b&&b<=c))return-1;var e=this.getLineCount();if(b===c)return e-1;var g,j,i=this._lastLineIndex;if(0<=i&&i<e){g=this._lineOffsets[i];j=i+1<e?this._lineOffsets[i+1]:c;if(g<=b&&b<j)return i}for(var k=e,m=-1;k-m>1;){i=Math.floor((k+m)/2);g=this._lineOffsets[i];j=i+1<e?this._lineOffsets[i+1]:c;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,c){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;if(b+1<e){e=this._lineOffsets[b+1];if(c)return e;b=this.getText(Math.max(this._lineOffsets[b],e-2),e);c=b.length;for(var g;(g=b.charCodeAt(c-1))===10||g===13;)c--;return e-(b.length-c)}else return this.getCharCount()},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;
return this._lineOffsets[b]},getText:function(b,c){if(b===undefined)b=0;if(c===undefined)c=this.getCharCount();if(b===c)return"";for(var e=0,g=0,j;g<this._text.length;){j=this._text[g].length;if(b<=e+j)break;e+=j;g++}for(var i=e,k=g;g<this._text.length;){j=this._text[g].length;if(c<=e+j)break;e+=j;g++}e=e;g=g;if(k===g)return this._text[k].substring(b-i,c-e);b=this._text[k].substring(b-i);c=this._text[g].substring(0,c-e);return b+this._text.slice(k+1,g).join("")+c},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,c,e){if(b===undefined)b="";if(c===undefined)c=0;if(e===undefined)e=this.getCharCount();if(!(c===e&&b==="")){for(var g=this.getLineAtOffset(c),j=this.getLineAtOffset(e),i=c,k=e-c,m=j-g,o=b.length,w=0,s=this.getLineCount(),v=0,u=0,t=0,q=[];;){if(v!==-1&&
v<=t)v=b.indexOf("\r",t);if(u!==-1&&u<=t)u=b.indexOf("\n",t);if(u===-1&&v===-1)break;t=v!==-1&&u!==-1?v+1===u?u+1:(v<u?v:u)+1:v!==-1?v+1:u+1;q.push(c+t);w++}this.onChanging({type:"Changing",text:b,start:i,removedCharCount:k,addedCharCount:o,removedLineCount:m,addedLineCount:w});if(q.length===0){v=this.getLineStart(g);j=j+1<s?this.getLineStart(j+1):this.getCharCount();if(c!==v){b=this.getText(v,c)+b;c=v}if(e!==j){b+=this.getText(e,j);e=j}}j=o-k;for(v=g+m+1;v<s;v++)this._lineOffsets[v]+=j;g=[g+1,m].concat(q);
Array.prototype.splice.apply(this._lineOffsets,g);for(j=q=0;j<this._text.length;){v=this._text[j].length;if(c<=q+v)break;q+=v;j++}s=q;for(g=j;j<this._text.length;){v=this._text[j].length;if(e<=q+v)break;q+=v;j++}q=q;j=j;v=this._text[j];c=this._text[g].substring(0,c-s);e=v.substring(e-q);g=[g,j-g+1];c&&g.push(c);b&&g.push(b);e&&g.push(e);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:w})}}};d.EventTarget.addMixin(f.prototype);return{TextModel:f}});
define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding","orion/textview/eventTarget"],function(d,f,a){function b(h,l,n,p){typeof h.addEventListener==="function"?h.addEventListener(l,n,p===true):h.attachEvent("on"+l,n)}function c(h,l,n,p){typeof h.removeEventListener==="function"?h.removeEventListener(l,n,p===true):h.detachEvent("on"+l,n)}function e(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,w=j.indexOf("Safari")!==-1&&!o,s=j.indexOf("WebKit")!==-1,v=j.indexOf("iPad")!==-1,u=navigator.platform.indexOf("Mac")!==-1,t=navigator.platform.indexOf("Win")!==-1,q=navigator.platform.indexOf("Linux")!==-1,x=typeof window.document.documentElement.addEventListener==="function",B=(!i||
i>=9)&&typeof window.document.createRange().getBoundingClientRect==="function",D=t?"\r\n":"\n";e.prototype={clone:function(){return new e(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(s)p.style.width=(524287).toString()+"px";for(var y=n.getLineCount(),A=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,A,z,n);E=this._getLineBoundingClientRect(E);h=Math.max(h,E.right-E.left);l+=E.bottom-E.top;G&&p.removeChild(G)}if(s)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(),A=this._viewDiv.getBoundingClientRect();switch(l){case "document":if(h.x!==undefined)h.x+=-p.x+A.left+r.left;if(h.y!==undefined)h.y+=-p.y+A.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-A.left-r.left;if(h.y!==undefined)h.y+=p.y-A.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(v)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 e(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 A=h[p];if(!this._compare(this["_"+p],A)){y=true;if(!n){var z=l[p].update;if(r&&z){if(z.call(this,A))n=true;continue}}this["_"+p]=this._clone(A)}}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 e(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 e(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(s||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(s||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(v){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(w&&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&&s)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"&&s)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),A=this._lastMouseButton===l;this._lastMouseX=h.clientX;this._lastMouseY=h.clientY;this._lastMouseTime=n;this._lastMouseButton=l;if(l===1){this._isMouseDown=true;if(A&&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(),A=this._getClientHeight();h=r.left+p.left;var z=r.top+p.top;y=r.left+p.left+y;p=r.top+p.top+A;r=this._model;A=r.getLineAtOffset(this._getSelection().getCaret());if(n<z&&A!==0)this._doAutoScroll("up",l,n-z);else if(n>p&&A!==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(w){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(w)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=v?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,A=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(A)>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,A);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),A=l._textArea;A.value=y;A.selectionStart=0;A.selectionEnd=y.length;if(!r.isEmpty()){y=l._touchDiv.getBoundingClientRect();r=l._getOffsetBounds(r.start);A.style.left=y.width/2+"px";A.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,A=this._columnX;if(A===-1||h.wholeLine||h.select&&i)A=this._getOffsetToX(h.wholeLine?l.getLineEnd(r+
1):p)+y;n.extend(this._getXToOffset(r+1,A-y));h.select||n.collapse();this._setSelection(n,true,true);this._columnX=A}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,A=this._columnX;if(A===-1||h.wholeLine||h.select&&i)A=this._getOffsetToX(h.wholeLine?l.getLineStart(r-1):p)+y;n.extend(this._getXToOffset(r-1,A-y));h.select||n.collapse();this._setSelection(n,true,true);this._columnX=A}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 A=this._getClientHeight(),z=this._getLineHeight(),E=Math.floor(A/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+A>h)p=h-A;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(),A=this._getLineHeight();y=Math.floor(y/A);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*A);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,A;switch(l){case "textStart":A=0;break;case "textEnd":A=p-h;break;case "pageDown":A=y+h;break;case "pageUp":A=y-h;break;case "centerLine":l=this._getSelection();A=n.getLineAtOffset(l.start);n=(n.getLineAtOffset(l.end)-A+1)*r;A=A*r-h/2+n/2;break}if(A!==
undefined){A=Math.min(Math.max(0,A),p-h);this._scrollView(0,A-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 A=l.createElement("SPAN");
A.style.fontWeight="bold";A.style.fontStyle="italic";A.appendChild(l.createTextNode(" "));n.appendChild(A);h.appendChild(n);l=n.getBoundingClientRect();p=p.getBoundingClientRect();r=r.getBoundingClientRect();y=y.getBoundingClientRect();var z=A.getBoundingClientRect();A=r.bottom-r.top;y=y.bottom-y.top;r=z.bottom-z.top;z=0;l=l.bottom-l.top;if(A>p.bottom-p.top)z=1;if(y>A)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,A=h.length;y<A;){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=f.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),
A=r.getLineStart(p),z={type:"LineStyle",textView:this,lineIndex:p,lineText:y,lineStart:A};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,A,{tabOffset:0,ranges:p});y=" ";if(!this._fullSelection&&i<9)y="\ufeff";if(s)y="\u200c";p.push({text:y,style:this._metrics.largestFontStyle,ignoreChars:1});
var E,G,M,H,N,L;z=y=0;var P,S;if(l){if(M=l.modelChangedEvent){if(M.removedLineCount===0&&M.addedLineCount===0){S=M.start-A;P=M.addedCharCount-M.removedCharCount}else S=-1;l.modelChangedEvent=undefined}M=l.firstChild}for(A=0;A<p.length;A++){E=p[A];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(S!==-1){H=y;if(H>=S)H-=P;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 A=0;A<h.length;A++){var z=h[A];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);A+1<h.length&&h[A+1].start-r===G&&this._compare(z.style,h[A+1].style);){z=h[A+1];G=Math.min(r+p,z.end)-r;A++}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 A=h.indexOf("\t",l);A!==-1&&A<n;){if(l<A){l={text:h.substring(l,A),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=A+1;A=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 A=this;b(y,"click",function(z){return A._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(A){y._handleRulerEvent(A)});b(r,"dblclick",function(A){y._handleRulerEvent(A)});b(r,"mousemove",function(A){y._handleRulerEvent(A)});b(r,"mouseover",function(A){y._handleRulerEvent(A)});b(r,"mouseout",function(A){y._handleRulerEvent(A)})}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(!s)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(A){}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(v){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(v)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(!v)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){c(h,"load",this._loadHandler,!!k);this._loadHandler=null}if(this._attrModifiedHandler){c(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){c(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,A=this._getLineNode(r);A||(A=y=this._createLine(p,null,n,r,l));var z=null;if(h<l.getLineEnd(r)){l=l.getLineStart(r);for(r=A.firstChild;r;){var E=r.firstChild,G=E.length;if(r.ignoreChars)G-=
r.ignoreChars;if(l+G>h){z=h-l;if(B){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){A=this._getLineBoundingClientRect(A);z={left:A.right,right:A.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,A=this._clipboardDiv;A.innerHTML="<pre contenteditable=''></pre>";A.firstChild.focus();var z=this,E=function(){var H=z._getTextFromElement(A);
A.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=A.childNodes.length>1||A.firstChild&&A.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,A=y.getLineAtOffset(h),z=y.getLine(A),E=y.getLineStart(A);A=y.getLineEnd(A);y=z.length;h=h-E;var G,M;if(n>0){if(h===y)return A;G=z.charCodeAt(h);M=p(G);n=!M&&!r(G);for(h++;h<y;){G=z.charCodeAt(h);
A=p(G);if(l==="wordend"){if(!A&&M)break}else if(A&&!M)break;G=!A&&!r(G);if(l==="wordend"){if(!G&&n)break}else if(G&&!n)break;n=G;M=A;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);A=p(G);if(l==="wordend"){if(A&&!M)break}else if(!A&&M)break;G=!A&&!r(G);if(l==="wordend"){if(G&&!n)break}else if(!G&&n)break;n=G;M=A;h--}}return E+h}return h+n},_getOffset_IE:function(h,l,n){var p=this._frameDocument,r=this._model,y=r.getLineAtOffset(h),A=this._clientDiv,
z,E=this._getLineNode(y);E||(E=z=this._createLine(A,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&&A.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(aa){var Z,ca,da,fa;if(!aa._rectsCache){Z=aa.getClientRects();ca=[Z.length];for(da=0;da<Z.length;da++){fa=Z[da];ca[da]={left:fa.left-M+L,top:fa.top,right:fa.right-M+L,bottom:fa.bottom}}aa._rectsCache=ca}Z=aa._rectsCache;ca=[Z.length];for(da=0;da<Z.length;da++){fa=Z[da];ca[da]={left:fa.left-L,top:fa.top,right:fa.right-L,bottom:fa.bottom}}return ca}var p=this._model,r=p.getLineStart(h),y=p.getLineEnd(h);
if(r===y)return r;var A=this._frameDocument,z=this._clientDiv,E,G=this._getLineNode(h);G||(G=E=this._createLine(z,null,A,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,P=i?window.screen.logicalXDPI:1,S=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||B){A=B?A.createRange():A.body.createTextRange();C=G;for(var J=-1;C-J>1;){var Q=Math.floor((C+J)/2);H=J+1;F=Q===G-1&&p.ignoreChars?N.length:Q+1;if(B){A.setStart(N,H);A.setEnd(N,F)}else{A.moveToElementText(p);A.move("character",H);A.moveEnd("character",F-H)}H=A.getClientRects();for(var T=false,U=0;U<H.length;U++){F=H[U];var W=F.right*P/S-M;if(F.left*P/S-M<=l&&l<W){T=true;break}}if(T)C=Q;else J=Q}h+=C;H=C;F=C===
G-1&&p.ignoreChars?N.length:Math.min(C+1,N.length);if(B){A.setStart(N,H);A.setEnd(N,F)}else{A.moveToElementText(p);A.move("character",H);A.moveEnd("character",F-H)}F=A.getClientRects()[0];l>F.left*P/S-M+(F.right-F.left)*P/S/2&&h++}else{H=[];for(P=0;P<G;P++){H.push("<span>");P===G-1?H.push(N.data.substring(P)):H.push(N.data.substring(P,P+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,A=v?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:A,type:"blur",handler:function(z){return h._handleBlur(z)}});r.push({target:A,type:"focus",handler:function(z){return h._handleFocus(z)}});r.push({target:n,
type:"scroll",handler:function(z){return h._handleScroll(z)}});if(v){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&&!t&&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 d.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 e(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,A=this._getSelection();if(A.end>l){if(A.end>l&&A.start<l+p)A.setCaret(l+n);else{A.start+=n-p;A.end+=n-p}this._setSelection(A,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 e(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 A=this;p=function(){y&&y.parentNode===A._clientDiv&&A._clientDiv.removeChild(y);A._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,A,z,E,G,M=0,H=h.firstChild,N,L,P=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>=P){A=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 S=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>=S){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,P,n,p,S);if(!v)if(r.getSelection){y=y.createRange();y.setStart(A,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(A.parentNode);y.moveStart("character",z);A=r.createTextRange();A.moveToElementText(E.parentNode);A.moveStart("character",G);y.setEndPoint("EndToStart",A);this._ignoreSelect=false;y.select();this._ignoreSelect=true}},_setDOMFullSelection:function(h,l,n,p,r,y){var A=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(A.getLineStart(h.lineIndex)+l).left;this._ignoreDOMSelection=false}if((n=this._textArea)&&v){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=v?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 P=H.bottom;N=H=0;if(this._clipDiv){N=this._clipDiv.getBoundingClientRect();
H=N.left-this._clipDiv.scrollLeft;N=N.top}var S=this._getLineBoundingClientRect(p);if(r===0)r=S.left;else if(r>=y)r=S.right;else{this._ignoreDOMSelection=true;r=this._getBoundsAtOffset(A.getLineStart(p.lineIndex)+r).left;this._ignoreDOMSelection=false}y=this._selDiv1;E=Math.min(n,Math.max(l,E));A=Math.min(P,Math.max(L,z.top));var C=n;z=Math.min(P,Math.max(L,z.bottom));y.style.left=E-H+"px";y.style.top=A-N+"px";y.style.width=Math.max(0,C-E)+"px";y.style.height=Math.max(0,z-A)+(v?1:0)+"px";if(v){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(v)y.style.borderRight=M}else{h=Math.min(P,Math.max(L,S.top));p=Math.min(n,Math.max(l,r));E=Math.min(P,Math.max(L,S.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(v)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)+(v?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,A=0,z,E;A<h.length;){if(A>=l.length)break;z=h[A];E=l[A];if(z!==E)if(this._isLinkURL(z))return true;else{y=p[A+1];y=y.ownerNode;E=n.createElement("STYLE");z=n.createTextNode(z);E.appendChild(z);r.replaceChild(E,y);y=true}A++}if(A<l.length)for(;A<l.length;){z=l[A];if(this._isLinkURL(z))return true;else{y=p[A+1];y=y.ownerNode;r.removeChild(y);y=true}A++}else for(;A<h.length;){z=h[A];if(this._isLinkURL(z))return true;else{E=n.createElement("STYLE");z=n.createTextNode(z);
E.appendChild(z);r.appendChild(E);y=true}A++}y&&this._updateStyle();return false},_setFullSelection:function(h,l){this._fullSelection=h;if(i<9)this._fullSelection=false;if(s)this._fullSelection=true;var n=this._clipDiv||this._scrollDiv;if(n)if(!v&&!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&&(v||this._fullSelection&&
!s)){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(),A=p.start,z=p.end,E=n.getLineAtOffset(A),G=n.getLineAtOffset(z),M=Math.max(Math.max(A,n.getLineStart(G)),
z-1),H=this._getViewPadding(),N=this._getClientWidth(),L=H.left;H=H.left+N;var P=this._getBoundsAtOffset(y===A?A:M),S=P.left,C=P.right,F=N/4;if(h&&!p.isEmpty()&&E===G){P=this._getBoundsAtOffset(y===z?A:M);if(N-F>(y===A?P.right-S:C-P.left)){if(S>P.left)S=P.left;if(C<P.right)C=P.right}}p=this._viewDiv.getBoundingClientRect();S-=p.left;C-=p.left;p=0;if(S<L)p=Math.min(S-L,-F);if(C>H)p=Math.min(this._scrollDiv.scrollWidth-r.x-N,Math.max(C-H,F));L=0;S=this._getTopIndex(true);C=this._getBottomIndex(true);
n=n.getLineAtOffset(y);H=this._getClientHeight();if(!(S<=n&&n<=C)){S=this._getLineHeight();h=h?(G-E)*S:0;L=n*S;L-=r.y;if(L+S>H){L-=H-S;if(y===A&&A!==z)L+=Math.min(H-S,h)}else if(y===z)L-=Math.min(H-S,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];c(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(),A;if(n<r.lineIndex){A=r;n=0}else if(n>y.lineIndex){A=y;n=0}else{A=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(A,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(),A=this._getLineHeight(),z=Math.max(0,p.y)/A,E=Math.floor(z),G=Math.max(0,E-1),M=Math.round((z-G)*A),H=this._partialY=Math.round((z-E)*A);z=y*A;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 P=this._frameDocument;p=this._getFrameWidth();L=this._getFrameHeight();P.body.style.width=
p+"px";P.body.style.height=L+"px";N=this._viewDiv;N.style.height=Math.max(0,L-r.top-r.bottom)+"px";L=this._getClientHeight();A=Math.floor((L+H)/A);A=Math.min(E+A,y-1);for(var S=Math.min(A+1,y-1),C=l.firstChild;C;){H=C.lineIndex;var F=C.nextSibling;if(!(G<=H&&H<=S)||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=P.createDocumentFragment();for(H=G;H<=S;H++)if(!C||C.lineIndex>H)this._createLine(F,null,
P,H,n);else{if(F.firstChild){l.insertBefore(F,C);F=P.createDocumentFragment()}if(C&&C.lineChanged){C=this._createLine(F,C,P,H,n);C.lineChanged=false}C=this._getLineNext(C)}F.firstChild&&l.insertBefore(F,C);if(s)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===
A)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,P,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,A);this._updateRuler(this._rightDiv,E,A);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;
A=this._clipDiv;y=this._overlayDiv;if(A){A.scrollLeft=H;G=n+r.left;P=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){P-=r.top;n+=r.top;C+=r.top}if(p.y+L===z)n+=r.bottom;A.style.left=G+"px";A.style.top=P+"px";A.style.width=h+"px";A.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;P=M;A=H+N;C=M+L;if(G===0)G-=r.left;if(P===0)P-=r.top;if(A===E)A+=r.right;if(p.y+L===z)C+=r.bottom;l.style.clip="rect("+P+"px,"+A+"px,"+C+"px,"+G+"px)";l.style.left=-H+n+r.left+"px";l.style.width=(s?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(v){var J=this;setTimeout(function(){J._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 A=r[y].firstChild,z=p;if(A._ruler.getOverview()==="page")z+=n;A.style.top=-z+"px";A.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(),A=0;A<h.length;A++){var z=h[A].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,P;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;P=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";P.appendChild(L)}else{if(P.firstChild){z.insertBefore(P,M);P=r.createDocumentFragment()}if(M)M=M.nextSibling}P.firstChild&&z.insertBefore(P,M)}else{M=v?0:17;N=this._getClientHeight();
H=this._model.getLineCount();G=N+y.top+y.bottom-2*M;var S;S=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);P=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*S)+"px";if(N.html)L.innerHTML=N.html;L.annotation=N;L.lineIndex=H;P.appendChild(L)}}z.appendChild(P)}else if(z._oldTrackHeight!==G)for(L=z.firstChild?
z.firstChild.nextSibling:null;L;){L.style.top=M+p+Math.floor(L.lineIndex*S)+"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(d,f){function a(b){this._model=b;this._projections=[]}a.prototype={addProjection:function(b){if(b){var c=this._model,e=this._projections;b._lineIndex=c.getLineAtOffset(b.start);b._lineCount=c.getLineAtOffset(b.end)-b._lineIndex;var g=b.text;g||(g="");b._model=typeof g==="string"?new d.TextModel(g,c.getLineDelimiter()):g;c=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:c,removedCharCount:g,addedCharCount:i,removedLineCount:j,addedLineCount:k});var m=this._binarySearch(e,b.start);e.splice(m,0,b);this.onChanged({type:"Changed",start:c,removedCharCount:g,addedCharCount:i,removedLineCount:j,addedLineCount:k})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(b,c){var e=this._projections,
g=0,j;if(c){for(c=0;c<e.length;c++){j=e[c];if(j.start>b)break;if(j.end>b)return-1;g+=j._model.getCharCount()-(j.end-j.start)}return b+g}for(c=0;c<e.length;c++){j=e[c];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 c,e=0;for(c=0;c<this._projections.length;c++){var g=this._projections[c];if(g===b){b=g;break}e+=g._model.getCharCount()-(g.end-g.start)}if(c<this._projections.length){g=this._model;e=b.start+
e;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:e,removedCharCount:k,addedCharCount:j,removedLineCount:m,addedLineCount:i});this._projections.splice(c,1);this.onChanged({type:"Changed",start:e,removedCharCount:k,addedCharCount:j,removedLineCount:m,addedLineCount:i})}},_binarySearch:function(b,c){for(var e=b.length,g=-1,j;e-g>1;){j=Math.floor((e+g)/2);if(c<=b[j].start)e=j;else g=j}return e},
getCharCount:function(){for(var b=this._model.getCharCount(),c=this._projections,e=0;e<c.length;e++){var g=c[e];b+=g._model.getCharCount()-(g.end-g.start)}return b},getLine:function(b,c){if(b<0)return null;var e=this._model,g=this._projections,j=0,i=[],k=0,m,o,w;for(m=0;m<g.length;m++){w=g[m];if(w._lineIndex>=b-j)break;o=w._model.getLineCount()-1;if(w._lineIndex+o>=b-j){k=b-(w._lineIndex+j);if(k<o)return w._model.getLine(k,c);else i.push(w._model.getLine(o))}k=w.end;j+=o-w._lineCount}for(k=Math.max(k,
e.getLineStart(b-j));m<g.length;m++){w=g[m];if(w._lineIndex>b-j)break;i.push(e.getText(k,w.start));o=w._model.getLineCount()-1;if(w._lineIndex+o>b-j){i.push(w._model.getLine(0,c));return i.join("")}i.push(w._model.getText());k=w.end;j+=o-w._lineCount}b=e.getLineEnd(b-j,c);k<b&&i.push(e.getText(k,b));return i.join("")},getLineAtOffset:function(b){for(var c=this._model,e=this._projections,g=0,j=0,i=0;i<e.length;i++){var k=e[i];if(k.start>b-g)break;var m=k._model.getCharCount();if(k.start+m>b-g){e=b-
(k.start+g);j+=k._model.getLineAtOffset(e);g+=e;break}j+=k._model.getLineCount()-1-k._lineCount;g+=m-(k.end-k.start)}return c.getLineAtOffset(b-g)+j},getLineCount:function(){for(var b=this._projections,c=this._model.getLineCount(),e=0;e<b.length;e++){var g=b[e];c+=g._model.getLineCount()-1-g._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){if(b<0)return-1;for(var e=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),c)+m.start+i;i+=m._model.getCharCount()-(m.end-m.start);j+=o-m._lineCount}return e.getLineEnd(b-j,c)+i},getLineStart:function(b){if(b<0)return-1;for(var c=this._model,e=this._projections,g=0,j=0,i=0;i<e.length;i++){var k=e[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 c.getLineStart(b-g)+j},getText:function(b,c){if(b===undefined)b=0;var e=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(c!==undefined&&m.start+o>c-j)return m._model.getText(b-(m.start+j),c-(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(c!==undefined){for(;k<g.length;k++){m=g[k];if(m.start>c-j)break;
i.push(e.getText(b,m.start));o=m._model.getCharCount();if(m.start+o>c-j){i.push(m._model.getText(0,c-(m.start+j)));return i.join("")}i.push(m._model.getText());b=m.end;j+=o-(m.end-m.start)}i.push(e.getText(b,c-j))}else{for(;k<g.length;k++){m=g[k];i.push(e.getText(b,m.start));i.push(m._model.getText());b=m.end}i.push(e.getText(b))}return i.join("")},_onChanging:function(b,c,e,g,j,i){for(var k=this._model,m=this._projections,o,w=0,s,v=c+e;o<m.length;o++){e=m[o];if(e.start>c)break;w+=e._model.getCharCount()-
(e.end-e.start)}c=c+w;for(var u=o;o<m.length;o++){e=m[o];if(e.start>v)break;w+=e._model.getCharCount()-(e.end-e.start);s+=e._model.getLineCount()-1-e._lineCount}e=v+w;w=o;this.onChanging(c,e-c,g,j+s,i);m.splice(m,w-u);for(b=b.length-(e-c);o<m.length;o++){e=m[o];e.start+=b;e.end+=b;e._lineIndex=k.getLineAtOffset(e.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,
c,e){if(b===undefined)b="";if(c===undefined)c=0;var g=c,j=e,i=this._model,k=this._projections,m=0,o=0,w,s,v,u,t,q=0;for(w=0;w<k.length;w++){s=k[w];if(s.start>c-m)break;v=s._model.getCharCount();if(s.start+v>c-m)if(e!==undefined&&s.start+v>e-m){s._model.setText(b,c-(s.start+m),e-(s.start+m));return}else{q=s._model.getLineCount()-1-s._model.getLineAtOffset(c-(s.start+m));u={projection:s,start:c-(s.start+m)};c=s.end+m+v-(s.end-s.start)}o+=s._model.getLineCount()-1-s._lineCount;m+=v-(s.end-s.start)}c=
c-m;var x=w;q=i.getLineAtOffset(c)+o-q;if(e!==undefined)for(;w<k.length;w++){s=k[w];if(s.start>e-m)break;v=s._model.getCharCount();if(s.start+v>e-m){o+=s._model.getLineAtOffset(e-(s.start+m));v=e-(s.start+m);e=s.end+m;t={projection:s,end:v};break}o+=s._model.getLineCount()-1-s._lineCount;m+=v-(s.end-s.start)}else{for(;w<k.length;w++){s=k[w];o+=s._model.getLineCount()-1-s._lineCount;m+=s._model.getCharCount()-(s.end-s.start)}e=j=i.getCharCount()+m}e=e-m;w=w;s=i.getLineAtOffset(e)+o;j=j-g;o=s-q;q=b.length;
for(var B=v=s=m=0;;){if(s!==-1&&s<=B)s=b.indexOf("\r",B);if(v!==-1&&v<=B)v=b.indexOf("\n",B);if(v===-1&&s===-1)break;B=s!==-1&&v!==-1?s+1===v?v+1:(s<v?s:v)+1:s!==-1?s+1:v+1;m++}this.onChanging({type:"Changing",text:b,start:g,removedCharCount:j,addedCharCount:q,removedLineCount:o,addedLineCount:m});i.setText(b,c,e);if(u){s=u.projection;s._model.setText("",u.start)}if(t){s=t.projection;s._model.setText("",0,t.end);s.start=s.end;s._lineCount=0}k.splice(x,w-x);b=b.length-(e-c);for(w=w;w<k.length;w++){s=
k[w];s.start+=b;s.end+=b;s._lineIndex=i.getLineAtOffset(s.start)}this.onChanged({type:"Changed",start:g,removedCharCount:j,addedCharCount:q,removedLineCount:o,addedLineCount:m})}};f.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(d,f,a,b){function c(e){this._view=e;this._create(e._parent.ownerDocument);e.addEventListener("Destroy",this,this.destroy)}c.getTooltip=function(e){if(!e._tooltip)e._tooltip=new c(e);return e._tooltip};c.prototype={_create:function(e){if(!this._domNode){this._document=e;var g=this._domNode=e.createElement("DIV");g.className="viewTooltip";
var j=this._viewParent=e.createElement("DIV");g.appendChild(j);j=this._htmlParent=e.createElement("DIV");g.appendChild(j);e.body.appendChild(g);this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var e=this._domNode.parentNode;e&&e.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(e){if(this.target!==e){this._target=e;this.hide();if(e){var g=this;g._showTimeout=setTimeout(function(){g.show(true)},1E3)}}},show:function(e){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 f.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(w){m.onLineStyle(w)}}.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(e){var o=this;o._hideTimeout=setTimeout(function(){var w=parseFloat(o._getNodeStyle(j,"opacity","1"));o._fadeTimeout=
setInterval(function(){if(j.style.visibility==="visible"&&w>0){w-=0.1;j.style.opacity=w}else o.hide()},50)},5E3)}}}},_getAnnotationContents:function(e){function g(w,s){w=i.getLineStart(i.getLineAtOffset(w));s=i.getLineEnd(i.getLineAtOffset(s),true);return i.getText(w,s)}if(e.length===0)return null;var j=this._view.getModel(),i=j.getBaseModel?j.getBaseModel():j,k;if(e.length===1){j=e[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{e=new b.ProjectionTextModel(i);k=i.getLineStart(i.getLineAtOffset(j.start));e.addProjection({start:j.end,end:e.getCharCount()});e.addProjection({start:0,end:k});return e}}else{for(var m="<div><em>"+d.multipleAnnotations+"</em></div>",o=0;o<e.length;o++){j=e[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(e,g,j){var i;if(e){i=e.style[g];
if(!i)if(e.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=e.currentStyle[g]}else i=(e=e.ownerDocument.defaultView.getComputedStyle(e,null))?e.getPropertyValue(g):null}return i||j}};return{Tooltip:c}});
define("orion/editor/editor",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget","orion/textview/tooltip"],function(d,f,a,b){function c(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 e;c.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 e.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 w;if(g){w=k.getLineStart(o);o=k.getLineEnd(o);if(k.getBaseModel){w=k.mapOffset(w);o=k.mapOffset(o)}this._currentLineAnnotation={start:w,end:o,type:this.currentLineType,title:d.currentLine,html:"<div class='annotationHTML currentLine'></div>",overviewStyle:{styleClass:"annotationOverview currentLine"},lineStyle:{styleClass:"annotationLine currentLine"}};
w=[this._currentLineAnnotation]}i.replaceAnnotations(m,w)}}},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 f.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(),w=this.getAnnotationModel(),
s=g.mapOffset(o.getLineStart(m));m=g.mapOffset(o.getLineEnd(m));for(m=w.getAnnotations(s,m);m.hasNext();){w=m.next();if(this.isAnnotationTypeVisible(w.type)){m=g.getModel();g.onGotoLine(m.getLineAtOffset(s),w.start-s,w.end-s);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(d.formatMessage(d.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()),w;o.hasNext();){w=o.next();if(w.type===this.errorType||w.type===this.warningType)i.push(w)}if(g)for(o=0;o<g.length;o++)if(w=g[o]){var s=w.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),v=m.getLineStart(w.line-1),u=w.severity;w={type:this[u+"Type"],start:v+w.start-1,end:v+w.end,title:s,html:"<div class='annotationHTML "+u+"'></div>",style:{styleClass:"annotation "+u},overviewStyle:{styleClass:"annotationOverview "+
u},rangeStyle:{styleClass:"annotationRange "+u}};k.push(w)}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(c.prototype);e={Animation:function(){function g(j){this.options=j}g.prototype.play=function(){function j(){t=t===-1?(new Date).getTime():t;var q=((new Date).getTime()-t)/i;if(q<1){q=k(q);v=w+q*s;m(v)}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(){},w=this.options.curve[0],s=this.options.curve[1]-w,v,u,t=-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=e.bind;return{Editor:c,util:e}});
define("orion/textview/annotations",["orion/textview/eventTarget"],function(d){function f(e,g,j,i,k,m,o,w){this.type=g;this.start=j;this.end=i;this._projectionModel=e;this._expandedHTML=this.html=k;this._expandedStyle=this.style=m;this._collapsedHTML=o;this._collapsedStyle=w;this.expanded=true}function a(){}function b(e){this._annotations=[];var g=this;this._listener={onChanged:function(j){g._onChanged(j)}};this.setTextModel(e)}function c(e,g){this._view=e;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)}};e.addEventListener("Destroy",this._listener.onDestroy);e.addEventListener("LineStyle",this._listener.onLineStyle);g.addEventListener("Changed",this._listener.onChanged)}f.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var e=this._projectionModel,g=e.getBaseModel();this._projection=
{start:g.getLineStart(g.getLineAtOffset(this.start)+1),end:g.getLineEnd(g.getLineAtOffset(this.end),true)};e.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(e){var g=a.prototype;for(var j in g)if(g.hasOwnProperty(j))e[j]=g[j]};a.prototype={addAnnotationType:function(e){if(!this._annotationTypes)this._annotationTypes=[];
this._annotationTypes.push(e)},getAnnotationTypePriority:function(e){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===e)return g+1;return 0},getAnnotationsByType:function(e,g,j){e=e.getAnnotations(g,j);for(j=[];e.hasNext();){g=e.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(e){return this.getAnnotationTypePriority(e)!==
0},removeAnnotationType:function(e){if(this._annotationTypes)for(var g=0;g<this._annotationTypes.length;g++)if(this._annotationTypes[g]===e){this._annotationTypes.splice(g,1);break}}};b.prototype={addAnnotation:function(e){if(e){var g=this._annotations,j=this._binarySearch(g,e.start);g.splice(j,0,e);this.onChanged({type:"Changed",added:[e],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(e,g){var j=this._annotations,i,k=0,m=function(){for(;k<j.length;){var o=
j[k++];if(e===o.start||(e>o.start?e<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(e){if(e)this._getAnnotationIndex(e)<0||this.onChanged({type:"Changed",added:[],removed:[],changed:[e]})},onChanged:function(e){return this.dispatchEvent(e)},removeAnnotations:function(e){var g=this._annotations,j,i;if(e){j=[];for(i=g.length-1;i>=0;i--){var k=g[i];k.type===e&&g.splice(i,
1);j.splice(0,0,k)}}else j=g;this.onChanged({type:"Changed",removed:j,added:[],changed:[]})},removeAnnotation:function(e){if(e){e=this._getAnnotationIndex(e);e<0||this.onChanged({type:"Changed",removed:this._annotations.splice(e,1),added:[],changed:[]})}},replaceAnnotations:function(e,g){var j=this._annotations,i,k,m,o=[];if(e)for(i=e.length-1;i>=0;i--){m=e[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(e){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=e)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(e,g){for(var j=e.length,i=-1,k;j-i>1;){k=Math.floor((j+i)/2);if(g<=e[k].start)j=k;else i=k}return j},_getAnnotationIndex:function(e){for(var g=this._annotations,j=this._binarySearch(g,e.start);j<g.length&&g[j].start===
e.start;){if(g[j]===e)return j;j++}return-1},_onChanged:function(e){var g=e.start,j=e.removedCharCount,i=this._annotations,k=g+j;if(0<i.length){var m={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:e};e=e.addedCharCount-j;for(j=0;j<i.length;j++){var o=i[j];if(o.start>=k){o.start+=e;o.end+=e;m.changed.push(o)}else if(!(o.end<=g))if(o.start<g&&k<o.end){o.end+=e;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)}}};d.EventTarget.addMixin(b.prototype);c.prototype={destroy:function(){var e=this._view;if(e){e.removeEventListener("Destroy",this._listener.onDestroy);e.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}(e=this._annotationModel)&&e.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(e,g){if(g){e||(e={});if(e.styleClass&&g.styleClass&&e.styleClass!==g.styleClass)e.styleClass+=" "+g.styleClass;else e.styleClass=g.styleClass;var j;
if(g.style){if(!e.style)e.style={};for(j in g.style)e.style[j]||(e.style[j]=g.style[j])}if(g.attributes){if(!e.attributes)e.attributes={};for(j in g.attributes)e.attributes[j]||(e.attributes[j]=g.attributes[j])}}return e},_mergeStyleRanges:function(e,g){if(e)for(var j=0;j<e.length;j++){var i=e[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)e[j]={start:i.start,end:i.end,style:k};else if(g.start>i.start&&
g.end<i.end){e.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){e.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){e.splice(j,1,{start:i.start,end:g.end,style:k},{start:g.end,end:i.end,style:i.style});j+=1}}}},_onAnnotationModelChanged:function(e){function g(m){for(var o=0;o<m.length;o++)if(i.isAnnotationTypeVisible(m[o].type)){var w=
m[o].start,s=m[o].end;if(k.getBaseModel){w=k.mapOffset(w,true);s=k.mapOffset(s,true)}w!==-1&&s!==-1&&j.redrawRange(w,s)}}if(!e.textModelChangedEvent){var j=this._view;if(j){var i=this,k=j.getModel();g(e.added);g(e.removed);g(e.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(e){var g=this._annotationModel,j=this._view.getModel(),i=g.getTextModel(),k=e.lineStart,m=e.lineStart+e.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(e.ranges,{start:m,end:o,style:k.rangeStyle})}if(k.lineStyle){e.style=this._mergeStyle({},e.style);e.style=this._mergeStyle(e.style,k.lineStyle)}}}}};a.addMixin(c.prototype);return{FoldingAnnotation:f,AnnotationTypeList:a,AnnotationModel:b,AnnotationStyler:c}});
define("orion/textview/rulers",["i18n!orion/textview/nls/messages","orion/textview/annotations","orion/textview/tooltip"],function(d,f,a){function b(i,k,m,o){this._location=k||"left";this._overview=m||"page";this._rulerStyle=o;this._view=null;var w=this;this._listener={onTextModelChanged:function(s){w._onTextModelChanged(s)},onAnnotationModelChanged:function(s){w._onAnnotationModelChanged(s)}};this.setAnnotationModel(i)}function c(i,k,m,o,w){b.call(this,i,k,"page",m);this._oddStyle=o||{style:{backgroundColor:"white"}};
this._evenStyle=w||{style:{backgroundColor:"white"}};this._numOfDigits=0}function e(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){e.call(this,i,k,m)}b.prototype={getAnnotations:function(i,k){var m=this._annotationModel;if(!m)return[];var o=this._view.getModel(),w=o.getLineStart(i),s=o.getLineEnd(k-1),v=o;if(o.getBaseModel){v=o.getBaseModel();w=o.mapOffset(w);s=o.mapOffset(s)}var u=[];m=this.getAnnotationsByType(m,w,s);for(w=0;w<m.length;w++){s=
m[w];for(var t=v.getLineAtOffset(s.start),q=v.getLineAtOffset(Math.max(s.start,s.end-1)),x=t;x<=q;x++){var B=x;if(o!==v){B=v.getLineStart(x);B=o.mapOffset(B,true);if(B===-1)continue;B=o.getLineAtOffset(B)}if(i<=B&&B<k){var D=this._mergeAnnotation(u[B],s,x-t,q-t+1);if(D)u[B]=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(),w=this._annotationModel,s=[];if(w){s=o.getLineStart(i);var v=o.getLineEnd(i);if(o.getBaseModel){s=o.mapOffset(s);v=o.mapOffset(v)}s=this.getAnnotationsByType(w,s,v)}w=this._getTooltipContents(i,s);if(!w)return null;w={contents:w,anchor:this.getLocation()};s=m.getClientArea();
s.y=this.getOverview()==="document"?m.convert({y:k},"view","document").y:m.getLocationAtOffset(o.getLineStart(i)).y;m.convert(s,"document","page");w.x=s.x;w.y=s.y;if(w.anchor==="right")w.x+=s.width;w.maxWidth=s.width;w.maxHeight=s.height-(s.y-m._parent.getBoundingClientRect().top);return w}},_getTooltipContents:function(i,k){return k},_onAnnotationModelChanged:function(i){function k(v){for(var u=0;u<v.length;u++)if(w.isAnnotationTypeVisible(v[u].type)){var t=v[u].start,q=v[u].end;if(o.getBaseModel){t=
o.mapOffset(t,true);q=o.mapOffset(q,true)}t!==-1&&q!==-1&&m.redrawLines(o.getLineAtOffset(t),o.getLineAtOffset(Math.max(t,q-1))+1,w)}}var m=this._view;if(m){var o=m.getModel(),w=this,s=o.getLineCount();if(i.textModelChangedEvent){i=i.textModelChangedEvent.start;if(o.getBaseModel)i=o.mapOffset(i,true);i=o.getLineAtOffset(i);m.redrawLines(i,s,w)}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}};
f.AnnotationTypeList.addMixin(b.prototype);c.prototype=new b;c.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 w=i&1?this._oddStyle:this._evenStyle,s=i;if(o.getBaseModel){s=o.getLineStart(s);s=o.getBaseModel().getLineAtOffset(o.mapOffset(s))}m[i]||(m[i]={});m[i].html=s+1+"";if(!m[i].style)m[i].style=w}return m};c.prototype.getWidestAnnotation=function(){var i=this._view.getModel().getLineCount();return this.getAnnotations(i-
1,i)[i-1]};c.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)}};e.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 d.formatMessage(d.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 e;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 w;for(k=k.getAnnotations(o,i);!w&&k.hasNext();){i=k.next();if(this.isAnnotationTypeVisible(i.type))w=i}if(w&&m.getLineAtOffset(w.start)===m.getLineAtOffset(o)){(m=a.Tooltip.getTooltip(this._view))&&m.setTarget(null);w.expanded?w.collapse():w.expand();this._annotationModel.modifyAnnotation(w)}}}};
j.prototype._getTooltipContents=function(i,k){if(k.length===1)if(k[0].expanded)return null;return e.prototype._getTooltipContents.call(this,i,k)};j.prototype._onAnnotationModelChanged=function(i){function k(t){for(s=0;s<t.length;s++)if(w.isAnnotationTypeVisible(t[s].type)){var q=t[s].start;if(o.getBaseModel)q=o.mapOffset(q,true);if(q!==-1)u=Math.min(u,o.getLineAtOffset(q))}}if(i.textModelChangedEvent)e.prototype._onAnnotationModelChanged.call(this,i);else{var m=this._view;if(m){var o=m.getModel(),
w=this,s,v=o.getLineCount(),u=v;k(i.added);k(i.removed);k(i.changed);i=m.getRulers();for(s=0;s<i.length;s++)m.redrawLines(u,v,i[s])}}};return{Ruler:b,AnnotationRuler:e,LineNumberRuler:c,OverviewRuler:g,FoldingRuler:j}});
define("orion/textview/textDND",[],function(){function d(f,a){this._view=f;this._undoStack=a;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(c){b._onDragStart(c)},onDragEnd:function(c){b._onDragEnd(c)},onDragEnter:function(c){b._onDragEnter(c)},onDragOver:function(c){b._onDragOver(c)},onDrop:function(c){b._onDrop(c)},onDestroy:function(c){b._onDestroy(c)}};f.addEventListener("DragStart",this._listener.onDragStart);f.addEventListener("DragEnd",
this._listener.onDragEnd);f.addEventListener("DragEnter",this._listener.onDragEnter);f.addEventListener("DragOver",this._listener.onDragOver);f.addEventListener("Drop",this._listener.onDrop);f.addEventListener("Destroy",this._listener.onDestroy)}d.prototype={destroy:function(){var f=this._view;if(f){f.removeEventListener("DragStart",this._listener.onDragStart);f.removeEventListener("DragEnd",this._listener.onDragEnd);f.removeEventListener("DragEnter",this._listener.onDragEnter);f.removeEventListener("DragOver",
this._listener.onDragOver);f.removeEventListener("Drop",this._listener.onDrop);f.removeEventListener("Destroy",this._listener.onDestroy);this._view=null}},_onDestroy:function(){this.destroy()},_onDragStart:function(f){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;f.event.dataTransfer.effectAllowed="copyMove";f.event.dataTransfer.setData("Text",a)}},
_onDragEnd:function(f){var a=this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(f=f.event.dataTransfer.dropEffect==="move")&&a.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,c=this._dropOffset;if(f)if(c>=this._dragSelection.end)c-=this._dragSelection.end-this._dragSelection.start;else if(c>=this._dragSelection.start)c=this._dragSelection.start;a.setText(b,c,c);a.setSelection(c,c+b.length);this._dropText=
null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(f){this._onDragOver(f)},_onDragOver:function(f){var a=f.event.dataTransfer.types;if(a)if(!(a.contains?a.contains("text/plain"):a.indexOf("text/plain")!==-1))f.event.dataTransfer.dropEffect="none"},_onDrop:function(f){var a=this._view,b=f.event.dataTransfer.getData("Text");if(b){f=a.getOffsetAtLocation(f.x,f.y);if(this._dragSelection){this._dropOffset=f;this._dropText=b}else{a.setText(b,
f,f);a.setSelection(f,f+b.length)}}}};return{TextDND:d}});
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(d,f,a,b,c,e,g){function j(){}function i(){}function k(){}function m(){}function o(){}function w(u,t,q){this.editor=u;this.textView=u.getTextView();this.undoStack=t;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 s(u,t,q,x){this.editor=u;this.textView=u.getTextView();this.undoStack=t;this.contentAssist=q;this.linkedMode=x;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}function v(u){this.editor=u;this.textView=u.getTextView();this.linkedModeActive=false;this.linkedModePositions=
[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(t){for(var q=false,x=0,B=0;B<this.linkedModePositions.length;++B){var D=this.linkedModePositions[B];if(q)D.offset+=x;else if(t.start>=D.offset&&t.end<=D.offset+D.length){q=D.length;D.length=t.start-D.offset+t.text.length+(D.offset+D.length-t.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 t=new f.UndoStack(u,200);u.setKeyBinding(new a.KeyBinding("z",true),"Undo");u.setAction("Undo",function(){t.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(){t.redo();return true});return t}};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 c.AnnotationModel(u)},createAnnotationStyler:function(u,t){return new c.AnnotationStyler(u,t)},createAnnotationRulers:function(u){var t=new b.AnnotationRuler(u,"left",{styleClass:"ruler annotations"});u=new b.OverviewRuler(u,"right",{styleClass:"ruler overview"});return{annotationRuler:t,overviewRuler:u}}};o.prototype={createTextDND:function(u,
t){return new e.TextDND(u.getTextView(),t)}};w.prototype={init:function(){var u=this;this._incrementalFindListener={onVerify:function(q){var x=u.editor,B=x.getModel(),D=x.mapOffset(q.start),h=x.mapOffset(q.end);D=B.getText(D,h);B=u._incrementalFindPrefix;if((B=B.match(new RegExp("^"+g.escape(D),"i")))&&B.length>0){B=u._incrementalFindPrefix+=q.text;u.editor.reportStatus(d.formatMessage(d.incrementalFind,B));D=B.toLowerCase()===B;h=x.getSelection().start;if(D=x.doFind(B,h,D)){u._incrementalFindSuccess=
true;u._incrementalFindIgnoreSelection=true;x.moveSelection(D.index,D.index+D.length);u._incrementalFindIgnoreSelection=false}else{x.reportStatus(d.formatMessage(d.incrementalFindNotFound,B),"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),d.find);this.textView.setAction(d.find,function(){if(this._searcher){var q=this.editor,x=q.getSelection(),B="";if(x.end>x.start)B=q.getModel().getText(x.start,x.end);this._searcher.buildToolBar(B);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",true),d.findNext);this.textView.setAction(d.findNext,function(){if(this._searcher){this._searcher.findNext(true);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",
true,true),d.findPrevious);this.textView.setAction(d.findPrevious,function(){if(this._searcher){this._searcher.findNext(false);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("j",true),d.incrementalFindKey);this.textView.setAction(d.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 B;if(this._searcher)B=this._searcher.findNext(true,
x);else{B=0;if(this._incrementalFindSuccess)B=q.getSelection().start+1;var D=x.toLowerCase()===x;B=q.doFind(x,B,D)}if(B){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.moveSelection(B.index,B.index+B.length);this._incrementalFindIgnoreSelection=false;q.reportStatus(d.formatMessage(d.incrementalFind,x))}else{q.reportStatus(d.formatMessage(d.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(d.formatMessage(d.incrementalFind,x));var B=q.getCaretOffset();B=q.getModel().getText().lastIndexOf(x,
B-x.length-1);if(B!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;q.moveSelection(B,B+x.length);this._incrementalFindIgnoreSelection=false}else q.reportStatus(d.formatMessage(d.incrementalFindNotFound,x),"error");return true}return false}.bind(this));this.textView.setAction("tab",function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start),h=x.getLineAtOffset(B.end>B.start?B.end-1:B.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===B.start?B.start:B.start+p.length,B.end+(h-D+1)*p.length);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),d.unindentLines);this.textView.setAction(d.unindentLines,function(){for(var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start),
h=x.getLineAtOffset(B.end>B.start?B.end-1:B.end),l=this.textView.getOptions("tabSize"),n=(new Array(l+1)).join(" "),p=[],r=0,y=0,A=D;A<=h;A++){var z=x.getLine(A,true);if(x.getLineStart(A)!==x.getLineEnd(A))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(A===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===B.start?B.start:B.start-y,B.end-r+(B.end===x+1?1:0));return true}.bind(this));
this.textView.setKeyBinding(new a.KeyBinding(38,false,false,true),d.moveLinesUp);this.textView.setAction(d.moveLinesUp,function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start);if(D===0)return true;var h=x.getLineAtOffset(B.end>B.start?B.end-1:B.end),l=x.getLineCount();B=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,B,B);q.setSelection(B,B+r.length-y);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,false,false,true),d.moveLinesDown);this.textView.setAction(d.moveLinesDown,function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start),h=x.getLineAtOffset(B.end>B.start?B.end-1:B.end),l=x.getLineCount();if(h===l-1)return true;D=x.getLineStart(D);B=x.getLineEnd(h,true);var n=x.getLineEnd(h+1,true)-(B-D),p=0;if(h!==l-2)x=x.getText(D,
B);else{h=x.getLineEnd(h);x=x.getText(h,B)+x.getText(D,h);p+=B-h}this.startUndo();q.setText("",D,B);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),d.copyLinesUp);this.textView.setAction(d.copyLinesUp,function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start);B=x.getLineAtOffset(B.end>B.start?B.end-1:B.end);D=x.getLineStart(D);var h=x.getLineEnd(B,true),l=x.getLineCount(),
n="";h=x.getText(D,h);if(B===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),d.copyLinesDown);this.textView.setAction(d.copyLinesDown,function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start);B=x.getLineAtOffset(B.end>B.start?B.end-1:B.end);var h=x.getLineStart(D);D=x.getLineEnd(B,true);var l=x.getLineCount(),n="";h=x.getText(h,D);if(B===
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),d.deleteLines);this.textView.setAction(d.deleteLines,function(){var q=this.editor,x=q.getSelection(),B=q.getModel(),D=B.getLineAtOffset(x.start);x=B.getLineAtOffset(x.end>x.start?x.end-1:x.end);D=B.getLineStart(D);B=B.getLineEnd(x,true);q.setText("",D,B);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("l",
true),d.gotoLine);this.textView.setAction(d.gotoLine,function(){var q=this.editor,x=q.getModel().getLineAtOffset(q.getCaretOffset());if(x=prompt(d.gotoLinePrompty,x+1)){x=parseInt(x,10);q.onGotoLine(x-1,0)}return true}.bind(this));var t=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding("q",!t,false,false,t),d.lastEdit);this.textView.setAction(d.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(d.formatMessage(d.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 t=this.editor,q=t.getModel(),x;x=this._incrementalFindSuccess?t.getCaretOffset()-u.length-1:q.getCharCount()-1;q=q.getText().lastIndexOf(u,x);if(q!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;t.moveSelection(q,q+u.length);this._incrementalFindIgnoreSelection=false;t.reportStatus(d.formatMessage(d.incrementalFind,u))}else{t.reportStatus(d.formatMessage(d.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 t=this.editor,q=t.getModel(),x=0;if(this._incrementalFindSuccess)x=t.getSelection().start+1;q=q.getText().indexOf(u,x);if(q!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;t.moveSelection(q,q+u.length);this._incrementalFindIgnoreSelection=false;t.reportStatus(d.formatMessage(d.incrementalFind,u))}else{t.reportStatus(d.formatMessage(d.incrementalFindNotFound,
u),"error");this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};s.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function u(q,x,B){var D=q.getLineAtOffset(x),h=q.getLineAtOffset(B),l,n,p,r,y,A;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?B-q.getLineStart(h):0;r=n.indexOf("/*",p);n=n.indexOf("*/",p);if(r!==-1&&r<n)break;else if(n!==-1){A=q.getLineStart(l)+n;break}}return{commentStart:y,commentEnd:A}}this.textView.setKeyBinding(new a.KeyBinding(191,true),d.toggleLineComment);this.textView.setAction(d.toggleLineComment,function(){for(var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getLineAtOffset(B.start),h=x.getLineAtOffset(B.end>B.start?
B.end-1:B.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 A;for(A=0;A<r;A++){l=p.charCodeAt(A);if(!(l===32||l===9))break}l=A===r}}y=x.getLineStart(D);A=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===B.start?B.start:B.start-2;B=B.end-2*(h-D+1)+(B.end===p+1?2:0)}else{n.splice(0,0,"");n=n.join("//");x=y===B.start?B.start:
B.start+2;B=B.end+2*(h-D+1)}q.setText(n,y,A);q.setSelection(x,B);return true}.bind(this));var t=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding(191,true,!t,false,t),d.addBlockComment);this.textView.setAction(d.addBlockComment,function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=new RegExp("/\\*|\\*/","g"),h=u(x,B.start,B.end);if(h.commentStart!==undefined&&h.commentEnd!==undefined)return true;x=x.getText(B.start,B.end);if(x.length===0)return true;h=
x.length;x=x.replace(D,"");D=x.length;q.setText("/*"+x+"*/",B.start,B.end);q.setSelection(B.start+2,B.end+2+(D-h));return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(220,true,!t,false,t),d.removeBlockComment);this.textView.setAction(d.removeBlockComment,function(){var q=this.editor,x=q.getModel(),B=q.getSelection(),D=x.getText(B.start,B.end),h,l,n;for(n=0;n<D.length;n++)if(D.substring(n,n+2)==="/*"){h=B.start+n;break}for(;n<D.length;n++)if(D.substring(n,n+2)==="*/"){l=B.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,B.start,B.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(B.start-2,B.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(u){var t=u.data.proposal,q;if(typeof t==="string")q=t;else if(typeof t.proposal==="string")q=t.proposal;this.textView.setText(q,u.data.start,
u.data.end);if(t.positions&&this.linkedMode){u=[];for(q=0;q<t.positions.length;++q)u[q]={positions:[{offset:t.positions[q].offset,length:t.positions[q].length}]};this.linkedMode.enterLinkedMode({groups:u,escapePosition:t.escapePosition})}else t.escapePosition&&this.textView.setCaretOffset(t.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,t=u.getSelection();if(t.start===t.end){var q=u.getModel(),x=q.getLineAtOffset(t.start),B=q.getLine(x,true),D=q.getLineStart(x);x=0;D=t.start-D;for(var h;x<D&&((h=B.charCodeAt(x))===32||h===9);)x++;if(x>0){var l=B.substring(0,x);for(x=D;x<B.length&&((h=B.charCodeAt(x++))===32||h===9);)t.end++;u.setText(q.getLineDelimiter()+l,t.start,t.end);return true}}return false}};v.prototype={enterLinkedMode:function(u){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=
[];for(var t=0;t<u.groups.length;++t){var q=u.groups[t];this.linkedModePositions[t]={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(d.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(d.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:w,SourceCodeActions:s,LinkedMode:v}});
define("orion/breadcrumbs",["require","dojo","orion/util"],function(d,f,a){function b(c){this._init(c)}b.prototype={_init:function(c){var e=c.container;if(typeof e==="string")e=f.byId(e);if(!e)throw"no parent container";this._container=e;f.removeClass(e,"currentLocation");this._id=c.id||"eclipse.breadcrumbs";this._resource=c.resource||null;this._firstSegmentName=c.firstSegmentName;this._makeHref=c.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var c;
if(this._resource&&this._resource.Parents){c=document.createElement("a");if(this._makeHref)this._makeHref(c,"");else c.href=d.toUrl("navigate/table.html")+"#"}else c=document.createElement("span");f.place(document.createTextNode(this._firstSegmentName),c,"only");return c}return null},render:function(){var c=this._container,e=f.byId(this._id);if(e)f.empty(e);else{e=document.createElement("span");e.id=this._id;c.appendChild(e)}var g;if(g=this.getNavigatorRootSegment()){f.addClass(g,"breadcrumb");e.appendChild(g);
if(this._resource&&this._resource.Parents){g=document.createElement("span");f.place(document.createTextNode(" >> "),g,"only");this.path+="/";f.addClass(g,"breadcrumb");e.appendChild(g)}else{g.href="";f.removeClass(g,"breadcrumb");f.addClass(g,"currentLocation");a.forceLayout(c);return}}if(this._resource){if(this._resource.Parents)for(var j=this._resource.Parents,i=j.length;--i>=0;){g=document.createElement("a");f.addClass(g,"breadcrumb");f.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=d.toUrl("navigate/table.html")+"#"+j[i].ChildrenLocation;e.appendChild(g);g=document.createElement("span");f.place(document.createTextNode(" >> "),g,"only");this.path+="/";f.addClass(g,"breadcrumb");e.appendChild(g)}g=document.createElement("span");f.place("<br>"+this._resource.Name,g,"only");f.addClass(g,"currentLocation");this.path+=this._resource.Name;e.appendChild(g)}if(e.childNodes.length===0){g=document.createElement("a");
f.place(document.createTextNode(document.title),g,"only");f.addClass(g,"breadcrumb");f.addClass(g,"currentLocation");e.appendChild(g)}a.forceLayout(c)}};b.prototype.constructor=b;return{BreadCrumbs:b}});
define("orion/compare/gap-model",["orion/textview/eventTarget"],function(d){var f=f||{};f.GapTextModel=function(){function a(b,c,e){this._model=b;this._myIndex=(this._isOriginal=c===undefined?true:c)?1:0;this._reverseIndex=1-this._myIndex;this._map=e;var g=this;this._listener={onChanging:function(j){g.onChanging(j)},onChanged:function(j){g.onChanged(j)}};b.addEventListener("Changing",this._listener.onChanging);b.addEventListener("Changed",this._listener.onChanged);this._init()}navigator.platform.indexOf("Win");
a.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var b=this._gapNumber=0,c=0;c<this._map.length;c++){if(this._map[c][this._myIndex]<this._map[c][this._reverseIndex]){var e=this._map[c][this._reverseIndex]-this._map[c][this._myIndex];this._gapNumber+=e;this._gapBlocks.push([b+this._map[c][this._myIndex],e])}b+=Math.max(this._map[c][this._reverseIndex],this._map[c][this._myIndex])}},lookUpRealIndex:function(b){for(var c=0,e=0;e<this._gapBlocks.length;e++){var g=
this._gapBlocks[e][0],j=this._gapBlocks[e][0]+this._gapBlocks[e][1]-1;if(b<g)break;if(b>=g&&b<=j)return{lineIndex:-1,gapsBefore:c+b-g};c+=this._gapBlocks[e][1]}return{lineIndex:b-c,gapsBefore:c}},getLineType:function(b){for(var c=0,e=0;e<this._map.length;e++){var g=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex]);if(b>=c&&b<c+g){if(this._map[e][2]===0)return"unchnaged";else if(this._map[e][2]<0)return"removed";else if(this._map[e][1]===0)return"added";else if(b<this._map[e][this._myIndex]+
c)return"changed";return"changed_gap"}c+=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex])}return"unchnaged"},getCharCount:function(){var b=this._model.getCharCount();b+=this._gapNumber*this.getLineDelimiter().length;return b},getLine:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return null;b=this.lookUpRealIndex(b);if(b.lineIndex<0){if(c)return this.getLineDelimiter();return""}else return this._model.getLine(b.lineIndex,c)},getLineAtOffset:function(b){if(!(0<=b&&b<=
this.getCharCount()))return-1;for(var c=this.getLineCount(),e=0,g=0;e<c;){var j=this.lookUpRealIndex(e);g+=j.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(j.lineIndex,true).length;e++;if(g>b)break}return e-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(b,c){var e=this.getLineCount();if(!(0<=b&&b<e))return-1;var g=this.lookUpRealIndex(b);e=g.gapsBefore*this.getLineDelimiter().length;
if(g.lineIndex<0){b=b-g.gapsBefore;if(b>0)e+=this._model.getLineEnd(b-1,true);if(c)e+=this.getLineDelimiter().length}else e+=this._model.getLineEnd(g.lineIndex,c);return e},getLineStart:function(b){if(!(0<=b&&b<this.getLineCount()))return-1;var c=this.lookUpRealIndex(b),e=0,g=-1;if(c.lineIndex<0){e=c.gapsBefore;if(b-e>=0)g=b-e-1}else{e=c.gapsBefore;g=c.lineIndex}b=0;b+=this.getLineDelimiter().length*e;if(g>=0)b+=c.lineIndex<0?this._model.getLineEnd(g,true):this._model.getLineStart(g);return b},getText:function(b,
c){return this._model.getText(b,c)},onChanging:function(b){return this.dispatchEvent(b)},onChanged:function(b){return this.dispatchEvent(b)},setLineDelimiter:function(b){this._model.setLineDelimiter(b)},setText:function(b,c,e){this._model.setText(b,c,e)}};d.EventTarget.addMixin(a.prototype);return a}();return f});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(d,f){function a(e,g,j){var i=new d.Deferred;e[g].apply(e,j).then(function(k){i.callback(k)},function(k){k.status===401||k.status===403?f.handleAuthenticationError(k,function(){e[g].apply(e,j).then(function(m){i.callback(m)},function(m){i.errback(m)})}):i.errback(k)});return i}function b(e){if(e.indexOf("://")===-1){var g=document.createElement("a");g.href=e;return g.href}return e}function c(e,g){var j=e.getServiceReferences("orion.core.diff"),
i=j;if(g){i=[];for(var k=0;k<j.length;++k)g(j[k])&&i.push(j[k])}var m=[],o=[];for(k=0;k<i.length;++k){m[k]=new RegExp(i[k].getProperty("pattern")||".*");o[k]=e.getService(i[k])}this._getService=function(w){w=b(w);for(var s=0;s<m.length;++s)if(m[s].test(w))return o[s];throw"No Matching DiffService for location:"+w;}}c.prototype={getDiffContent:function(e){return a(this._getService(e),"getDiffContent",arguments)},getDiffFileURI:function(e){return a(this._getService(e),"getDiffFileURI",arguments)}};
return{DiffProvider:c}});
var JsDiff=function(){function d(i){return{newPos:i.newPos,components:i.components.slice(0)}}function f(i){for(var k=[],m=0;m<i.length;m++)i[m]&&k.push(i[m]);return k}function a(i){i=i;i=i.replace(/&/g,"&amp;");i=i.replace(/</g,"&lt;");i=i.replace(/>/g,"&gt;");return i=i.replace(/"/g,"&quot;")}var b=function(i){this.ignoreWhitespace=i};b.prototype={diff:function(i,k){if(k==i)return[{value:k}];if(!k)return[{value:i,removed:true}];if(!i)return[{value:k,added:true}];k=this.tokenize(k);i=this.tokenize(i);
var m=k.length,o=i.length,w=m+o,s=[{newPos:-1,components:[]}],v=this.extractCommon(s[0],k,i,0);if(s[0].newPos+1>=m&&v+1>=o)return s[0].components;for(var u=1;u<=w;u++)for(var t=-1*u;t<=u;t+=2){var q;q=s[t-1];var x=s[t+1];v=(x?x.newPos:0)-t;if(q)s[t-1]=undefined;var B=q&&q.newPos+1<m,D=x&&0<=v&&v<o;if(!B&&!D)s[t]=undefined;else{if(!B||D&&q.newPos<x.newPos){q=d(x);this.pushComponent(q.components,i[v],undefined,true)}else{q=d(q);q.newPos++;this.pushComponent(q.components,k[q.newPos],true,undefined)}v=
this.extractCommon(q,k,i,t);if(q.newPos+1>=m&&v+1>=o)return q.components;else s[t]=q}}},pushComponent:function(i,k,m,o){var w=i[i.length-1];if(w&&w.added===m&&w.removed===o)i[i.length-1]={value:this.join(w.value,k),added:m,removed:o};else i.push({value:k,added:m,removed:o})},extractCommon:function(i,k,m,o){var w=k.length,s=m.length,v=i.newPos;for(o=v-o;v+1<w&&o+1<s&&this.equals(k[v+1],m[o+1]);){v++;o++;this.pushComponent(i.components,k[v],undefined,undefined)}i.newPos=v;return o},equals:function(i,
k){var m=/\S/;return this.ignoreWhitespace&&!m.test(i)&&!m.test(k)?true:i==k},join:function(i,k){return i+k},tokenize:function(i){return i}};var c=new b,e=new b(true);e.tokenize=function(i){return f(i.split(/(\s+|\b)/))};var g=new b(true);g.tokenize=function(i){return f(i.split(/([{}:;,]|\s+)/))};var j=new b;j.tokenize=function(i){return i.split(/^/m)};return{diffChars:function(i,k){return c.diff(i,k)},diffWords:function(i,k){return e.diff(i,k)},diffLines:function(i,k){return j.diff(i,k)},diffCss:function(i,
k){return g.diff(i,k)},createPatch:function(i,k,m,o,w){var s=[];s.push("Index: "+i);s.push("===================================================================");s.push("--- "+i+"\t"+o);s.push("+++ "+i+"\t"+w);i=j.diff(k,m);i.push({value:"",lines:[]});m=k=0;o=[];for(var v=w=1,u=0;u<i.length;u++){var t=i[u],q=t.lines||t.value.replace(/\n$/,"").split("\n");t.lines=q;if(t.added||t.removed){if(!k){var x=i[u-1];k=w;m=v;if(x){o.push.apply(o,x.lines.slice(-4).map(function(B){return" "+B}));k-=4;m-=4}}o.push.apply(o,
q.map(function(B){return(t.added?"+":"-")+B}));if(t.added)v+=q.length;else w+=q.length}else{if(k)if(q.length<=8&&u<i.length-1)o.push.apply(o,q.map(function(B){return" "+B}));else{x=Math.min(q.length,4);s.push("@@ -"+k+","+(w-k+x)+" +"+m+","+(v-m+x)+" @@");s.push.apply(s,o);s.push.apply(s,q.slice(0,x).map(function(B){return" "+B}));m=k=0;o=[]}w+=q.length;v+=q.length}}i.length>1&&!/\n$/.test(i[i.length-2].value)&&s.push("\\ No newline at end of file\n");return s.join("\n")},convertChangesToXML:function(i){for(var k=
[],m=0;m<i.length;m++){var o=i[m];if(o.added)k.push("<ins>");else o.removed&&k.push("<del>");k.push(a(o.value));if(o.added)k.push("</ins>");else o.removed&&k.push("</del>")}return k.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",["require","exports","module"],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(d){var f=f||{};f.JSDiffAdapter=function(){function a(){}a.prototype={adapt:function(b,c){var e=b.split("\n"),g=c.split("\n"),j=e[e.length-1]==="";g=g[g.length-1]==="";var i=d.diffLines(b,c);b=[];c=[];linesRemoved=linesAdded=0;changeIndex=-1;for(var k=0,m=true,o=0;o<i.length;o++){var w=i[o];lines=w.lines||w.value.split("\n");var s=lines.length,v=0;lines.length>1&&lines[lines.length-1]===""&&s--;if(s>1&&!m)if(lines[0]===""){s--;v++}w.lines=
lines;if(!w.added&&!w.removed){if(linesAdded||linesRemoved){b.push([linesAdded,linesRemoved,changeIndex]);linesRemoved=linesAdded=0;changeIndex=-1;k+=linesRemoved}b.push([s,s,0]);k+=s}else if(w.added){if(changeIndex===-1)changeIndex=c.length+1;linesAdded+=s;for(m=v;m<s+v;m++)c.push(w.lines[m])}else linesRemoved+=s;m=false;if(lines.length>1&&lines[lines.length-1]==="")m=true}if(linesAdded||linesRemoved){b.push([linesAdded,linesRemoved,changeIndex]);k+=linesRemoved}if(k<e.length&&e.length>1){e=b[b.length-
1];if(e[2]===0){e[0]+=1;e[1]+=1}else if(e[2]===-1)b.push([1,1,0]);else if(j===g)b.push([1,1,0]);else{if(g)e[0]+=1;if(j)e[1]+=1}}return{mapper:b,changContents:{array:c,index:0}}}};return a}();return f});
define("examples/textview/textStyler",["i18n!orion/textview/nls/messages","orion/textview/annotations"],function(d,f){function a(h,l){this.keywords=h;this.whitespacesVisible=l;this.setText("")}function b(){a.call(this,null,true)}function c(h){a.call(this,null,h)}function e(){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 e;this._commentScanner=new c(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"},w={styleClass:"token_doc_comment"},s={styleClass:"token_doc_html_markup"},v={styleClass:"token_task_tag"},u={styleClass:"token_doc_tag"},t={styleClass:"token_string"},q={styleClass:"token_keyword"},x={styleClass:"token_space"},B={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}}};c.prototype=new a(null);c.prototype.setType=function(h){this._type=h};c.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}}};e.prototype=new a(null);e.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 w.styleClass;
case "docHtmlComment":return s.styleClass;case "tasktag":return v.styleClass;case "doctag":return u.styleClass;case "string":return t.styleClass;case "keyword":return q.styleClass;case "space":return x.styleClass;case "tab":return B.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 A=r[y];(A=this._createFoldingAnnotation(h,p,A.start,A.end))&&n.push(A)}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 f.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 A=p.getAnnotations(l,n);for(r=[];A.hasNext();){var z=A.next();z.type==="orion.annotation.task"&&r.push(z)}A=[];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);
A.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,A)}}},_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,A=this.comments,z=this._binarySearch(A,n,true);z<A.length;z++){if(A[z].start>=p)break;var E=A[z].start,G=A[z].end;y<E&&this._parse(l.substring(y-n,E-n),y,r);var M=A[z].type===6?w: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,A[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,t);continue}else y=t;break;case 6:this._parseComment(p.getData(),r,n,w,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=
B;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 A=p;switch(h){case 8:if(this.whitespacesVisible)A=B;break;case 9:if(this.whitespacesVisible)A=x;break;case 10:A=s;break;case 11:A=u;break;case 12:A=v;break;default:if(this.detectHyperlinks)A=this._detectHyperlinks(y.getData(),r,n,A)}A&&n.push({start:r,end:y.getOffset()+
l,style:A})}},_parseString:function(h,l,n,p){var r=this._whitespaceScanner;for(r.setText(h);h=r.nextToken();){var y=r.getStartOffset()+l,A=p;switch(h){case 8:if(this.whitespacesVisible)A=B;break;case 9:if(this.whitespacesVisible)A=x;break}A&&n.push({start:y,end:r.getOffset()+l,style:A})}},_detectHyperlinks:function(h,l,n,p){var r=null,y;if((y=h.indexOf("://"))>0){r=h;for(var A=y;A>0;){y=r.charCodeAt(A-1);if(!(97<=y&&y<=122||65<=y&&y<=90||45===y||48<=y&&y<=57))break;A--}if(A>0){y="\"\"''(){}[]<>".indexOf(r.substring(A-
1,A));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(A,z)};n.push({start:l,end:l+A,style:p});n.push({start:l+A,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 A=h.getLineAtOffset(l);n=h.getLine(A);var z=h.getLineStart(A),E=h.getLineEnd(A);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(A-=1;A>=0;){n=h.getLine(A);z=h.getLineStart(A);E=h.getLineEnd(A);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}A--}}else{for(E++;E<n.length;E++){z=
n[E]>=0?1:-1;l+=z;if(l===0)return n[E]*z}A+=1;for(r=h.getLineCount();A<r;){n=h.getLine(A);z=h.getLineStart(A);E=h.getLineEnd(A);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}A++}}break}}return-1},_findBrackets:function(h,l,n,p,r,y){var A=[];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)A.push(E.getStartOffset()+z-r+p);else G===l&&A.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)A.push(E.getStartOffset()+z-r+p);else G===l&&A.push(-(E.getStartOffset()+z-r+p));return A},_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 A=n.start===n.end;l=l.start===l.end;if(!(y===r&&l&&A)){l&&p.redrawLines(y,y+1);if((y!==r||!l)&&A)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:d.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:d.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 A=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&&A-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=A}var N;A=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!==A.length;if(!L)for(z=0;z<A.length;z++){N=this.comments[G+z];var P=A[z];if(N.start!==P.start||N.end!==P.end||N.type!==P.type){L=true;break}}z=[G,M-G].concat(A);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<A.length;z++)if(N.start===A[z].start&&N.end===A[z].end)break;if(z===A.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<A.length;z++){N=A[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(d){function f(b,c,e){this.initialize(b);this.grammar=this.copy(c);this.externalGrammars=e?this.copy(e):[];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 c(k,
m){throw new Error('Unsupported regex feature "'+k+'": "'+m[0]+'" at index: '+m.index+" in "+m.input);}function e(k){for(var m="",o=false,w=k.length,s=0;s<w;){var v=k[s];if(!o&&v==="#")for(;s<w&&v!=="\r"&&v!=="\n";)v=k[++s];else if(!o&&/\s/.test(v))for(;s<w&&/\s/.test(v);)v=k[++s];else{if(v==="\\"){m+=v;if(!/\s/.test(k[s+1])){m+=k[s+1];s+=1}}else{if(v==="[")o=true;else if(v==="]")o=false;m+=v}s+=1}}return m}var g="",j;b=a.processGlobalFlag("x",b,function(k){return e(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))c(this.unsupported[j].func(i),i)}return new RegExp(b,g)},processGlobalFlag:function(b,c,e){function g(i,k){var m=0,o=i.length,w=-1;for(k=k;k<o&&w===-1;k++)switch(i[k]){case "\\":k++;break;case "(":m++;break;case ")":m--;if(m===0)w=k;break}return w}var j="(?"+b+")";b="(?"+b+":";if(c.substring(0,j.length)===j)return e(c.substring(j.length));else if(c.substring(0,b.length)===b){j=g(c,0);
if(j<c.length-1)throw new Error("Only a "+b+") group that encloses the entire regex is supported in: "+c);return e(c.substring(b.length,j))}return c},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,c,e){e=typeof e==="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=c[k[1]]||"";g.push(e?d.escape(i):i)}else g.push(i)}return new RegExp(g.join(""))},groupify:function(b,c){var e=b.source,
g=e.length,j=[],i=0,k=[],m=1,o=1,w=[];b={};for(var s={},v=0;v<g;v++){var u=j[j.length-1],t=e[v];switch(t){case "(":if(u===4){j.pop();w.push(")");k[k.length-1].end=v}var q=v+2<g?e[v+1]+""+e[v+2]:null;if(q==="?:"||q==="?="||q==="?!"){var x;if(q==="?:")x=1;else{x=3;i++}j.push(x);k.push({start:v,end:-1,type:x});w.push(t);w.push(q);v+=q.length}else{j.push(2);k.push({start:v,end:-1,type:2,oldNum:m,num:o});w.push(t);if(i===0)s[o]=null;b[m]=o;m++;o++}break;case ")":u=j.pop();u===3&&i--;k[k.length-1].end=
v;w.push(t);break;case "*":case "+":case "?":case "}":var B=t,D=e[v-1];q=v-1;if(t==="}"){for(x=v-1;e[x]!=="{"&&x>=0;x--);D=e[x-1];q=x-1;B=e.substring(x,v+1)}x=k[k.length-1];if(D===")"&&(x.type===2||x.type===4)){w.splice(x.start,0,"(");w.push(B);w.push(")");t={start:x.start,end:w.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(t);o++;break}default:if(t!=="|"&&u!==
2&&u!==4)if(i===0){j.push(4);k.push({start:v,end:-1,type:4,num:o});w.push("(");s[o]=null;o++}w.push(t);if(t==="\\"){w.push(e[v+1]);v+=1}break}}for(;j.length;){j.pop();w.push(")")}e=new RegExp(w.join(""));g={};c=c||b;for(var h in c)if(c.hasOwnProperty(h))g[h]="\\"+c[h];e=this.getSubstitutedRegex(e,g,false);return[e,b,s]},complexCaptures:function(b){if(!b)return false;for(var c in b)if(b.hasOwnProperty(c))if(c!=="0")return true;return false}};f.prototype={initialize:function(b){this.textView=b;var c=
this;this._listener={onModelChanged:function(e){c.onModelChanged(e)},onDestroy:function(e){c.onDestroy(e)},onLineStyle:function(e){c.onLineStyle(e)}};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 c=b.pop();if(!(c._resolvedRule&&c._typedRule)){c._resolvedRule=this._resolve(c);c._typedRule=this._createTypedRule(c);this.addStyles(c.name);this.addStyles(c.contentName);this.addStylesForCaptures(c.captures);this.addStylesForCaptures(c.beginCaptures);
this.addStylesForCaptures(c.endCaptures);c._resolvedRule!==c&&b.push(c._resolvedRule);if(c.patterns)for(var e=0;e<c.patterns.length;e++)b.push(c.patterns[e])}}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var c=b.split("."),e=0;e<c.length;e++)this._styles[b].push(c.slice(0,e+1).join("-"))}},addStylesForCaptures:function(b){for(var c in b)b.hasOwnProperty(c)&&this.addStyles(b[c].name)},ContainerRule:function(){function b(c){this.rule=c;this.subrules=c.patterns}b.prototype.valueOf=
function(){return"aa"};return b}(),BeginEndRule:function(){function b(c){this.rule=c;this.beginRegex=a.toRegExp(c.begin);this.endRegex=a.toRegExp(c.end);this.subrules=c.patterns||[];this.endRegexHasBackRef=a.hasBackReference(this.endRegex);var e=a.complexCaptures(c.captures);c=a.complexCaptures(c.beginCaptures)||a.complexCaptures(c.endCaptures);if(this.isComplex=e||c){e=a.groupify(this.beginRegex);this.beginRegex=e[0];this.beginOld2New=e[1];this.beginConsuming=e[2];e=a.groupify(this.endRegex,this.beginOld2New);
this.endRegex=e[0];this.endOld2New=e[1];this.endConsuming=e[2]}}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(c){this.rule=c;this.matchRegex=a.toRegExp(c.match);if(this.isComplex=a.complexCaptures(c.captures)){c=a.groupify(this.matchRegex);this.matchRegex=c[0];this.matchOld2New=c[1];this.matchConsuming=c[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 c=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]==="#"){c=this.grammar.repository&&this.grammar.repository[b.substring(1)];if(!c)throw new Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")c=this.grammar;else if(b==="$base")throw new Error('Include "$base" is not supported');else{c=this._allGrammars[b];
if(!c)for(var e=0;e<this.externalGrammars.length;e++){var g=this.externalGrammars[e];if(g.scopeName===b){this.preprocess(g);c=this._allGrammars[b]=g;break}}}}return c},ContainerNode:function(){function b(c,e){this.parent=c;this.rule=e;this.children=[];this.end=this.start=null}b.prototype.addChild=function(c){this.children.push(c)};b.prototype.valueOf=function(){var c=this.rule;return"ContainerNode { "+(c.include||"")+" "+(c.name||"")+(c.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(c,
e,g){this.parent=c;this.rule=e;this.children=[];this.setStart(g);this.endMatch=this.end=null;this.endRegexSubstituted=e.endRegexHasBackRef?a.getSubstitutedRegex(e.endRegex,g):null}b.prototype.addChild=function(c){this.children.push(c)};b.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};b.prototype.setStart=function(c){this.start=c.index;this.beginMatch=c};b.prototype.setEnd=function(c){if(c&&typeof c==="object"){this.endMatch=c;this.end=c.index+c[0].length}else{this.endMatch=
null;this.end=c}};b.prototype.shiftStart=function(c){this.start+=c;this.beginMatch.index+=c};b.prototype.shiftEnd=function(c){this.end+=c;if(this.endMatch)this.endMatch.index+=c};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return b}(),push:function(b,c){if(c)for(var e=c.length;e>0;)b.push(c[--e])},exec:function(b,c,e){if(c=b.exec(c))c.index+=e;b.lastIndex=0;return c},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,
c,e){if(b instanceof this.BeginEndNode){var g=b.rule;b=b.endRegexSubstituted||g.endRegex;if(!b)return null;return this.exec(b,c,e)}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 c=b.addedCharCount,e=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;c=i?this.parse(i,true,g,b,c,e):j;this.textView.redrawRange(g,c)}else this.initialParse()},getFirstDamaged:function(b,c){if(b<0)return this._tree;for(var e=[this._tree],g=null;e.length;){var j=e.pop();if(!j.parent||this.isDamaged(j,b,c)){if(j instanceof this.BeginEndNode)g=j;for(var i=0;i<j.children.length;i++)e.push(j.children[i])}}return g||this._tree},isDamaged:function(b,c,e){return b.start<=e&&b.end>c},parse:function(b,c,e,g,j,i){var k=this.textView.getModel(),m=k.getLineStart(k.getLineCount()-
1),o=k.getCharCount(),w=this.getInitialExpected(b,e),s=-1;if(c){b.repaired=true;b.endNeedsUpdate=true;s=b.children[b.children.length-1];var v=j-i;s=s?k.getLineEnd(k.getLineAtOffset(s.end+v)):-1;g=k.getLineEnd(k.getLineAtOffset(g+i));s=Math.max(s,g)}s=s===-1?o:s;g=w;var u=b;v=false;for(var t=e,q=-1;u&&(!c||t<s);){var x=this.getNextMatch(k,u,t);x||(t=t>=m?o:k.getLineStart(k.getLineAtOffset(t)+1));var B=x&&x.match,D=x&&x.rule,h=x&&x.isEnd;if(x&&x.isSub){t=this.afterMatch(B);if(D instanceof this.BeginEndRule){v=
true;if(c&&D===g.rule&&u===g.parent){u=g;u.setStart(B);u.repaired=true;u.endNeedsUpdate=true;u=u;g=this.getNextExpected(g,"begin")}else{if(c){this.prune(u,g);c=false}B=new this.BeginEndNode(u,D,B);u.addChild(B);u=B}}}else if(h||t===o){if(u instanceof this.BeginEndNode)if(B){v=true;q=Math.max(q,u.end);u.setEnd(B);t=this.afterMatch(B);if(c&&u===g&&u.parent===g.parent){u.repaired=true;delete u.endNeedsUpdate;g=this.getNextExpected(g,"end")}else if(c){this.prune(u,g);c=false}}else{u.setEnd(o);delete u.endNeedsUpdate}u=
u.parent}if(c&&t>=s&&!v){this.prune(b,w);c=false}}this.removeUnrepairedChildren(b,c,e);this.cleanup(c,b,e,s,o,j,i);return c?Math.max(q,t):t},removeUnrepairedChildren:function(b,c,e){if(c){c=b.children;for(var g=-1,j=0;j<c.length;j++){var i=c[j];if(!i.repaired&&this.isDamaged(i,e,Number.MAX_VALUE)){g=j;break}}if(g!==-1)b.children.length=g}},cleanup:function(b,c,e,g,j,i,k){if(b){b=i-k;j=this.getIntersecting(g-b+1,j);c=this.getIntersecting(e,g);for(e=0;e<j.length;e++){g=j[e];if(!g.repaired&&g instanceof
this.BeginEndNode){g.shiftEnd(b);g.shiftStart(b)}}for(e=0;e<c.length;e++){g=c[e];g.repaired&&g.endNeedsUpdate&&g.shiftEnd(b);delete g.endNeedsUpdate;delete g.repaired}}else{c=this.getIntersecting(e,g);for(e=0;e<c.length;e++)delete c[e].repaired}},getNextMatch:function(b,c,e,g){var j=b.getLineAtOffset(e);j=b.getLineEnd(j);var i=b.getText(e,j),k=[],m=[];b=[];j=[];for(this.push(k,c.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 w=o&&this.exec(o.matchRegex||o.beginRegex,i,e);if(w){b.push(w);j.push(o)}}}k=Number.MAX_VALUE;m=-1;for(o=0;o<b.length;o++){w=b[o];if(w.index<k){k=w.index;m=o}}if(!g)if(e=this.getEndMatch(c,i,e)){g=c.rule.applyEndPatternLast;if(m===-1||e.index<k||!g&&e.index===k)return{isEnd:true,rule:c.rule,match:e}}return m===-1?null:{isSub:true,rule:j[m],match:b[m]}},getInitialExpected:function(b,c){var e,g;if(b===this._tree)for(e=
0;e<b.children.length;e++){g=b.children[e];if(g.start>=c)return g}else if(b instanceof this.BeginEndNode)if(b.endMatch){var j=b.endMatch.index;for(e=0;e<b.children.length;e++){g=b.children[e];if(g.start>=c)break}if(g&&g.start<j)return g}return b},getNextExpected:function(b,c){if(c==="begin")return(c=b.children[0])?c:b;else if(c==="end")if(c=b.parent)return(b=c.children[c.children.indexOf(b)+1])?b:c;return null},prune:function(b,c){if(c.parent===b)b.children.length=c.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 c(k,m){return k.start-m.start}this._tree||this.initialParse();var e=b.lineStart,g=this.textView.getModel(),j=g.getLineEnd(b.lineIndex),i=g.getLineEnd(g.getLineAtOffset(e)-1);i=this.getFirstDamaged(i,i);e=this.getLineScope(g,i,e,j);b.ranges=this.toStyleRanges(e);b.ranges.sort(c)},getLineScope:function(b,c,e,g){for(var j=e,i=this.getInitialExpected(c,e),k=[],m=
[];c&&j<g;){var o=this.getNextMatch(b,c,j);if(!o)break;var w=o&&o.match,s=o&&o.rule,v=o&&o.isSub;o=o&&o.isEnd;w.index!==j&&m.push({start:j,end:w.index,node:c});if(v){j=this.afterMatch(w);if(s instanceof this.BeginEndRule){this.addBeginScope(k,w,s);c=i;i=this.getNextExpected(i,"begin")}else this.addMatchScope(k,w,s)}else if(o){j=this.afterMatch(w);this.addEndScope(k,w,s);i=this.getNextExpected(i,"end");c=c.parent}}j<g&&m.push({start:j,end:g,node:c});b=this.getInheritedLineScope(m,e,g);return k.concat(b)},
getInheritedLineScope:function(b){for(var c=[],e=0;e<b.length;e++)for(var g=b[e],j=g.node;j;){var i=j.rule.rule,k=i.name;if(i=i.contentName||k){this.addScopeRange(c,g.start,g.end,i);break}j=j.parent}return c},addBeginScope:function(b,c,e){var g=e.rule;this.addCapturesScope(b,c,g.beginCaptures||g.captures,e.isComplex,e.beginOld2New,e.beginConsuming)},addEndScope:function(b,c,e){var g=e.rule;this.addCapturesScope(b,c,g.endCaptures||g.captures,e.isComplex,e.endOld2New,e.endConsuming)},addMatchScope:function(b,
c,e){var g=e.rule,j=g.name;(g=g.captures)?this.addCapturesScope(b,c,g,e.isComplex,e.matchOld2New,e.matchConsuming):this.addScope(b,c,j)},addScope:function(b,c,e){e&&b.push({start:c.index,end:this.afterMatch(c),scope:e})},addScopeRange:function(b,c,e,g){g&&b.push({start:c,end:e,scope:g})},addCapturesScope:function(b,c,e,g,j,i){if(e)if(g){g={1:0};for(var k=0,m=1;c[m]!==undefined;m++){if(i[m]!==undefined)k+=c[m].length;if(c[m+1]!==undefined)g[m+1]=k}i=c.index;for(k=1;e[k];k++){m=e[k].name;var o=j[k],
w=i+g[o];typeof c[o]!=="undefined"&&this.addScopeRange(b,w,w+c[o].length,m)}}else this.addScope(b,c,e[0]&&e[0].name)},getIntersecting:function(b,c){for(var e=[],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,c)){i=true;e.push(j)}if(i){i=j.children.length;for(var k=0;k<i;k++)g.push(j.children[k])}}return e.reverse()},toStyleRanges:function(b){for(var c=[],e=0;e<b.length;e++){var g=b[e],j=this._styles[g.scope];if(!j)throw new Error("styles not found for "+
g.scope);j=j.join(" ");c.push({start:g.start,end:g.end,style:{styleClass:j}})}return c}};return{RegexUtil:a,TextMateStyler:f}});
define("orion/editor/asyncStyler",["i18n!orion/editor/nls/messages"],function(d){function f(b){return b.getName()==="orion.edit.highlighter"&&b.getProperty("type")==="highlighter"}function a(b,c,e){this.initialize(b,c,e);this.lineStyles=[]}a.prototype={initialize:function(b,c,e){this.textView=b;this.serviceRegistry=c;this.annotationModel=e;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);c.addEventListener("serviceAdded",this.listener.onServiceAdded);
c.addEventListener("serviceRemoved",this.listener.onServiceRemoved);b=c.getServiceReferences("orion.edit.highlighter");for(e=0;e<b.length;e++){var j=b[e];f(j)&&this.addServiceListener(c.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 c=this.startLine;if(b.addedLineCount||b.removedLineCount)Array.prototype.splice.apply(this.lineStyles,[c,b.removedLineCount].concat(this._getEmptyStyle(b.addedLineCount)))},onStyleReady:function(b){var c=b.lineStyles||b.style;b=Number.MAX_VALUE;var e=-1,g=this.textView.getModel();for(var j in c)if(c.hasOwnProperty(j)){this.lineStyles[j]=c[j];b=Math.min(b,j);e=Math.max(e,j)}b=Math.max(b,0);e=Math.min(e,g.getLineCount());
if(c=this.annotationModel){for(var i=c.getAnnotations(g.getLineStart(b),g.getLineEnd(e)),k=[];i.hasNext();){var m=i.next();m.type==="orion.annotation.highlightError"&&k.push(m)}i=[];for(m=b;m<=e;m++){j=m;var o=this.lineStyles[j];o=o&&o.errors;j=g.getLineStart(j);if(o)for(var w=0;w<o.length;w++){var s=o[w];i.push({start:s.start+j,end:s.end+j,type:"orion.annotation.highlightError",title:d.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}})}}c.replaceAnnotations(k,
i)}this.textView.redrawLines(b,e+1)},onLineStyle:function(b){function c(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 e=this.lineStyles[b.lineIndex];if(e)if(e.ranges)b.ranges=c(e.ranges,b.lineStart);else if(e.style)b.style=e.style},_getEmptyStyle:function(b){for(var c=[],e=0;e<b;e++)c.push(null);return c},setContentType:function(b){this.contentType=b;if(this.services)for(b=0;b<this.services.length;b++){var c=this.services[b];
c.setContentType&&c.setContentType(this.contentType)}},onServiceAdded:function(b,c){f(b)&&this.addServiceListener(c)},onServiceRemoved:function(b,c){this.services.indexOf(c)!==-1&&this.removeServiceListener(c)},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 d(f){this._styler=f;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)}}d.prototype={_getSetting:function(f,a){for(var b=JSON.parse(localStorage.getItem("JavaScript Editor")),
c,e=0;e<b.length;e++)if(b[e].label===f)for(var g=0;g<b[e].data.length;g++)if(b[e].data[g].label===a){c=b[e].data[g].value;break}return c},_getStyleSheet:function(f){function a(m,o){if(m=k.getClassNameForToken(m)){var w=i._getSetting(o,"Color");o=i._getSetting(o,"Weight").toLowerCase();b.push("."+f+" ."+m+" {");b.push("\tcolor: "+w+";");b.push("\tfont-weight: "+o+";");b.push("}")}}var b=[];b.push("");var c=this._getSetting("Font","Family").toLowerCase();c=c==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':
"monospace";var e=this._getSetting("Font","Size"),g=this._getSetting("Font","Color"),j=this._getSetting("Font","Background");b.push("."+f+" {");b.push("\tfont-family: "+c+";");b.push("\tfont-size: "+e+";");b.push("\tcolor: "+g+";");b.push("\tbackground-color: "+j+";");b.push("}");b.push("."+f+" .view {");b.push("\tbackground-color: "+j+";");b.push("}");b.push("."+f+" .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 f=this._view,a={stylesheet:null,themeClass:null};f.getOptions(a);var b=a.stylesheet;b||(b=[]);b instanceof Array||(b=[b]);for(var c=0;c<b.length;c++)if(b[c].indexOf("/* Orion Editor User Preference CSS (key) */")===0){b.splice(c,
1);break}if(c=a.themeClass){if(c=c.replace("userTheme",""))c+=" ";c+="userTheme"}else c="userTheme";b.push("/* Orion Editor User Preference CSS (key) */"+this._getStyleSheet("userTheme"));a.stylesheet=b;a.themeClass=c;f.setOptions(a)}},_onLoad:function(){this._updateStylesheet();this._view.removeEventListener("Load",this._listener.onLoad)},_onStorage:function(f){f.key==="JavaScript Editor"&&this._updateStylesheet()}};return{TextStylerOptions:d}});
define("orion/highlight",["dojo","examples/textview/textStyler","orion/editor/textMateStyler","orion/editor/asyncStyler","examples/textview/textStylerOptions"],function(d,f,a,b,c){function e(j,i,k,m,o,w){function s(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 d.Deferred;h.callback(D);return h}return null}function v(D){var h=null;switch(D&&D.id){case "text.javascript":case "text.json":h=
new f.TextStyler(m,"js",o);break;case "text.java":h=new f.TextStyler(m,"java",o);break;case "text.css":h=new f.TextStyler(m,"css",o);break}h&&new c.TextStylerOptions(h);return h}var u=v(k);if(u){w=new d.Deferred;w.callback(u);return w}u=w&&w.split(".").pop().toLowerCase();w=j.getServiceReferences("orion.edit.highlighter");for(var t=[],q=[],x=0;x<w.length;x++){var B=w[x];B.getProperty("type")==="grammar"&&t.push(B.getProperty("grammar"));(B=s(B,u))&&q.push(B)}return(new d.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,t)}}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 e(this.serviceRegistry,this.serviceRegistry.getService("orion.file.contenttypes"),
j,i,k,m).then(function(w){return o.styler=w})},getStyler:function(){return this.styler}};return{createStyler:e,SyntaxHighlighter:g}});
define("orion/compare/compare-container",["require","dojo","orion/compare/diff-parser","orion/compare/rulers","orion/compare/compare-inline-model","orion/compare/compare-2way-model","orion/editor/contentAssist","orion/editorCommands","orion/editor/editor","orion/editor/editorFeatures","orion/globalCommands","orion/breadcrumbs","orion/compare/gap-model","orion/commands","orion/textview/textModel","orion/textview/textView","orion/compare/compareUtils","orion/compare/diff-provider","orion/compare/jsdiffAdapter",
"orion/highlight"],function(d,f,a,b,c,e,g,j,i,k,m,o,w,s,v,u,t,q,x,B){var D={};D.CompareContainer=function(){function h(){this._diffParser=new a.DiffParser}h.prototype={_clearOptions:function(){this._complexURL=this._diffProvider=this._hasConflicts=this._readonly=undefined;this._baseFile={URL:"",Name:"",Type:""};this._newFile={URL:"",Name:"",Type:""};this._onSetTitle=this._onSave=this._diffContent=this._diffURL=undefined},setOptions:function(l,n){n&&this._clearOptions();if(l){this._mapper=l.mapper?
l.mapper:this._mapper;this._readonly=l.readonly!==undefined||l.readonly!==null?l.readonly:this._readonly;this._hasConflicts=l.hasConflicts!==undefined||l.hasConflicts!==null?l.hasConflicts:this._hasConflicts;this._diffProvider=l.diffProvider?l.diffProvider:this._diffProvider;this._complexURL=l.complexURL?l.complexURL:this._complexURL;this._baseFile.URL=l.baseFileURL?l.baseFileURL:this._baseFile.URL;this._baseFile.Name=l.baseFileName?l.baseFileName:this._baseFile.Name;this._baseFile.Type=l.baseFileType?
l.baseFileType:this._baseFile.Type;this._baseFile.Content=l.baseFileContent?l.baseFileContent:this._baseFile.Content;this._newFile.URL=l.newFileURL?l.newFileURL:this._newFile.URL;this._newFile.Name=l.newFileName?l.newFileName:this._newFile.Name;this._newFile.Type=l.newFileType?l.newFileType:this._newFile.Type;this._newFile.Content=l.newFileContent?l.newFileContent:this._newFile.Content;this._diffURL=l.diffURL?l.diffURL:this._diffURL;this._diffContent=l.diffContent?l.diffContent:this._diffContent;
this._onSave=l.onSave?l.onSave:this._onSave;this._callback=l.callback?l.callback:this._callback;this._errorCallback=l.errorCallback?l.errorCallback:this._errorCallback;this._onSetTitle=l.onSetTitle?l.onSetTitle:this._onSetTitle}},clearContent:function(){if(this._baseFile)this._baseFile.Content=null;if(this._newFile)this._newFile.Content=null},_getLineDelim:function(){return"\n"},resolveComplexDiff:function(l){if(this._diffProvider){var n=this;n._diffProvider.provide(n._complexURL,l,n._hasConflicts,
function(p){n._baseFile.URL=p.baseFile&&typeof p.baseFile.URL==="string"?p.baseFile.URL:n._baseFile.URL;n._baseFile.Name=p.baseFile&&typeof p.baseFile.Name==="string"?p.baseFile.Name:n._baseFile.Name;n._baseFile.Type=p.baseFile&&typeof p.baseFile.Type==="object"?p.baseFile.Type:n._baseFile.Type;n._baseFile.Content=p.baseFile&&typeof p.baseFile.Content==="string"?p.baseFile.Content:n._baseFile.Content;n._newFile.URL=p.newFile&&typeof p.newFile.URL==="string"?p.newFile.URL:n._newFile.URL;n._newFile.Name=
p.newFile&&typeof p.newFile.Name==="string"?p.newFile.Name:n._newFile.Name;n._newFile.Type=p.newFile&&typeof p.newFile.Type==="object"?p.newFile.Type:n._newFile.Type;n._newFile.Content=p.newFile&&typeof p.newFile.Content==="string"?p.newFile.Content:n._newFile.Content;n._diffContent=typeof p.diff==="string"?p.diff:n._diffContent;if(l||typeof n._baseFile.Content==="string")n.setEditor(l);else{n._callback&&n._callback(n._baseFile.Name,n._newFile.Name);n.getFileContent([n._baseFile],0)}},n._errorCallback)}else console.log("A diff provider is needed for Complex diff URL")},
resolveDiffByContents:function(l){if(typeof this._baseFile.Content==="string"&&typeof this._newFile.Content==="string"){if(!this._diffContent&&!this._mapper)this._diffContent="";this.setEditor(l);return true}else return false},getFileContent:function(l,n){if(this._fileClient){var p=this;p._fileClient.read(l[n].URL).then(function(r){l[n].Content=r;n<l.length-1?p.getFileContent(l,n+1):p.setEditor()},function(r,y){if(r.status===404){l[n].Content="";n<l.length-1?p.getFileContent(l,n+1):p.setEditor()}else p.errorCallback&&
p.errorCallback(r,y)})}else console.log("A file client is needed for getting file content")},parseMapper:function(l,n,p,r,y){var A=this._getLineDelim(l,p);if(this._mapper)return{delim:A,mapper:this._mapper,output:n,diffArray:n};if(n){l=(new x.JSDiffAdapter).adapt(l,n);return{delim:A,mapper:l.mapper,output:n,diffArray:l.changContents}}else{this._diffParser.setLineDelim(A);n=this._diffParser.parse(l,p,r,y);l=this._diffParser.getDiffArray();return{delim:A,mapper:n.mapper,output:n.outPutFile,diffArray:l}}},
startup:function(l){this._complexURL?this.resolveComplexDiff(l):this.resolveDiffByContents(l)}};return h}();D.DefaultDiffProvider=function(){function h(l){this.serviceRegistry=l;this._diffProvider=new q.DiffProvider(l)}h.prototype={_resolveComplexDiff:function(l,n,p){if(this._diffProvider){var r=this;r._diffProvider.getDiffContent(l).then(function(y){r._diffContent=r._hasConflicts?y.split("diff --git")[1]:y;n?r.callBack({diff:r._diffContent}):r._resolveComplexFileURL(l)},p)}else console.log("A diff provider is needed for compound diff URL")},
_resolveFileName:function(l){return l.split("?")[0]},_getContentType:function(l){l=this._resolveFileName(l);return this.serviceRegistry.getService("orion.file.contenttypes").getFilenameContentType(l)},_resolveComplexFileURL:function(l,n){var p=this;this._diffProvider.getDiffFileURI(l).then(function(r){(new f.DeferredList([p._getContentType(r.Old),p._getContentType(r.New)])).then(function(y){var A=y[0][1];y=y[1][1];p.callBack({baseFile:{URL:r.Old,Name:p._resolveFileName(r.Old),Type:A},newFile:{URL:r.New,
Name:p._resolveFileName(r.New),Type:y},diff:p._diffContent})},n)},n)},provide:function(l,n,p,r,y){this.callBack=r;this._hasConflicts=p;this._resolveComplexDiff(l,n,y)}};return h}();D.DiffStyler=function(){function h(l,n){this._compareMatchRenderer=l;this._textView=n}h.prototype={highlight:function(l){this._textView&&this._textView.removeEventListener("LineStyle",this._lineStyleListener);if(l)this._textView=l;if(this._textView&&!this._textView.getModel().isMapperEmpty())this._textView.addEventListener("LineStyle",
this._lineStyleListener=f.hitch(this,this._onLineStyle))},_onLineStyle:function(l){var n=this._textView,p=l.lineIndex,r=n.getModel().getLineType(p);p=r.type;var y=t.getAnnotationIndexByMapper(n.getModel().getAnnotations(),r.mapperIndex).current;n=t.isMapperConflict(n.getModel().getMapper(),r.mapperIndex);y=y===this._compareMatchRenderer.getCurrentAnnotationIndex();if(p==="top-only"){p=y?"url('"+d.toUrl("images/diff-border-sel.png")+"')":"url('"+d.toUrl("images/diff-border.png")+"')";l.style={style:{backgroundImage:p,
backgroundRepeat:"repeat-x"}}}else if(p!=="unchanged")l.style={styleClass:y?n?"diffConflictSelect":"diffNormalSelect":n?"diffConflict":"diffNormal"}}};return h}();D.TwoWayCompareStyler=function(){function h(l,n){this._syntaxHighlither=new B.SyntaxHighlighter(l);this._diffHighlither=new D.DiffStyler(n)}h.prototype={highlight:function(l,n,p){var r=this;this._syntaxHighlither.setup(n,p,null,l).then(function(){r._diffHighlither.highlight(p)})}};return h}();D.TwoWayCompareContainer=function(){function h(l,
n,p){this._registry=l;this._commandService=this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._uiFactory=n;this._viewLoadedCounter=0;this.setOptions(p,true);var r=this;if(!this._callback)this._callback=function(y,A){if(r._uiFactory.getTitleDivId(true)&&r._uiFactory.getTitleDivId(false)){f.place(document.createTextNode(A),r._uiFactory.getTitleDivId(true),"only");f.place(document.createTextNode(y),r._uiFactory.getTitleDivId(false),"only")}};
if(!this._errorCallback)this._errorCallback=function(y,A){if(r._uiFactory.getTitleDivId(true)&&r._uiFactory.getTitleDivId(false)){y=typeof y.message==="string"?y.message:A.xhr.statusText;f.place(document.createTextNode(y),r._uiFactory.getTitleDivId(true),"only");f.place(document.createTextNode(y),r._uiFactory.getTitleDivId(false),"only");f.style(n.getTitleDivId(true),"color","red");f.style(n.getTitleDivId(false),"color","red")}};this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._rightEditorDivId=
this._uiFactory.getEditorParentDivId(false);this.initCommands();r=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},setDirty:function(y){if(y)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},getFileMetadata:function(){return this._fileMetadata},setInput:function(y){this.onSetTitle?this.onSetTitle(y,f.hitch(this,function(A){this.setTitle(A)}),
f.hitch(this,function(A){console.error("Error loading file metadata: "+A.message);this.setTitle(y)})):r._fileClient.read(y,true).then(f.hitch(this,function(A){this._fileMetadata=A;this.setTitle(A.Location)}),f.hitch(this,function(A){console.error("Error loading file metadata: "+A.message);this.setTitle(y)}));this.lastFilePath=y},setTitle:function(y){var A=y.lastIndexOf("/"),z=y;if(A!==-1){z="Compare "+z.substring(A+1);if(y.charAt(0)==="*")z="*"+z}this._lastTitle=z;window.document.title=z;if((A=f.byId("location"))&&
this._fileMetadata){f.empty(A);new o.BreadCrumbs({container:"location",resource:this._fileMetadata});if(y.charAt(0)==="*")f.create("b",null,A,"last").innerHTML="*"}},afterSave:function(){r.startup(true)}};if(this._onSave)this._inputManager.onSave=this._onSave;if(this._onSetTitle)this._inputManager.onSetTitle=this._onSetTitle;this._compareMatchRenderer=new b.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new D.TwoWayCompareStyler(this._registry,
this._compareMatchRenderer));this._highlighter.push(new D.TwoWayCompareStyler(this._registry,this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}h.prototype=new D.CompareContainer;h.prototype.initEditorContainers=function(l,n,p,r,y){this._editorLeft=this.createEditorContainer(n,l,r,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this._readonly,y,this._newFile);m.generateDomCommandsInBanner(this._commandService,this._editorLeft,null,null,null,true);
this._textViewLeft=this._editorLeft.getTextView();this._editorRight=this.createEditorContainer(p,l,r,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,y,this._baseFile);this._textViewRight=this._editorRight.getTextView();var A=this;l=new b.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},A._compareMatchRenderer.getAnnotation(),function(z){A._compareMatchRenderer.matchPositionFromAnnotation(z)});this._textViewRight.addRuler(l);this._compareMatchRenderer.setOverviewRuler(l);
A=this;window.onbeforeunload=function(){if(A._editorLeft.isDirty())return"There are unsaved changes."}};h.prototype.initCommands=function(){var l=this._uiFactory.getCommandSpanId();if(l){var n=this,p=new s.Command({tooltip:"Go to next diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){n.nextDiff()}}),r=new s.Command({tooltip:"Go to previous diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",
callback:function(){n.prevDiff()}}),y=new s.Command({tooltip:"Copy current change from right to left",imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(){n.copyToLeft()}});this._commandService.addCommand(r,"dom");this._commandService.addCommand(p,"dom");this._commandService.addCommand(y,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,l);this._commandService.registerCommandContribution("orion.compare.nextDiff",
2,l);this._readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,l);this._commandService.renderCommands(l,"dom",n,n,"button")}};h.prototype.gotoMatch=function(l,n,p,r,y,A){if(!this.onScroll)this.onScroll=y;if(!this.onLoad)this.onLoad=A;y=this._textViewRight.getModel().getLineStart(l)+n.startIndex;this._editorRight.moveSelection(y,y+(n.length?n.length:r));l=this._textViewLeft.getModel().getLineStart(l)+p.startIndex;this._editorLeft.moveSelection(l,l+(p.length?p.length:
r))};h.prototype.nextDiff=function(){this._compareMatchRenderer.nextDiff()};h.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};h.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};h.prototype.createEditorContainer=function(l,n,p,r,y,A,z,E,G){var M=f.byId(y),H=this;l=new v.TextModel(l,n);var N=new e.TwoWayCompareModel(l,{mapper:p,columnIndex:r}),L="";p=z?new k.UndoFactory:new j.UndoCommandFactory(H._registry,H._commandService,"pageActions");var P=new i.Editor({textViewFactory:function(){var F=
new u.TextView({parent:M,model:N,readonly:z,stylesheet:[d.toUrl("orion/compare/editor.css"),d.toUrl("css/default-theme.css")],tabSize:4});F.addEventListener("Load",function(){H._viewLoadedCounter++;H._viewLoadedCounter===2&&H._compareMatchRenderer.matchPositionFromAnnotation(-1);H.onLoad&&H.onLoad()});return F},undoStackFactory:p,contentAssistFactory:function(F){return new g.ContentAssist(F,"contentassist")},keyBindingFactory:function(F,J,Q,T){if(!z){(new j.EditorCommandFactory(H._registry,H._commandService,
H._fileClient,H._inputManager,"pageActions")).generateEditorCommands(F);var U=new k.TextActions(F,Q);J.push(U);F=new k.SourceCodeActions(F,Q,T);J.push(F)}},statusReporter:function(F,J){if(A){L=J?"ERROR: "+F:F;f.byId(A).innerHTML=""+L}},domNode:M});P.installTextView();if(!z){var S=this._inputManager;P.addEventListener("DirtyChanged",function(){S.setDirty(P.isDirty())})}var C=P.getTextView();if(E&&G&&typeof G.Name==="string"&&typeof G.Type==="string"){P.setInput(G.Name);this._highlighter[r].highlight(G.Name,
G.Type,P)}C.addRuler(new b.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));C.addEventListener("Selection",function(){var F=C.getModel().getLineAtOffset(C.getCaretOffset());F=t.lookUpMapper(C.getModel().getMapper(),r,F).mapperIndex;F=t.getAnnotationIndexByMapper(C.getModel().getAnnotations(),F);F.current!==-1&&H._compareMatchRenderer.gotoDiff(F.current)});if(r===0){C.getModel().addEventListener("Changed",function(F){H._compareMatchRenderer.onChanged(F)});
C.addEventListener("Scroll",function(){if(H._compareMatchRenderer){H._compareMatchRenderer.matchPositionFrom(true);H._compareMatchRenderer.render()}H.onScroll&&H.onScroll()})}else C.addEventListener("Scroll",function(){H._compareMatchRenderer&&H._compareMatchRenderer.render()});return P};h.prototype.setEditor=function(l){var n=this._baseFile.Content,p=this._newFile.Content,r=this._diffContent;if(p)r=this.parseMapper(n,p,r,this._hasConflicts,true);else{r=this.parseMapper(n,p,r,this._hasConflicts,l);
p=r.output}this._compareMatchRenderer.init(r.mapper,this._textViewLeft,this._textViewRight);if(this._editorLeft)if(l){this._textViewLeft.getModel().init(r.mapper);this._textViewRight.getModel().init(r.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFile.URL;this._textViewLeft.getModel().init(r.mapper);this._textViewRight.getModel().init(r.mapper);this._editorRight.setInput(this._baseFile.Name,null,n);this._highlighter[1].highlight(this._baseFile.Name,
this._baseFile.Type,this._textViewRight);this._editorLeft.setInput(this._newFile.Name,null,p);this._highlighter[0].highlight(this._newFile.Name,this._newFile.Type,this._textViewLeft);this._readonly||this._inputManager.setInput(this._newFile.URL,this._editorLeft)}else this.initEditorContainers(r.delim,p,n,r.mapper,true);this._viewLoadedCounter>1&&this._compareMatchRenderer.matchPositionFromAnnotation(-1)};return h}();D.InlineCompareContainer=function(){function h(l,n,p){this._registry=l;this._commandService=
this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._statusService=this._registry.getService("orion.page.message");this.setOptions(p,true);var r=this;if(!this._callback)this._callback=function(){f.place(document.createTextNode(r._diffTitle),"fileNameInViewer","only");f.style("fileNameInViewer","color","#6d6d6d");r._statusService.setProgressMessage("");f.empty("compare_rightContainerCommands");r._commandService.renderCommands("compare_rightContainerCommands",
"dom",r,r,"button")};if(!this._errorCallback)this._errorCallback=function(y,A){var z=[];z.Severity="Error";z.HTML=false;try{var E=JSON.parse(y.responseText);z.Message=E.DetailedMessage?E.DetailedMessage:E.Message}catch(G){z.Message=typeof y.message==="string"?y.message:A.xhr.statusText}this._statusService.setProgressResult(z);f.empty("compare_rightContainerCommands")};this._annotation=new b.CompareAnnotation;this._editorDivId=n;this.initEditorContainers("","\n",[],[]);this.hasContent=false}h.prototype=
new D.CompareContainer;h.prototype.addRulers=function(){if(this._textView&&!this._hasRuler){this._textView.addRuler(this._rulerOrigin);this._textView.addRuler(this._rulerNew);this._textView.addRuler(this._overview);this._hasRuler=true}};h.prototype.removeRulers=function(){if(this._textView&&this._hasRuler){this._textView.removeRuler(this._rulerOrigin);this._textView.removeRuler(this._rulerNew);this._textView.removeRuler(this._overview);this._hasRuler=false}};h.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],
[]);this._textView.setText("");this.removeRulers()}this.hasContent=false};h.prototype.createEditorContainer=function(l,n,p,r,y,A){var z=f.byId(this._editorDivId),E=this;l=new v.TextModel(l,n);var G=new c.CompareTextModel(l,{mapper:p,columnIndex:0},new c.DiffLineFeeder(r,n));n=new k.UndoFactory;n=new i.Editor({textViewFactory:function(){return new u.TextView({parent:z,model:G,readonly:true,stylesheet:d.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:n,keyBindingFactory:function(){},
statusReporter:function(){},domNode:z});n.installTextView();y&&A&&n.setInput(A.Name);var M=n.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});this._rulerNew=new b.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});E=this;this._overview=new b.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},E._annotation,
function(H){E._annotation.matchPositionFromAnnotation(H);E.positionAnnotation(H)});M.addEventListener("LineStyle",function(H){E._onLineStyle(H)});M.addEventListener("Selection",function(){var H=M.getModel().getLineAtOffset(M.getCaretOffset());H=M.getModel().getLineType(H).mapperIndex;H=t.getAnnotationIndexByMapper(M.getModel().getAnnotations(),H);if(H.current!==-1){E._annotation.gotoDiff(H.current);H=M.getTopIndex();M.redrawRange();M.redrawLines(H,H+1,E._overview)}});return n};h.prototype.initEditorContainers=
function(l,n,p,r){this._editor=this.createEditorContainer(n,l,p,r,this._newFile);this._textView=this._editor.getTextView()};h.prototype._onLineStyle=function(l){var n=l.lineIndex,p=this._textView.getModel().getLineType(n);n=p.type;p=t.getAnnotationIndexByMapper(this._textView.getModel().getAnnotations(),p.mapperIndex).current;if(n==="added")l.style=p===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineAddedSelect"}:{styleClass:"diffInlineAdded"};else if(n==="removed")l.style=p===
this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineRemovedSelect"}:{styleClass:"diffInlineRemoved"}};h.prototype._initDiffPosition=function(l){var n=l.getModel();if(n&&n.getAnnotations){n=n.getAnnotations();if(n.length>0){n=n[0][0];var p=l.getLineHeight(),r=l.getClientArea();p=Math.floor(r.height/p/3);l.setTopIndex(n-p>0?n-p:0)}}};h.prototype.setDiffTitle=function(l){this._diffTitle=l};h.prototype.setEditor=function(){var l=this._baseFile.Content,n=this._newFile.Content,p=this._diffContent;
this.hasContent=true;n=this.parseMapper(l,n,p,false,n);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");this._textView.getModel().init(n.mapper,n.diffArray);if(l==="")l=" ";this._textView.setText(l);this._annotation.init(n.mapper,this._textView)}else this.initEditorContainers(n.delim,l,n.mapper,n.diffArray,true);this._initDiffPosition(this._textView)};h.prototype.nextDiff=function(){this._annotation.nextDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};
h.prototype.setConflicting=function(l){this._conflcit=l};h.prototype.prevDiff=function(){this._annotation.prevDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};h.prototype.positionAnnotation=function(l){if(this._textView){var n=this._textView.getLineHeight(),p=this._textView.getClientArea();n=Math.floor(p.height/n/3);this._textView.setTopIndex(l-n>0?l-n:0);this._textView.redrawRange();l=this._textView.getTopIndex();this._textView.redrawLines(l,
l+1,this._overview)}};return h}();return D});
define("compare/compare",["dojo","orion/bootstrap","orion/status","orion/progress","orion/operationsClient","orion/commands","orion/fileClient","orion/searchClient","orion/globalCommands","orion/compare/compare-features","orion/compare/compare-container","orion/contentTypes","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(d,f,a,b,c,e,g,j,i,k,m,o){d.addOnLoad(function(){function w(){return d.queryToObject(window.location.search.slice(1)).readonly!=null}
function s(){return d.queryToObject(window.location.search.slice(1)).conflict!=null}f.startup().then(function(v){var u=v.serviceRegistry;v=v.preferences;document.body.style.visibility="visible";d.parser.parse();var t=new e.CommandService({serviceRegistry:u}),q=new g.FileClient(u);new o.ContentTypeService(u);q=new j.Searcher({serviceRegistry:u,commandService:t,fileService:q});var x=new c.OperationsClient(u);new a.StatusReportingService(u,x,"statusPane","notifications","notificationArea");new b.ProgressService(u,
x);i.generateBanner("banner",u,t,v,q);var B=new k.TwoWayCompareUIFactory({parentDivID:"compareContainer",showTitle:true,showLineStatus:true});B.buildUI();v=w();t=s();q=new m.DefaultDiffProvider(u);var D={readonly:v,hasConflicts:t,diffProvider:q,complexURL:d.hash()},h=new m.TwoWayCompareContainer(u,B,D);h.startup();d.subscribe("/dojo/hashchange",h,function(){D.compoundURL=d.hash();h=new m.TwoWayCompareContainer(u,B,D);h.startup()})})})});