/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2013 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). 
 *
 *******************************************************************************/

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

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

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

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

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

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

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

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 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
 ******************************************************************************/

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

/*******************************************************************************
 * @license
 * Copyright (c) 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
 ******************************************************************************/

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

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

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

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

/*******************************************************************************
 * 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: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 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
 ******************************************************************************/

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

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 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
 *******************************************************************************/

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

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

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

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

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

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 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
 *******************************************************************************/

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

/*******************************************************************************
 * @license
 * 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: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

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

/*******************************************************************************
 * @license
 * 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
 *	Adrian Aichner - regular expression capture group support in replace
 ******************************************************************************/

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

/*******************************************************************************
 * @license
 * 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
 *               Alex Lakatos - fix for bug#369781
 ******************************************************************************/

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

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

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

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

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

/*******************************************************************************
 * @license
 * Copyright (c) 2013 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, 2013 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). 


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 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). 


 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). 


 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, 2013 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). 


 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). 

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 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). 


 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, 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) 2009, 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, 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) 2013 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

 Copyright (c) 2012, 2013 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

 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

 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). 


 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). 


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

 Contributors: IBM Corporation - initial API and implementation

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


 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). 


 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) 2009, 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) 2010, 2013 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) 2013 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

 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
 Copyright (c) 2013 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). 


 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). 


 Copyright (c) 2011, 2013 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, 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) 2009, 2013 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). 


 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). 


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


 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). 


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

 Copyright (c) 2013 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, 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, 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (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: 
 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, 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (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) 2013 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) 2013 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, 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: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (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) 2013 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) 2013 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, 2013 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, 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, 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) 2013 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
 Adrian Aichner - regular expression capture group support in replace

 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, 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, 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
 Alex Lakatos - fix for bug#369781

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

 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, 2013 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

 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). 


 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). 


 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

 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

 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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

 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) 2011, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation
*/
define("orion/browserCompatibility",[],function(){function g(){for(var c=navigator.userAgent,a={browser:!1,version:!1},b=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"MSIE",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],i=0;i<b.length;i++){var h=b[i],f=c.match(h.regExp);if(f){a.browser=!0;a.version=f[1]>=h.minVersion;a.name=h.name;break}}return a}
function k(){try{return"localStorage"in window&&window.localStorage!==null}catch(c){return!1}}function j(c){alert(c);throw"unsupported browser";}var d=g();if(d.browser)d.version||j("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.name+".\n");else if(k()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else k()||j("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:g,supportsLocalStorage:k,throwBrowserAlert:j}});
(function(g,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(g.orion=g.orion||{},g.orion.Deferred=k())})(this,function(){function g(){for(var f;f=b.shift()||i.shift();)f();h=!1}function k(f,e){(e?i:b).push(f);h||(h=!0,e?setTimeout(g,0):g())}function j(f){return function(){f.apply(null,arguments)}}function d(){}function c(){var f=Error("Cancel");f.name="Cancel";return f}function a(){function f(){for(var f;f=h.shift();){var a=f.deferred,
c=b==="resolved"?"resolve":"reject";if(typeof f[c]==="function")try{var i=f[c](e);i&&typeof i.then==="function"?(a.cancel=i.cancel||d,i.then(j(a.resolve),j(a.reject),a.progress)):a.resolve(i)}catch(p){a.reject(p)}else a[c](e)}}var e,b,h=[],i=this;this.reject=function(a){b||(b="rejected",e=a,h.length&&k(f));return i.promise};this.resolve=function(a){b||(b="resolved",e=a,h.length&&k(f));return i.promise};this.progress=function(f){b||h.forEach(function(a){a.progress&&a.progress(f)});return i.promise};
this.cancel=function(){b||i.reject(c())};this.then=function(e,c,d){var e={resolve:e,reject:c,progress:d,deferred:new a},j=e.deferred,g=!1,l=function(){g||(g=!0,k(function(){var f=j.cancel===l?i.cancel:j.cancel;typeof f==="function"&&f()},!0))};j.cancel=l;h.push(e);b&&k(f,!0);return j.promise};this.promise=Object.create(Object.prototype,{then:{value:i.then},cancel:{get:function(){return i.cancel},set:function(f){i.cancel=f}}})}var b=[],i=[],h=!1;a.all=function(f,e){function b(f,a){d||(i[f]=a,--c===
0&&r.resolve(i))}function h(f,a){if(!d){if(e)try{b(f,e(a));return}catch(l){a=l}r.reject(a)}}var c=f.length,i=[],d=!1,r=new a;r.then(null,function(){d=!0;f.forEach(function(f){f.cancel&&f.cancel()})});c===0?r.resolve(i):f.forEach(function(f,a){f.then(b.bind(null,a),h.bind(null,a))});return r.promise};a.when=function(f,e,b,h){var c;if(!(f&&typeof f.then==="function"))c=new a,c.resolve(f),f=c.promise;return f.then(e,b,h)};return a});
define("orion/EventTarget",[],function(){function g(){this._namedListeners={}}g.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var j=this._namedListeners[g.type];j&&j.forEach(function(d){try{typeof d==="function"?d(g):d.handleEvent(g)}catch(c){typeof console!=="undefined"&&console.log(c)}});return!g.defaultPrevented},addEventListener:function(g,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[g]=this._namedListeners[g]||[],this._namedListeners[g].push(j)},
removeEventListener:function(g,j){var d=this._namedListeners[g];if(d)for(var c=0;c<d.length;c++)if(d[c]===j){d.length===1?delete this._namedListeners[g]:d.splice(c,1);break}}};g.prototype.constructor=g;g.attach=function(k){var j=new g;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return g});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(g,k){function j(a,b,f){this._properties=f||{};this._properties["service.id"]=a;this._properties.objectClass=b;this._properties["service.names"]=b}function d(a,b,f){this._serviceId=a;this._serviceReference=b;this._internalRegistry=f}function c(a,b){function f(f){return function(){var e;try{if(!b())throw Error("Service was unregistered");var c=a[f].apply(a,Array.prototype.slice.call(arguments));if(c&&typeof c.then==="function")return c;
else e=new g,e.resolve(c)}catch(d){e=new g,e.reject(d)}return e.promise}}for(var e in a)typeof a[e]==="function"&&(this[e]=f(e))}function a(a,b){this.type=a;this.serviceReference=b}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(h){var f=b._entries[h];if(!f)throw Error("already unregistered");var e=f.reference;b._serviceEventTarget.dispatchEvent(new a("unregistering",
e));b._entries[h]=null;e.getProperty("objectClass").forEach(function(f){for(var a=b._namedReferences[f],h=0;h<a.length;h++)if(a[h]===e){a.length===1?delete b._namedReferences[f]:a.splice(h,1);break}})},modifyService:function(h){h=b._entries[h];if(!h)throw Error("already unregistered");b._serviceEventTarget.dispatchEvent(new a("modified",h.reference))}}}j.prototype={getPropertyKeys:function(){var a=[],b;for(b in this._properties)this._properties.hasOwnProperty(b)&&a.push(b);return a},getProperty:function(a){return this._properties[a]}};
j.prototype.constructor=j;d.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(a){var b=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;a.objectClass=b.objectClass;a["service.names"]=b["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
d.prototype.constructor=d;b.prototype={getService:function(a){var b;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(a){b=this._entries[a.getProperty("service.id")].service;return!!b},this);else if(a=this._entries[a.getProperty("service.id")])b=a.service;return b||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:[];var b=[];this._entries.forEach(function(a){a&&b.push(a.reference)});return b},registerService:function(b,h,f){if(typeof h===
"undefined"||h===null)throw Error("invalid service");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var e=this._entries.length,n=new j(e,b,f),o=this._namedReferences;b.forEach(function(a){o[a]=o[a]||[];o[a].push(n)});b=new c(h,this._internalRegistry.isRegistered.bind(null,e));this._entries.push({reference:n,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new a("registered",n));return new d(e,n,b)},addEventListener:function(a,b){this._serviceEventTarget.addEventListener(a,
b)},removeEventListener:function(a,b){this._serviceEventTarget.removeEventListener(a,b)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(g){function k(j,d,c,a){var b=typeof c.response!=="undefined"?c.response:c.responseText,i;try{i=c.status}catch(h){i=0}j={args:d,response:b,responseText:typeof b==="string"?b:null,status:i,url:j,xhr:c};if(typeof a!=="undefined")j.error=a;return j}return function(j,d,c){var c=c||{},a=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new g,i=c.headers||{},h=c.log||!1,f;typeof i["X-Requested-With"]==="undefined"&&(i["X-Requested-With"]="XMLHttpRequest");
if(typeof c.data!=="undefined"&&(j==="POST"||j==="PUT"))f=c.data;a.onprogress=function(f){f.xhr=a;b.progress(f)};a.onreadystatechange=function(){if(a.readyState===4){var f=k(d,c,a),e=a.status;200<=e&&e<400?b.resolve(f):(h&&typeof console!=="undefined"&&console.log(Error(a.statusText)),b.reject(f))}};try{a.open(j,d,!0);if(typeof c.responseType==="string")a.responseType=c.responseType;if(typeof c.timeout==="number")if(typeof a.timeout==="number")a.timeout=c.timeout,a.addEventListener("timeout",function(){b.reject(k(d,
c,a,"Timeout exceeded"))});else{var e=setTimeout(function(){b.reject(k(d,c,a,"Timeout exceeded"))},c.timeout);b.then(clearTimeout.bind(null,e),clearTimeout.bind(null,e))}Object.keys(i).forEach(function(f){a.setRequestHeader(f,i[f])});a.send(f)}catch(n){b.reject(k(d,c,a,n))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(g,k,j){function d(a,e){this._name=a;this._providers=e;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function c(a,e){return{get:function(b,h){if(e===0)return null;var c=localStorage.getItem(a+b);if(c===null)return null;c=JSON.parse(c);return h||e===-1||c._expires&&c._expires>(new Date).getTime()?(delete c._expires,c):null},set:function(b,h){if(e!==0){if(e!==-1)h._expires=(new Date).getTime()+1E3*e;
if(Object.keys(h).length===0)localStorage.removeItem(a+b);else{var c=JSON.stringify(h);localStorage.setItem(a+b,c);delete h._expires}}},remove:function(e){localStorage.removeItem(a+e)}}}function a(a){this._currentPromises={};this._cache=new c("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var e=a.getServiceReferences("orion.core.preference.provider");if(e.length>0)this._service=a.getService(e[0])}return!!this._service}}function b(a){this._location=
a;this._currentPromise=null;this._cache=new c("/orion/preferences/default",3600)}function i(){this._cache=new c("/orion/preferences/local",-1)}function h(f,e){this._userProvider=new a(f);this._localProvider=new i;e=e||"defaults.pref";e.indexOf("://")===-1&&(e=g.toUrl(e));this._defaultsProvider=new b(e);this._serviceRegistration=f.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var a=[],e=0;e<this._stores.length;++e){var b=this._stores[e];this._dirty.indexOf(b)!==-1&&
a.push(this._providers[e].put(this._name,b))}this._dirty=[];return k.all(a)},_scheduleFlush:function(a){this._dirty.indexOf(a)===-1&&this._dirty.push(a);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),0)},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var e=this._stores[a],b;for(b in e)e.hasOwnProperty(b)&&typeof this._cached[b]==="undefined"&&(this._cached[b]=
e[b])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,b){if(this._stores.length!==0){var h=this._stores[0];if(h[a]!==b)h[a]=b,this._cached=null,this._scheduleFlush(h)}},remove:function(a){for(var b=0;b<this._stores.length;++b){var h=this._stores[b];if(h.hasOwnProperty(a))return delete h[a],this._cached=null,this._scheduleFlush(h),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]=
{},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var b=this,h=[],c=0;c<this._providers.length;++c)h.push(this._providers[c].get(this._name,a).then(function(a){return function(f){b._stores[a]=f}}(c)));return k.all(h).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};a.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var h=new k,c=null;
b?this._cache.remove(a):c=this._cache.get(a);if(c!==null)h.resolve(c);else{this._currentPromises[a]=h;var i=this;this._service.get(a).then(function(b){i._cache.set(a,b);delete i._currentPromises[a];h.resolve(b)},function(b){b.status===404?(b={},i._cache.set(a,b),delete i._currentPromises[a],h.resolve(b)):(delete i._currentPromises[a],h.resolve(i._cache.get(a,!0)||{}))})}return h},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)}};b.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;
var h=new k,c=null;b?this._cache.remove(a):c=this._cache.get(a);if(c!==null)h.resolve(c);else{this._currentPromise=h;var i=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);i._cache.set(a,b[a]||{});i._currentPromise=null;h.resolve(b[a]||{})},function(b){b.xhr.status===401||b.xhr.status===404?(i._cache.set(a,{}),i._currentPromise=null,h.resolve({})):(i._currentPromise=null,b=i._cache.get(a,!0),b!==null?h.resolve(b[a]||{}):h.resolve({}))})}return h},
put:function(){var a=new k;a.resolve();return a}};i.prototype={get:function(a){var b=new k,a=this._cache.get(a);a!==null?b.resolve(a):b.resolve({});return b},put:function(a,b){var h=new k;this._cache.set(a,b);h.resolve();return h}};h.DEFAULT_SCOPE=1;h.LOCAL_SCOPE=2;h.USER_SCOPE=4;h.prototype={listenForChangedSettings:function(a,b,c){if(!b||typeof b!=="number"||b>7||b<1)c=b,b=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;window.addEventListener("storage",c,!1);if((h.USER_SCOPE&b)!==0)return"/orion/preferences/user"+
a;else if((h.LOCAL_SCOPE&b)!==0)return"/orion/preferences/local"+a;return"/orion/preferences/default"+a},getPreferences:function(a,b){if(!b||typeof b!=="number"||b>7||b<1)b=h.DEFAULT_SCOPE|h.LOCAL_SCOPE|h.USER_SCOPE;var c=[];h.USER_SCOPE&b&&this._userProvider.available()&&c.push(this._userProvider);h.LOCAL_SCOPE&b&&c.push(this._localProvider);h.DEFAULT_SCOPE&b&&c.push(this._defaultsProvider);var i=new d(a,c);return i.sync().then(function(){return i})},getSetting:function(a,b,h){for(var c,i=0;i<a.length;i++)if(a[i].label===
b)for(var d=0;d<a[i].data.length;d++)if(a[i].data[d].label===h){c=a[i].data[d].value;break}return c}};return{PreferencesService:h}});
(function(){function g(l){if(typeof l!=="string")throw new TypeError;}function k(l){return l?l.split("&"):[]}function j(l){return l.length===0?"":l.join("&")}function d(l){var a=/([^=]*)(?:=?)(.*)/.exec(l),l=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[l,a]}function c(l){var a=encodeURIComponent(l[0]);l[1]&&(a+="="+encodeURIComponent(l[1]));return a}function a(l,a){var b="",f=[],e=0;return{next:function(){if(b!==l.query)b=l.query,f=k(b);if(e<f.length){var h=d(f[e++]);
switch(a){case "keys":return h[0];case "values":return h[1];case "keys+values":return[h[0],h[1]];default:throw new TypeError;}}throw v;}}}function b(l){Object.defineProperty(this,"_url",{get:function(){return l._url}})}function i(l){var a=[];l.split("/").forEach(function(l){l===".."?a.pop():l!=="."&&a.push(l)});return a.join("/")}function h(l){return l.replace(/\s/g,function(l){return"%"+l.charCodeAt(0).toString(16)})}function f(l,a){if(typeof l!=="string")throw new TypeError;var l=h(l),b=o.exec(l);
if(!b)return null;var f={};f.scheme=b[1]||"";if(f.scheme&&!m.test(f.scheme))return null;var e=b[2];if(e&&(e=p.exec(e),f.userinfo=e[1],f.host=e[2],f.port=e[3],f.port&&!q.test(f.port)))return null;f.path=b[3];f.query=b[4];f.fragment=b[5];if(!f.scheme&&a&&(f.scheme=a.scheme,!f.host&&a.host))f.userinfo=a.userinfo,f.host=a.host,f.port=a.port,f.pathRelative=!0;if(f.pathRelative)if(f.path){if(f.path[0]!=="/")b=/^(.*\/)[^\/]*$/.exec(a.path)[1]||"/",f.path=b+f.path}else f.path=a.path;if(f.scheme)f.scheme=
f.scheme.toLowerCase();if(f.port)f.port=/[1-9]\d*$/.exec(f.port)[0];if(f.host&&f.path)f.path=i(f.path);return f}function e(l,a){var e;if(a){a=a.href||a;e=f(a);if(!e||!e.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:e})}e=f(l,e);if(!e)throw new SyntaxError;Object.defineProperty(this,"_input",{value:l,writable:!0});Object.defineProperty(this,"_url",{value:e,writable:!0});var h=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?h:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(n){}var o=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,p=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,m=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,q=/^\d*$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,s=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,t=/^([^?#\s]*)$/,l=/^([^\s]*)$/,u=/^\S*$/,w=/([^:]*):?(.*)/,v=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),y={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(l){g(l);var a;k(this._url.query).some(function(b){b=d(b);if(b[0]===l)return a=b[1],!0});return a},enumerable:!0},set:{value:function(l,a){g(l);g(a);var b=k(this._url.query);b.some(function(f,e){var h=d(f);if(h[0]===l)return h[1]=a,b[e]=c(h),!0})||b.push(c([l,a]));this._url.query=j(b)},enumerable:!0},has:{value:function(l){g(l);return k(this._url.query).some(function(a){if(d(a)[0]===
l)return!0})},enumerable:!0},"delete":{value:function(l){g(l);var a=k(this._url.query),b=a.filter(function(a){return d(a)[0]!==l});return b.length!==a.length?(this._url.query=j(b),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(l,b){if(typeof l!=="function")throw new TypeError;var f=a(this._url,"keys+values");try{for(;;){var e=f.next();l.call(b,e[1],e[0],this)}}catch(h){if(h!==v)throw h;}},enumerable:!0},keys:{value:function(){return a(this._url,
"keys")},enumerable:!0},values:{value:function(){return a(this._url,"values")},enumerable:!0},items:{value:function(){return a(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(l){g(l);var a=[];k(this._url.query).forEach(function(b){b=d(b);b[0]===l&&a.push(b[1])});return a},enumerable:!0},append:{value:function(l,a){g(l);g(a);var b=k(this._url.query);b.push(c([l,a]));this._url.query=j(b)},enumerable:!0}});Object.defineProperties(e.prototype,
{href:{get:function(){var l;if(this._url){l=this._url;var a=l.scheme?l.scheme+":":"";l.host&&(a+="//",l.userinfo&&(a+=l.userinfo+"@"),a+=l.host,l.port&&(a+=":"+l.port));a+=l.path;l.query&&(a+="?"+l.query);l.fragment&&(a+="#"+l.fragment);l=a}else l=this._input;return l},set:function(l){g(l);this._input=l;this._url=f(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:""},enumerable:!0},protocol:{get:function(){return this._url?
this._url.scheme+":":":"},set:function(l){g(l);if(this._url&&(l=l.slice(-1)===":"?l.substring(0,l.length-1):l,m.test(l)))this._url.scheme=l.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(l){g(l);if(this._url)this._url.userinfo=l}},username:{get:function(){if(!this._url)return"";var l=w.exec(this._userinfo);return decodeURIComponent(l[1]||"")},set:function(l){g(l);if(this._url){var a=w.exec(this._userinfo),l=[encodeURIComponent(l||"")];
a[2]&&l.push(a[2]);this._userinfo=l.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var l=w.exec(this._userinfo);return decodeURIComponent(l[2]||"")},set:function(l){g(l);if(this._url){var a=[w.exec(this._userinfo)[1]||""];l&&a.push(encodeURIComponent(l));this._userinfo=a.join(":")}},enumerable:!0},host:{get:function(){var l="";this._url&&this._url.host&&(l+=this._url.host,this._url.port&&(l+=":"+this._url.port));return l},set:function(l){g(l);if(this._url&&(l=s.exec(l)))this._url.host=
l[1],this._url.port=/[1-9]\d*$/.exec(l[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(l){g(l);if(this._url&&r.exec(l))this._url.host=l},enumerable:!0},port:{get:function(){var l=this._url?this._url.port||"":"";l&&l===y[this.protocol]&&(l="");return l},set:function(l){g(l);if(this._url&&q.exec(l))this._url.port=/[1-9]\d*$/.exec(l)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(l){g(l);if(this._url&&t.exec(l))this._url.host&&
l&&l[0]!=="/"&&(l="/"+l),this._url.path=l?i(l):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){g(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),l.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(l){g(l);if(this._url&&(l&&l[0]==="#"&&(l=l.substring(1)),u.exec(l)))this._url.fragment=l},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(e,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(e,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=e})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(g,k){function j(a,b){var e=Object.keys(a),c=Object.keys(b);if(e.length!==c.length)return!1;e.sort();c.sort();for(var i=0,d=e.length;i<d;i++){var m=e[i];if(m!==c[i])return!1;var q=a[m],m=b[m];if(q!==m&&JSON.stringify(q)!==JSON.stringify(m))return!1}return!0}function d(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(b){}return a}function c(a){var b=null;return{key:function(e){return(b=
b||Object.keys(a))[e]},getItem:function(b){return a[b]},setItem:function(e,c){a[e]=c;b=null},removeItem:function(e){delete a[e];b=null},clear:function(){(b=b||Object.keys(a)).forEach(function(b){delete a[b]}.bind(this));b=null}}}function a(a,b){return{type:a,plugin:b}}function b(b,f,e){function c(l,a,b){if(!I)return(new g).reject(Error("plugin not connected"));var f=z++,h=new g;h.then(null,function(l){y==="active"&&l instanceof Error&&l.name==="Cancel"&&e.postMessage({id:f,cancel:l.message||"Cancel"},
I)});P[String(f)]=h;e.postMessage({id:f,serviceId:l,method:a,params:b},I);return h.promise}function i(l){var a={};if(l.methods&&(l.methods.forEach(function(b){a[b]=function(){var a=Array.prototype.slice.call(arguments);return y==="active"?c(l.serviceId,b,a):s.start({"transient":!0}).then(function(){return c(l.serviceId,b,a)})}}),a.addEventListener&&a.removeEventListener)){var b=new k;a.dispatchEvent=b.dispatchEvent.bind(b);var f=a.addEventListener;a.addEventListener=function(l,a){b._namedListeners[l]||
f(l);b.addEventListener(l,a)};var e=a.removeEventListener;a.removeEventListener=function(l,a){b.removeEventListener(l,a);b._namedListeners[l]&&e(l)}}return a}function d(l){var a=JSON.parse(JSON.stringify(l.properties));a.__plugin__=b;l=l.names||l.type||[];Array.isArray(l)||(l=[l]);a.objectClass=l;return a}function m(l){var a=i(l),b=d(l),b=e.registerService(l.names||l.type,a,b);C[l.serviceId]={registration:b,proxy:a}}function q(){e.persist(b,{created:t,headers:l,services:u,autostart:w,lastModified:v})}
function r(l){var a;try{if(l.method)if("manifest"===l.method||"plugin"===l.method){var b=l.params[0];L({headers:b.headers,services:b.services}).then(function(){G.resolve(s)})}else if("dispatchEvent"===l.method){var f=C[l.serviceId].proxy;f.dispatchEvent.apply(f,l.params)}else if("progress"===l.method)a=P[String(l.requestId)],a.progress.apply(a,l.params);else if("timeout"===l.method)G&&G.reject(l.error);else throw Error("Bad response method: "+l.method);else if(a=P[String(l.id)],delete P[String(l.id)],
l.error){var h=e.handleServiceError(s,l.error);a.reject(h)}else a.resolve(l.result)}catch(c){console.log("Plugin._responseHandler "+c)}}var s=this,f=f||{},t=f.created||(new Date).getTime(),l=f.headers||{},u=f.services||[],w=f.autostart,v=f.lastModified||0,y="installed",A,G,I,C={},z=0,P={},L;this._persist=q;this._resolve=function(){y="resolved";e.dispatchEvent(new a("resolved",s))};this._getAutostart=function(){return w};this._getCreated=function(){return t};this.getLocation=function(){return b};this.getHeaders=
function(){return JSON.parse(JSON.stringify(l))};this.getName=function(){var l=this.getHeaders();return l?l.name||"":null};this.getVersion=function(){var l=this.getHeaders();return l?l.version||"0.0.0":null};this.getLastModified=function(){return v};this.getServiceReferences=function(){var l=[];Object.keys(C).forEach(function(a){l.push(C[a].registration.getReference())});return l};this.getState=function(){return y};this.start=function(l){if(y==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));
if(A)return A.promise.then(this.start.bind(this,l));if(y==="active")return(new g).resolve();if(!l||!l["transient"]){var f=l&&l.lazy?"lazy":"started";f!==w&&(w=f,q())}f=e.getState();if(f!=="starting"&&f!=="active")return l["transient"]?(new g).reject(Error("start transient error")):(new g).resolve();if(y==="installed")try{this._resolve()}catch(c){return(new g).reject(c)}y==="resolved"&&u.forEach(function(l){m(l)});if(l&&l.lazy)return y!=="starting"&&(y="starting",e.dispatchEvent(new a("lazy activation",
s))),(new g).resolve();var i=new g;A=i;y="starting";e.dispatchEvent(new a("starting",s));G=new g;I=e.connect(b,r);G.then(function(){G=null;y="active";e.dispatchEvent(new a("started",s));A=null;i.resolve()},function(){G=null;y="stopping";e.dispatchEvent(new a("stopping",s));Object.keys(C).forEach(function(l){C[l].registration.unregister();delete C[l]});e.disconnect(I);I=null;y="resolved";A=null;e.dispatchEvent(new a("stopped",s));i.reject(Error("plugin activation error"))});return i.promise};this.stop=
function(l){if(y==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(A)return A.promise.then(this.stop.bind(this,l));if((!l||!l["transient"])&&"stopped"!==w)w="stopped",q();if(y!=="active"&&y!=="starting")return(new g).resolve();A=l=new g;y="stopping";e.dispatchEvent(new a("stopping",s));Object.keys(C).forEach(function(l){C[l].registration.unregister();delete C[l]});I&&(e.disconnect(I),I=null);y="resolved";A=null;e.dispatchEvent(new a("stopped",s));l.resolve();return l.promise};
L=function(f){if(y==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(!f)return v===0&&(v=(new Date).getTime(),q()),e.loadManifest(b).then(L);var c=l,i=u,n=w;l=f.headers||{};u=f.services||{};w=f.autostart||w;f.lastModified?v=f.lastModified:(v=(new Date).getTime(),q());if(j(l,c)&&j(u,i)&&w===n)return(new g).resolve();if(y==="active"||y==="starting"){var o=[];Object.keys(u).forEach(function(l){var a=u[l];o.push(l);var b=C[l];if(b){if(j(a.methods,Object.keys(b.proxy))){var l=d(a),
f=b.registration.getReference(),e={};f.getPropertyKeys().forEach(function(l){e[l]=f.getProperty(l)});j(l,e)||b.registration.setProperties(l);return}b.registration.unregister();delete C[l]}m(a)});Object.keys(C).forEach(function(l){o.indexOf(l)===-1&&(C[l].registration.unregister(),delete C[l])})}y==="active"&&(e.disconnect(I),G=new g,I=e.connect(b,r),G.then(function(){G=null},function(){G=null;y="stopping";e.dispatchEvent(new a("stopping"),s);Object.keys(C).forEach(function(l){C[l].registration.unregister();
delete C[l]});e.disconnect(I);I=null;y="resolved";e.dispatchEvent(new a("stopped",s))}));return(new g).resolve()};this.update=function(l){return L(l).then(function(){e.dispatchEvent(new a("updated",s))})};this.uninstall=function(){if(y==="uninstalled")return(new g).reject(Error("Plugin is uninstalled"));if(y==="active"||y==="starting"||y==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));e.removePlugin(this);y="uninstalled";e.dispatchEvent(new a("uninstalled",
s));return(new g).resolve()}}var i=/^http[s]?/i;return{Plugin:b,PluginRegistry:function(h,f){function e(a){var l=a.source;m.some(function(b){if(l===b.target){if(typeof b.useStructuredClone==="undefined")b.useStructuredClone=typeof a.data!=="string";b.handler(b.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var f=f||{},n=f.storage||localStorage;n.getItem||(n=c(n));var o="installed",p=[],m=[],q=new k,r={},j={registerService:h.registerService.bind(h),connect:function(a,l,b){function e(a){a=
Error(a);a.name="timeout";l({method:"timeout",error:a})}var h={handler:l,url:a},c=setTimeout(e.bind(null,"Load timeout for: "+a),b||15E3),i=document.createElement("iframe");i.name=a+"_"+(new Date).getTime();if(!f.visible)i.style.display="none",i.style.visibility="hidden";i.src=a;i.onload=function(){clearTimeout(c);setTimeout(e.bind(null,"Plugin handshake timeout for: "+a),5E3)};i.sandbox="allow-scripts allow-same-origin";document.body.appendChild(i);h.target=i.contentWindow;h.close=function(){i&&
(document.body.removeChild(i),i=null)};m.push(h);return h},disconnect:function(a){for(var l=0;l<m.length;l++)if(a===m[l]){m.splice(l,1);try{a.close()}catch(b){}break}},removePlugin:function(a){for(var l=0;l<p.length;l++)if(a===p[l]){p.splice(l,1);break}n.removeItem("plugin."+a.getLocation())},persist:function(a,l){n.setItem("plugin."+a,JSON.stringify(l))},postMessage:function(a,l){l.target.postMessage(l.useStructuredClone?a:JSON.stringify(a),l.url)},dispatchEvent:function(a){try{q.dispatchEvent(a)}catch(l){console&&
console.log("PluginRegistry.dispatchEvent "+l)}},loadManifest:function(a){var l=new g,b=j.connect(a,function(a){b&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],j.disconnect(b),b=null,l.resolve(a)):"timeout"===a.method&&(j.disconnect(b),b=null,l.reject(a.error)))});return l.promise},getState:function(){return o},handleServiceError:function(a,l){if(l&&l.status===401){var b=a.getHeaders(),f=a.getName()||a.getLocation(),e=document.createElement("span");e.appendChild(document.createTextNode("Authentication required for: "+
f+"."));if(b.login)e.appendChild(document.createTextNode(" ")),f=document.createElement("a"),f.target="_blank",f.textContent="Login",f.href=b.login,i.test(f.href)?(e.appendChild(f),e.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(e)}}if(l.__isError){var h=l,l=Error(h.message);Object.keys(h).forEach(function(a){l[a]=h[a]});delete l.__isError}return l}};this.getLocation=
function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=j.getState;this.init=function(){if(!(o==="starting"||o==="active"||o==="stopping")){addEventListener("message",e,!1);for(var a=[],l=0,h=n.length;l<h;l++)a.push(n.key(l));a.forEach(function(l){if(l.indexOf("plugin.")===0){var a=l.substring(7),l=JSON.parse(n.getItem(l));l.created&&p.push(new b(a,l,j))}});
p.sort(function(l,a){return l._getCreated()<a._getCreated()?-1:1});f.plugins&&Object.keys(f.plugins).forEach(function(l){l=d(l);if(!this.getPlugin(l)){var a=f.plugins[l],a=typeof a==="object"||{};a.autostart=a.autostart||f.defaultAutostart||"lazy";p.push(new b(l,a,j))}}.bind(this));o="starting"}};this.start=function(){o!=="starting"&&this.init();if(o!=="starting")return(new g).reject("Cannot start framework. Framework is already "+o+".");var a=[],l=(new Date).getTime();p.forEach(function(b){var f=
b._getAutostart();b.getLastModified()===0?a.push(b.update().then(function(){if("started"===f)return b.start({"transient":!0});if("lazy"===f)return b.start({lazy:!0,"transient":!0});b._resolve()})):"started"===f?a.push(b.start({"transient":!0})):"lazy"===f?(a.push(b.start({lazy:!0,"transient":!0})),l>b.getLastModified()+864E5&&b.update()):b._resolve()});return g.all(a,function(l){console.log("PluginRegistry.stop "+l)}).then(function(){o="active"})};this.stop=function(){if(o!=="starting"&&o!=="active")return(new g).reject("Cannot stop registry. Registry is already "+
o+".");o="stopping";var a=[];p.forEach(function(l){a.push(l.stop({"transient":!0}))});return g.all(a,function(l){console.log("PluginRegistry.stop "+l)}).then(function(){removeEventListener("message",e);o="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new g).reject("Cannot uninstall registry")};this.installPlugin=function(f,l){var f=d(f),e=this.getPlugin(f);if(e)return(new g).resolve(e);if(r[f])return r[f];if(l)return e=new b(f,l,j),p.push(e),
e._persist(),j.dispatchEvent(new a("installed",e)),(new g).resolve(e);var h=j.loadManifest(f).then(function(l){e=new b(f,l,j);p.push(e);e._persist();delete r[f];j.dispatchEvent(new a("installed",e));return e},function(l){delete r[f];throw l;});return r[f]=h};this.getPlugins=function(){return p.slice()};this.getPlugin=function(a){var l=null,a=d(a);p.some(function(b){if(a===b.getLocation())return l=b,!0});return l};this.addEventListener=q.addEventListener.bind(q);this.removeEventListener=q.removeEventListener.bind(q);
this.resolvePlugins=function(){var a=!0;p.forEach(function(l){a=a&&l._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function g(d,c){function a(a){var b=a.getProperty("service.id"),f=this.addingService(a);f&&(i[b]=a,h[b]=f)}function b(a){var b=a.getProperty("service.id"),f=h[b];delete i[b];delete h[b];this.removedService(a,f)}this.serviceRegistry=d;var i={},h={},f=k,e,n;this.close=function(){if(f!==j)throw"Already closed";f=k;d.removeEventListener("registered",e);d.removeEventListener("unregistering",n);n=e=null;var a=this;this.getServiceReferences().forEach(function(f){b.call(a,
f)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return i.length?Object.keys(i).map(function(a){return i[a]}):null};this.open=function(){if(f!==k)throw"Already open";f=j;var h=this;e=function(b){if(b.serviceReference.getProperty("objectClass").indexOf(c)!==-1&&(a.call(h,b.serviceReference),typeof h.onServiceAdded==="function"))return h.onServiceAdded(b.serviceReference,h.serviceRegistry.getService(b.serviceReference))};n=function(a){a.serviceReference.getProperty("objectClass").indexOf(c)!==
-1&&b.call(h,a.serviceReference)};d.addEventListener("registered",e);d.addEventListener("unregistering",n);d.getServiceReferences(c).forEach(function(b){a.call(h,b)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;g.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return g});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(g,k){var j,d,c,a,b,i="pid";j=function(a,b,h){function c(a,f,h){f.forEach(function(l,c){try{var i=a[c].getProperty("__plugin__"),d=i&&b.getPlugin(i);(!i||d&&d.getState()==="active")&&f[c].updated(h)}catch(n){typeof console!=="undefined"&&console.log(n)}})}k.call(this,a,"orion.cm.managedservice");var d={},m={},q=function(b){var e=[];b.plugin.getServiceReferences().forEach(function(b){if(b.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var l=b.getProperty(i),b=a.getService(b);l&&b&&(l=(l=h._find(l))&&l.getProperties(),e.push(b.updated(l)))}});return g.all(e)};this.addingService=function(b){var e=b.getProperty(i),h=a.getService(b);if(!e||!h)return null;d[e]||(d[e]=[]);m[e]||(m[e]=[]);d[e].push(b);m[e].push(h);return h};this.onServiceAdded=function(a,b){var f=a.getProperty(i),f=h._find(f);c([a],[b],f&&f.getProperties())};this.onOpen=function(){b.addEventListener("started",q)};this.onClose=function(){b.removeEventListener("started",
q)};this.notifyUpdated=function(a){var b=a.getPid();c(d[b]||[],m[b]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();c(d[a]||[],m[a]||[],null)};this.removedService=function(a,b){var f=a.getProperty(i),l=d[f],e=m[f];l.length>1?l.splice(l.indexOf(a),1):delete d[f];e.length>1?e.splice(e.indexOf(b),1):delete m[f]}};d=function(){function b(f,h,i){this.store=new c(this,i);this.configAdmin=new a(this,this.store);this.tracker=new j(f,h,this.store)}b.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(b){a.tracker.open();return b})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return b}();a=function(){function a(b,f){this.factory=b;this.store=f}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var h="/cm/configurations";
c=function(){function a(f,c){this.factory=f;this.prefsService=c;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(h).then(function(a){d.pref=a;a.keys().forEach(function(f){if(!d.configs[f]){var e=a.get(f);typeof e==="object"&&e!==null&&Object.keys(e).length>0&&(e[i]=f,d.configs[f]=new b(d.factory,d,e))}})})}a.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var f=this._find(a);
f||(f=new b(this.factory,this,a),this.configs[a]=f);return f},list:function(){var a=this,b=[];this.pref.keys().forEach(function(f){(f=a._find(f))&&f.getProperties()!==null&&b.push(f)});return b},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,b){this.pref.put(a,b.getProperties(!0)||{})}};return a}();b=function(){function a(b){for(var f={},e=Object.keys(b),h=0;h<e.length;h++){var c=e[h],i=b[c];f[c]=i instanceof Array?i.slice():i}return f}function b(e,h,c){this.factory=
e;this.store=h;if(c!==null&&typeof c==="object")this.pid=c[i],e=a(c),delete e[i],this.properties=e;else if(typeof c==="string")this.pid=c,this.properties=null;else throw Error("Invalid pid/properties "+c);}b.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(b){this._checkRemoved();var e=null;if(this.properties&&(e=a(this.properties),!b))e[i]=this.pid;return e},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(b){this._checkRemoved();b=a(b);delete b[i];this.properties=b;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return b}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(g,k,j,d,c,a){var b;return{startup:function(){if(b)return b;b=new k;var i=new j.ServiceRegistry,h=new d.PreferencesService(i);return h.getPreferences("/plugins").then(function(f){var e={plugins:{}};f.keys().forEach(function(a){var b=g.toUrl(a);e.plugins[b]=f[a]});var d=new c.PluginRegistry(i,e);return d.start().then(function(){if(i.getServiceReferences("orion.core.preference.provider").length>
0)return h.getPreferences("/plugins",h.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=g.toUrl(a);d.getPlugin(a)||b.push(d.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return k.all(b,function(a){console.log(a)})})}).then(function(){return(new a.ConfigurationAdminFactory(i,d,h)).getConfigurationAdmin().then(i.registerService.bind(i,"orion.cm.configadmin"))}).then(function(){var a=i.getService("orion.core.auth");
if(a){var b=a.getUser().then(function(b){if(b)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),f=localStorage.getItem("lastLogin");if(!f||f<(new Date).getTime()-9E5)return b}}).then(function(){var a={serviceRegistry:i,preferences:h,pluginRegistry:d};b.resolve(a);return a})})}}});
(function(){function g(c,a,b,i,h,f){a[c]&&(b.push(c),(a[c]===!0||a[c]===1)&&i.push(h+c+"/"+f))}function k(c,a,b,i,h){a=i+a+"/"+h;require._fileExists(c.toUrl(a+".js"))&&b.push(a)}function j(c,a,b){for(var i in a)a.hasOwnProperty(i)&&(!c.hasOwnProperty(i)||b)?c[i]=a[i]:typeof a[i]==="object"&&j(c[i],a[i],b)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(c){var a=c.config?c.config():{};return{version:"2.0.1+",load:function(b,c,h,f){f=f||{};if(f.locale)a.locale=f.locale;
var e=d.exec(b),n=e[1],o=e[4],p=e[5],m=o.split("-"),q=[],r={},s,t="";if(e[5])n=e[1],b=n+p;else{p=e[4];o=a.locale;if(!o)o=a.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();m=o.split("-")}if(f.isBuild){q.push(b);k(c,"root",q,n,p);for(s=0;s<m.length;s++)f=m[s],t+=(t?"-":"")+f,k(c,t,q,n,p);c(q,function(){h()})}else c([b],function(l){var a=[],b;g("root",l,a,q,n,p);for(s=0;s<m.length;s++)b=m[s],t+=(t?"-":"")+b,g(t,l,a,q,n,p);c(q,function(){var b,
f,e;for(b=a.length-1;b>-1&&a[b];b--){e=a[b];f=l[e];if(f===!0||f===1)f=c(n+e+"/"+p);j(r,f)}h(r)})})}}})})();
define("orion/i18n",[],function(){return{load:function(g,k,j,d){var d=d||{},c=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,a=c.exec(g);if(a)if(k.defined(g))j(k(g));else if(d.isBuild||d.isTest)j({});else{var b=a[1],i=a[3]?a[2]:"",h=a[3]||a[2];k(["orion/bootstrap"],function(f){f.startup().then(function(f){var n=f.serviceRegistry,f=n.getServiceReferences("orion.i18n.message");if(i)f.some(function(a){return g===a.getProperty("name")?(n.getService(a).getMessageBundle().then(function(a){j(a)},function(){j({})}),
!0):!1})||j({});else{var o={},p;f.forEach(function(f){var e=f.getProperty("name");if((a=c.exec(e))&&b===a[1]&&h===(a[3]||a[2]))if(i=a[3]?a[2]:""){if((f=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&f.toLowerCase().indexOf(i.toLowerCase())===0)o[i]=!0,k.specified(e)||define(e,["orion/i18n!"+e],function(a){return a})}else p=f});k.specified(g)?j(o):p?n.getService(p).getMessageBundle().then(function(a){Object.keys(o).forEach(function(b){typeof a[b]==="undefined"&&
(a[b]=o[b])});define(g,[],a);j(a)},function(){define(g,[],o);j(o)}):(define(g,[],o),j(o))}})})}else j(null)}}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}","An error occurred: ":"An error occurred: ","No File Selected":"No File Selected","There are unsaved changes.  Do you still want to navigate away?":"There are unsaved changes.  Do you still want to navigate away?","Search Files":"Search Files","Enter search term:":"Enter search term:","Toggle Outliner":"Toggle Outliner","There are unsaved changes.":"There are unsaved changes.",Save:"Save","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.","Reading metedata of":"Reading metedata of ${0}",Reading:"Reading ${0}","Save this file":"Save this file","Go to Line":"Go to Line","Go to specified line number":"Go to specified line number","Go to line:":"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find","No response from server.  Check your internet connection and try again.":"No response from server.  Check your internet connection and try again.",
"Saving file {0}":"Saving file ${0}","Running {0}":"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",New:"New",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/webui/littlelib",[],function(){function g(a,b){b||(b=document);return b.querySelectorAll(a)}function k(a,b){var f=a.compareDocumentPosition(b);return a===b||Boolean(f&16)}function j(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var f=j(a.childNodes[b]);if(f)return f}return null}function d(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;b>=0;b--){var f=d(a.childNodes[b]);if(f)return f}return null}function c(b,
h){if(b.nodeType===3){var f=a.exec(b.nodeValue);f&&f.length>1&&h(b,f)}if(b.hasChildNodes())for(f=0;f<b.childNodes.length;f++)c(b.childNodes[f],h)}var a=/\$\{([^\}]+)\}/,b=[];return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:g,$$array:function(a,b){return Array.prototype.slice.call(g(a,b))},node:function(a){var b=a;typeof a==="string"&&(b=document.getElementById(a));return b},contains:k,bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.body.scrollLeft,top:a.top+
document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:j,lastTabbable:d,stop:function(a){window.document.all?a.keyCode=0:(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){c(a,function(a,e){a.parentNode.replaceChild(document.createTextNode(b[e[1]]||e[1]),a)})},processDOMNodes:function(a,b){c(a,function(a,e){var c=b[e[1]];if(c){var d=document.createRange(),i=e.index;d.setStart(a,i);d.setEnd(a,
i+e[0].length);d.deleteContents();d.insertNode(c)}})},addAutoDismiss:function(a,h){b.length===0&&document.addEventListener("click",function(a){for(var e=[],h=0;h<b.length;h++){var c=b[h].dismiss,d=!1,i;if(b[h].excludeNodes.every(function(b){return b&&(d=document.compareDocumentPosition(document,b)!==1)&&k(b,a.target)?(i=b,!1):!0})){try{c()}catch(q){typeof console!=="undefined"&&console&&console.error(q&&q.message)}d=document.compareDocumentPosition(document,i)!==1}d&&e.push(b[h])}b=e},!0);b.push({excludeNodes:a,
dismiss:h})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(g){function k(j,d){d||(d="orion.page.selection");this._serviceRegistry=j;g.attach(this);this._serviceRegistration=j.registerService(d,this);this._selections=null}k.prototype={getSelection:function(j){var d=this._getSingleSelection();typeof j==="function"&&j(d);return d},getSelections:function(j){var d=Array.isArray(this._selections)?this._selections.slice():[];typeof j==="function"&&j(d);return d},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(j){var d=this._selections;this._selections=Array.isArray(j)?j.length>0?j.slice():null:j?[j]:null;d!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer",
"Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it","Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown",
" is already a favorite.":" is already a favorite.","Add to the favorites list":"Add to the favorites list","Make Favorite":"Make Favorite","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was "," has been added to the favorites list.":" has been added to the favorites list.",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy",
"Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20130625-1555","Add this page to the favorites list":"Add this page to the favorites list","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ",
"Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?","Orion Home":"Orion Home","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error",
"no service registry":"no service registry","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?","You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the More menu.",
Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Open in new tab":"Open in new tab","Regular expression":"Regular expression","Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations",
"Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site","Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin",
"Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion."});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("text",["module"],function(g){var k,j,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],c=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b=typeof location!=="undefined"&&location.href,i=b&&location.protocol&&location.protocol.replace(/\:/,""),h=b&&location.hostname,f=b&&(location.port||void 0),e=[],n=g.config&&g.config()||{};k={version:"2.0.5",strip:function(b){if(b){var b=b.replace(c,""),f=b.match(a);f&&(b=f[1])}else b="";return b},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:n.createXhr||function(){var a,b,f;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(b=0;b<3;b+=1){f=d[b];try{a=new ActiveXObject(f)}catch(e){}if(a){d=[f];break}}return a},parseName:function(a){var b,
f,e=!1,h=a.indexOf(".");b=a.indexOf("./")===0||a.indexOf("../")===0;h!==-1&&(!b||h>1)?(b=a.substring(0,h),f=a.substring(h+1,a.length)):b=a;a=f||b;h=a.indexOf("!");h!==-1&&(e=a.substring(h+1)==="strip",a=a.substring(0,h),f?f=a:b=a);return{moduleName:b,ext:f,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,f,e){var h,c;h=k.xdRegExp.exec(a);if(!h)return!0;a=h[2];h=h[3];h=h.split(":");c=h[1];h=h[0];return(!a||a===b)&&(!h||h.toLowerCase()===f.toLowerCase())&&(!c&&!h||c===e)},finishLoad:function(a,
b,f,h){f=b?k.strip(f):f;n.isBuild&&(e[a]=f);h(f)},load:function(a,e,c,d){if(d.isBuild&&!d.inlineText)c();else{n.isBuild=d.isBuild;var r=k.parseName(a),d=r.moduleName+(r.ext?"."+r.ext:""),j=e.toUrl(d),g=n.useXhr||k.useXhr;!b||g(j,i,h,f)?k.get(j,function(l){k.finishLoad(a,r.strip,l,c)},function(a){c.error&&c.error(a)}):e([d],function(a){k.finishLoad(r.moduleName+"."+r.ext,r.strip,a,c)})}},write:function(a,b,f){if(e.hasOwnProperty(b)){var h=k.jsEscape(e[b]);f.asModule(a+"!"+b,"define(function () { return '"+
h+"';});\n")}},writeFile:function(a,b,f,e,h){var b=k.parseName(b),c=b.ext?"."+b.ext:"",d=b.moduleName+c,l=f.toUrl(b.moduleName+c)+".js";k.load(d,f,function(){var b=function(a){return e(l,a)};b.asModule=function(a,b){return e.asModule(a,l,b)};k.write(a,d,b,h)},h)}};if(n.env==="node"||!n.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)j=require.nodeRequire("fs"),k.get=function(a,b){var f=j.readFileSync(a,"utf8");f.indexOf("\ufeff")===0&&(f=f.substring(1));b(f)};else if(n.env===
"xhr"||!n.env&&k.createXhr())k.get=function(a,b,f,e){var h=k.createXhr(),c;h.open("GET",a,!0);if(e)for(c in e)e.hasOwnProperty(c)&&h.setRequestHeader(c.toLowerCase(),e[c]);if(n.onXhr)n.onXhr(h,a);h.onreadystatechange=function(){var e;if(h.readyState===4)e=h.status,e>399&&e<600?(e=Error(a+" HTTP status: "+e),e.xhr=h,f(e)):b(h.responseText)};h.send(null)};else if(n.env==="rhino"||!n.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(a,b){var f,e,h=new java.io.File(a),c=java.lang.System.getProperty("line.separator"),
h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(h),"utf-8")),d="";try{f=new java.lang.StringBuffer;(e=h.readLine())&&e.length()&&e.charAt(0)===65279&&(e=e.substring(1));for(f.append(e);(e=h.readLine())!==null;)f.append(c),f.append(e);d=String(f.toString())}finally{h.close()}b(d)};return k});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(g,k,j){return{slideoutHTMLFragment:function(d){var c=document.createElement("div");c.innerHTML=j;var a=k.$("#slideContainer",c);a.id=d+a.id;a=k.$("#pageCommandParameters",c);a.id=d+a.id;a=k.$("#pageCommandDismiss",c);a.id=d+a.id;return c.innerHTML}}});
define("orion/util",[],function(){var g=navigator.userAgent,k=parseFloat(g.split("MSIE")[1])||void 0,j=parseFloat(g.split("Firefox/")[1]||g.split("Minefield/")[1])||void 0,d=g.indexOf("Opera")!==-1,c=parseFloat(g.split("Chrome/")[1])||void 0,a=g.indexOf("Safari")!==-1&&!c,b=parseFloat(g.split("WebKit/")[1])||void 0,i=g.indexOf("Android")!==-1,h=g.indexOf("iPad")!==-1,g=g.indexOf("iPhone")!==-1,f=h||g,e=navigator.platform.indexOf("Mac")!==-1,n=navigator.platform.indexOf("Win")!==-1,o=navigator.platform.indexOf("Linux")!==
-1;return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,f){return b[(f<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:k,isFirefox:j,isOpera:d,isChrome:c,isSafari:a,isWebkit:b,isAndroid:i,isIPad:h,isIPhone:g,isIOS:f,isMac:e,isWindows:n,isLinux:o,platformDelimiter:n?"\r\n":"\n"}});
define("orion/keyBinding",["orion/util"],function(g){function k(d,c,a,b,i,h){this.type=h||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=c!==void 0&&c!==null?c:!1;this.mod2=a!==void 0&&a!==null?a:!1;this.mod3=b!==void 0&&b!==null?b:!1;this.mod4=i!==void 0&&i!==null?i:!1}function j(d){this.keys=d}k.prototype={getKeys:function(){return[this]},match:function(d,c){if(c!==void 0){if(c!==0)return!1}else if(d instanceof Array){if(d.length>1)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(g.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(g.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:g.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d?!1:this.keyCode!==d.keyCode?!1:this.mod1!==d.mod1?!1:this.mod2!==d.mod2?!1:this.mod3!==d.mod3?!1:this.mod4!==d.mod4?!1:this.type!==d.type?!1:!0}};j.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(d,c){var a=this.keys;if(c!==void 0)return c>a.length?!1:a[c].match(d)?c===a.length-1?!0:c+1:!1;else{d instanceof Array||(d=[d]);if(d.length>a.length)return!1;var b;for(b=0;b<d.length;b++)if(!a[b].match(d[b]))return!1;return b===a.length?!0:b}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var c=0;c<d.keys.length;c++)if(!d.keys[c].equals(this.keys[c]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:j}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(g,k){function j(d){this._init(d)}j.prototype={_init:function(d){this._dropdownNode=k.node(d.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._triggerNode=k.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";this._populate=d.populate;var c=this;this._triggerNode.addEventListener("click",function(a){c.toggle()&&k.stop(a)},!1);this._triggerNode.tagName.toLowerCase()===
"span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===k.KEY.ENTER||a.keyCode===k.KEY.SPACE)c.toggle(),k.stop(a)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")?this.close():this.open()},open:function(){this._populate&&(this.empty(),this._populate(this._dropdownNode));var d=this.getItems();if(d.length>0){if(!this._hookedAutoDismiss){var c=k.$$(".dropdownSubMenu",
this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(c)),this.close.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._dropdownNode.classList.add("dropdownMenuOpen");this._positionDropdown();d[0].focus();return!0}return!1},_positionDropdown:function(){this._dropdownNode.style.left="";var d=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(d.left+d.width>c.left+c.width)this._dropdownNode.style.right=
0},_boundingNode:function(d){return d.style.right!==""||d.style.position==="absolute"||!d.parentNode||!d.parentNode.style?d:this._boundingNode(d.parentNode)},close:function(d){this._triggerNode.classList.remove("dropdownTriggerOpen");this._dropdownNode.classList.remove("dropdownMenuOpen");d&&this._triggerNode.focus();return!0},getItems:function(){var d=[],c=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===c._dropdownNode&&
d.push(a)});return d},empty:function(){var d=this;k.$$array("li",this._dropdownNode).forEach(function(c){c.parentNode===d._dropdownNode&&c.parentNode.removeChild(c)})},_dropdownKeyDown:function(d){if(d.keyCode===k.KEY.UP||d.keyCode===k.KEY.DOWN||d.keyCode===k.KEY.RIGHT||d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.LEFT){var c=this.getItems(),a=document.activeElement;if(c.length&&c.length>0&&a){var b=c.indexOf(a);b<0&&(b=c.indexOf(a.parentNode));b>=0&&(d.keyCode===k.KEY.UP&&b>0?(b--,c[b].focus()):d.keyCode===
k.KEY.DOWN&&b<c.length-1?(b++,c[b].focus()):d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.RIGHT?a.classList.contains("dropdownTrigger")&&a.dropdown&&a.dropdown.open():d.keyCode===k.KEY.LEFT&&a.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),k.stop(d))}}else d.keyCode===k.KEY.ESCAPE&&(this.close(!0),k.stop(d))}};j.prototype.constructor=j;return{Dropdown:j}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<span class="dropdownArrowDown"></span></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0">${ButtonText}<span class="dropdownArrowRight"></span></span><ul class="dropdownMenu"></ul></li>'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(g,k){function j(d){this._init(d)}j.prototype={_init:function(d){this._node=k.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=d.hideDelay===void 0?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var c=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",function(a){a.target===c._node&&(c.show(),k.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=d.showDelay===void 0?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",function(a){k.contains(c._node,a.target)&&(c.show(),k.stop(a))},!1);for(var a=0;a<d.length;a++)this._node.addEventListener(d[a],function(a){k.contains(c._node,a.target)&&c.hide()},!1)}},_makeTipNode:function(){if(!this._tip){this._tip=
document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("span");this._tipInner.classList.add("tooltip");this._text&&this._tipInner.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);document.body.appendChild(this._tip);var d=this;k.addAutoDismiss([this._tip,this._node],function(){d.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),
this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(d._timeout)window.clearTimeout(d._timeout),d._timeout=null;d._tip.addEventListener("mouseout",function(c){k.contains(d._tip,c.target)&&(d.hide(),k.stop(c))},!1)},!1)}return this._tip},_positionTip:function(d,c){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var a=this._node,b;for(b=k.bounds(a);a&&!b.width&&!b.height;a=a.parentNode)b=
k.bounds(a);var a=k.bounds(this._tipInner),i;switch(d){case "above":i=b.top-a.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":i=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":i=b.top-this._tailSize/2;b=b.left-a.width-this._tailSize-1;break;default:i=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var h=k.bounds(document.documentElement);if(i+a.height>h.height)if(c)i=h.height-a.height-1;else return!1;if(b+a.width>h.width)if(c)b=h.width-a.width-
1;else return!1;if(b<0)if(c)b=4;else return!1;if(i<0)if(c)i=4;else return!1;if(!this._tail&&(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+d),d==="above"||d==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),d==="left"))this._tail.style.left=a.width+"px";this._tip.style.top=i+"px";this._tip.style.left=b+"px";this._tip.style.width=a.width+"px";this._tip.style.height=a.height+"px";return!0},contentContainer:function(){this._makeTipNode();
return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){var d=this;if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){for(var c=!1,a=0;!c&&a<d._position.length;)c=d._positionTip(d._position[a]),a++;c||d._positionTip(d._position[0],!0);d._tip.classList.add("tooltipShowing");d._afterShowing&&d._afterShowing()},this._showDelay)}},hide:function(d){if(this._timeout)window.clearTimeout(this._timeout),
this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(d===void 0)d=this._hideDelay;var c=this;this._timeout=window.setTimeout(function(){c._tip.classList.remove("tooltipShowing");c._tip.removeAttribute("style");c._afterHiding&&c._afterHiding()},d)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipInner=this._tip=null}};j.prototype.constructor=j;return{Tooltip:j}});
define("orion/commands","require,orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(g,k,j,d,c,a,b,i){function h(a,b){for(var f in b)if(b[f]&&b[f].keyBinding&&b[f].command&&b[f].keyBinding.match(a)){var e=b[f],h=e.keyBinding;if(!h.domScope||j.contains(j.node(h.domScope),a.target)){var l=e.invocation;if(l){var c=e.command;if(c.hrefCallback){j.stop(a);
f=c.hrefCallback.call(l.handler||window,l);f.then?f.then(function(a){window.open(a)}):window.open(f);break}else if(c.onClick||c.callback){j.stop(a);window.setTimeout(function(){(c.onClick||c.callback).call(l.handler||window,l)},0);break}}}}}function f(a,b,f){b.classList.add("commandImage");var e;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(e=document.createElement("span"),b.appendChild(e),e.classList.add(a.spriteClass),e.classList.add(a.imageClass)):(e=new Image,e.alt=a.name,
e.name=f,e.id=f,e.src=a.image,b.appendChild(e));return e}function e(a,b,f,e,h){this.commandRegistry=h;this.handler=a;this.items=b;this.userData=f;this.command=e;if(e.parameters)this.parameters=e.parameters.makeCopy();this.id=e.id}function n(a){this._init(a)}var o=null,p={};window.document.addEventListener("keydown",function(a){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===
90)?!0:!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var b=a.target.nodeName.toLowerCase();if(b==="input")switch(a.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(b===
"textarea")return}b={};if(o){var f,e,c;e=Object.keys(p);for(f=0;f<e.length;f++)c=e[f],b[c]=p[c];var l=o();e=Object.keys(l);for(f=0;f<e.length;f++)c=e[f],b[c]=l[c]}else b=p;h(a,b)},!1);e.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new e(this.handler,this.items,this.userData,this.command,this.commandRegistry);b.domNode=this.domNode;b.domParent=this.domParent;if(a)b.parameters=a.makeCopy();else if(this.parameters)b.parameters=
this.parameters.makeCopy();return b}};e.prototype.constructor=e;n.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip||a.name;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.image=a.image||g.toUrl("images/none.png");this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters},populateChoicesMenu:function(a,
b,f,e,h){this.getChoices(b,f,e).forEach(function(l){if(l.name){var f=document.createElement("li");a.appendChild(f);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");var c=document.createTextNode(l.name);e.appendChild(c);f.appendChild(e);e.choice=l;e.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1);e.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&
a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1)}else h._generateMenuSeparator(a)})},getChoices:function(a,b,f){return this.choiceCallback?this.choiceCallback.call(b,a,f):null},makeChoiceCallback:function(a,b){return function(f){a.callback&&a.callback.call(a,b,f)}},hasImage:function(){return this.imageClass||this.image!==g.toUrl("images/none.png")}};n.prototype.constructor=n;return{Command:n,CommandInvocation:e,createDropdownMenu:function(a,b,e,h,i,l){a=j.node(a);if(!a)throw"no parent node was specified";
var u=document.createRange();u.selectNode(a);u=u.createContextualFragment(c);j.processTextNodes(u,{ButtonText:b});a.appendChild(u);a=a.lastChild;u=a.previousSibling;h?u.classList.add(h):(u.classList.add("orionButton"),u.classList.add("commandButton"));if(i){if(!l)u.textContent="",u.setAttribute("aria-label",b);f({spriteClass:"commandSprite",imageClass:i},u,b);u.classList.add("orionButton")}u.dropdown=new d.Dropdown({dropdown:a,populate:e});a.dropdown=u.dropdown;return{menuButton:u,menu:a,dropdown:u.dropdown}},
createCheckedMenuItem:function(a,f,e,h){a=j.node(a);if(!a)throw"no parent node was specified";var c=document.createRange();c.selectNode(a);c=c.createContextualFragment(b);j.processTextNodes(c,{ItemText:f});a.appendChild(c);a=j.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",h,!1)},createCommandItem:function(a,b,e,h,c,l,d){var n,l=l||!b.name&&b.hasImage();if(b.hrefCallback)n=document.createElement("a"),n.id=h,l&&b.hasImage()?f(b,n,h):(n.className="commandLink",n.appendChild(document.createTextNode(b.name))),
d=b.hrefCallback.call(e.handler,e),d.then?d.then(function(a){n.href=a}):n.href=d?d:"#";else{n=document.createElement("button");n.className="orionButton";l?b.hasImage()?(f(b,n,h),b.name&&n.setAttribute("aria-label",b.name)):(n.classList.add("commandButton"),n.classList.add("commandMissingImageButton"),n.appendChild(document.createTextNode(b.name))):(n.classList.add("commandButton"),h=document.createTextNode(b.name),n.appendChild(h));var o=d||b.callback;if(o)b.onClick=o,n.addEventListener("click",function(){o.call(e.handler,
e)},!1)}a.nodeName.toLowerCase()==="ul"?(d=document.createElement("li"),a.appendChild(d),a=d):n.classList.add("commandMargins");a.appendChild(n);if(b.tooltip)n.commandTooltip=new i.Tooltip({node:n,text:b.tooltip,position:["above","below","right","left"]});c&&(p[b.id]={keyBinding:c,command:b,invocation:e});return n},createCommandMenuItem:function(a,b,f,e,h){var l,c=a.dropdown;if(b.hrefCallback)l=document.createElement("a"),l.appendChild(document.createTextNode(b.name)),h=b.hrefCallback.call(f.handler,
f),h.then?h.then(function(a){l.href=a}):l.href=h?h:"#";else{l=document.createElement("span");l.tabIndex=0;l.appendChild(document.createTextNode(b.name));var d=h||b.callback;if(d)b.onClick=d,l.addEventListener("click",function(){c.close(!0);d.call(f.handler,f)},!1)}if(b.tooltip)l.commandTooltip=new i.Tooltip({node:l,text:b.tooltip,position:["right","left","above","below"]});l.className="dropdownMenuItem";l.role="menuitem";h=document.createElement("li");a.appendChild(h);h.appendChild(l);e&&(p[b.id]=
{keyBinding:e,command:b,invocation:f});return l},setKeyBindingProvider:function(a){o=a},localKeyBindings:p,_testMethodProcessKey:h}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(c){var a="",b=navigator.platform.indexOf("Mac")!==-1;c.mod1&&(a+=b?"Cmd+":"Ctrl+");c.mod2&&(a+="Shift+");c.mod3&&(a+="Alt+");c.mod4&&b&&(a+="Ctrl+");if(c.alphaKey)return a+c.alphaKey;if(c.type==="keypress")return a+c.keyCode;for(var d in k.KEY)if(typeof(k.KEY[d]==="number")&&k.KEY[d]===c.keyCode)return a+d;var h;switch(c.keyCode){case 59:h=c.mod2?":":";";break;case 61:h=c.mod2?"+":"=";break;case 188:h=
c.mod2?"<":",";break;case 190:h=c.mod2?">":".";break;case 191:h=c.mod2?"?":"/";break;case 192:h=c.mod2?"~":"`";break;case 219:h=c.mod2?"{":"[";break;case 220:h=c.mod2?"|":"\\";break;case 221:h=c.mod2?"}":"]";break;case 222:h=c.mod2?'"':"'"}return h?a+h:c.keyCode>=112&&c.keyCode<=123?a+"F"+(c.keyCode-111):a+String.fromCharCode(c.keyCode)}function d(c){var a=window.navigator.platform.indexOf("Mac")!==-1;return a&&c.metaKey||!a&&c.ctrlKey}return{getUserKeyString:function(c){for(var a="",c=c.getKeys(),
b=0;b<c.length;b++)b!==0&&(a+=" "),a+=j(c[b]);return a},getUserText:function(c,a,b,d,h,f,e,n,o){var p=!1,e=function(e){return function(n){if(!p){var m=k.node(c),j=m.value;if(m)if(e&&n.keyCode===k.KEY.ESCAPE){if(b)a.style.display="inline";p=!0;m.parentNode.removeChild(m);f&&f()}else if(!(e&&n.keyCode!==k.KEY.ENTER)){if(j.length===0||!o&&j===d){if(b)a.style.display="inline"}else h(j);p=!0;m.parentNode&&m.parentNode.removeChild(m);f&&f()}}}},m=document.createElement("input");m.id=c;m.value=d||"";a.parentNode.insertBefore(m,
a.nextSibling);m.classList.add("userEditBoxPrompt");if(b)a.style.display="none";m.addEventListener("keydown",e(!0),!1);m.addEventListener("blur",e(!1),!1);window.setTimeout(function(){m.focus();if(d){var a=k.node(c),b=n?d.indexOf(n):-1;if(b>0)if(a.createTextRange)a=a.createTextRange(),a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",b),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,b);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=b}else a.select()}},
0)},openInNewWindow:d,followLink:function(c,a){a&&d(a)?window.open(c):window.location=c},createButton:function(c,a){var b=document.createElement("button");b.className="orionButton commandButton commandMargins";b.addEventListener("click",function(b){a();k.stop(b)},!1);c&&b.appendChild(document.createTextNode(c));return b},createDropdownButton:function(){}}});
define("orion/PageUtil",[],function(){var g=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,k=/^http[s]?/i;return{matchResourceParameters:function(j){var j=j||window.location.toString(),d={resource:""},c=j.indexOf("#");if(c!==-1&&(j=j.substring(c+1),j.length!==0)){j=j.split(",");Object.defineProperty(d,"resourceRaw",{value:j[0]});d.resource=decodeURIComponent(j[0]);if(!d.resource.match(g))d.resource=encodeURI(d.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(c=1;c<j.length;c++){var a=
/([^=]*)(=?)(.*)/.exec(j[c]),b=decodeURIComponent(a[1]||""),a=decodeURIComponent(a[3]||"");b!==""&&b!=="resource"&&(d[b]=a)}}return d},validateURLScheme:function(j,d){var c=j;if(j.indexOf("://")===-1){var a=document.createElement("a");a.href=j;c=a.href}a=!1;return(a=d?d.some(function(a){return RegExp("^"+a+":","i").test(c)}):k.test(c))?j:(console.log("Illegal URL Scheme: '"+j+"'"),"")}}});
define("orion/explorers/navigationUtils",[],function(){function g(j,d){if(!k&&j)j.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,d,c){j&&(j=j.getGridNavHolder(d,!0))&&g(j,c)},generateNavGrid:g,removeNavGrid:function(j,d){if(j)for(var c=0;c<j.length;c++)if(j[c].domNode===d){j.splice(c,1);break}}}});
define("orion/commandRegistry","require,orion/commands,orion/uiUtils,orion/PageUtil,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip,orion/explorers/navigationUtils".split(","),function(g,k,j,d,c,a,b,i,h,f,e){function n(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function o(a,b){this.token=a;this.parameterName=b}function p(a,b,f,e,l){this.name=a;this.type=b;this.label=f;this.value=e;this.lines=l||1}function m(a,b,f){this._storeParameters(a);this._hasOptionalParameters=b&&b.hasOptionalParameters;this._options=b;this.optionsRequested=!1;this.getParameters=f;this.clientCollect=b&&b.clientCollect}n.prototype={_init:function(a){this._selectionService=a.selection;var b=this;k.setKeyBindingProvider(function(){return b._activeBindings})},processURL:function(a){for(var b in this._urlBindings)if(this._urlBindings[b]&&
this._urlBindings[b].urlBinding&&this._urlBindings[b].command){var f=this._urlBindings[b].urlBinding.match(a);if(f){var e=this._urlBindings[b],l=e.command,h=e.invocation;if(h&&h.parameters&&l.callback){h.parameters.setValue(f.parameterName,f.parameterValue);var c=this;window.setTimeout(function(){c._invoke(h)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,b,f,e){b?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback&&this._invoke(new k.CommandInvocation(f,
b,null,a,this),e):(b=this._urlBindings[a])&&b.command&&b.command.callback&&this._invoke(b.invocation,e)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,b,f){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,b,f))},confirm:function(a,b,f,e,l,h){var c=!1;if(this._parameterCollector&&!l){var d=this;this._parameterCollector.close();if(this._parameterCollector.open(a,
function(a,l){var h=document.createElement("span");h.classList.add("parameterPrompt");h.textContent=b;a.appendChild(h);h=document.createElement("button");h.addEventListener("click",function(){c=!0;d._parameterCollector.close()},!1);l.appendChild(h);h.appendChild(document.createTextNode(f));h.className="dismissButton";var i=document.createElement("button");i.addEventListener("click",function(){c=!1;d._parameterCollector.close()},!1);l.appendChild(i);i.appendChild(document.createTextNode(e));i.className=
"dismissButton";return h},function(){h(c)}))return}c=window.confirm(b);h(c)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,b){return this._collectAndInvoke(a.makeCopy(b),!1)},_collectAndInvoke:function(a,b){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){var e=!1;a.parameters.updateParameters(a);
if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a),!e)){var h=new f.Tooltip({node:a.domNode,trigger:"click",position:["below","right","above","left"]}),e=h.contentContainer();e.classList.add("parameterPopup");var l=window.document.activeElement,c=this._parameterCollector.getFillFunction(a,function(){l&&l.focus();h.destroy()})(e);h.show();window.setTimeout(function(){c.focus();c.select()},0);e=!0}e||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||
window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function b(a){var l=a.invocation;if(l)if(a=a.command,a.hrefCallback)l=a.hrefCallback.call(l.handler||window,l),l.then?l.then(function(a){window.open(a)}):window.open(l);else if(a.onClick||a.callback)(a.onClick||a.callback).call(l.handler||window,l)}function f(a){return function(){b(a)}}var e=
{},l,h,c=[],d;for(d in this._activeBindings)(h=this._activeBindings[d])&&h.keyBinding&&h.command&&c.push(h);c.sort(function(a,l){return a.command.name.localeCompare(l.command.name)});for(d=0;d<c.length;d++)h=c[d],h.keyBinding.scopeName?(e[h.keyBinding.scopeName]||(e[h.keyBinding.scopeName]=[]),e[h.keyBinding.scopeName].push(h)):(l=j.getUserKeyString(h.keyBinding),a.createItem(l,h.command.name,f(h)));for(var i in e)e[i].length&&e[i].length>0&&(a.createHeader(i),e[i].forEach(function(b){l=j.getUserKeyString(b.keyBinding);
a.createItem(l,b.command.name,f(b))}))},addCommand:function(a){this._commandList[a.id]=a;var b=this._pendingBindings[a.id];if(b){var f=this;b.forEach(function(b){f._addBinding(a,b.type,b.binding,b.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,b,f,e,l,h,c,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];l&&(a=this._createEntryForPath(a,l));if(a[b]){if(e)a[b].title=e;if(f)a[b].position=f;if(c)a[b].imageClass=
c;if(d)a[b].tooltip=d;a[b].emptyGroupMessage=h}else a[b]={title:e,position:f,emptyGroupMessage:h,imageClass:c,tooltip:d,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,b){b&&b.split("/").forEach(function(b){if(b.length>1)a[b]||(a[b]={position:0,children:{}}),a=a[b].children});return a},registerSelectionService:function(a,b){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=b},registerCommandContribution:function(a,
b,f,e,l,h,c){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];e&&(a=this._createEntryForPath(a,e));a[b]={position:f};h&&((f=this._commandList[b])?this._addBinding(f,"key",h,l):this._addPendingBinding(b,"key",h,l));c&&((f=this._commandList[b])?this._addBinding(f,"url",c,l):this._addPendingBinding(b,"url",c,l));a.sortedContributions=null},_addBinding:function(a,b,f,e){if(!a.id)throw Error("No command id: "+a);b==="key"?this._activeBindings[a.id]=
{command:a,keyBinding:f,bindingOnly:e}:b==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:f,bindingOnly:e})},_addPendingBinding:function(a,b,f,e){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:b,binding:f,bindingOnly:e})},_checkForTrailingSeparator:function(a,b,f){var e;if(b==="tool"||b==="button")if((e=a.childNodes.length>0?a.childNodes[a.childNodes.length-1]:null)&&e.classList.contains("commandSeparator"))return f?(a.removeChild(e),!1):!0;if(b===
"menu"&&(a=c.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(e=a[a.length-1],f)e.parentNode.parentNode.removeChild(e.parentNode);else return!0;return!1},renderCommands:function(a,b,f,e,l,h,d){if(typeof a!=="string")throw"a scope id for rendering must be specified";b=c.node(b);if(!b)throw"no parent";var i=this._contributionsByScopeId[a];if(!f&&i){var f=i.localSelectionService||this._selectionService,n=this;f&&f.getSelections(function(f){n.renderCommands(a,
b,f,e,l,h)})}else i&&(this._render(this._contributionsByScopeId[a],b,f,e,l||"button",h,d),this._checkForTrailingSeparator(b,l,!0))},destroy:function(a){a=c.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var b=a.firstChild;b.commandTooltip&&b.commandTooltip.destroy();b.emptyGroupTooltip&&b.emptyGroupTooltip.destroy();this.destroy(b);a.removeChild(b)}},_render:function(a,b,h,c,l,d,i){var n=a.sortedContributions;if(!n){var n=[],m=!1,o;for(o in a)if(!a.hasOwnProperty||a.hasOwnProperty(o)){var p=
a[o];if(p&&typeof p.position==="number")p.id=o,n.push(p),m=!0}if(m)n.sort(function(a,b){return a.position-b.position}),a.sortedContributions=n}var j=0,g=this;n.forEach(function(a){var n,m;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){n=a.children;var o;if(l==="tool"||l==="button")if(a.title)o=g._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip),i&&e.generateNavGrid(i,o.menuButton),window.setTimeout(function(){g._render(a.children,o.menu,
h,c,"menu",d,i);g._checkForTrailingSeparator(o.menu,"menu",!0);if(o.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!o.menuButton.emptyGroupTooltip)o.menuButton.emptyGroupTooltip=new f.Tooltip({node:o.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else i&&e.removeNavGrid(i,o.menuButton),o.menu.parentNode&&o.menu.parentNode.removeChild(o.menu),o.destroyButton&&o.destroyButton.parentNode&&o.destroyButton.parentNode.removeChild(o.destroyButton);
else o.menuButton.style.visibility="visible"},0);else{var v;b.childNodes.length>0&&!g._checkForTrailingSeparator(b,l)&&(v=g.generateSeparatorImage(b));g._render(n,b,h,c,l,d,i);b.childNodes.length>0&&b.childNodes[b.childNodes.length-1]!==v&&(v=g.generateSeparatorImage(b))}else if(a.title){if(v=g._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))g._render(n,v.menu,h,c,"menu",d,i),v.menu.childNodes.length===0&&v.destroyButton&&b.removeChild(v.destroyButton)}else b.childNodes.length>0&&g._generateMenuSeparator(b),
g._render(n,b,h,c,l,d,i),g._generateMenuSeparator(b)}else{var p=g._commandList[a.id];n=p?!0:!1;var q=null,q=null;if(p){m=new k.CommandInvocation(c,h,d,p,g);m.domParent=b;v=n&&(p.visibleWhen?p.visibleWhen(h):!0);if(g._activeBindings[p.id]&&g._activeBindings[p.id].keyBinding)q=g._activeBindings[p.id],q.invocation=v?m:null,q.bindingOnly&&(n=!1);if(g._urlBindings[p.id]&&g._urlBindings[p.id].urlBinding)q=g._urlBindings[p.id],q.invocation=v?m:null,q.bindingOnly&&(n=!1);n=n&&v}if(n)p.choiceCallback?(l===
"tool"||l==="button"?(n=b,v=!1,b.nodeName.toLowerCase()==="ul"&&(n=document.createElement("li"),b.appendChild(n))):(n=b,v=!0),g._createDropdownMenu(n,p.name,v,function(a){p.populateChoicesMenu(a,h,c,d,g)}.bind(p),p.imageClass,p.tooltip||p.title)):(m.handler=m.handler||this,m.domParent=b,v=function(){g._invoke(m)},l==="menu"?n=k.createCommandMenuItem(b,p,m,null,v):(n=l+p.id+j,n=k.createCommandItem(b,p,m,n,null,l==="tool",v)),e.generateNavGrid(i,n),m.domNode=n,j++)}})},_createDropdownMenu:function(b,
e,h,d,l,n){b=c.node(b);if(!b||!c.contains(document.body,b))return null;var m,o=b;if(h)n=document.createRange(),n.selectNode(b),n=n.createContextualFragment(i),c.processTextNodes(n,{ButtonText:e}),b.appendChild(n),m=b.lastChild,b=m.lastChild,e=b.previousSibling,e.dropdown=new a.Dropdown({dropdown:b,populate:d}),b.dropdown=e.dropdown;else if(b.nodeName.toLowerCase()==="ul"&&(o=document.createElement("li"),b.appendChild(o),m=o),b=null,l&&(b="dropdownButtonWithIcon",n=n||e),n=l?n||e:n,d=k.createDropdownMenu(o,
e,d,b,l),e=d.menuButton,b=d.menu,n)e.commandTooltip=new f.Tooltip({node:e,text:n,position:["above","below","right","left"]});return{menuButton:e,menu:b,dropdown:e.dropdown,destroyButton:m}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var b=document.createElement("li");b.classList.add("dropdownSeparator");var f=document.createElement("span");f.classList.add("dropdownSeparator");b.appendChild(f);a.appendChild(b)}},generateSeparatorImage:function(a){var b;b=a.nodeName.toLowerCase()===
"ul"?document.createElement("li"):document.createElement("span");a.appendChild(b);b.classList.add("core-sprite-sep");b.classList.add("imageSprite");b.classList.add("commandSeparator");return b}};n.prototype.constructor=n;o.prototype={match:function(a){a=d.matchResourceParameters(a);return typeof a[this.token]!=="undefined"?(this.parameterValue=a[this.token],this):null}};o.prototype.constructor=o;p.prototype={optionsRequested:function(){return this.optionsRequested}};p.prototype.constructor=p;m.prototype=
{_storeParameters:function(a){this.parameterTable=null;if(a){var b=this.parameterTable={};a.forEach(function(a){b[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:
null},setValue:function(a,b){var f=this.parameterTable[a];if(f)f.value=b},forEach:function(a){for(var b in this.parameterTable)this.parameterTable[b].type&&this.parameterTable[b].name&&a(this.parameterTable[b])},makeCopy:function(){var a=[];this.forEach(function(b){b=new p(b.name,b.type,b.label,b.value,b.lines);a.push(b)});var b=new m(a,this._options,this.getParameters);b.clientCollect=this.clientCollect;return b},hasOptionalParameters:function(){return this._hasOptionalParameters}};m.prototype.constructor=
m;return{CommandRegistry:n,URLBinding:o,ParametersDescription:m,CommandParameter:p}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(g,k,j){function d(c,a){this._activeContainer=null;this._getElementsFunction=c;this._toolbarLayoutFunction=a}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&j.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&j.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(c,a,b){typeof c==="string"&&(c=j.node(c));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===c)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(c))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var d=a(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!d)return!1;this._activeElements.focusNode=d;c=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(c.length===0){a=this._activeElements.dismissArea||
this._activeElements.parameterArea;c=document.createElement("button");c.id="closebox";c.className="imageSprite core-sprite-close dismissButton";c.title=g.Close;a.appendChild(c);var h=this;c.addEventListener("click",function(){h.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(d)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){d.focus();d.select&&d.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(c,a){j.$$array("input",a).forEach(function(a){a.type==="checkbox"?c.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&c.parameters.setValue(a.parameterName,a.value.trim())});j.$$array("textArea",a).forEach(function(a){c.parameters.setValue(a.parameterName,a.value.trim())});c.command.callback&&c.command.callback.call(c.handler,c)},collectParameters:function(c){return c.parameters?
(c.domNode&&c.domNode.classList.add("commandMarker"),this.open(c.domNode||c.domParent,this.getFillFunction(c))):!1},getFillFunction:function(c,a){var b=this;return function(d,h){var f=null,e=function(){a&&a();b.close()},n=function(a){a.keyCode===j.KEY.ENTER&&b._collectAndCall(c,d);if(a.keyCode===j.KEY.ESCAPE||a.keyCode===j.KEY.ENTER)e(),j.stop(a)};c.parameters.forEach(function(a){var b=null;if(a.label)b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",a.name+
"parameterCollector"),b.textContent=a.label,d.appendChild(b);var h=a.name+"parameterCollector",c=b||d;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)b=document.createElement("textarea"),b.rows=a.lines,b.type="textarea",b.id=h,c.appendChild(b),n=function(a){a.keyCode===j.KEY.ESCAPE&&(e(),j.stop(a))};else if(a.type==="boolean"){if(b=document.createElement("input"),b.type="checkbox",b.id=h,c.appendChild(b),a.value)b.checked=!0}else if(b=document.createElement("input"),b.type=a.type,b.id=h,
c.appendChild(b),a.value)b.value=a.value;b.classList.add("parameterInput");b.setAttribute("speech","speech");b.setAttribute("x-webkit-speech","x-webkit-speech");b.parameterName=a.name;f||(f=b);b.addEventListener("keydown",n,!1)});var o=h;if(!o)o=document.createElement("span"),o.className="layoutRight parametersDismiss",d.appendChild(o);var p=function(a,b){var f=document.createElement("button");b.appendChild(f);a&&f.appendChild(document.createTextNode(a));f.classList.add("dismissButton");return f};
if(c.parameters.hasOptionalParameters())c.parameters.optionsRequested=!1,p(g.More,o).addEventListener("click",function(){c.parameters.optionsRequested=!0;b._collectAndCall(c,d);e()},!1);p(g.Submit,o).addEventListener("click",function(){b._collectAndCall(c,d);e()},!1);o=p(null,o);o.id="closebox";o.classList.add("imageSprite");o.classList.add("core-sprite-close");o.title=g.Close;o.addEventListener("click",function(){e()},!1);return f}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/editor/regex",[],function(){return{escape:function(g){return g.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(g){return(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))?{pattern:g[1],flags:g[2]}:null}}});
define("orion/contentTypes",[],function(){function g(a,b){function c(a,b,f,e){var f=b.filename.indexOf(f)>=0,h=b.extension.indexOf(e)>=0;if(f||h)if(!a||f&&a.extension.indexOf(e)>=0)return b;return a}for(var h=a&&a.split(".").pop(),f=null,e=0;e<b.length;e++){var d=b[e];c(f,d,a,h)===d&&(f=d)}return f}function k(a){this.serviceRegistry=a;this.map=function(a){function i(a){return a===null||typeof a==="undefined"?[]:a instanceof Array?a:[a]}for(var a=a.getServiceReferences(d).concat(a.getServiceReferences(c)),
h={},f=0;f<a.length;f++)for(var e=i(a[f].getProperty("contentTypes")),n=0;n<e.length;n++){var o=e[n];h[o.id]||(h[o.id]={id:o.id,name:o.name,image:o.image,"extends":o["extends"],extension:i(o.extension),filename:i(o.filename)})}return h}(a);a.registerService(j,this)}var j="orion.core.contenttypes",d="orion.core.contenttype",c="orion.file.contenttype";k.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return g(a.Name,this.getContentTypes())},getFilenameContentType:function(a){return g(a,this.getContentTypes())},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!1;if(a.id===b.id)return!0;else for(var c=a,h={};c&&(c=this.getContentType(c["extends"]));){if(c.id===b.id)return!0;if(h[c.id])throw Error("Cycle: "+c.id);h[c.id]=!0}return!1},
isSomeExtensionOf:function(a,b){for(var c=0;c<b.length;c++)if(this.isExtensionOf(a,b[c]))return!0;return!1}};return{ContentTypeService:k,getFilenameContentType:g}});
define("orion/URITemplate",[],function(){function g(a){this._text=a}function k(a,b){if(b==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(b==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]");if(b==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function j(a,b,e){for(var c=[],d=0;d<a.length;d++)typeof a[d]!=="undefined"&&
c.push(k(a[d],b));return c.join(e)}function d(a,b,e,c){for(var d=Object.keys(a),i=[],m=0;m<d.length;m++)typeof a[d[m]]!=="undefined"&&i.push(k(d[m],b)+e+k(a[d[m]],b));return i.join(c)}function c(a){if(a.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=b[a[0]])?a=a.substring(1):this._operator=b.NUL;for(var f=[],e=a.split(","),c=0;c<e.length;c++){var d=e[c].match(i);if(d===null)throw Error("Bad VarSpec: "+a);f.push({name:d[1],explode:!!d[2],prefix:d[3]?parseInt(d[3],
10):-1})}this._varSpecList=f}function a(a){for(var b=[],e=0,d=a.indexOf("{",e);d!==-1;){b.push(new g(a.substring(e,d)));e=a.indexOf("}",d+1);if(e===-1)throw Error("Invalid template: "+a);b.push(new c(a.substring(d+1,e)));e+=1;d=a.indexOf("{",e)}b.push(new g(a.substring(e)));this._templateComponents=b}var b={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:!1,ifemp:"",
allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:!0,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:!0,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},i=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;g.prototype={expand:function(){return encodeURI(this._text)}};c.prototype={expand:function(a){for(var b=[],e=
0;e<this._varSpecList.length;e++){var c=this._varSpecList[e],i=c.name,p=a[i],m=typeof p;if(m!=="undefined"&&p!==null){var q=b.length===0?this._operator.first:this._operator.sep;if(m==="string")this._operator.named&&(q+=k(i,"U+R"),q+=p.length===0?this._operator.ifemp:"="),c.prefix!==-1&&c.prefix<p.length&&(p=p.substring(0,c.prefix)),q+=k(p,this._operator.allow);else if(Array.isArray(p))c.explode?q+=j(p,this._operator.allow,this._operator.sep):(this._operator.named&&(q+=k(i,"U+R"),q+=p.length===0?this._operator.ifemp:
"="),q+=j(p,this._operator.allow,","));else if(m==="object")c.explode?q+=d(p,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(q+=k(i,"U+R"),q+=Object.keys(p).length===0?this._operator.ifemp:"="),q+=d(p,this._operator.allow,",",","));else throw Error("bad param type: "+i+" : "+m);b.push(q)}}return b.join("")}};a.prototype={expand:function(a){for(var b=[],e=0;e<this._templateComponents.length;e++)b.push(this._templateComponents[e].expand(a));return b.join("")}};return a});
define("orion/i18nUtil",["require","orion/Deferred"],function(g,k){function j(c){if(c=localStorage.getItem("orion/messageBundle/"+c))if(c=JSON.parse(c),c._expires&&c._expires>(new Date).getTime())return delete c._expires,c;return null}var d={};return{getMessageBundle:function(c){function a(){g(["i18n!"+c],function(a){if(a){var e=c;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+e,JSON.stringify(a));delete a._expires}b.resolve(a)})}if(d[c])return d[c];var b=new k;d[c]=
b;var i=j(c);if(i)return b.resolve(i),b;try{g([c],a)}catch(h){g(["orion/i18n!"+c],a)}return b},formatMessage:function(c){var a=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(b,c){return a[(c<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(g,k,j,d,c){function a(){return(new URL(g.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function b(b,h){var f=b.getServiceReferences(h||"orion.page.link"),e=j.matchResourceParameters(window.location.href),n={OrionHome:a(),Location:e.resource},o=[];f.forEach(function(a){var b={};a.getPropertyKeys().forEach(function(f){b[f]=a.getProperty(f)});if(b.uriTemplate&&
b.nls&&(b.name||b.nameKey)){var f=new k;c.getMessageBundle(b.nls).then(function(a){var e=new d(b.uriTemplate),e=window.decodeURIComponent(e.expand(n)),e=j.validateURLScheme(e);b.href=e;b.textContent=b.nameKey?a[b.nameKey]:b.name;f.resolve(b)});o.push(f)}else if(b.uriTemplate&&b.name){var e=new d(b.uriTemplate),e=window.decodeURIComponent(e.expand(n)),e=j.validateURLScheme(e);b.href=e;b.textContent=b.name;o.push((new k).resolve(b))}});return k.all(o)}return{createPageLinks:function(a,h){return b(a,
h).then(function(a){a.sort(function(a,b){var f=a.textContent&&a.textContent.toLowerCase(),h=b.textContent&&b.textContent.toLowerCase();return f<h?-1:f>h?1:0});return a.map(function(a){var b=a.href,a=a.textContent,f=document.createElement("a");f.href=b;f.target="_self";f.classList.add("targetSelector");f.textContent=a;return f})})},getPageLinksInfo:b,getOrionHome:a}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/editor/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(g,k,j,d,c,a,b,i,h){var f={},e=h.getOrionHome();f._cloneItemWithoutChildren=function p(a){if(a===null||typeof a!=="object")return a;var b=a.constructor(),f;for(f in a)f!=="children"&&f!=="Children"&&(b[f]=p(a[f]));return b};f._getOpenWithNavCommandExtensions=function(a){function b(a,l){for(var f=a.getServiceReferences("orion.navigate.openWith"),
e=[],h=0;h<f.length;h++){var c=f[h];c.getProperty("editor")===l.id&&(c=c.getProperty("contentType"),c instanceof Array?e=e.concat(c):c!==null&&typeof c!=="undefined"&&e.push(c))}return e}for(var f=function(){for(var b=a.getServiceReferences("orion.edit.editor"),l=[],f=0;f<b.length;f++){var e=b[f],h=e.getProperty("id");l.push({id:h,name:e.getProperty("name"),nameKey:e.getProperty("nameKey"),nls:e.getProperty("nls"),uriTemplate:e.getProperty("orionTemplate")||e.getProperty("uriTemplate")})}return l}(),
e=function(a){for(a=a.getServiceReferences("orion.navigate.openWith.default");0<a.length;)return{editor:a[0].getProperty("editor")};return null}(a),h=[],c=0;c<f.length;c++){var l=f[c],d=e&&e.editor===l.id,i=b(a,l);i.length&&h.push({properties:{name:l.name||l.id,nameKey:l.nameKey,id:"eclipse.openWithCommand."+l.id,tooltip:l.name,tooltipKey:l.nameKey,contentType:i,uriTemplate:l.uriTemplate,nls:l.nls,forceSingleItem:!0,isEditor:d?"default":"editor"},service:{}})}return h};f._makeValidator=function(b,
f,h,d){function i(a,b,f,e){var h=f.match,c;if(b.indexOf("|")>=0)return c=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),i(a,c,f,e)?!0:i(a,b,f,e);else if(b.indexOf(":")>=0)return c=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[c]?i(a[c],b,f,e):!1;else{a:{c=!1;var d;if(typeof a[b]!=="undefined"){if(typeof h==="undefined")d=a[b],c=!0;else if(typeof h==="string"){if(!typeof(a[b]==="string")){f=!1;break a}if(f.variableName){if(h=RegExp(h).exec(a[b]))c=h[0],d=f.variableMatchPosition===
"before"?a[b].substring(0,h.index):f.variableMatchPosition==="after"?a[b].substring(h.index+c.length):f.variableMatchPosition==="only"?c:a[b],c=!0}else{f=RegExp(h).test(a[b]);break a}}else a[b]===h&&(d=a[b],c=!0);if(c&&f.variableName&&(e[f.variableName]=d,e.itemCached=a,f.replacements))for(a=0;a<f.replacements.length;a++)b=!1,f.replacements[a].pattern?e[f.variableName]=e[f.variableName].replace(RegExp(f.replacements[a].pattern),f.replacements[a].replacement||""):b=!0,b&&window.console.log("Invalid replacements specified in validation property.  "+
f.replacements[a]);f=c}else f=!1}return f}}return{info:b,validationFunction:function(a){typeof d==="function"&&(a=d.call(this,a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&a.length!==1)return!1;if(a.length<1)return!1}else a=[a];for(var l=0;l<a.length;l++){var f;a:{var e=a[l],n=h;if(this.info.validationProperties)for(f=0;f<this.info.validationProperties.length;f++){var m=this.info.validationProperties[f];if(typeof m.source!=="undefined"){if(!i(e,m.source,m,this)){f=
!1;break a}}else{window.console.log("Invalid validationProperties in "+b.id+".  No source property specified.");f=!1;break a}}if(this.info.contentType&&n){m=!1;if(e=c.getFilenameContentType(e.Name,n))for(f=0;f<this.info.contentType.length;f++)if(e.id===this.info.contentType[f]){m=!0;break}f=m}else f=!0}if(!f)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(b){if(this.info.uriTemplate){var l={},f;for(f in b)b.hasOwnProperty(f)&&(l[f]=b[f]);if(this.info.validationProperties)for(f=
0;f<this.info.validationProperties.length;f++){var h=this.info.validationProperties[f];h.source&&h.variableName&&(this.itemCached===b&&this[h.variableName]||i(b,h.source,h,this),b[h.variableName]?window.console.log("Variable name "+h.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):l[h.variableName]=this[h.variableName])}l.OrionHome=e;b=new a(this.info.uriTemplate);return window.decodeURIComponent(b.expand(l))}return null}}};f._createCommandOptions=
function(a,e,h,c,d,i){function l(b,l){var n=f._makeValidator(a,h,c,i);b.visibleWhen=n.validationFunction.bind(n);if(d)if(n.generatesURI.bind(n)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return n.getURI.bind(n)(a)};else{var u=a;b.callback=function(a){var l;if(u.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,l=f._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){l=[];for(var c=0;c<a.items.length;c++)l.push(f._cloneItemWithoutChildren(a.items[c]))}else l=
f._cloneItemWithoutChildren(a.items);if(h)var d=h.getService("orion.page.progress");e.run?d?d.progress(e.run(l),"Running command: "+b.name):e.run(l):h&&(d?d.progress(h.getService(e).run(l),"Running command: "+b.name):h.getService(e).run(l))}}l.resolve(b)}var n=new k;a.nls?b.getMessageBundle(a.nls).then(function(b){l({name:a.nameKey?b[a.nameKey]:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltipKey?b[a.tooltipKey]:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},n)}):l({name:a.name,image:a.image,
id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},n);return n};f.getOpenWithCommands=function(a){var b=[],f;for(f in a._commandList){var e=a._commandList[f];e.isEditor&&b.push(e)}return b};var n;f.createAndPlaceFileCommandsExtension=function(a,b,e,h,c,d){var l=!!d;return f.createFileCommands(a,null,d?"all":void 0,l).then(function(a){b._addedOpenWithCommands=l;var f=!1,d=!1;a.forEach(function(a){b.addCommand(a);c&&!f&&(f=!0,b.addCommandGroup(e,"eclipse.fileCommandExtensions",
1E3,null,c));c&&!d&&(d=!0,b.addCommandGroup(e,"eclipse.openWith",1E3,"Open With",c+"/eclipse.fileCommandExtensions"));this.isEditor?b.registerCommandContribution(e,a.id,h+this.index,c?c+"/eclipse.fileCommandExtensions/eclipse.openWith":null):b.registerCommandContribution(e,a.id,h+this.index,c?c+"/eclipse.fileCommandExtensions":null)});return{}})};f.createFileCommands=function(a,b,e,h){var e=e===void 0?"global":e,h=h===void 0?!0:h,c=a.getServiceReferences("orion.navigate.command"),d=[];if(e==="all"||
e==="global")for(var l=0;l<c.length;l++)if(c[l].getProperty("id")!=="orion.navigateFromMetadata"){for(var i=a.getService(c[l]),w={},v=c[l].getPropertyKeys(),g=0;g<v.length;g++)w[v[g]]=c[l].getProperty(v[g]);(e==="all"||w.forceSingleItem&&w.showGlobally)&&d.push({properties:w,service:i})}return k.when(function(){var l=a.getService("orion.core.contenttypes")||b;return n||k.when(l.getContentTypes(),function(a){return n=a})}(),function(){d=h?d.concat(f._getOpenWithNavCommandExtensions(a,n)):d;var b=d.map(function(b){var l=
b.properties;return f._createCommandOptions(l,b.service,a,n,!0).then(function(a){a=new j.Command(a);if(l.isEditor)a.isEditor=l.isEditor;return a})});return k.all(b,function(a){return{_error:a}}).then(function(a){return a})})};f.createOpenWithCommands=function(a,b,e){return e&&e._addedOpenWithCommands?(new k).resolve(f.getOpenWithCommands(e)):f.createFileCommands(a,b,"none",!0)};return f});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(g,k){function j(d){this._init(d)}j.prototype={_init:function(d){var c=k.node(d.container);if(!c)throw"no parent container";this._container=c;c.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this.path="";this.measure();
this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents){d=document.createElement("a");var c=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,c):d.href=g.toUrl("navigate/table.html")+"#"+c}else d=document.createElement("span");k.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],
buildSegment:function(d){var c=document.createElement("a");c.classList.add("breadcrumb");c.appendChild(document.createTextNode(d));return c},addSegmentHref:function(d,c){this._makeHref?this._makeHref(d,c.Location,c):d.href=g.toUrl("navigate/table.html")+"#"+c.ChildrenLocation},buildSegments:function(d,c){if(this._resource.Parents){var a=this._resource.Parents.slice(0),b,i;a&&(a=a.slice(0),c==="reverse"&&(a=a.reverse().slice(0)),a.forEach(function(a){d?(i=d,d=null):i=a.Name;b=this.buildSegment(i);
this.path+=a.Name;this.addSegmentHref(b,a);b.include=!1;this.segments.push(b)}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},refresh:function(){(this.crumbs=k.node(this._id))?k.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),this.dirty=document.createElement("span"),this.dirty.id=
"dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(d){this.crumbs.appendChild(d)},addTitle:function(d,c){var a=c||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(a)),d.classList.add("breadcrumb"),d.classList.add("currentLocation"),
this.append(d))},finalSegment:function(d,c){d=document.createElement("span");c?d.appendChild(document.createTextNode(c)):d.appendChild(document.createTextNode(this._resource.Name));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)},firstSegment:function(d){if(d)this.append(d),this._resource&&this._resource.Parents?(d.classList.add("breadcrumb"),this.addDivider()):(d.href="",d.classList.add("currentLocation"))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){d.include===
!0&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(c){this.append(c);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?c.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;
if(c)this.addTitle(d,c);else if(this.finalSegment(d,c),this._resource&&this._resource.Parents&&(this.buildSegments(c,"reverse"),this.measureSegments(),this.firstSegment(d)),this.crumbs.offsetWidth>=this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),c=this._rootSegmentName;c?this.addTitle(d,c):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,
c)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};j.prototype.constructor=j;return{BreadCrumbs:j}});
define("orion/webui/splitter",["require","orion/webui/littlelib"],function(g,k){function j(d){this._init(d)}j.prototype={_init:function(d){this._tracking=null;this._resizeListeners=[];this._animationDelay=501;this.$node=k.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=k.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=k.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=d.vertical;
this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(d.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add("splitThumbLayout");this._closeByDefault=d.closeByDefault;this._initializeFromStoredSettings();this._closed?(this._closed=!1,this._thumbDown()):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display=
"block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(d){this._resizeListeners.push(d)},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed=d?d==="closed":this._closeByDefault?
!0:!1;if(this._vertical)if(d=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(d,10);else{if(this._closeByDefault)this._splitTop=150}else if(d=localStorage.getItem(this._prefix+"/xPosition"))this._splitLeft=parseInt(d,10);else if(this._closeByDefault)this._splitLeft=150},_adjustToSplitPosition:function(d){var c=k.bounds(this.$node),a=k.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=c.height;if(d||!this._splitTop)this._splitTop=c.top,localStorage.setItem(this._prefix+
"/yPosition",this._splitTop);d=this._splitTop;this.$node.parentNode.style.position==="relative"&&(d=this._splitTop-a.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.bottom=d-1+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=c.width;if(d||!this._splitLeft)this._splitLeft=c.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);d=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(d=this._splitLeft-a.left);this.$sideNode.style.width=
d+"px";this.$sideNode.style.right=d-1+"px";this.$sideNode.style.display="block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d){var d=d||0,c=k.bounds(this.$node.parentNode),a=k.bounds(this.$node);this._vertical?this.$mainNode.style.height=c.height-(a.top-c.top+a.height)+"px":this.$mainNode.style.width=c.width-(a.left-c.left+a.width)+"px";var b=this;window.setTimeout(function(){b._notifyResizeListeners(b.$mainNode)},d);window.setTimeout(function(){b._notifyResizeListeners(b.$sideNode)},
d)},_notifyResizeListeners:function(d){for(var c=0;c<this._resizeListeners.length;c++)this._resizeListeners[c](d)},_thumbDown:function(){this._closed?(this._closed=!1,this._addAnimation(),this._vertical?(this.$sideNode.style.height=this._splitTop+"px",this.$node.style.top=this._splitTop+"px"):(this.$sideNode.style.width=this._splitLeft+"px",this.$node.style.left=this._splitLeft+"px")):(this._closed=!0,this._addAnimation(),this._vertical?(this.$sideNode.style.top=0,this.$node.style.top="1px"):(this.$sideNode.style.width=
0,this.$node.style.left="1px"));this._resize(this._animationDelay);this._removeAnimation();localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove("sidePanelLayoutAnimation");d.$mainNode.classList.remove("mainPanelLayoutAnimation");d.$node.classList.remove("splitLayoutAnimation");d._thumb.classList.remove("splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add("sidePanelLayoutAnimation");
this.$mainNode.classList.add("mainPanelLayoutAnimation");this.$node.classList.add("splitLayoutAnimation");this._thumb&&this._thumb.classList.add("splitLayoutAnimation")},_mouseDown:function(d){if(d.target===this._thumb)return k.stop(d),this._thumbDown(d);if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),
k.stop(d)},_mouseMove:function(d){if(this._tracking){var c=k.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;if(this._splitTop<c.top+5)this._splitTop=c.top+5;else if(this._splitTop>c.top+c.height-5)this._splitTop=c.top+c.height-5;var a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-c.top);this.$node.style.top=a+"px"}else{this._splitLeft=d.clientX;if(this._splitLeft<c.left+5)this._splitLeft=c.left+5;else if(this._splitLeft>c.left+c.width-
5)this._splitLeft=c.left+c.width-5;a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-c.left);this.$node.style.left=a+"px"}this._adjustToSplitPosition(!0);k.stop(d)}},_mouseUp:function(d){if(this._tracking)window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),k.stop(d)}};j.prototype.constructor=j;return{Splitter:j}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(g){return{makeRelative:function(g){if(!g)return g;var j=window.location.protocol+"//"+window.location.host;return g.indexOf(j)===0?g.substring(j.length):g},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var j=new URL(g.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(j.href)===0}}});
define("orion/favorites",["require","orion/fileUtils","orion/EventTarget"],function(g,k,j){function d(c){this._favorites=[];j.attach(this);this._init(c);this._initializeFavorites()}d.prototype={_init:function(c){this._registry=c.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this.dispatchEvent({type:"favoritesChanged",navigator:this._favorites,registry:this._registry})},makeFavorites:function(c){for(var c=Array.isArray(c)?
c:[c],a=0;a<c.length;a++){var b=c[a],d=b.ChildrenLocation?b.ChildrenLocation:b.Location,d=k.makeRelative(d);this.addFavorite(b.Name,d,b.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(c){this.addFavorite(c,c,!1,!0)},addFavorite:function(c,a,b){this._favorites.push({name:c,path:a,directory:b,isFavorite:!0});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(c){for(var a in this._favorites)if(this._favorites[a].path===
c){this._favorites.splice(a,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(c,a){var b=!1,d;for(d in this._favorites)if(this._favorites[d].path===c){var h=this._favorites[d];if(h.name!==a)h.name=a,b=!0}b&&(this._favorites.sort(this._sorter),this._storeFavorites(),this._notifyListeners())},hasFavorite:function(c){for(var a in this._favorites)if(this._favorites[a].path===c)return!0;return!1},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(c){var a;
if(!c)return this._favorites;var b="";for(a=0;a<c.length;a++){var d=c.charAt(a);b+=d==="*"?".*":d==="?"?".?":this._SPECIAL_CHARS.indexOf(d)>=0?"\\"+d:d}b+=".*";c=RegExp(b);b=[];for(a in this._favorites)this._favorites[a].name.search(c)===0&&b.push(this._favorites[a]);return b},_initializeFavorites:function(){var c=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var b,a=a.get("navigate");typeof a==="string"&&(a=JSON.parse(a));if(a)for(b in a)a[b].isFavorite=
!0,c._favorites.push(a[b]);c._favorites.sort(c._sorter);c._notifyListeners()})},_storeFavorites:function(){var c=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("navigate",c)})},_sorter:function(c,a){var b=c.name.toLowerCase(),d=a.name.toLowerCase();return b>d?1:b<d?-1:0},getFavorites:function(){return{navigator:this._favorites}}};d.prototype.constructor=d;return{FavoritesService:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function g(g,j){this._preferences=g;this._themeData=j;var d=j.getThemeStorageInfo(),c=g.listenForChangedSettings(d.storage,2,function(a){a.key===c&&this.apply()}.bind(this))}g.prototype={_initialize:function(g,j,d){var c=d.get(g.styleset);c||(c=j.getStyles(),d.put(g.styleset,JSON.stringify(c)));(j=d.get("selected"))&&(j=JSON.parse(j));if(!j||j[g.selectedKey]===void 0)j=j||{},j[g.selectedKey]=g.defaultTheme,d.put("selected",JSON.stringify(j))},
apply:function(){this.setTheme()},getTheme:function(g){var j=this._themeData,d=j.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,j,c);var a=JSON.parse(c.get("selected")),c=JSON.parse(c.get(d.styleset)),b;if(c)for(var i=0;i<c.length;i++)if(c[i].name===a[d.selectedKey]){b=c[i];break}g({style:b,styles:c})}.bind(this))},setTheme:function(g,j){var d=this._themeData,c=d.getThemeStorageInfo();this._preferences.getPreferences(c.storage,2).then(function(a){this._initialize(c,
d,a);var b=JSON.parse(a.get("selected"));g||(g=b[c.selectedKey]);b[c.selectedKey]=g;a.put("selected",JSON.stringify(b));j?a.put(c.styleset,JSON.stringify(j)):j=JSON.parse(a.get(c.styleset));for(a=0;a<j.length;a++)if(j[a].name===b[c.selectedKey]){d.processSettings(j[a]);break}}.bind(this))},setFontSize:function(g){var j=this._themeData,d=j.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(c){this._initialize(d,j,c);var a=JSON.parse(c.get("selected")),b=JSON.parse(c.get(d.styleset)),
i;if(b)for(var h=0;h<b.length;h++)b[h].fontSize=g,b[h].name===a[d.selectedKey]&&(i=b[h]);c.put(d.styleset,JSON.stringify(b));j.processSettings(i)}.bind(this))}};return{ThemePreferences:g}});
define("orion/editor/eventTarget",[],function(){function g(){}g.addMixin=function(k){var j=g.prototype,d;for(d in j)j.hasOwnProperty(d)&&(k[d]=j[d])};g.prototype={addEventListener:function(g,j,d){if(!this._eventTypes)this._eventTypes={};var c=this._eventTypes[g];c||(c=this._eventTypes[g]={level:0,listeners:[]});c.listeners.push({listener:j,useCapture:d})},dispatchEvent:function(g){var j=g.type;this._dispatchEvent("pre"+j,g);this._dispatchEvent(j,g);this._dispatchEvent("post"+j,g)},_dispatchEvent:function(g,
j){var d=this._eventTypes?this._eventTypes[g]:null;if(d){var c=d.listeners;try{if(d.level++,c)for(var a=0,b=c.length;a<b;a++)if(c[a]){var i=c[a].listener;typeof i==="function"?i.call(this,j):i.handleEvent&&typeof i.handleEvent==="function"&&i.handleEvent(j)}}finally{if(d.level--,d.compact&&d.level===0){for(a=c.length-1;a>=0;a--)c[a]||c.splice(a,1);c.length===0&&delete this._eventTypes[g];d.compact=!1}}}},isListening:function(g){return!this._eventTypes?!1:this._eventTypes[g]!==void 0},removeEventListener:function(g,
j,d){if(this._eventTypes){var c=this._eventTypes[g];if(c){for(var a=c.listeners,b=0,i=a.length;b<i;b++){var h=a[b];if(h&&h.listener===j&&h.useCapture===d){c.level!==0?(a[b]=null,c.compact=!0):a.splice(b,1);break}}a.length===0&&delete this._eventTypes[g]}}}};return{EventTarget:g}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(g,k,j){function d(a){a=a||{};this._document=a.document||document}var c={};d.getTheme=function(a){var a=a||"default",b=c[a];b||(b=c[a]=new d);return b};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(a,b){var c=this,h=c._themeClass;c._themeClass=a;this._load(a,b,function(){c.onThemeChanged({type:"ThemeChanged",oldValue:h,newValue:c.getThemeClass()})})},onThemeChanged:function(a){return this.dispatchEvent(a)},
buildStyleSheet:function(a,b){function c(b,e,d){e&&(h.push("."+a+" ."+b+" {"),h.push("\t"+(d?"background-color":"color")+": "+e+";"),h.push("}"))}var h=[];h.push("");h.push("."+a+" {");b.fontFamily&&h.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&h.push("\tfont-size: "+b.fontSize+";");b.fontSize&&h.push("\tcolor: "+b.text+";");h.push("}");h.push("."+a+".textview {");b.background&&h.push("\tbackground-color: "+b.background+";");h.push("}");c("ruler.annotations",b.annotationRuler,!0);c("ruler.lines",
b.annotationRuler,!0);c("ruler.folding",b.annotationRuler,!0);c("ruler.overview",b.overviewRuler,!0);c("rulerLines",b.lineNumber,!1);c("rulerLines.even",b.lineNumberEven,!1);c("rulerLines.odd",b.lineNumberOdd,!1);c("annotationLine.currentLine",b.currentLine,!0);c("entity-name-tag",b.keyword,!1);c("entity-other-attribute-name",b.attribute,!1);c("string-quoted",b.string,!1);c("line_caret",b.currentLine,!0);c("token_keyword",b.keyword,!1);c("token_string",b.string,!1);c("token_singleline_comment",b.comment,
!1);c("token_multiline_comment",b.comment,!1);c("token_doc_comment",b.comment,!1);c("token_doc_html_markup",b.comment,!1);return h.join("\n")},_createStyle:function(a,b,c,h){var f=this._document,a="orion-theme-"+a,e=f.getElementById(a);if(e){if(h||e.firstChild.data===b)return;e.removeChild(e.firstChild);e.appendChild(f.createTextNode(b))}else h?(e=j.createElement(f,"link"),e.rel="stylesheet",e.type="text/css",e.href=b,e.addEventListener("load",function(){c()})):(e=j.createElement(f,"style"),e.appendChild(f.createTextNode(b))),
e.id=a,(f.getElementsByTagName("head")[0]||f.documentElement).appendChild(e);h||c()},_load:function(a,b,c){if(a)if(typeof b==="string")this._createStyle(a,b,c);else if(b=b.href,b.substring(b.length-4)!==".css"&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!g.toUrl)this._createStyle(a,b,c,!0);else{var h=this;g(["text!"+b],function(b){h._createStyle(a,b,c,!1)})}else c()}};k.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function g(g){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=g;this.classString="."+g+"{ "}g.prototype.className=null;g.prototype.classString=void 0;g.prototype.style=void 0;g.prototype.closeString=" }\n";g.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:g}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(g){function k(){}k.prototype.navbar="#333";k.prototype.button="#777777";k.prototype.location="#EFEFEF";k.prototype.selection="FEC";k.prototype.sidepanel="#FBFBFB";k.prototype.mainpanel="white";k.prototype.navtext="#bfbfbf";k.prototype.content="#3087B3";k.prototype.search="#444";k.prototype.toolpanel="white";k.prototype.writeNavigationStyle=function(){var j="",d=[],c=new g.ThemeClass("orionPage");
c.style.backgroundColor="#fdfdfd";c.style.width="100%";c.style.height="100%";d.push(c);c=new g.ThemeClass("topRowBanner");c.style.margin="0";c.style.border="0";c.style.backgroundColor=this.navbar;c.style.height="15px";c.style.padding="10px";c.style.paddingRight="3px";d.push(c);c=new g.ThemeClass("a");c.style.textDecoration="none";c.style.color=this.content;d.push(c);c=new g.ThemeClass("navlink");c.style.display="inline-block";c.style.padding="2px";c.style.color=this.content;d.push(c);c=new g.ThemeClass("primaryNav");
c.style.color=this.navtext;c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.paddingTop="0";c.style.verticalAlign="baseline";d.push(c);c=new g.ThemeClass("primaryNav a");c.style.fontSize="8pt";c.style.color=this.navtext;c.style.marginRight="6px";c.style.marginLeft="6px";c.style.verticalAlign="baseline";c.style.textDecoration="none";d.push(c);c=new g.ThemeClass("primaryNav a:hover");c.style.color="#bfbfbf";c.style.cursor="hand";c.style.color="white";c.style.fontWeight="normal";d.push(c);for(var a in d)j+=
d[a].toString();return j};k.prototype.writeLocationStyle=function(){var j="",d=[],c=new g.ThemeClass("titleArea");c.style.margin="0";c.style.paddingTop="5px";c.style.border="0";c.style.background=this.location;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";c.style.borderBottom="1px solid "+this.location;c.style.minHeight="20px";d.push(c);c=new g.ThemeClass("breadcrumb");c.style.fontSize="8pt";c.style.textDecoration=
"none";c.style.color="#f1f1f2;";c.style.paddingTop="2px";d.push(c);c=new g.ThemeClass("a.breadcrumb:hover");c.style.textDecoration="none";c.style.borderBottom="1px dotted";c.style.color="#F58B0F";c.style.cursor="pointer";d.push(c);c=new g.ThemeClass("breadcrumbSeparator");c.style.fontSize="8pt";c.style.textDecoration="none";c.style.color="#f1f1f2";c.style.fontWeight="bold";d.push(c);c=new g.ThemeClass("currentLocation");c.style.fontWeight="bold";c.style.fontSize="8pt";c.style.color="#f1f1f2";c.style.textDecoration=
"none";c.style.textWrap="normal";c.style.lineHeight="10pt";d.push(c);c=new g.ThemeClass("a.currentLocation:hover");c.style.fontWeight="bold";c.style.fontSize="10pt";c.style.color="#666666";c.style.textDecoration="none";c.style.borderBottom="0";d.push(c);c=new g.ThemeClass("navlinkonpage");c.style.color=this.content;d.push(c);c=new g.ThemeClass("progressPane_running");c.style.background="url(../images/progress_running_dark.gif) no-repeat center";c.style.width="16px";c.style.height="16px";d.push(c);
for(var a in d)j+=d[a].toString();return j};k.prototype.writeButtonStyle=function(){var j="",d=[],c=new g.ThemeClass("commandButton");c.style.color="#666";c.style.border="1px solid #dedede";c.style.backgroundColor="#ddd";c.style.textAlign="center";c.style.verticalAlign="baseline";c.style.cursor="pointer";c.style.display="inline-block";c.style.padding="5px 6px";c.style.borderRadius="3px";c.style.lineHeight="12px";c.style.fontSize="8pt";c.style.userSelect="none";d.push(c);c=new g.ThemeClass("commandButton:over");
c.style.backgroundColor="#e6e6e6";c.style.border="1px solid #808080";d.push(c);c=new g.ThemeClass("commandMenu");c.style.color="#222";c.style.display="inline-block";c.style.verticalAlign="baseline";c.style.margin="0";c.style.fontSize="8pt";c.style.fontWeight="normal";c.style.border="1px solid #dedede";c.style.backgroundColor="#efefef";c.style.cursor="pointer";c.style.borderRadius="1px";d.push(c);c=new g.ThemeClass("commandMenuItem");c.style.border="0";c.style.padding="0";c.style.margin="0";d.push(c);
for(var a in d)j+=d[a].toString();return j};k.prototype.writeMainStyle=function(){var j="",d=[],c=new g.ThemeClass("searchbox");c.style.backgroundImage="url(../images/core_sprites.png)";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="4px -297px";c.style.width="12px";c.style.height="12px";c.style.backgroundColor=this.search;c.style.border="1px solid "+this.search;c.style.fontSize="11px";c.style.width="15em";c.style.height="16px";c.style.borderRadius="10px";c.style.color="#999";c.style.padding=
"0";c.style.paddingLeft="20px";c.style.marginLeft="5px";c.style.marginTop="6px !important";c.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(c);c=new g.ThemeClass("searchbox:focus");c.style.color="white";c.style.outline="none";d.push(c);c=new g.ThemeClass("checkedRow");c.style.cssText="background-color:"+this.selection+" !important;";d.push(c);c=new g.ThemeClass("navbar-item-selected");c.style.background=this.selection;c.style.color=
this.content;d.push(c);c=new g.ThemeClass("auxpane");c.style.border="0";c.style.background=this.sidepanel;c.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";c.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";d.push(c);c=new g.ThemeClass("mainpane");c.style.background=this.mainpanel;c.style.border=0;d.push(c);c=new g.ThemeClass("mainToolbar");c.style.background=this.toolpanel;
c.style.height="34px";c.style.borderBottom="1px solid #ebebeb";c.style.paddingTop="2px";d.push(c);for(var a in d)j+=d[a].toString();return j};k.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};k.prototype.getSheet=function(j){j.navbar.value?(this.navbar=j.navbar.value,this.button=j.button.value,this.location=j.location.value,this.selection=j.selection.value,this.sidepanel=
j.sidepanel.value,this.mainpanel=j.mainpanel.value,this.navtext=j.navtext.value,this.search=j.search.value,this.content=j.content.value,this.toolpanel=j.toolpanel.value):(this.navbar=j.navbar,this.button=j.button,this.location=j.location,this.selection=j.selection,this.sidepanel=j.sidepanel,this.mainpanel=j.mainpanel,this.navtext=j.navtext,this.search=j.search,this.content=j.content,this.toolpanel=j.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(g,k){function j(){}function d(){this.styles=[];var a=new j;a.name="Orion";a.navbar="#333";a.button="#EFEFEF";a.location="#efefef";a.selection="FEC";a.sidepanel="#FBFBFB";a.mainpanel="white";a.toolpanel="white";a.navtext="#bfbfbf";a.content="#3087B3";a.search="#444";a.breadcrumb="#3087B3";a.separator="#333";this.styles.push(a);a=new j;a.name="Green Zone";a.navbar=
"seagreen";a.button="lavender";a.location="darkseagreen";a.selection="moccasin";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="darkgreen";a.search="darkgreen";a.breadcrumb="#3087B3";a.separator="seagreen";this.styles.push(a);a=new j;a.name="Pretty In Pink";a.navbar="plum";a.button="lavender";a.location="pink";a.selection="lavender";a.sidepanel="seashell";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumorchid";a.search="violet";
a.breadcrumb="#3087B3";a.separator="plum";this.styles.push(a);a=new j;a.name="Blue Monday";a.navbar="cornflowerblue";a.button="lavender";a.location="skyblue";a.selection="lavender";a.sidepanel="aliceblue";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="royalblue";a.search="royalblue";a.breadcrumb="#3087B3";a.separator="cornflowerblue";this.styles.push(a);a=new j;a.name="Vanilla Skies";a.navbar="sandybrown";a.button="lemmonchiffon";a.location="cornsilk";a.selection="lemonchiffon";
a.sidepanel="white";a.mainpanel="white";a.toolpanel="white";a.navtext="lemonchiffon";a.content="chocolate";a.search="moccasin";a.breadcrumb="#3087B3";a.separator="sandybrown";this.styles.push(a);a=new j;a.name="Beetlejuice";a.navbar="indigo";a.button="slateblue";a.location="darkslateblue";a.selection="silver";a.sidepanel="lavender";a.mainpanel="white";a.toolpanel="white";a.navtext="#FBFBFB";a.content="mediumslateblue";a.search="#444";a.breadcrumb="#3087B3";a.separator="indigo";this.styles.push(a);
a=new j;a.name="Red";a.navbar="#CD2127";a.button="#777777";a.location="#D85F56";a.selection="lightcoral";a.sidepanel="#EFDAB2";a.mainpanel="#FDFADD";a.toolpanel="#FDFADD";a.navtext="#FBFBFB";a.content="darkred";a.search="#D85F56";a.breadcrumb="darkred";a.separator="#CD2127";this.styles.push(a)}function c(){return this.styles}j.prototype.name="Orion";j.prototype.navbar="#333";j.prototype.button="#EFEFEF";j.prototype.location="#333";j.prototype.breadcrumb="#3087B3";j.prototype.separator="#333";j.prototype.selection=
"FEC";j.prototype.sidepanel="#FBFBFB";j.prototype.mainpanel="white";j.prototype.toolpanel="white";j.prototype.navtext="#bfbfbf";j.prototype.content="#3087B3";j.prototype.search="#444";d.prototype.styles=[];d.prototype.getStyles=c;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};d.prototype.getViewData=function(){for(var a={top:10,left:10,width:350,height:350,shapes:[{type:"RECTANGLE",name:"Navigation Bar",x:10,y:10,
width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:"Navigation Text",label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:"Search Box",x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:"Tool Panel",x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:"Selection Bar",x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},
{type:"RECTANGLE",name:"Location",x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:"Content",label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:"Content",label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:"Content",label:"Location",
x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:"Main Panel",x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:"Button",x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:"Button Text",label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",
name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Section Text",label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:"Line Color",x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:"Line Color",x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:"Side Panel",x:10,y:71,
width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:"Navigation Text",label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},
{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}]},b=0;b<3;b++)a.shapes.push({type:"TEXT",name:"content",label:"org.eclipse.orion.content",x:170,y:127+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)a.shapes.push({type:"TEXT",name:"content",label:"Item",x:25,y:115+20*b,fill:"#3087B3",family:"content"});for(b=0;b<3;b++)a.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+b*20,x2:165,y2:124+b*20,x3:160,y3:127+b*20,family:"navbar",fill:"#333"});
a.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return a};d.prototype.processSettings=function(a){var b=new k.ThemeSheetWriter;(new g.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",b.getSheet(a))};return{ThemeData:d,getStyles:c}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","Populating favorites...":"Populating favorites...",Favorite:"Favorite","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'."});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/widgets/UserMenu",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/PageLinks"],function(g,k,j,d){function c(a){this._displaySignOut=!0;this._init(a)}c.prototype={_init:function(a){this._dropdownNode=j.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=
a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;if(a.signOut!==void 0)this._displaySignOut=a.signOut},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(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b},_makeMenuItem:function(a,b){var c=document.createElement("span");c.role="menuitem";
c.tabIndex=0;var h=document.createTextNode(a);c.appendChild(h);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&c.classList.add(this._dropDownItemClass):c.classList.add("dropdownMenuItem");c.addEventListener("click",b,!1);c.addEventListener("keydown",function(a){(a.keyCode===j.KEY.ENTER||a.keyCode===j.KEY.SPACE)&&b()},!1);return c},_renderAuthenticatedService:function(a){var b=this,c=this.authenticatedServices[a].authService;if(c&&c.logout&&this._displaySignOut){var h=document.createElement("li"),
f=this._makeMenuItem(g["Sign Out"],function(){c.logout().then(function(){b.addUserItem(a,c,b.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var f=localStorage.length-1;f>=0;f--){var h=localStorage.key(f);h&&h.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(h)}c.getAuthForm(window.location.href).then(function(a){window.location=a})})});h.appendChild(f);this._dropdownNode.appendChild(h)}},renderServices:function(){function a(a){c[a]||
(c[a]=b.createDocumentFragment());return c[a]}var b=document,c=[];d.getPageLinksInfo(this._serviceRegistry,"orion.page.link.user").then(function(h){this._dropdown?this._dropdown.empty():this._dropdownNode&&j.empty(this._dropdownNode);h.forEach(function(f){var e=a(typeof f.category==="number"?f.category:1),c=b.createElement("li"),h=b.createElement("a");h.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&h.classList.add(this._dropDownItemClass):h.classList.add("dropdownMenuItem");
h.href=f.href;h.textContent=f.textContent;c.appendChild(h);e.appendChild(c)}.bind(this));if(this.keyAssistFunction){var h=document.createElement("li"),f=this._makeMenuItem(g["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&f.classList.add(this._keyAssistClass):f.classList.add("key-assist-menuitem");h.appendChild(f);a(0).appendChild(h)}var e=this;c.sort(function(a,b){return a-b}).forEach(function(a,b){if(b<c.length-1&&!this._noSeparator){var f=
document.createElement("li");f.classList.add("dropdownSeparator");var h=document.createElement("span");h.classList.add("dropdownSeparator");f.appendChild(h);a.appendChild(f)}e._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var d in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(d)&&this._renderAuthenticatedService(d,0)}.bind(this))},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,c,h){h?(this.unauthenticatedServices[a]&&
delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,label:c,data:h}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:c,pending:this.unauthenticatedServices[a].pending}:{authService:b,label:c});this.renderServices()}};c.prototype.constructor=c;return{UserMenu:c}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/editor/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(g,k,j,d,c,a){function b(a,b,e){var c="";e&&(c="^");if(c=j.parse("/"+c+a.searchStr+"/"))e=c.pattern,c=c.flags,c.indexOf("i")===-1&&!b.caseSensitive&&(c+="i"),a.regExp={pattern:e,flags:c},a.wildCard=!0}var i={ALL_FILE_TYPE:"*.*"};i.doSearch=function(a,b,e,c){if(a){var d=!0;e==="*"&&(e="");e===""&&(d=c&&c.type!==i.ALL_FILE_TYPE);if(d){e!==""&&i.addRecentSearch(b,
e,c?c.regEx:!1);var a=a.createSearchParams(e,!1,!1,c),p=i.generateSearchHref(a);i.getOpenSearchPref(b,function(a){a?window.open(p):window.location=p})}}else window.alert(g["Can't search: no search service is available"])};i.generateSearchHelper=function(a,f){var e=a.keyword,c=e,d={};a.fileType&&a.fileType!==i.ALL_FILE_TYPE&&e===""&&(c="*."+a.fileType);if(a.regEx)d.searchStr=e,b(d,a,f);else{var p=e.indexOf("*")>-1,m=e.indexOf("?")>-1;p&&(e=e.split("*").join(".*"));m&&(e=e.split("?").join("."));!p&&
!m&&!a.nameSearch?(d.searchStr=a.caseSensitive?e.split("\\").join(""):e.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=a.caseSensitive?e:e.toLowerCase(),b(d,a,f),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:a,inFileQuery:d,displayedSearchTerm:c}};i.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive===
"string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};i.copySearchParams=function(a,b){var e={},c;for(c in a)if(a[c]!==void 0&&a[c]!==null&&(b||c!=="replace"))e[c]=a[c];return e};i.generateSearchHref=function(b){var f=k.toUrl("search/search.html"),b=i.copySearchParams(b,!0),e=b.resource;b.resource=void 0;return(new a(f+"#{,resource,params*}")).expand({resource:e,params:b})};i.generateFindURLBinding=function(b,
f,e,c){b={find:f.searchStr,regEx:f.wildCard?!0:void 0,caseSensitive:b.caseSensitive?!0:void 0,replaceWith:typeof c==="string"?c:void 0,atLine:typeof e==="number"?e:void 0};return","+(new a("{,params*}")).expand({params:b})};i.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};i.replaceRegEx=function(a,
b,e){return a.replace(RegExp(b.pattern,b.flags),e)};i.replaceStringLiteral=function(a,b,e){b=j.parse("/"+b+"/gim");return i.replaceRegEx(a,b,e)};i.searchOnelineLiteral=function(a,b,e){var c;c=0;for(var d=!1,i=[];;)if(c=b.indexOf(a.searchStr,c),c<0)break;else{i.push({startIndex:c,length:a.searchStrLength});d=!0;if(e)break;c+=a.searchStrLength}return d?i:null};i.findRegExp=function(a,b,e,c){if(!b)return null;e=e||"";e+=(e.indexOf("g")===-1?"g":"")+(e.indexOf("m")===-1?"m":"");var d=null;return(d=RegExp(b,
e).exec(a.substring(c)))&&{startIndex:d.index+c,length:d[0].length}};i.searchOnelineRegEx=function(a,b,e){for(var c=0,d=!1,p=[];;)if(c=i.findRegExp(b,a.regExp.pattern,a.regExp.flags,c)){p.push(c);d=!0;if(e)break;c=c.startIndex+c.length}else break;return d?p:null};i.generateNewContents=function(a,b,e,c,d,p){if(c&&b){if(!a)e.contents=[];for(var m=0;m<b.length;m++){for(var j=b[m],g=!1,k=!1,t=[],l,u=0,w=0;w<c.children.length;w++)if(c.children[w].lineNumber-1===m){u=w;for(g=0;g<c.children[w].matches.length;g++)c.children[w+
g].checked!==!1&&t.push(g);k=t.length>0;l=c.children[w].matches;g=!0;break}if(g){if(k){t=i.replaceCheckedMatches(j,d,l,t,p);j=t.replacedStr;for(g=0;g<c.children[u].matches.length;g++)c.children[u+g].newMatches=t.newMatches}else for(g=0;g<c.children[u].matches.length;g++)c.children[u+g].newMatches=c.children[u+g].matches;a?e.contents[m]=j:e.contents.push(j)}else a||e.contents.push(j)}}};i.generateMatchContext=function(a,b,e){var c=[],d=a*2+1,i;b.length<=d?(i=0,a=b.length-1):(i=e-a,i<0?(i=0,a=i+d-1):
(a=e+a,a>b.length-1&&(a=b.length-1,i=a-d+1)));for(d=i;d<=a;d++)c.push({context:b[d],current:d===e});return c};i.splitFile=function(a){for(var b=0,e=0,c=0,d=0,i=[];;){b!==-1&&b<=c&&(b=a.indexOf("\r",c));e!==-1&&e<=c&&(e=a.indexOf("\n",c));if(e===-1&&b===-1){i.push(a.substring(d));break}var m=1;b!==-1&&e!==-1?b+1===e?(m=2,c=e+1):c=(b<e?b:e)+1:c=b!==-1?b+1:e+1;i.push(a.substring(d,c-m));d=c}return i};i.searchWithinFile=function(a,b,e,c,d,p){e=i.splitFile(e);if(d)b.contents=e;if(b){b.children=[];for(var m=
c=0;m<e.length;m++){var g=e[m];if(g&&g.length>0){var j=p?g:g.toLowerCase();if(j=a.wildCard?i.searchOnelineRegEx(a,j):i.searchOnelineLiteral(a,j)){var k,t=m+1;if(d)for(var l=0;l<j.length;l++)k=l+1,k={parent:b,checked:b.checked,type:"detail",matches:j,lineNumber:t,matchNumber:k,name:g,location:b.location+"-"+t+"-"+k},b.children.push(k);else k={parent:b,context:i.generateMatchContext(2,e,m),checked:b.checked,type:"detail",matches:j,lineNumber:t,name:g,location:b.location+"-"+t},b.children.push(k);c+=
j.length}}}b.totalMatches=c}};i.replaceCheckedMatches=function(a,b,e,c,d){for(var i=0,m="",g=[],j=0;j<e.length;j++){i!==e[j].startIndex&&(m+=a.substring(i,e[j].startIndex));if(e[j].length)d=e[j].length;for(var i=!1,k=0;k<c.length;k++)if(c[k]===j){i=!0;break}i?(g.push({startIndex:m.length,length:b.length}),m+=b):(g.push({startIndex:m.length,length:d}),m+=a.substring(e[j].startIndex,e[j].startIndex+d));i=e[j].startIndex+d}i<a.length&&(m+=a.substring(i));return{replacedStr:m,newMatches:g}};i.fullPathNameByMeta=
function(a){var b=a.length,e="";if(b>0)for(b-=1;b>-1;b--)e=e+(e===""?"":"/")+a[b].Name;return e};i.path2FolderName=function(a,b,e){return a.substring(0,a.length-b.length-(e?0:1))};i._storeRecentSearch=function(a,b,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",b);e&&window.setTimeout(function(){e.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),20)})};i.addRecentSearch=function(a,b,e){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var d,
c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c){for(d in c)if(c[d].name===b)return;c.length>=20&&c.splice(19,c.length-20+1)}else c=[];c.splice(0,0,{name:b,regEx:e});i._storeRecentSearch(a,c)})};i.removeRecentSearch=function(a,b,e){typeof b==="string"&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){var d,c=c.get("recentSearch");typeof c==="string"&&(c=JSON.parse(c));if(c)for(d in c)if(c[d].name===b){c.splice(d,1);i._storeRecentSearch(a,
c,e);break}})};i.getSearches=function(a,b,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(b);typeof a==="string"&&(a=JSON.parse(a));a&&e&&e(a)})};i.getMixedSearches=function(a,b,e,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var h=a.get("recentSearch");typeof h==="string"&&(h=JSON.parse(h));b&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(e){var b=i.parseQueryStr(a.query);
h.some(function(a){return b.searchStrTitle===a.name})||h.push({name:b.searchStrTitle,label:a.name})}else h.push({name:null,label:a.name,value:a.query})}));h&&c&&c(h)})};i.getOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};i.setOpenSearchPref=function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:b})})};return i});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(g,k,j,d,c,a){function b(a,b,f,e){this.registry=a;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=e&&e.searchOnName;this._buildSkeletonOnly=e&&e.buildSkeletonOnly;this._fetchChildrenCallBack=e&&e.fetchChildrenCallBack;this._searchParams=f;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(f);this._location=e&&e.location;this._childrenLocation=e&&e.childrenLocation?e.childrenLocation:this._location}b.prototype.search=function(a){var b=this.registry.getService("orion.core.contenttypes");this._onSearchComplete=a;b.getContentTypes().then(function(a){this.contentTypesCache=a;this._visitRecursively(this._childrenLocation).then(function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})}.bind(this))}.bind(this))};b.prototype.searchName=function(a,b){if(a)this.searchHelper=d.generateSearchHelper(a,!0);if(b)this.onSearchNameComplete=b;var f=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var e=0;e<this.fileSkeleton.length;e++){var c=this.fileSkeleton[e].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,c,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,c,!0))if(f.push(this.fileSkeleton[e]),
f.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:f.length,docs:f}})}};b.prototype.buildSkeleton=function(a,b){this._buildingSkeleton=!0;var f=this.registry.getService("orion.core.contenttypes"),e=this;a();f.getContentTypes().then(function(a){e.contentTypesCache=a;e._visitRecursively(e._childrenLocation).then(function(){e._buildingSkeleton=!1;b();e.searchHelper&&!e._buildSkeletonOnly&&e.searchName()})})};b.prototype._searchCompleted=function(){console.log("Search Completed.")};
b.prototype._searchFiles=function(){var b=[],c;if(this.fileLocations.length>0){c=this;for(var f=0;f<c.fileLocations.length;f++)b.push(c._sniffSearch(c.fileLocations[f]))}return a.all(b)};b.prototype._sort=function(a){a.sort(function(a,b){var e=a.Name&&a.Name.toLowerCase(),c=b.Name&&b.Name.toLowerCase();return e<c?-1:e>c?1:0})};b.prototype._onFileType=function(a){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===d.ALL_FILE_TYPE?!0:a.extension.indexOf(this.searchHelper.params.fileType)>=
0:!0};b.prototype._visitRecursively=function(b){var h=[],f=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);var e=f.registry.getService("orion.page.progress");return(e?e.progress(f.fileClient.fetchChildren(b),"Crawling search for children of "+b):f.fileClient.fetchChildren(b)).then(function(b){for(var e=0;e<b.length;e++)if(b[e].Directory!==void 0&&b[e].Directory===!1)if(f._searchOnName)h.push(f._buildSingleSkeleton(b[e]));else if(f._buildSkeletonOnly)h.push(f._buildSingleSkeleton(b[e]));
else{var d=c.getFilenameContentType(b[e].Name,f.contentTypesCache);d&&(d["extends"]==="text/plain"||d.id==="text/plain")&&f._onFileType(d)&&h.push(f._sniffSearch(b[e]))}else b[e].Location&&h.push(f._visitRecursively(b[e].ChildrenLocation));return a.all(h)})};b.prototype._hitOnceWithinFile=function(a){a=this._searchParams.caseSensitive?a:a.toLowerCase();return this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,a,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,
a,!0)};b.prototype._reportSingleHit=function(a){a.LastModified=a.LocalTimeStamp;this.fileLocations.push(a);this._hitCounter++;this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};b.prototype._sniffSearch=function(a){this._totalCounter++;var b=this;if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return this.registry.getService("orion.page.progress").progress(b.fileClient.read(a.Location),"Reading file "+a.Location).then(function(c){b._hitOnceWithinFile(c)&&b._reportSingleHit(a);b.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(g["${0} files found out of ${1}"],b._hitCounter,b._totalCounter)})},function(a){console.error("Error loading file content: "+a.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;
this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new a;b.resolve(this._totalCounter);return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(g,k,j,d){function c(){}c.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',_initialize:function(){var a=
document.body;this.$frameParent=a;this.$$modalExclusions=this.$$modalExclusions||[];var b=document.createRange();b.selectNode(a);b=b.createContextualFragment(this.CONTAINERTEMPLATE);a.appendChild(b);this.$frame=a.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var c=this;this.$close.addEventListener("click",function(){c.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);b=document.createRange();b.selectNode(this.$parent);
a=b.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(a,this.messages);this.$parent.appendChild(a);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE?c.hide():a.keyCode===j.KEY.ENTER&&typeof c._defaultCallback==="function"&&c._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var a=this;this.buttons.forEach(function(b){var c=d.createButton(b.text,b.callback);if(b.id)c.id=b.id,a["$"+c.id]=c;if(b.isDefault)a._defaultCallback=b.callback,a._defaultButton=c;a.$buttonContainer.appendChild(c)})}},_makeModal:function(){var a=this;this.$frame.addEventListener("blur",function(b){a.$lastFocusedElement=b.target},!0);this._modalListener=function(b){var c=!j.contains(a.$frame,b.target);if(c)for(var f=0;f<
a.$$modalExclusions.length;f++)if(j.contains(a.$$modalExclusions[f],b.target)){c=!1;break}c&&(window.setTimeout(function(){(a.$lastFocusedElement||a.$parent).focus()},0),j.stop(b))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var b=this.$frameParent.childNodes,c=!1;this._addedBackdrop=[];for(var h=0;h<b.length;h++){for(var f=0;f<this.$$modalExclusions.length;f++)if(j.contains(this.$$modalExclusions[f],b[h])){c=
!0;break}!c&&b[h]!==a.$frame&&b[h].classList&&!b[h].classList.contains("tooltipContainer")&&(f=b[h],f.classList.contains("modalBackdrop")||(f.classList.add("modalBackdrop"),this._addedBackdrop.push(f)))}(b=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(b){if(b.keyCode===j.KEY.TAB){var c=a._getFirstFocusField();c&&c!==b.target&&c.focus();j.stop(b)}},!1)},_addChildDialog:function(a){this.$$modalExclusions.push(a.$frame||a.$parent)},_bindElements:function(a){for(var b=
0;b<a.childNodes.length;b++){var c=a.childNodes[b];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},hide:function(){typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");typeof this._afterHiding==="function"&&this._afterHiding();var a=this;this.keepAlive||window.setTimeout(function(){a.destroy()},
0)},show:function(a){typeof this._beforeShowing==="function"&&this._beforeShowing();var b=j.bounds(this.$frame),c=j.bounds(document.documentElement),h;a?(h=j.bounds(a),a=h.top+h.height+4,h=h.left+4,a+b.height>c.height&&(a=Math.max(0,c.height-b.height-4)),h+b.width>c.width&&(h=Math.max(0,c.width-b.width-4))):(h=Math.max(0,(c.width-b.width)/2),a=Math.max(0,(c.height-b.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=a+"px";this.$frame.style.left=h+"px";this.$frame.classList.add("dialogShowing");
typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return j.firstTabbable(this.$parent)||this._defaultButton||j.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(a){a.classList.remove("modalBackdrop")});this.$frameParent.removeEventListener("focus",this._modalListener,!0);this.$frameParent.removeEventListener("click",
this._modalListener,!0);this.$frameParent.removeChild(this.$frame);this.$parent=this.$frame=void 0}};c.prototype.constructor=c;return{Dialog:c}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(g,k,j,d,c,a,b){function i(a){this._init(a)}i.prototype=new b.Dialog;i.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+d.toUrl("../../../images/progress_running.gif")+
'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';i.prototype._init=function(a){this.title=a.title||g["Find File Named"];this.modal=!0;this.messages=g;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new j.ContentTypeService(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(g["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(g["Missing required argument: searchRenderer"]);this._favService=a.favoriteService;if(!this._favService)throw Error(g["Missing required argument: favService"]);this._initialize()};i.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",g.Search);this.$fileName.addEventListener("input",function(){b._time=+new Date;b._timeoutId&&clearTimeout(b._timeoutId);
b._timeoutId=setTimeout(b.checkSearch.bind(b),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===c.KEY.ENTER){var h=c.$("a",b.$results);h&&(c.stop(a),window.open(h.href),b.hide())}},!1);a.addEventListener("keydown",function(a){var h,d,i,m,g;if(a.keyCode===c.KEY.DOWN||a.keyCode===c.KEY.UP)d=c.$$array("a",b.$results),h=c.$$array("a",b.$favresults),i=document.activeElement,g=d.indexOf(i),m=h.indexOf(i),a.keyCode===c.KEY.DOWN?m>=0?(m<h.length-1?h[m+1]:d.length>0?d[0]:h[0]).focus():
g>=0?(g<d.length-1?d[g+1]:h.length>0?h[0]:d[0]).focus():(d.length>0||h.length>0)&&(-1<h.length-1?h[0]:d[0]).focus():m>=0?(i=b.$fileName,(m>0?h[m-1]:i).focus()):g>=0?(i=b.$fileName,(g>0?d[g-1]:h.length>0?h[h.length-1]:i).focus()):d.length>0?d[d.length-1].focus():h.length>0&&h[h.length-1].focus(),c.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);this.populateFavorites();setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new k.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(g["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));if(this._initialText)this.$fileName.value=this._initialText,this.doSearch()};i.prototype.populateFavorites=function(){var a=document.createElement("div");a.appendChild(document.createTextNode(g["Populating favorites&#x2026;"]));c.empty(this.$favresults);this.$favresults.appendChild(a);this._progress?this._progress.progress(this._favService.getFavorites(),"Getting favorites").then(this.showFavorites()):this._favService.getFavorites().then(this.showFavorites());
this._favService.addEventListener("favoritesChanged",this.showFavorites())};i.prototype.showFavorites=function(){var a=this;return function(b){if(b.navigator)b=b.navigator;a._searchRenderer.makeRenderFunction(a._contentTypeService,a.$favresults,!1,a.decorateResult.bind(a),a.showFavoritesImage)(b);if(b&&b.length>0)b=document.createElement("div"),b.style.borderBottom="1px dashed #BBBBBB",b.style.padding="5px",a.$favresults.appendChild(b)}};i.prototype.showFavoritesImage=function(a){var b=new Image;
b.classList.add("modelDecorationSprite");b.classList.add("core-sprite-favorite");b.src=d.toUrl("images/none.png");b.title=g.Favorite;a.appendChild(b);b.style.verticalAlign="middle"};i.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};i.prototype.doSearch=function(){var b=this.$fileName.value;if(b){var f=this._searcher.createSearchParams(b,
this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var d=document.createElement("div");d.appendChild(document.createTextNode(this._nameSearch?g["Searching..."]:a.formatMessage(g["Searching for occurrences of"],b)));c.empty(this.$results);this.$results.appendChild(d);this._searcher.search(f,!1,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};i.prototype.decorateResult=
function(a){for(var b=this,a=c.$$array("a",a),e=0;e<a.length;e++){var d=a[e];d.addEventListener("mouseup",function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&b.hide()},!1);d.addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER&&b.hide()},!1)}};i.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};i.prototype._afterHiding=function(){this._onHide&&this._onHide()};i.prototype.constructor=i;return{OpenResourceDialog:i}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\t<\!-- Top row:  Logo + discovery links + search + user --\>\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\t\t<nav id="primaryNav" class="bannerLeftArea" role="navigation">\n\t\t\t<div class="centralNavigation" id="centralNavigation" tabindex="0" role="button" style="margin-top:0;"></div>\n\t\t</nav>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\t\t<div class="bannerRightArea">\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;">\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger">\n\t\t\t\t\t<span class="dropdownArrowEmpty"></span>\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<\!-- Requires some js code to bind the NLS variables  --\>\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<\!-- <li><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">${FAQ}</a></li --\>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=3.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility:hidden;">\n</div>\n<div class="layoutRight" style="padding-left:7px;margin-left:4px;margin-top:6px;" id="settingsTab" style="visibility:hidden;">\n\t<button class="layoutRight core-sprite-wrench imageSprite" id="settingsAction" aria-live="off" style="visibility:hidden;"></button>\n</div>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/objects",[],function(){return{mixin:function(g){Array.prototype.slice.call(arguments,1).forEach(function(k){for(var j=Object.keys(k),d=0;d<j.length;d++){var c=j[d];g[c]=k[c]}})}}});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(g,k){function j(d,c,a){this.CLEAR_PANEL=a!==null?a:!0;this.OPEN="false";a="";d.nodeType?this.node=d:(a=d+"_",d=document.getElementById(d),this.node=d.nodeType?d:document.createElement("span"));this.node.innerHTML=this.templateString;this.navLabelId=a+"navigationlabel";document.getElementById("navigationlabel").id=this.navLabelId;this.arrowId=a+"dropDownArrow";document.getElementById("dropDownArrow").id=this.arrowId;
this.navDropDownId=a+"navdropdown";document.getElementById("navdropdown").id=this.navDropDownId;if(c.icon)this.node.className=this.node.className+" "+c.icon,this.node.onclick=this.click.bind(this);else{if(c.label)d=document.getElementById(this.navLabelId),d.textContent=c.label,d.onclick=this.click.bind(this);if(c.caret)document.getElementById(this.arrowId).className=c.caret}this._dropdownNode=k.node(this.navDropDownId);this._triggerNode=k.node(this.navLabelId)}g.mixin(j.prototype,{templateString:'<div id="navigationlabel" class="navigationLabel dropdownTrigger" ></div><span id="dropDownArrow" class="dropDownArrow"></span><div class="dropDownContainer" id="navdropdown" style="display:none;"></div>',
click:function(){var d=document.getElementById(this.navDropDownId);d.style.display==="none"?this.updateContent(this.getContentNode(),function(){d.style.display="";this._positionDropdown();this.handle=k.addAutoDismiss([this.node,d],this.clearPanel.bind(this))}.bind(this)):this.CLEAR_PANEL&&this.clearPanel()},clearPanel:function(){document.getElementById(this.navDropDownId).style.display="none"},addContent:function(d){document.getElementById(this.navDropDownId).innerHTML=d},getContentNode:function(){return document.getElementById(this.navDropDownId)},
updateContent:function(d,c){c()},toggleLabel:function(d){document.getElementById(this.navLabelId).style.display=d?"":"none";document.getElementById(this.arrowId).style.display=d?"":"none"},_positionDropdown:function(){this._dropdownNode.style.left="";var d=k.bounds(this._dropdownNode),c=k.bounds(this._boundingNode(this._triggerNode));if(d.left+d.width>c.left+c.width)this._dropdownNode.style.right=0},_boundingNode:function(d){return d.style.right!==""||d.style.position==="absolute"||!d.parentNode||
!d.parentNode.style?d:this._boundingNode(d.parentNode)},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null}});return j});
define("orion/widgets/input/GroupedContent",["orion/objects","orion/webui/littlelib"],function(g){function k(){}g.mixin(k.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">Main Pages</span><nav><ul id="navigationlinks"></ul></nav></section></div><div class="groupedContentDivider"></div><div style="float:left;"><section><span style="color:#333;padding:15px;">Related Links</span><nav><ul id="relatedLinks"></ul></nav></section></div>',getContentPane:function(){return this.templateString}});
return k});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize Strings from JavaScript files in this folder","Choose a Folder":"Choose a Folder",
"Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Make Favorite":"Make Favorite","Delete the selected files or folders":"Delete the selected files or folders","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Are you sure you want to delete '${0}' from the favorites?":"Are you sure you want to delete '${0}' from the favorites?","Are you sure you want to delete these ${0} favorites?":"Are you sure you want to delete these ${0} favorites?",
"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.":"You can create favorites by selecting any file or folder in the navigator and choosing ${0} from the ${1} menu.","Export as zip":"Export as zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"New File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"New Folder","Folder name:":"Folder name:",
"Create a new folder":"Create a new folder","Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Import local file...":"Import local file...",
"Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP from...","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP to...","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}","Copy to":"Copy to",
"Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location","Copy Items":"Copy Items","Copy the selected items to the copy/paste buffer":"Copy the selected items to the copy/paste buffer","Paste Items":"Paste Items","Paste items from the copy/paste buffer":"Paste items from the copy/paste buffer",
"Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With","Loading ":"Loading ",New:"New",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content",Favorites:"Favorites","Import from HTTP...":"Import from HTTP...","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:",
"Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.","You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding."});
define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(g,k,j){function d(a,c,h){if(!a[c])throw c+g[" is not supported in this file system"];return a[c].apply(a,h)}function c(a,i,h,f){if(!a.readBlob)throw g["source file service does not support binary read"];if(!h.writeBlob)throw g["target file service does not support binary write"];if(i[i.length-1]!=="/")return d(a,"readBlob",[i]).then(function(a){return d(h,"writeBlob",[f,a])});var e=f.substring(0,
f.length-1),n=decodeURIComponent(e.substring(e.lastIndexOf("/")+1)),e=e.substring(0,e.lastIndexOf("/")+1);return d(h,"createFolder",[e,n]).then(function(){},function(){}).then(function(){return d(a,"fetchChildren",[i]).then(function(e){for(var d=[],i=0;i<e.length;++i){var n=e[i].Location,g=n;e[i].Directory&&(g=n.substring(0,n.length-1));g=decodeURIComponent(g.substring(g.lastIndexOf("/")+1));g=f+encodeURIComponent(g);e[i].Directory&&(g+="/");d[i]=c(a,n,h,g)}return k.all(d)})})}function a(a,c){function h(a){var b=
new k;b.reject(g["No Matching FileService for location:"]+a);return b}var f=a.getServiceReferences("orion.core.file"),e=f;if(c)for(var e=[],d=0;d<f.length;++d)c(f[d])&&e.push(f[d]);for(var o=[],p=[],m=[],q=[],r={fetchChildren:function(){var a=new k;a.resolve(q);return a},createWorkspace:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspaces:function(){var a=new k;a.reject(g["no file service"]);return a},loadWorkspace:function(){var a=new k;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:g["File Servers"],Location:"/",Children:q,ChildrenLocation:"/"})},100);return a},search:h,createProject:h,createFolder:h,createFile:h,deleteFile:h,moveFile:h,copyFile:h,read:h,write:h},f=0;f<e.length;++f)q[f]={Directory:!0,Length:0,LocalTimeStamp:0,Location:e[f].getProperty("top"),ChildrenLocation:e[f].getProperty("top"),Name:e[f].getProperty("Name")},d=e[f].getProperty("pattern")||".*",d[0]!=="^"&&(d="^"+d),o[f]=RegExp(d),p[f]=a.getService(e[f]),m[f]=e[f].getProperty("Name"),
e[f].getProperty("NameKey")&&e[f].getProperty("nls")&&j.getMessageBundle(e[f].getProperty("nls")).then(function(a,b){q[a].Name=b[e[a].getProperty("NameKey")];m[a]=b[e[a].getProperty("NameKey")]}.bind(this,f));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return p[0]?0:-1;for(var b=0;b<o.length;++b)if(o[b].test(a))return b;throw g["No Matching FileService for location:"]+a;};this._getService=function(a){a=this._getServiceIndex(a);return a===-1?r:p[a]};this._getServiceName=
function(a){a=this._getServiceIndex(a);return a===-1?r.Name:m[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?r.Location:q[a].Location}}a.prototype={getService:function(a){return this._getService(a)},fileServiceName:function(a){return this._getServiceName(a)},fileServiceRootURL:function(a){return this._getServiceRootURL(a)},fetchChildren:function(a){return d(this._getService(a),"fetchChildren",arguments)},createWorkspace:function(a){return d(this._getService(),"createWorkspace",
arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(a){return d(this._getService(a),"loadWorkspace",arguments)},createProject:function(a,c,h,f){return d(this._getService(a),"createProject",arguments)},createFolder:function(a,c){return d(this._getService(a),"createFolder",arguments)},createFile:function(a,c){return d(this._getService(a),"createFile",arguments)},deleteFile:function(a){return d(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,i,h){var f=this._getService(a),e=this._getService(i);if(f===e)return d(f,"moveFile",arguments);var n=a[a.length-1]==="/",o=i;o[o.length-1]!=="/"&&(o+="/");if(h)o+=encodeURIComponent(h);else{var p=a;n&&(p=p.substring(0,p.length-1));o+=p.substring(p.lastIndexOf("/")+1)}n&&o[o.length-1]!=="/"&&(o+="/");return c(f,a,e,o).then(function(){return d(f,"deleteFile",[a])})},copyFile:function(a,i,h){var f=this._getService(a),e=this._getService(i);if(f===e)return d(f,"copyFile",arguments);
var n=a[a.length-1]==="/",o=i;o[o.length-1]!=="/"&&(o+="/");if(h)o+=encodeURIComponent(h);else{var p=a;n&&(p=p.substring(0,p.length-1));o+=p.substring(p.lastIndexOf("/")+1)}n&&o[o.length-1]!=="/"&&(o+="/");return c(f,a,e,o)},read:function(a,c){return d(this._getService(a),"read",arguments)},write:function(a,c,h){return d(this._getService(a),"write",arguments)},remoteImport:function(a,c){return d(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,c){return d(this._getService(a),
"remoteExport",arguments)},search:function(a){return d(this._getService(a.resource),"search",arguments)}};a.prototype.constructor=a;return{FileClient:a}});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/favorites,orion/contentTypes,orion/URITemplate,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/widgets/input/GroupedContent,orion/util,orion/customGlobalCommands,orion/fileClient".split(","),function(g,
k,j,d,c,a,b,i,h,f,e,n,o,p,m,q,r,s,t,l,u,w,v,y,A,G,I,C,z,P,L,S,U){function H(a,b){if(a.getLabel)return a.getLabel();else{var l=new w;l.resolve(b.properties.name);return l}}function Q(a){n.node("progressPane").setAttribute("aria-label",g["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function B(a,b){var l=a.getServiceReferences("orion.core.auth");Y=[];for(var c=R.createMenuGenerator.apply(this,arguments),e=0;e<l.length;e++){var f=
l[e],h=a.getService(f);H(h,f).then(function(a){h.getKey().then(function(b){Y.push(b);h.getUser().then(function(l){c.addUserItem(b,h,a,l)},function(l,e){c.addUserItem(b,h,a,e)});window.addEventListener("storage",function(){T[b]!==localStorage.getItem(b)&&(T[b]=localStorage.getItem(b),h.getUser().then(function(l){c.addUserItem(b,h,a,l)},function(){c.addUserItem(b,h,a)}))},!1)})})}}function x(b,l,c,e,f){var h=arguments,d,u=b&&b.getServiceReferences("orion.page.link.related");u&&u.length!==0&&w.when(function(){if(d)return d;
var a=b.getService("orion.core.contenttypes");a||(a=new r.ContentTypeService(b),a=b.getService("orion.core.contenttypes"));return a.getContentTypes().then(function(a){return d=a})}(),function(){var n;if(R.beforeGenerateRelatedLinks.apply(this,h)){for(var m=[],v=0;v<u.length;v++){var o={},p,g=u[v].getPropertyKeys();for(p=0;p<g.length;p++)o[g[p]]=u[v].getProperty(g[p]);if(o.id){var j=function(b){if(b)if(!b.visibleWhen||b.visibleWhen(l)){var c=new a.CommandInvocation(l,l,null,b,e);R.addRelatedLinkCommand(b,
c)}else typeof f==="function"&&(n||(n=f()),w.when(n,function(c){c&&l===W&&(!b.visibleWhen||b.visibleWhen(c))&&R.addRelatedLinkCommand(b,new a.CommandInvocation(c,c,null,b,e))}))},q=null;p=null;if(c.indexOf(o.id)<0)if((o.nls&&o.nameKey||o.name)&&o.uriTemplate)p=i._createCommandOptions(o,u[v],b,d,!0),m.push(p),p.then(function(b){b=new a.Command(b);j(b)});else{if(!q&&(q=e.findCommand(o.id))){j(q);continue}if(!q){var y=b.getServiceReferences("orion.navigate.command");for(p=0;p<y.length;p++)if(y[p].getProperty("id")===
o.id){for(var o={},g=y[p].getPropertyKeys(),k=0;k<g.length;k++)o[g[k]]=y[p].getProperty(g[k]);p=i._createCommandOptions(o,y[p],b,d,!0);m.push(p);p.then(function(b){q=new a.Command(b);j(q)});break}}}}}w.all(m,function(a){return a}).then(function(){R.afterGenerateRelatedLinks.apply(this,h)})}})}function D(a){var b=n.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function F(a){var b={},l=null;typeof a==="string"&&(a=n.node(a));a||(a=n.node("pageActions"));for(var c=a;c&&
c.classList;){if(c.classList.contains("toolComposite")){l=c;break}c=c.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(l&&(b.slideContainer=n.$(".slideParameters",l),b.parameterArea=n.$(".parameters",l),b.dismissArea=n.$(".parametersDismiss",l),b.notifications=n.$("#notificationArea",l),l.parentNode&&(b.toolbarTarget=n.$(".toolbarTarget",l.parentNode),b.toolbarTarget)))a=n.bounds(l),b.toolbarTargetY=a.height+1;return b}function E(a){if(a.toolbarTarget&&a.toolbarTargetY){var b=
0,l;a.notifications&&a.notifications.classList.contains("slideContainerActive")&&(l=n.bounds(a.notifications),b+=l.height);a.slideContainer&&a.slideContainer.classList.contains("slideContainerActive")&&(l=n.bounds(a.slideContainer),b+=l.height);b>0&&(b+=8);a.toolbarTarget.style.top=a.toolbarTargetY+b+"px";a.toolbarTarget.style.bottom=0}}var c=function(a){var b=document.createElement("a");b.href=a;return b.href}(k.toUrl("auth/NotifyAuthentication.html")),T={},R={createMenuGenerator:S.createMenuGenerator||
function(a,b){if(n.node("userMenu")){var l=n.node("userDropdown"),c=new p.Dropdown({dropdown:l}),l=new v.UserMenu({dropdownNode:l,dropdown:c,serviceRegistry:a}),c=n.node("userTrigger");new m.Tooltip({node:c,text:g.Options,position:["below","left"]});var c=document.getElementById("userTrigger"),e=c.className;e+=" imageSprite core-sprite-silhouette";c.className=e;l.setKeyAssist(b);return l}},beforeGenerateRelatedLinks:S.beforeGenerateRelatedLinks||function(){var a=n.node("relatedLinks");n.empty(a);
return!0},addRelatedLinkCommand:S.addRelatedLinkCommand||function(b,l){var c=n.node("relatedLinks");a.createCommandMenuItem(c,b,l).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:S.afterGenerateRelatedLinks||function(){},afterSetPageTarget:S.afterSetPageTarget||function(){},generateNavigationMenu:S.generateNavigationMenu||function(){var a=document.getElementById("centralNavigation");new m.Tooltip({node:a,text:"Navigation Menu",position:["right"]});var a=new z("centralNavigation",{label:"Develop",
icon:"commandSprite core-sprite-hamburger"}),b=new P;a.addContent(b.getContentPane())},afterGenerateBanner:S.afterGenerateBanner||function(){}},Y=[],W,X=[],K,J=null;return{addSettings:function(a){(new z("settingsTab",{label:"Develop",icon:"imageSprite core-sprite-wrench"},!1)).updateContent=a.updateContent.bind(a)},generateBanner:function(c,e,f,i,m,v,w){function p(){this.create();this._filterString=""}function r(a){a.registerService("orion.cm.managedservice",{updated:function(a){for(var a=a&&a["links.newtab"]!==
"undefined"?a["links.newtab"]?"_blank":"_self":"_self",b=n.$$array(".targetSelector"),l=0;l<b.length;l++)b[l].target=a}},{pid:"nav.config"})}(new l.ThemePreferences(i,new u.ThemeData)).apply();var z=n.node(c);if(!z)throw g["could not find banner parent, id was "]+c;var s=document.createRange();s.selectNode(z);s=s.createContextualFragment(G);n.processTextNodes(s,g);z.firstChild?z.insertBefore(s,z.firstChild):z.appendChild(s);z=n.node("home");z.href=k.toUrl("navigate/table.html");z.setAttribute("aria-label",
g["Orion Home"]);n.node("progressPane").src=k.toUrl("images/none.png");if(z=n.node("pageToolbar"))z.classList.add("toolbarLayout"),z.innerHTML=C+j.slideoutHTMLFragment("mainToolbar");(z=n.node("closeNotifications"))&&z.setAttribute("aria-label",g["Close notification"]);if(z=n.node("footer"))z.innerHTML=I,n.processTextNodes(z,g);f.setParameterCollector(new b.CommandParameterCollector(F,E));document.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&(a=e.getService("orion.page.message"))&&
a.setProgressMessage("")},!1);R.generateNavigationMenu.apply(this,arguments);var t=n.node("navigationlinks");t&&y.createPageLinks(e,"orion.page.link").then(function(a){a.forEach(function(a){var b=document.createElement("li");b.appendChild(a);t.appendChild(b)})});if(z=n.$(".split")){var s=n.$(".sidePanelLayout"),P=n.$(".mainPanelLayout");if(s&&P)J={side:s,main:P},J.splitter=new o.Splitter({node:z,sidePanel:s,mainPanel:P,toggle:!0,closeByDefault:z.style&&z.style.left==="0%"}),z=new a.Command({name:g["Toggle side panel"],
tooltip:g["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){J.splitter.toggleSidePanel()}}),f.addCommand(z),f.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("o",!0)),w&&J.splitter.addResizeListener(function(a){w&&a===P&&(a=w.getTextView())&&a.resize()})}z=new a.Command({name:g["Make Favorite"],tooltip:g["Add to the favorites list"],imageClass:"core-sprite-favorite",id:"orion.makeFavorite",visibleWhen:function(a){a=Array.isArray(a)?
a:[a];if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!a[b].Location)return!1;return!0},callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=e.getService("orion.core.favorite"),l=e.getService("orion.page.progress"),c=function(a){return function(c){c?e.getService("orion.page.message").setMessage(a.Name+g[" is already a favorite."],2E3):l.progress(b.makeFavorites(a),"Making favorite "+a.Name)}},f=0;f<a.length;f++){var h=a[f];l.progress(b.hasFavorite(h.ChildrenLocation||h.Location),
"Checking favorite "+h.Name).then(c(h))}}});f.addCommand(z);var T=!1,S=function(a,b,l){if(!T){var c=b.getService("orion.core.favorite"),e=b.getService("orion.page.progress");c||(c=new q.FavoritesService({serviceRegistry:b}),c=b.getService("orion.core.favorite"));var f=new A.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,favoriteService:c,onHide:function(){T=!1;l&&l.getTextView()&&l.getTextView().focus()}});window.setTimeout(function(){T=!0;f.show()},0)}},z=new a.Command({name:g["Find File Named..."],
tooltip:g["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){S(m,e,w)}});f.addCommand(z);f.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));z=new a.Command({name:g["Toggle banner and footer"],tooltip:g["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=n.node("banner"),b=n.node("footer"),l=n.$(".content-fixedHeight");a.style.visibility==="hidden"?(a.style.visibility=
"visible",b.style.visibility="visible",l.classList.remove("content-fixedHeight-maximized")):(a.style.visibility="hidden",b.style.visibility="hidden",l.classList.add("content-fixedHeight-maximized"));w&&w.getTextView()&&w.getTextView().resize();return!0}});f.addCommand(z);f.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));z=new a.Command({name:g["System Configuration Details"],tooltip:g["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});
f.addCommand(z);f.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));z=new a.Command({name:g["Background Operations"],tooltip:g["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});f.addCommand(z);f.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));p.prototype={create:function(){var a=this._keyAssistDiv=
document.createElement("div");a.id="keyAssist";a.style.display="none";a.classList.add("keyAssistFloat");a.setAttribute("role","menu");var b=this._keyAssistInput=document.createElement("input");b.classList.add("keyAssistInput");b.type="text";b.placeholder=g["Filter bindings"];a.appendChild(b);var l=this._keyAssistContents=document.createElement("div");l.classList.add("keyAssistContents");if(L.isIOS||L.isAndroid)l.style.overflowY="auto";a.appendChild(l);var c=this._keyAssistTable=document.createElement("table");
c.tabIndex=0;c.classList.add("keyAssistList");l.appendChild(c);document.body.appendChild(a);b.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));c.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));b.addEventListener("input",function(){this.filterChanged()}.bind(this));l.addEventListener(L.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&this.hide()}.bind(this));
n.addAutoDismiss([a],function(){this.hide()}.bind(this))},createContents:function(){n.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(w&&w.getTextView()){var a=w.getTextView(),b=a.getActions(!0).filter(function(b){return(b=a.getActionDescription(b))&&b.name});b.sort(function(b,l){return a.getActionDescription(b).name.localeCompare(a.getActionDescription(l).name)});this.createHeader(g.Editor);for(var l=function(b){return function(){a.focus();
return a.invokeAction(b)}},c={},e,d=0;d<b.length;d++)for(var i=b[d],u=a.getActionDescription(i),m=a.getKeyBindings(i),v=0;v<m.length;v++){e=m[v];var o=h.getUserKeyString(e);e.scopeName?(c[e.scopeName]||(c[e.scopeName]=[]),c[e.scopeName].push({bindingString:o,name:u.name,execute:l(i)})):this.createItem(o,u.name,l(i))}for(var p in c)if(c[p].length){this.createHeader(p);for(b=0;b<c[p].length;b++)e=c[p][b],this.createItem(e.bindingString,e.name,e.execute)}}this.createHeader(g.Global);f.showKeyBindings(this)},
createItem:function(a,b,l){if(this._filterString){var c=this._filterString.toLowerCase(),e;c!==this._filterString?(c=this._filterString,e=function(a){return a}):e=function(a){return a.toLowerCase()};if(e(b).indexOf(c)===-1&&e(a).indexOf(c)===-1&&e(this._lastHeader).indexOf(c)===-1)return}var f=this._keyAssistTable.insertRow(-1);f.id="keyAssist-keyBinding-"+this._idCount++;f.setAttribute("role","menuitem");f._execute=l;f.classList.add("keyAssistItem");f.addEventListener("click",function(a){this._selectedRow=
f;this.execute();a.preventDefault()}.bind(this));l=f.insertCell(-1);l.classList.add("keyAssistName");l.appendChild(document.createTextNode(b));l=f.insertCell(-1);l.classList.add("keyAssistAccel");l.appendChild(document.createTextNode(a))},createHeader:function(a){this._lastHeader=a;var b=this._keyAssistTable.insertRow(-1);b.classList.add("keyAssistSection");var b=b.insertCell(-1),l=document.createElement("h2");l.appendChild(document.createTextNode(a));b.appendChild(l)},execute:function(){window.setTimeout(function(){this.hide();
var a=this._selectedRow;this._selectedRow=null;a&&a._execute&&a._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var a=this._keyAssistInput.value;if(this._filterString!==a)this._filterString=a,this.createContents()}.bind(this),100)},hide:function(){var a=document.activeElement,b=this._keyAssistDiv,a=b===a||(b.compareDocumentPosition(a)&16)!==0;b.style.display="none";a&&document.compareDocumentPosition(this._previousActiveElement)!==
1&&this._previousActiveElement.focus();this._previousActiveElement=null},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(a){var b=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(b.length===0)this._selectedIndex=-1;else{var l=this._selectedIndex;l+=a?1:-1;l%=b.length;l<0&&(l=b.length-1);if(this._selectedIndex!==-1)a=b[this._selectedIndex],a.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=l;if(this._selectedIndex!==-1){this._selectedRow=
a=b[this._selectedIndex];a.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",a.id);this._keyAssistTable.focus();var b=a.getBoundingClientRect(),c=this._keyAssistContents,e=c.getBoundingClientRect();a.offsetTop<c.scrollTop?l===0?c.scrollTop=0:a.scrollIntoView(!0):b.bottom>e.bottom&&a.scrollIntoView(!1)}}},show:function(){this._previousActiveElement=document.activeElement;this.createContents();this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*
0.75)+"px";this._keyAssistDiv.style.display="block";this._keyAssistInput.value=this._filterString;this._keyAssistInput.focus();this._keyAssistInput.select()},_keyDown:function(a){if(a.keyCode===40)this.select(!0);else if(a.keyCode===38)this.select(!1);else if(a.keyCode===13)this.execute();else return;a.preventDefault()},_scrollWheel:function(a){var b=0,b=L.isIE||L.isOpera?-a.wheelDelta:L.isFirefox?a.detail*40:-a.wheelDeltaY,l=this._keyAssistContents,c=l.scrollTop;l.scrollTop+=b;if(c!==l.scrollTop)return a.preventDefault&&
a.preventDefault(),!1}};var U=new p,H=new a.Command({name:g["Show Keys"],tooltip:g["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){U.isVisible()?U.hide():U.show();return!0}});f.addCommand(H);f.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));z=function(){w.getTextView().setKeyBinding(new d.KeyBinding(191,!1,!0,!L.isMac,L.isMac),H.id);w.getTextView().setAction(H.id,H.callback,H)};w&&(w.getTextView()?
z():w.addEventListener("TextViewInstalled",z));D(f);B(e,H.callback);Q(e);window.addEventListener("hashchange",function(){f.processURL(window.location.href)},!1);window.setTimeout(function(){r(e)},0);R.afterGenerateBanner.apply(this,arguments)},getToolbarElements:F,getMainSplitter:function(){return J},layoutToolbarElements:E,setPageTarget:function(a){var b,l,c=a.breadcrumbRootName,f=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&
(l=c?c+" ":"",l+=a.fileService.fileServiceName(a.target.Location),c=null),b=a.name||a.target.Name,W=a.target,x(f,a.target,X,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(c=c||a.task||a.name),b=a.name,x(f,{NoTarget:""},X,a.commandService,a.makeAlternate));(K=a.title)||(K=b?b+" - "+a.task:a.task);window.document.title=K;R.afterSetPageTarget.apply(this,arguments);if(b=n.node("location")){n.empty(b);var h=f&&new U.FileClient(f),f=a.breadcrumbTarget||a.target,h=h&&f&&f.Location?h.fileServiceRootURL(f.Location):
null;new e.BreadCrumbs({container:b,resource:f,rootSegmentName:c,workspaceRootSegmentName:l,workspaceRootURL:h,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(K)K.charAt(0)==="*"&&!a&&(K=K.substring(1)),a&&K.charAt(0)!=="*"&&(K="*"+K),window.document.title=K;var b=n.node("dirty");if(b)b.textContent=a?"*":""},setPageCommandExclusions:function(a){X=a},notifyAuthenticationSite:c}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(g){return{detectValidURL:function(k){for(var j=/\[([^\]]*)\]\(([^\)]+)\)/g,d=j.exec(k),c=[],a=0;d;){if(d.length===3&&d[2].length>0){var b=new URL(d[2]);b.protocol!==":"&&g.validateURLScheme(b.href)&&(d.index>a&&c.push({segmentStr:k.substring(a,d.index)}),c.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),a=d.index+d[0].length)}d=j.exec(k)}if(a===0)return null;a<k.length-1&&c.push({segmentStr:k.substring(a)});return c},processURLSegments:function(g,
j){j.forEach(function(d){if(d.urlStr){var c=document.createElement("a");c.href=d.urlStr;c.appendChild(document.createTextNode(d.segmentStr))}else c=document.createElement("span"),c.textContent=d.segmentStr;g.appendChild(c)})}}});
define("orion/status",["require","orion/webui/littlelib","orion/globalCommands","orion/PageUtil","orion/urlUtils"],function(g,k,j,d,c){function a(a,b,c,e,d){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=d;this.domId=c;this.progressDomId=e||c;this._hookedClose=!1;this._timer=null}var b;a.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&!this._hookedClose)this._hookedClose=!0,
a.addEventListener("click",function(){window.clearTimeout(this._timer);this.setProgressMessage("")}.bind(this))},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,b,c){this._init();this.currentMessage=a;var e=k.node(this.domId);if(typeof c==="boolean"){var d=e.getAttribute("aria-live");e.setAttribute("aria-live",c?"polite":"off");window.setTimeout(function(){a===
this.currentMessage&&(k.empty(e),e.appendChild(document.createTextNode(a)),window.setTimeout(function(){e.setAttribute("aria-live",d)},100))}.bind(this),100)}else k.empty(e),e.appendChild(document.createTextNode(a));typeof b==="number"&&window.setTimeout(function(){a===this.currentMessage&&(k.empty(e),e.appendChild(document.createTextNode("")))}.bind(this),b)},setErrorMessage:function(a){this.currentMessage=a;this._init();var b=a.responseText||a.message||a;if(typeof b==="string")try{b=JSON.parse(b)}catch(c){}var a=
b.Message||b,e="red";if(b.Severity)switch(b.Severity){case "Warning":e="#FFCC00";break;case "Error":e="red";break;case "Info":case "Ok":e="green"}b=document.createElement("span");b.style.color=e;b.appendChild(document.createTextNode(a));a=k.node(this.domId);k.empty(a);a.appendChild(b)},setProgressMessage:function(a){this._init();this.currentMessage=a;var b=document.createElement("span");b.classList.add("imageSprite");b.classList.add("progressIcon");b.classList.add("core-sprite-progress");var c=k.node(this.progressDomId);
k.empty(c);c.appendChild(b);c.appendChild(document.createTextNode(a));b=k.node(this.notificationContainerDomId);b.classList.remove("notificationHide");if(a&&a.length>0)b.classList.add("progressNormal"),b.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else b.classList.remove("notificationShow"),b.classList.add("notificationHide")},setProgressResult:function(a){this.currentMessage=a;var b=a.responseText||a;if(typeof b===
"string")try{b=JSON.parse(b)}catch(f){}this._init();var e=b.Message||b,d="core-sprite-information",o="progressInfo",p=document.createElement("span");p.classList.add("imageSprite");p.classList.add("progressIcon");a=[];if(b.Severity)switch(b.Severity){case "Warning":d="core-sprite-warning";o="progressWarning";a.push("progressInfo");a.push("progressError");a.push("progressNormal");break;case "Error":d="core-sprite-error";o="progressError";a.push("progressWarning");a.push("progressInfo");a.push("progressNormal");
break;default:a.push("progressWarning"),a.push("progressError"),a.push("progressNormal")}a.push("notificationHide");p.classList.add(d);var m=k.node(this.progressDomId),d=k.node(this.notificationContainerDomId);k.empty(m);m.appendChild(p);if(b.HTML)b=document.createElement("span"),b.innerHTML=e,m.appendChild(b);else{if(p=c.detectValidURL(e))e=document.createDocumentFragment(),c.processURLSegments(e,p),Array.prototype.forEach.call(k.$$("a",e),function(a){a.target="_blank"});else{if(b.Severity!=="Warning"&&
b.Severity!=="Error")this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);e=document.createTextNode(e)}m.appendChild(e)}if(o&&this.progressDomId!==this.domId){d.classList.add(o);for(o=0;o<a.length;o++)d.classList.remove(a[o])}d.classList.add("notificationShow")},showWhile:function(a,b){var c=this;if(b){c.setProgressMessage(b);var e=function(){b===c.currentMessage&&c.setProgressMessage("")};a.then(e,e)}return a},
_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,c){return new b(this,++this._lastProgressId,a,c)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",b=!0,c;for(c in this._progressMonitors)this._progressMonitors[c].status&&(b||(a+=", "),a+=this._progressMonitors[c].status,b=!1);this.setProgressMessage(a)}else this.setProgressMessage("")},_beginProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._progressMonitors.length++;
this._renderOngoingMonitors()},_workedProgressMonitor:function(a){this._progressMonitors[a.progressId]=a;this._renderOngoingMonitors()},_doneProgressMonitor:function(a){delete this._progressMonitors[a.progressId];this._progressMonitors.length--;a.status?this.setProgressResult(a.status):this._renderOngoingMonitors()}};a.prototype.constructor=a;b=function(a,b,c,e){this.statusService=a;this.progressId=b;if(c){this.deferred=c;this.begin(e);var d=this;c.then(function(){d.done.bind(d)()},function(){d.done.bind(d)()})}};
b.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};b.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};b.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};b.prototype.constructor=b;return{StatusReportingService:a,ProgressMonitor:b}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(g,k,j,d){function c(){}c.prototype={_initialize:function(a,b,c,h,f){this._tooltip=new d.Tooltip({node:a,hideDelay:f||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:c,trigger:h?h:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";a=document.createRange();a.selectNode(this.$parent);a=a.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(a,g);this.$parent.appendChild(a);var e=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE&&e.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];c.id&&(this["$"+c.id]=c);this._bindElements(c)}},_afterShowingFunction:function(a){return function(){a&&a.bind(this)();if(!this.customFocus){var b=
j.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};c.prototype.constructor=c;return{PopupDialog:c}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(g,k,j,d){var c={};(function(){var a=!1;c.updateNavTools=function(b,c,d,f,e,n){var o=j.node(f);if(o)c.destroy(o);else throw g["could not find toolbar "]+f;c.renderCommands(f,o,n,d,"button");if(e&&(f=j.node(e)))c.destroy(f),c.renderCommands(e,f,null,d,"button");a||(a=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var b=j.node(e);
b&&(c.destroy(b),c.renderCommands(e,b,a.selections,d,"button"))}))};c.createOperationsCommands=function(a,c,h){function f(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var e=new d.Command({name:g["Remove Completed"],tooltip:g["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){h.removeCompletedOperations().then(function(){c.loadOperations.bind(c)()})},visibleWhen:function(){return!0}});a.addCommand(e);
e=new d.Command({name:g.Remove,tooltip:g["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var e=a[b];h.removeOperation.bind(h)(e.Location).then(function(){c.loadOperations.bind(c)()},function(){c.loadOperations.bind(c)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!f(a);for(var b in a)if(f(a[b]))return!1;return!0}});a.addCommand(e);
e=new d.Command({name:g.Cancel,tooltip:g["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return f(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!f(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});a.addCommand(e)}})();
return c});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(g,k,j,d,c){function a(a){this._options=a}a.prototype=new d.PopupDialog;a.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';a.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;c.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};a.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};a.prototype.setOperations=function(a,c){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var d in a)this._myOperations.push(a[d]),this._operationsDeferreds.push(c[d]);this._renderOperations()};a.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(c){}var d={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==d.Message)d.DetailedMessage=a.DetailedMessage;return d};a.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};a.prototype._renderOperationsTable=function(a,c,d){j.empty(a);for(var f=0;f<c.length;f++){var e=c[f],n=document.createElement("tr"),o=document.createElement("td");o.style.paddingLeft="5px";o.style.paddingRight="5px";o.textContent=e.Name;n.appendChild(o);var p=document.createElement("div");o.appendChild(p);o=document.createElement("span");o.style.paddingRight="5px";o.classList.add("imageSprite");switch(e.type){case "Warning":o.classList.add("core-sprite-warning");o.setAttribute("aria-label",
g["Operation resulted in a warning."]);break;case "error":o.classList.add("core-sprite-error");o.setAttribute("aria-label",g["Operation resulted in an error."]);break;case "loadstart":case "progress":o.classList.add("core-sprite-start");o.setAttribute("aria-label",g["Operation is running."]);break;case "abort":o.classList.add("core-sprite-stop");o.setAttribute("aria-label",g["Operation is canceled."]);break;case "load":case "loadend":o.classList.add("core-sprite-ok"),o.setAttribute("aria-label","Operation ok.")}p.appendChild(o);
o=document.createElement("span");o.classList.add("operationStatus");o.textContent=e.Name;p.appendChild(o);if(e.error){var m=e.error.Message||e.error;e.error.DetailedMessage&&e.error.DetailedMessage!==""&&(m+=": "+e.error.DetailedMessage);o.textContent=m;o.classList.remove("operationStatus");o.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",p,{operation:e,deferred:d[f]},this,"tool");a.appendChild(n)}this._setOperationsVisibility()};a.prototype._setOperationsVisibility=
function(){this.$myOperationsList.style.display=this._myOperations.length>0?"":"none";this.$myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.$operationsDontExist.style.display=this._myOperations.length>0?"none":"";this.$operationsExist.style.display=this._myOperations.length>0?"":"none"};a.prototype.constructor=a;return{OperationsDialog:a}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(g,k,j,d,c){function a(a,b){if(!this._progressPane){this._progressPane=d.node(a);this._operationsDialog=new c.OperationsDialog({triggerNode:this._progressPane,commandRegistry:b});var f=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===d.KEY.ENTER)&&f._operationsDialog.show()})}}function b(a,b,c,e){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=c;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=e}a.prototype={_switchIconTo:function(a){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=a;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(a,b){var c=
{},e;for(e in a)a[e].progressMonitor||(c[e]=a[e]);if(this._isEmpty(c))this._switchIconTo("progressPane_empty"),this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(e in c){var o=c[e];if(o.type&&(o.type==="loadstart"||o.type==="progress")){d="running";break}}switch(d){case "running":this._progressPane.title=g["Operations running"];this._progressPane.alt=g["Operations running"];
this._progressPane.setAttribute("aria-valuetext",g["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=g["Some operations finished with warning"];this._progressPane.alt=g["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=g["Some operations finished with error"];this._progressPane.alt=
g["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",g["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=g.Operations,this._progressPane.alt=g.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(c,b)},_isEmpty:function(a){for(var b in a)return!1;return!0}};
a.prototype.constructon=a;b.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new a(b,this._commandRegistry)},progress:function(a,b,c){var e=this,d=this._operationsIndex++;!c&&this._progressMonitorClass&&(c=new this._progressMonitorClass,c.begin(b));a.then(function(){if(e._operations[d]){var o=e._operations[d];if(b)o.Name=b;e._lastOperation=o;o.type="loadend";if(c)o.progressMonitor=c;e.writeOperation.bind(e)(d,o,a);o.Location||e._removeOperationFromTheList.bind(e)(d)}},
function(o){if(e._operations[d]){var p=e._operations[d];if(b)p.Name=b;if(c)p.progressMonitor=c;e._lastOperation=p;p.type=o.canceled?"abort":"error";p.error=o;e.writeOperation.bind(e)(d,p,a);p.Location||e._removeOperationFromTheList.bind(e)(d)}},function(o){if(b)o.Name=b;if(c)o.progressMonitor=c;e.writeOperation.bind(e)(d,o,a)});return a},removeOperation:function(a){for(var b in this._operations)if(this._operations[b].Location&&this._operations[b].Location===a){this._removeOperationFromTheList(b);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(a)},_removeOperationFromTheList:function(a){var b=this._operations[a].progressMonitor;delete this._operations[a];delete this._operationDeferrds[a];b?b.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var a in this._operations){var b=this._operations[a];if(b.type&&b.type!=="loadstart"&&b.type!=="progress")(b=this._operations[a].progressMonitor)&&
b.done(),delete this._operations[a],delete this._operationDeferrds[a]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(a){this._serviceRegistry.getService("orion.page.message").setProgressResult(a)},showWhile:function(a,b){b&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(b);var c=this;a.then(function(){c._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){c.setProgressResult.bind(c)(a);
return a});return this.progress(a,b)},writeOperation:function(a,b,c){this._operations[a]=b;this._operationDeferrds[a]=c;b.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(a){a.put(b.Location,{Name:b.Name,expires:b.expires})});b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/dialogs",[],function(){function g(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.dialog",this)}g.prototype={confirm:function(g,j){j(window.confirm(g))},openFiles:function(){}};g.prototype.constructor=g;return{DialogService:g}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(g,k){function j(a,c,d){return a[c].apply(a,d)}function d(a){this._location=a}function c(){var a=new k;a.reject(g["No Matching OperationService for location:"]+this._location);return a}function a(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var c=a.getServiceReferences("orion.core.operation"),
h=0;h<c.length;h++){var f=a.getService(c[h]);this._services[h]=f;f=c[h].getProperty("pattern")||".*";f[0]!=="^"&&(f="^"+f);this._patterns[h]=RegExp(f)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];return new d(a)}}d.prototype={getOperation:c,getOperations:c,removeCompletedOperations:c,removeOperation:c,cancelOperation:c};d.prototype.constructor=d;a.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var c=this;this._preferenceService.getPreferences("/operations").then(function(d){c._operations=d;a.resolve(c._operations)});return a},getOperation:function(a){return j(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],c=this,d=0;d<this._services.length;d++){var f=this._patterns[d],e=new k;a[d]=e.promise;j(this._services[d],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
c.getOperations.bind(c)().then(function(c){for(var e=c.keys(),d=0;d<e.length;d++){var h=e[d];f.test(h)&&b.indexOf(h)<0&&c.remove(h)}a.resolve()})}}(e),function(a){return function(b){a.reject(b)}}(e))}return k.all(a)},removeOperation:function(a){var c=this;return j(this._getService(a),"removeOperation",arguments).then(function(){c.getOperations.bind(c)().then(function(c){c.remove(a)})},function(a){return a},function(a){return a})}};a.prototype.constructor=a;return{OperationsClient:a}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Replace:"Replace","Replace All":"Replace All","Search ${0}":"Search ${0}",
"Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search",
"Open in Search page for this directory":"Open in Search page for this directory","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(g,k){function j(d){this._init(d)}j.prototype={_init:function(d){var c=d.parent,a=this,c=k.node(c);if(!c)throw g["no parent"];if(!d.model)throw g["no tree model"];if(!d.renderer)throw g["no renderer"];this._parent=c;this._treeModel=d.model;this._renderer=d.renderer;this._showRoot=d.showRoot===void 0?!1:d.showRoot;this._indent=d.indent===void 0?16:d.indent;this._onCollapse=d.onCollapse;this._labelColumnIndex=
d.labelColumnIndex===void 0?0:d.labelColumnIndex;this._id=d.id===void 0?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){a._showRoot?(b._depth=0,a._generate([b],0)):a._treeModel.getChildren(b,function(b){a._generate(b,0)})})},_generate:function(d,c){k.empty(this._parent);var a=document.createElement("div");this._renderer.wrapperCallback&&
this._renderer.wrapperCallback(a);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";this._generateChildren(d,c);b.appendChild(this._bodyElement);a.appendChild(b);
this._parent.appendChild(a);this._rowsChanged()},_generateChildren:function(d,c,a){for(var b=0;b<d.length;b++){var i=document.createElement(this._tableRowElement);i.id=this._treeModel.getId(d[b]);this._renderer.rowCallback&&this._renderer.rowCallback(i);i._depth=c;i._item=d[b];this._renderer.render(d[b],i);i.childNodes[this._labelColumnIndex].style.paddingLeft=this._indent*c+"px";a?(this._bodyElement.insertBefore(i,a.nextSibling),a&&(a=i)):this._bodyElement.appendChild(i)}},_rowsChanged:function(){this._renderer.rowsChanged&&
this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,c,a){var b=this._treeModel.getId(d),i;if(b===this._id)this._removeChildRows(b),this._generateChildren(c,0),this._rowsChanged();else{var h=k.node(b);h?(h._item=d,h&&(a||h._expanded)?(h._expanded=!0,this._removeChildRows(b),this._renderer.updateExpandVisuals(h,!0),c?(this._generateChildren(c,h._depth+1,h),this._rowsChanged()):(i=this,c=this._treeModel.getChildren(h._item,function(a){i._generateChildren(a,
h._depth+1,h);i._rowsChanged()}))):this._renderer.updateExpandVisuals(h,!1)):console.log(g["could not find table row "]+b)}},getItem:function(d){var c=k.node(d);return c&&c._item?c._item:d},toggle:function(d){var c=k.node(d);c&&(c._expanded?(this.collapse(d),this._renderer.updateExpandVisuals(c,!1)):(this.expand(d),this._renderer.updateExpandVisuals(c,!0)))},isExpanded:function(d){return(d=k.node(d))?d._expanded:!1},expand:function(d,c,a){var d=typeof d==="string"?d:this._treeModel.getId(d),b=k.node(d);
if(b&&!b._expanded){b._expanded=!0;var i=this;this._renderer.updateExpandVisuals(b,!0);this._treeModel.getChildren(b._item,function(d){i._generateChildren(d,b._depth+1,b);i._rowsChanged();c&&c.apply(i,a)})}},_removeChildRows:function(d){for(var c=d===this._id,a=!1,b=-1,i=[],h=k.$$array(".treeTableRow",this._parent),f=0;f<h.length;f++){var e=h[f];if(a)break;if(c)e._depth>b?i.push(e):a=!0;else if(e.id===d)c=!0,b=e._depth}for(d=0;d<i.length;d++)c=i[d],c.parentNode.removeChild(c)},collapse:function(d){var d=
typeof d==="string"?d:this._treeModel.getId(d),c=k.node(d);if(c){if(!c._expanded)return;c._expanded=!1;this._renderer.updateExpandVisuals(c,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var g={};g.TreeModelIterator=function(){function g(j,d){this.firstLevelChildren=j;this.reset();this._init(d)}g.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var d=this._getChildren(g),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(g));return d},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(this._getChildren(g)[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var c=this;return this.forceExpandFunc(this._cursor,"first",function(a){a&&c.setCursor(a)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(g){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(g&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var c=this;return this.forceExpandFunc(d,"last",function(a){a&&
c.setCursor(a)})}d&&this.setCursor(d);return d},_findSibling:function(g,d){for(var c=this.topLevel(g),a=this._getChildren(g.parent),a=c?this.firstLevelChildren:a,b=0;b<a.length;b++)if(a[b]===g)return b===0&&!d?c?null:g.parent:b===a.length-1&&d?c?null:this._findSibling(g.parent,d):d?a[b+1]:a[b-1];return null},_inParentChain:function(g,d){for(var c=g.parent;c;){if(c===d)return!0;c=c.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,d,c){this.setCursor(d);var a=[];for(a.push(d);;){if(this.iterate(g))a.push(this.cursor());else break;if(c===this.cursor())return a}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,d){var c=this.cursor(),
a=this._scan(!0,g,d);a||(a=this._scan(!1,g,d));this.setCursor(c);return a},iterate:function(g,d){return g?this._forward(d):this._backward(d)},iterateOnTop:function(g,d){var c=this._findSibling(this._getTopLevelParent(this.cursor()),g);c?this.setCursor(c):d&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return g}();return g});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator"],function(g,k,j){var g={},d=navigator.userAgent.indexOf("iPad")!==-1,c=window.navigator.platform.indexOf("Mac")!==-1;g.ExplorerNavHandler=function(){function a(a,c,d){this.explorer=a;this.model=this.explorer.model;this._navDict=c;this._listeners=[];this._selections=[];this._currentColumn=0;var f=this._getEventListeningDiv();f.tabIndex=0;f.classList.add("selectionModelContainer");
var e=this;this._modelIterator=new j.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return e.explorer.renderer.isExpandable(a)}:function(a){return e.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,c){return e.explorer.forceExpandFunc(a,b,c)}:void 0});this._init(d);(!d||d.setFocus!==!1)&&f.focus();a=function(a){if(a.target===f){if(e.explorer.preventDefaultFunc&&e.explorer.preventDefaultFunc(a,
e._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return e.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return e.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return e.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return e.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return e.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return e.onEnter(a)}};f.addEventListener("keydown",a,!1);this._listeners.push({type:"keydown",listener:a});a=function(){if(e.explorer.onFocus)e.explorer.onFocus(!1);else e.toggleCursor(null,
!1)};f.addEventListener("blur",a,!1);this._listeners.push({type:"blur",listener:a});a=function(){if(e.explorer.onFocus)e.explorer.onFocus(!0);else e.toggleCursor(null,!0)};f.addEventListener("focus",a,!1);this._listeners.push({type:"focus",listener:a});this._parentDiv=f}a.prototype={_init:function(a){this._linearGridMove=!1;if(a)this._selectionPolicy=a.selectionPolicy,this.gridClickSelectionPolicy=a.gridClickSelectionPolicy||"none",this.preventDefaultFunc=a.preventDefaultFunc,this.postDefaultFunc=
a.postDefaultFunc},_ctrlKeyOn:function(a){return c?a.metaKey:a.ctrlKey},removeListeners:function(){if(this._listeners)for(var a=0;a<this._listeners.length;a++)this._parentDiv.removeEventListener(this._listeners[a].type,this._listeners[a].listener,!1)},focus:function(){var a=this._getEventListeningDiv();a&&a.focus()},_getEventListeningDiv:function(a){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv==="function"?this.explorer.keyEventListeningDiv(a):k.node(this.explorer._parentId)},
isExpandable:function(a){return!a?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)))?!0:!1},isExpanded:function(a){return!a?!1:this.explorer.myTree.isExpanded(this.model.getId(a))},refreshSelection:function(a){var c=this;this.explorer.selection&&this.explorer.selection.getSelections(function(d){c._clearSelection();for(var f=0;f<d.length;f++)c._selections.push(d[f]);c._selections.length>0&&c.cursorOn(c._selections[0],!0,!1,a)})},refreshModel:function(a,c,d,f){this._currentColumn=
0;this.topIterationNodes=[];this.model=c;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(d)this.topIterationNodes=d;this._modelIterator.setTree(this.topIterationNodes);!f&&this.explorer.selection&&this._modelIterator.reset();this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),c=0;c<this._selections.length;c++)if(a===this.model.getId(this._selections[c]))return c;
return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},setSelection:function(a,c){if(this._selectionPolicy==="cursorOnly")c&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){if(!c||this._selectionPolicy==="singleSelection")this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a;else{var d=this._inSelection(a);d>=0?(this._checkRow(a,
!0),this._selections.splice(d,1)):(this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a)}this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,c){a||(a=this.currentModel());var d=this._getGridChildren(a);if(d&&d.length>1||c===0&&d){c!==0&&this.toggleCursor(a,!1);var f=this._currentColumn,e=!0;f+=c;f<0?(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():e=!1),
f=e?d.length-1:this._currentColumn):f>=d.length&&(this._linearGridMove&&c!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():e=!1),f=e?0:this._currentColumn);this._currentColumn=f;c!==0&&this.toggleCursor(a,!0);return!0}return!1},_getGridChildren:function(a){return this._navDict?this._navDict.getGridNavHolder(a):null},getCurrentGrid:function(a){a||(a=this.currentModel());return(a=this._getGridChildren(a))&&a.length>0?a[this._currentColumn]:null},getAriaContainerElement:function(a){for(var c=
this._parentDiv,d;a&&a!==c&&(d=a.getAttribute("role"))!=="grid"&&d!=="tree"&&d!=="treegrid";)a=a.parentNode;return a===c?null:a},toggleCursor:function(a,c){var d=this.getRowDiv(a),f=this.getCurrentGrid(a);f?(d&&(c?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),f.domNode&&(d=this.getAriaContainerElement(f.domNode),c?(f.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",f.domNode.id)):f.domNode.classList.remove("treeIterationCursor"))):
d&&(c?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,c,d,f){var d=d===void 0?!1:d,e,n;if(a||c){if(n===this._modelIterator.cursor())return;e=this._modelIterator.cursor();n=a;this._modelIterator.setCursor(n)}else e=this._modelIterator.prevCursor(),n=this._modelIterator.cursor();if(e!==n||c)if(this.toggleCursor(e,!1),!c||n)if(this.moveColumn(null,0),this.toggleCursor(n,
!0),(a=this.getRowDiv())&&!f&&!this._visible(a)&&a.scrollIntoView(!d),this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,n)},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=[],c=0;c<this._selections.length;c++)a.push(this.model.getId(this._selections[c]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),c=this._navDict.getValue(a);return c&&c.rowDomNode?c.rowDomNode:k.node(a)},iterate:function(a,
c,d){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,c)&&(this.cursorOn(null,!1,a),d&&this.setSelection(this.currentModel(),!0))},_checkRow:function(a,c){if(this.explorer.renderer._useCheckboxSelection){var d=this.getRowDiv(a);if(d){var f=k.node(this.explorer.renderer.getCheckBoxId(d.id)),e=c?!f.checked:!0;if(e!==f.checked)this.explorer.renderer.onCheck(d,f,e,!0)}}else this._select(a,c)},_vpWidth:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},
_vpHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},_getToolBarHeight:function(a){return(a=k.node(a))?k.bounds(a).height:0},_visible:function(a){if(a.offsetWidth===0||a.offsetHeight===0)return!1;var c=0;c+=this._getToolBarHeight("staticBanner");c+=this._getToolBarHeight("titleArea");c+=this._getToolBarHeight("pageToolbar");var d=this._getEventListeningDiv(!0).getClientRects()[0],f=this._vpHeight();this._vpWidth();for(var c=d.top>c?d.top:
c,d=d.bottom<f?d.bottom:f,a=a.getClientRects(),f=0,e=a.length;f<e;f++){var n=a[f];if(n.top>=c&&n.top<=d&&n.bottom>=c&&n.bottom<=d)return!0}return!1},_select:function(a){a||(a=this._modelIterator.cursor());var c=this.getRowDiv(a);c&&(this._inSelection(a)<0?c.classList.add("checkedRow"):c.classList.remove("checkedRow"))},_onModelGrid:function(a,c){var d=this._getGridChildren(a);if(d)for(var f=0;f<d.length;f++)if(c.target===d[f].domNode)return!0;return!1},onClick:function(a,c){var h=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));
if(c.target!==h&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,c)))if(this.cursorOn(a,!0,!1,!0),d)this.setSelection(a,!0);else if(this._ctrlKeyOn(c))this.setSelection(a,!0);else if(c.shiftKey&&this._lastSelection){if(h=this._modelIterator.scan(this._lastSelection,a)){this._clearSelection(!0);for(var f=0;f<h.length;f++)this.setSelection(h[f],!0)}}else this.setSelection(a,!1)},onCollapse:function(a){this._modelIterator.collapse(a)&&this.cursorOn()},onUpArrow:function(a){this.iterate(!1,
!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),!1);a.preventDefault();return!1},_shouldMoveColumn:function(a){var c=this.currentModel(),d=this._getGridChildren(c);return d&&d.length>1?this.isExpandable(c)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,
-1),a.preventDefault(),!0;var c=this._modelIterator.cursor();if(!c)return!1;if(this.isExpandable(c)&&this.isExpanded(c))return this.explorer.myTree.collapse(c),a.preventDefault(),!0;this._modelIterator.topLevel(c)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(c.parent),this.setSelection(c.parent,!1))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var c=this._modelIterator.cursor();
if(!c)return!1;if(this.isExpandable(c)&&!this.isExpanded(c))return this.explorer.myTree.expand(c),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),!0);a.preventDefault()},onEnter:function(a){var c=this.getCurrentGrid(this._modelIterator.cursor());if(c)if(c.widget)if(typeof c.onClick==="function")c.onClick();else typeof c.widget.focus==="function"&&c.widget.focus();
else{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);c.domNode.dispatchEvent(d)}else if(this.explorer.renderer.getRowActionElement&&(c=this._modelIterator.cursor()))if(c=this.explorer.renderer.getRowActionElement(this.model.getId(c)),c.href)this._ctrlKeyOn(a)?window.open(c.href):window.location.href=c.href}};return a}();g.ExplorerNavDict=function(){function a(a){this._dict={};this._model=a}a.prototype={addRow:function(a,
c){this._dict[this._model.getId(a)]={model:a,rowDomNode:c}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,c){if(!a)return null;var d=this._model.getId(a);if(this._dict[d]){if(!this._dict[d].gridChildren&&c)this._dict[d].gridChildren=[];return this._dict[d].gridChildren}return null},initGridNavHolder:function(a){if(!a)return null;a=this._model.getId(a);if(this._dict[a])this._dict[a].gridChildren=null}};return a}();return g});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(g,k,j,d,c,a){var b={};b.Explorer=function(){function a(b,c,e,d){this.registry=b;this.renderer=e;this.selection=c;this.commandService=d;this.myTree=null}a.prototype={changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},
makeNewItemPlaceHolder:function(a,b,c){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=b+"placeHolderRow",a.appendChild(c),{tempNode:c,refNode:c};if(a){c=document.createElement("tr");c.id=b+"placeHolderRow";var d=document.createElement("td");d.id=b+"placeHolderCol";c.appendChild(d);a.appendChild(c);c=j.node(b+"placeHolderRow");a=j.node(b+"placeHolderCol");if(c&&a)return{tempNode:c,refNode:a}}return null},getRow:function(a){if(a=
this.model.getId(a))return j.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this._expandRecursively(a[b])},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(a===
void 0||a===null))for(var c=a.length,d=0;d<c;d++)b._expandRecursively(a[d])})})}},createTree:function(a,b,e){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var n=a+"innerTree",i=j.node(n);i&&j.empty(i);if(b)b.rootId=n;this.model=b;this._parentId=a;this._treeOptions=e;if(!e||e&&!e.noSelection)this.selectionPolicy=e?e.selectionPolicy:"",this._navDict=new c.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:n,
model:b,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:e?!!e.showRoot:!1,indent:e?e.indent:void 0,onCollapse:e?e.onCollapse:void 0,navHandlerFactory:e?e.navHandlerFactory:void 0,tableElement:e?e.tableElement:void 0,tableBodyElement:e?e.tableBodyElement:void 0,tableRowElement:e?e.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},
refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];if(a&&this.getNavDict())for(var c=a.getSelection(),d=0;d<c.length;d++){var i=a.getRowDiv(c[d]);i&&i.parentNode&&(i=this.getNavDict().getValue(this.model.getId(c[d])),i.model&&b.push(i.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){if(!this.getNavHandler())this._navHandler=
a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler==="function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new c.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,
c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();b.createExplorerCommands=function(b,c){function f(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?c?c(a):!0:!1:!1}var e=new a.Command({tooltip:g["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.expandAll()}}),d=new a.Command({tooltip:g["Collapse all"],
imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return f(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(e);b.addCommand(d)};b.ExplorerModel=function(){function a(b,c,e){this.rootPath=b;this.fetchItems=c;this.idPrefix=e||""}a.prototype={destroy:function(){},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?
this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return b}};return a}();b.ExplorerFlatModel=function(){function a(b,c,e){this.rootPath=b;this.fetchItems=c;this.root=e}a.prototype=new b.ExplorerModel;a.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=
this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})}};a.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return a}();b.ExplorerRenderer=function(){function a(b,c){this.explorer=c;this._init(b);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?
"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;j.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,d,i){var c=c||"tool",g=document.createElement("td");g.id=b.id+"actionswrapper";d&&g.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,c,null,i&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return g},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));c.appendChild(d);var i=this;d.addEventListener("click",function(a){i.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,d,i){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,d);this.explorer.getNavHandler()&&i&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){a=window.sessionStorage[a+"selection"];typeof a==="string"&&(a=a.length>0?JSON.parse(a):null);var b;if(a&&this.explorer.getNavDict()){var c=[];for(b=0;b<a.length;b++){var d=this.explorer.getNavDict().getValue(a[b]);if(d&&d.rowDomNode&&
d.model&&(c.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=j.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(c),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+
"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(j.node(c[d])){this._expanded.push(c[d]);var i=this;this.tableTree.expand(c[d],function(){i._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return"/"+this._cachePrefix+"/"+a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,
b){var c=j.node(this.expandCollapseImageId(a.id));c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass))},getExpandImage:function(a,b,c,d){var i=document.createElement("span");i.id=this.expandCollapseImageId(a.id);b.appendChild(i);i.classList.add(this._twistieSpriteClass);i.classList.add(this._collapseImageClass);if(c){var g=document.createElement("span");b.appendChild(g);g.classList.add(d||"imageSprite");g.classList.add(c)}var m=
this;i.onclick=function(){m.tableTree.toggle(a.id);if(m.tableTree.isExpanded(a.id))m._expanded.push(a.id);else for(var b in m._expanded)if(m._expanded[b]===a.id){m._expanded.splice(b,1);break}(b=m._getUIStatePreferencePath())&&window.sessionStorage&&m._storeExpansions(b)};return i},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler())},updateCommands:function(){if(this.commandService)for(var a=
j.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],d=j.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return a}();b.SelectionRenderer=function(){function a(b,c){this._init(b);this.explorer=c}a.prototype=new b.ExplorerRenderer;
a.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var d=0,i=this.getCellHeaderElement(d);i;)i.innerHTML.length>0&&i.classList.add("navColumn"),c.appendChild(i),i=this.getCellHeaderElement(++d);b.appendChild(c);d>0&&a.appendChild(b)};a.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var c=
this.explorer.getNavDict();if(c){c.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,b)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,i=this.getCellElement(c,a,b);i;)b.appendChild(i),c===0?this.getPrimColumnStyle?i.classList.add(this.getPrimColumnStyle()):i.classList.add("navColumn"):this.getSecondaryColumnStyle?i.classList.add(this.getSecondaryColumnStyle()):i.classList.add("secondaryColumn"),
i=this.getCellElement(++c,a,b)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();b.SimpleFlatModel=function(){function a(b,c,e){this.items=b;this.getKey=e;this.idPrefix=c;this.root={children:b}}a.prototype=new b.ExplorerModel;a.prototype.getRoot=function(a){a(this.root)};a.prototype.destroy=function(){};a.prototype.getId=function(a){for(var a=this.getKey(a).replace(/[\\\/]/g,""),b="",c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):
a[c];return this.idPrefix+b};a.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return a}();return b});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/webui/littlelib,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/contentTypes".split(","),function(g,k,j,d,c,a){function b(b,c,e,d,i,g,m){var j;if(c.Directory)j=document.createElement("a"),j.className="navlinkonpage",j.href=b+"#"+c.ChildrenLocation,j.appendChild(document.createTextNode(c.Name));else{i||(i=a.getOpenWithCommands(e));if(!g)for(b=0;b<i.length;b++)i[b].isEditor===
"default"&&(g=i[b]);j=document.createElement("a");j.className="navlink targetSelector";m&&typeof m==="object"&&Object.keys(m).forEach(function(a){j[a]=m[a]});j.appendChild(document.createTextNode(c.Name));for(var r=c.Location,s=!1,b=0;b<i.length;b++)if(e=i[b],e.visibleWhen(c)){r=e.hrefCallback({items:c});s=!0;break}k.when(d.getFileContentType(c),function(a){var b;if(b=!s)if(b=g){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":b=
!0;break a}b=!1}b=!b}b&&(r=g.hrefCallback({items:c}));b=j;var e=c.Location,d;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":d=document.createElement("img");d.src=e;d.classList.add("thumbnail");break;default:a&&a.image?(d=document.createElement("img"),d.src=a.image,d.classList.add("thumbnail")):(d=document.createElement("span"),d.className="core-sprite-file_model modelDecorationSprite")}b.firstChild?b.insertBefore(d,b.firstChild):
b.appendChild(d);j.href=r})}return j}function i(a,b,c,d){this.explorer=b;this.commandService=c;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}i.prototype=new d.SelectionRenderer;i.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};i.prototype.tableCallback=function(a){a.setAttribute("aria-label",g.Navigator);a.setAttribute("role","presentation")};i.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};
i.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};i.prototype.setTarget=function(a){this.target=a};i.prototype.createFolderNode=function(a){var c;this.showFolderLinks?c=b(this.folderLink||"",a,this.commandService,this.contentTypeService):(c=document.createElement("span"),c.textContent=a.Name);return c};i.prototype.showFolderLinks=!0;i.prototype.getCellElement=function(d,f,e){switch(d){case 0:var d=
document.createElement("td"),i=document.createElement("span");i.id=e.id+"MainCol";i.setAttribute("role","presentation");d.appendChild(i);d.setAttribute("role","presentation");i.className="mainNavColumn";var g;if(f.Directory)this.getExpandImage(e,i),g=this.createFolderNode(f),i.appendChild(g),this.explorer._makeDropTarget(f,g),this.explorer._makeDropTarget(f,e);else{if(!this.openWithCommands){this.openWithCommands=a.getOpenWithCommands(this.commandService);for(g=0;g<this.openWithCommands.length;g++)if(this.openWithCommands[g].isEditor===
"default")this.defaultEditor=this.openWithCommands[g]}g=b("",f,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,{target:this.target});i.appendChild(g)}if(g)g.id=e.id+"NameLink",g.nodeType===1&&(c.addNavGrid(this.explorer.getNavDict(),f,g),g.setAttribute("role","link"),g.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,i,f,this.explorer,"tool",null,!0);return d;case 1:if(this.oneColumn)return null;e=document.createElement("td");
if(f.LocalTimeStamp)e.textContent=(new Date(f.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;e=document.createElement("td");if(!f.Directory&&typeof f.Length==="number")f=parseInt(f.Length,10)/1024,e.textContent=Math.ceil(f).toLocaleString()+" KB";e.style.textAlign="right";return e}};i.prototype.constructor=i;return{NavigatorRenderer:i,createLink:b}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(g,k,j,d,c,a,b,i,h){function f(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function e(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new f(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}f.prototype.makeRenderFunction=function(a,c,e,f,q){var r=this.serviceRegistry,s=this.commandRegistry;this.openWithCommands=this.openWithCommands||i.createOpenWithCommands(r,a,s);var t=this;return function(l,u,i){h.when(t.openWithCommands,function(h){if(i)j.empty(c),h=document.createElement("div"),h.appendChild(document.createTextNode(g["Search failed."])),c.appendChild(h),typeof f==="function"&&f(c);else{var y=
function(){function a(b,c){var l=c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=l.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+l+" "));b.appendChild(e)}var b={};return function(c,l){var e=l.name;if(b.hasOwnProperty(e)){a(c,l);var d=b[e];typeof d==="function"&&(b[e]=null,d())}else b[e]=function(){a(c,l)}}}(),A=!1;j.empty(c);if(l&&l.length>0){var r=document.createElement("table");r.setAttribute("role","presentation");for(var I=0;I<l.length;I++){var C=
l[I],z;if(!A&&(A=!0,e))z=r.insertRow(0).insertCell(0),z.textContent=e;z=r.insertRow(-1).insertCell(0);z.colspan=2;q&&q(z);var t={Name:C.name,Directory:C.directory,Location:C.path||C.location},t=b.createLink(k.toUrl("navigate/table.html"),t,s,a,h,null,{"aria-describedby":(C.folderName?C.folderName:C.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}});C.LineNumber&&t.appendChild(document.createTextNode(" (Line "+C.LineNumber+")"));z.appendChild(t);y(z,C)}c.appendChild(r);typeof f===
"function"&&f(c)}!A&&u&&(h=d.formatMessage(g["No matches found for ${0}"],u),j.empty(c),c.appendChild(document.createTextNode(h)),typeof f==="function"&&f(c))}})}};e.prototype={search:function(b,e,d){var f=function(a){for(var b=[],e=0;e<a.response.docs.length;e++){var l=a.response.docs[e];b.push({name:l.Name,path:l.Location,folderName:c.path2FolderName(l.Path?l.Path:l.Location,l.Name),directory:l.Directory,lineNumber:l.LineNumber})}return b};if(this._crawler&&b.nameSearch)this._crawler.searchName(b,
function(a){d(f(a),null)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(b),"Searching "+b.keyword).then(function(a){var c=b.keyword,c=c.substring(c.indexOf("}")+1),c=c.substring(c.indexOf(":")+1);d(f(a),c)},function(a){d(null,null,a)})}catch(h){typeof h==="string"&&h.indexOf("search")>-1&&this._crawler?this._crawler.searchName(b,function(a){d(f(a),null)}):typeof h==="string"&&h.indexOf("search")>-1&&!b.nameSearch?(new a.SearchCrawler(this.registry,this._fileService,
b,{childrenLocation:this.getChildrenLocation()})).search(function(a){d(f(a),null)}):this.registry.getService("orion.page.message").setErrorMessage(h)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,b){console.error(a);j.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&a.Parents.length>
0?e=b.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),c=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=j.node("search");c||(c="");if(e&&e.placeholder){e.value="";var f=d.formatMessage(g["Search ${0}"],c);e.placeholder=f.length>30?f.substring(0,27)+"...":d.formatMessage(g["Search ${0}"],
c)}if(e&&e.title)e.title=g["Type a keyword or wild card to search in "]+c},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?
this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,c,e){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,sort:e&&e.sort?e.sort:"Path asc",rows:e&&e.rows?e.rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.fileType:void 0,keyword:a,replace:e?e.replace:void 0}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(g,k,j,d){function c(a,c){var h=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!c.id)throw Error("Missing required argument: id");this.id=c.id;if(!c.title)throw Error("Missing required argument: title");var f=c.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var e=0;e<f.length;e++)this.domNode.classList.add(f[e]);this.domNode.id=c.id;if(c.canHide)this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitle"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=0,this.domNode.addEventListener("click",
function(a){(a.target===h.titleNode||a.target===h.twistie)&&h._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===g.KEY.ENTER&&(a.target===h.domNode||a.target===h.titleNode||a.target===h.twistie)&&h._changeExpandedState()},!1);if(c.iconClass){var n=document.createElement("span");n.classList.add("sectionIcon");this.domNode.appendChild(n);(Array.isArray(c.iconClass)?c.iconClass:[c.iconClass]).forEach(function(a){n.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=c.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=c.title;if(typeof c.getItemCount==="function")f=document.createElement("div"),f.classList.add("layoutLeft"),f.classList.add("sectionItemCount"),this.domNode.appendChild(f),f.textContent=c.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
c.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);f=document.createElement("div");f.id=c.id+"FilterSearchBox";this.domNode.appendChild(f);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=c.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");
this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("div");this.actionsNode.id=c.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("div");this.selectionNode.id=c.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);c.slideout&&(f=d.slideoutHTMLFragment(c.id),e=document.createRange(),e.selectNode(this.domNode),f=e.createContextualFragment(f),this.domNode.appendChild(f));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);c.content&&this.setContent(c.content);
this.hidden=c.hidden;if(typeof c.onExpandCollapse==="function")this._onExpandCollapse=c.onExpandCollapse;this._preferenceService=c.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var o=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(o.id);if(a!==void 0)o.hidden=!a;if(!o.hidden)o._contentParent.style.display="block";o._updateExpandedState(!o.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=c.commandService;this._lastMonitor=0;this._loading={}}function a(a){this._section=a;this._id=++a._lastMonitor}c.prototype={setTitle:function(a){this.titleNode.textContent=a},setContent:function(a){typeof a==="string"?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},createProgressMonitor:function(){return new a(this)},_setMonitorMessage:function(a,c){this._progressNode.style.visibility=
"visible";this._loading[a]=c;var d="",f;for(f in this._loading)d!==""&&(d+="\n"),d+=this._loading[f];this._progressNode.title=d},_monitorDone:function(a){delete this._loading[a];var a="",c;for(c in this._loading)a!==""&&(a+="\n"),a+=this._loading[c];this._progressNode.title=a;if(a==="")this._progressNode.style.visibility="hidden"},_changeExpandedState:function(){this.hidden?(this._contentParent.style.display="block",this.hidden=!1):(this._contentParent.style.display="none",this.hidden=!0);this._updateExpandedState(!this.hidden,
!0)},_updateExpandedState:function(a,c){var d=this.twistie,f=this.id;d&&(d.classList.add(a?this._expandImageClass:this._collapseImageClass),d.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&c&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(f,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};c.prototype.constructor=c;a.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};a.prototype.constructor=a;return{Section:c}});
define("orion/outliner","i18n!orion/nls/messages,orion/Deferred,orion/webui/littlelib,orion/uiUtils,orion/section,orion/explorers/explorer,orion/commands,orion/URITemplate,orion/EventTarget,orion/i18nUtil".split(","),function(g,k,j,d,c,a,b,i,h,f){function e(a,b,c,e){this.explorer=b;this._init(a);this.title=c;this.selectionService=e}function n(a,b,c){this.registry=a;this.renderer=new e({checkbox:!1,treeTableClass:"outlineExplorer"},this,c,b)}function o(a,b){this.items=a;this.root={children:a};this.root.outlinerId=
b;this.idItemMap={}}function p(a){this._init(a)}function m(a){this._serviceRegistry=a.serviceRegistry;this._preferences=a.preferences;h.attach(this);this._serviceRegistration=this._serviceRegistry.registerService("orion.edit.outline",this);this._outlinePref=this._preferences.getPreferences("/edit/outline");this._provider=new k;this._providerResolved=!1;this.filteredProviders=[]}e.prototype=a.SelectionRenderer.prototype;e.prototype.constructor=e;e.prototype.getLabelColumnIndex=function(){return 0};
e.prototype.getCellElement=function(a,b,c){b&&(a=document.createElement("span"),c.appendChild(a),b.className&&a.classList.add(b.className),b.children&&this.getExpandImage(c,a),b.href?this._createLink(b.label,b.href,a):b.line||b.column||b.start?(c=(new i("#{,resource,params*}")).expand({resource:this.title,params:b}),this._createLink(b.label,c,a)):b.label&&a.appendChild(document.createTextNode(b.label)))};e.prototype._createLink=function(a,b,c){var e=document.createElement("a");c.appendChild(e);this.selectionService?
e.style.cursor="pointer":e.href=b;e.classList.add("navlinkonpage");e.appendChild(document.createTextNode(a));if(this.selectionService){var l=this.selectionService;e.addEventListener("click",function(a){d.openInNewWindow(a)?d.followLink(b,a):l.setSelections(b)},!1)}return e};n.prototype=a.Explorer.prototype;n.prototype.constructor=n;o.prototype.constructor=o;o.prototype.getRoot=function(a){a(this.root)};o.prototype.destroy=function(){};o.prototype.getId=function(a){if(a.outlinerId)return a.outlinerId;
var b=a.label.replace(/[\\\/\.\:\-\_]/g,"");this.idItemMap[b]&&this.idItemMap[b]!==a||j.node(b)?(b=(new Date).getTime().toString(),this.idItemMap[b]=a,a.outlinerId=b):this.idItemMap[b]=a;return b};o.prototype.getChildren=function(a,b){if(a.children){for(var c=0;c<a.children.length;c++)a.children[c].parent=a;b(a.children)}else b([])};o.prototype.doExpansions=function(a){for(var b=0;b<this.root.children.length;b++)this.root.children[b].children&&a.expand(this.root.children[b])};p.prototype={_init:function(a){var b=
j.node(a.parent),c=j.node(a.toolbar);if(!b)throw Error("no parent");if(!a.outlineService)throw Error("no outline service");this._parent=b;this._toolbar=c;this._serviceRegistry=a.serviceRegistry;this._contentTypeRegistry=a.contentTypeRegistry;this._outlineService=a.outlineService;this._commandService=a.commandService;this._selectionService=a.selectionService;this._inputManager=a.inputManager;this._sidebar=a.sidebar;var e=this;this._inputManager.addEventListener("ContentTypeChanged",function(a){e.setContentType(a.contentType,
a.location)});this._inputManager.getEditor().addEventListener("InputChanged",this.generateOutline.bind(this));k.when(e._outlineService,function(a){a.addEventListener("outline",function(a){e.providerId=a.providerId;e._renderOutline(a.outline,a.title)})})},outlineChanged:function(a,b,c){var e=this;this._serviceRegistry.getService("orion.page.progress").progress(a.getOutline(c,b),"Getting outline for "+b).then(function(a){e._renderOutline(a,b)})},generateOutline:function(){if(this._isActive()&&!this._providerLookup){var a=
this._inputManager.getEditor();this._outlineService.emitOutline(a.getText(),a.getTitle())}},setSelectedProvider:function(a){this.providerId=a.getProperty("id");this.providerName=a.getProperty("name");this._outlineService.setProvider(a)},setOutlineProviders:function(a){var b=this.outlineProviders,c=this._isActive();this.outlineProviders=a;this._updateViewModes(b,this.outlineProviders);c&&this._selectNewProvider()},_renderOutline:function(a,b){var c=this._parent;j.empty(c);if(a=a instanceof Array?a:
[a]){var e=new o(a);this.explorer=new n(this._serviceRegistry,this._selectionService,b);this.explorer.createTree(c,e,{selectionPolicy:"cursorOnly",setFocus:!1});e.doExpansions(this.explorer.myTree)}},_selectNewProvider:function(){var a=this.outlineProviders,b=this,c=b._sidebar;a.every(function(a){return b.providerId!==a.getProperty("id")})&&((a=a[0])?c.setViewMode(this._viewModeId(a)):c.setViewMode(c.defaultViewMode))},_viewModeId:function(a){return"outline."+a.getProperty("id")},_updateViewModes:function(a,
b){var c=this;a&&a.forEach(function(a){c._sidebar.removeViewMode(c._viewModeId(a))});b.forEach(function(a){c._sidebar.addViewMode(c._viewModeId(a),{label:a.displayName||a.getProperty("name")||a.name+a.serviceId||"undefined",create:c.createViewMode.bind(c,a),destroy:c.destroyViewMode.bind(c,a)})});c._sidebar.renderViewModeMenu()},_isActive:function(){var a=this._sidebar.getActiveViewModeId();if(!a)return!1;var b=this;return this.outlineProviders&&this.outlineProviders.some(function(c){return a===b._viewModeId(c)})},
createViewMode:function(a){this.setSelectedProvider(a);this.generateOutline()},destroyViewMode:function(){},setContentType:function(a,b){var c=this,e=this.filteredProviders=this._serviceRegistry.getServiceReferences("orion.edit.outliner").filter(function(l){var e=l.getProperty("contentType"),l=l.getProperty("pattern");if(e)return e.some(function(b){return c._contentTypeRegistry.isExtensionOf(a,b)});else if(l&&RegExp(l).test(b))return!0;return!1});this._providerLookup=!0;var l=e.map(function(a){if(a.getProperty("nameKey")&&
a.getProperty("nls")){var b=new k;f.getMessageBundle(a.getProperty("nls")).then(function(a,b,c){a.displayName=c[a.getProperty("nameKey")];b.resolve()}.bind(null,a,b),b.reject);return b}else return a.displayName=a.getProperty("name"),(new k).resolve()});k.all(l,function(a){return a}).then(function(){c._providerLookup=!1;c._outlineService.setOutlineProviders(e);c.setOutlineProviders(e)})}};p.prototype.constructor=p;m.prototype={setOutlineProviders:function(a){this.providers=a;var b=this;k.when(this._outlinePref,
function(c){for(var e,l=0;l<a.length;l++)if(e=a[l],c.get("outlineProvider")===a[l].getProperty("id"))break;e&&b.setProvider(e)})},setProvider:function(a){if(this._providerResolved)this._provider=new k;this._provider.resolve(a);this._providerResolved=!0;var b=a.getProperty("id");b&&this._outlinePref.then(function(a){a.put("outlineProvider",b)})},getProvider:function(){return this._provider.promise},emitOutline:function(a,b){var c=this;k.when(this.getProvider(),function(e){c._serviceRegistry.getService("orion.page.progress").progress(c._serviceRegistry.getService(e).getOutline(a,
b),"Getting outline for "+b+" from "+e.displayName).then(function(a){a&&c.dispatchEvent({type:"outline",outline:a,title:b,providerId:e.getProperty("id")})})})}};m.prototype.constructor=m;return{Outliner:p,OutlineService:m}});
define("orion/problems",["orion/EventTarget"],function(g){function k(j){this._serviceRegistry=j;g.attach(this);this._serviceRegistration=j.registerService("orion.core.marker",this)}k.prototype={_setProblems:function(g){this.problems=g;this.dispatchEvent({type:"problemsChanged",problems:g})}};k.prototype.constructor=k;return{ProblemService:k}});define("orion/editor/i18n",{load:function(g,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+g],function(d){j(d)}):j({})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",setMarkCommand:"Set Mark",
clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",
incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",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:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",collapseAll:"Collapse All",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}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",
viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",
vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",
viP:"Paste Before Char or Line",replaceAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(g,k){var j={root:k},d;for(d in g)g.hasOwnProperty(d)&&typeof j[d]==="undefined"&&(j[d]=g[d]);return j});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(g,k){function j(c){if(c)this._view=c,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function d(c){j.call(this,c)}j.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(c){for(var a=[],b=this._keyBindings,d=0;d<b.length;d++)b[d].actionID===c&&a.push(b[d].keyBinding);return a},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(c){switch(c.keyCode){case 16:case 17:case 18:case 91:return}for(var a=this._keyBindingIndex,b=this._matchingKeyBindings||this._keyBindings,d=[],h=0;h<b.length;h++){var f=b[h],e=f.keyBinding.match(c,a);if(e===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,f.actionID;else typeof e==="number"&&d.push(f)}if(d.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(c,
a){for(var b=this._keyBindings,d=0;d<b.length;d++){var h=b[d];if(h.keyBinding.equals(c)){a?h.actionID=a:h.predefined?h.actionID="noop":b.splice(d,1);return}}a&&b.push({keyBinding:c,actionID:a})},setView:function(c){this._view=c}};d.prototype=new j;d.prototype.createKeyBindings=function(){var c=g.KeyBinding,a=[];a.push({actionID:"lineUp",keyBinding:new c(38),predefined:!0});a.push({actionID:"lineDown",keyBinding:new c(40),predefined:!0});a.push({actionID:"charPrevious",keyBinding:new c(37),predefined:!0});
a.push({actionID:"charNext",keyBinding:new c(39),predefined:!0});k.isMac?(a.push({actionID:"scrollPageUp",keyBinding:new c(33),predefined:!0}),a.push({actionID:"scrollPageDown",keyBinding:new c(34),predefined:!0}),a.push({actionID:"pageUp",keyBinding:new c(33,null,null,!0),predefined:!0}),a.push({actionID:"pageDown",keyBinding:new c(34,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new c(37,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new c(39,!0),predefined:!0}),
a.push({actionID:"wordPrevious",keyBinding:new c(37,null,null,!0),predefined:!0}),a.push({actionID:"wordNext",keyBinding:new c(39,null,null,!0),predefined:!0}),a.push({actionID:"scrollTextStart",keyBinding:new c(36),predefined:!0}),a.push({actionID:"scrollTextEnd",keyBinding:new c(35),predefined:!0}),a.push({actionID:"textStart",keyBinding:new c(38,!0),predefined:!0}),a.push({actionID:"textEnd",keyBinding:new c(40,!0),predefined:!0}),a.push({actionID:"scrollPageUp",keyBinding:new c(38,null,null,null,
!0),predefined:!0}),a.push({actionID:"scrollPageDown",keyBinding:new c(40,null,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new c(37,null,null,null,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new c(39,null,null,null,!0),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new c(38,null,null,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new c(40,null,null,!0),predefined:!0})):(a.push({actionID:"pageUp",keyBinding:new c(33),predefined:!0}),a.push({actionID:"pageDown",
keyBinding:new c(34),predefined:!0}),a.push({actionID:"lineStart",keyBinding:new c(36),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new c(35),predefined:!0}),a.push({actionID:"wordPrevious",keyBinding:new c(37,!0),predefined:!0}),a.push({actionID:"wordNext",keyBinding:new c(39,!0),predefined:!0}),a.push({actionID:"textStart",keyBinding:new c(36,!0),predefined:!0}),a.push({actionID:"textEnd",keyBinding:new c(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(a.push({actionID:"lineUp",keyBinding:new c(38,
!0),predefined:!0}),a.push({actionID:"lineDown",keyBinding:new c(40,!0),predefined:!0}));k.isWindows&&(a.push({actionID:"scrollLineUp",keyBinding:new c(38,!0),predefined:!0}),a.push({actionID:"scrollLineDown",keyBinding:new c(40,!0),predefined:!0}));a.push({actionID:"selectLineUp",keyBinding:new c(38,null,!0),predefined:!0});a.push({actionID:"selectLineDown",keyBinding:new c(40,null,!0),predefined:!0});a.push({actionID:"selectCharPrevious",keyBinding:new c(37,null,!0),predefined:!0});a.push({actionID:"selectCharNext",
keyBinding:new c(39,null,!0),predefined:!0});a.push({actionID:"selectPageUp",keyBinding:new c(33,null,!0),predefined:!0});a.push({actionID:"selectPageDown",keyBinding:new c(34,null,!0),predefined:!0});k.isMac?(a.push({actionID:"selectLineStart",keyBinding:new c(37,!0,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new c(39,!0,!0),predefined:!0}),a.push({actionID:"selectWordPrevious",keyBinding:new c(37,null,!0,!0),predefined:!0}),a.push({actionID:"selectWordNext",keyBinding:new c(39,
null,!0,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new c(36,null,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new c(35,null,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new c(38,!0,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new c(40,!0,!0),predefined:!0}),a.push({actionID:"selectLineStart",keyBinding:new c(37,null,!0,null,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new c(39,null,!0,null,!0),predefined:!0}),
a.push({actionID:"selectLineStart",keyBinding:new c(38,null,!0,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new c(40,null,!0,!0),predefined:!0})):(k.isLinux&&(a.push({actionID:"selectWholeLineUp",keyBinding:new c(38,!0,!0),predefined:!0}),a.push({actionID:"selectWholeLineDown",keyBinding:new c(40,!0,!0),predefined:!0})),a.push({actionID:"selectLineStart",keyBinding:new c(36,null,!0),predefined:!0}),a.push({actionID:"selectLineEnd",keyBinding:new c(35,null,!0),predefined:!0}),a.push({actionID:"selectWordPrevious",
keyBinding:new c(37,!0,!0),predefined:!0}),a.push({actionID:"selectWordNext",keyBinding:new c(39,!0,!0),predefined:!0}),a.push({actionID:"selectTextStart",keyBinding:new c(36,!0,!0),predefined:!0}),a.push({actionID:"selectTextEnd",keyBinding:new c(35,!0,!0),predefined:!0}));a.push({actionID:"undo",keyBinding:new g.KeyBinding("z",!0),predefined:!0});k.isMac?a.push({actionID:"redo",keyBinding:new g.KeyBinding("z",!0,!0),predefined:!0}):a.push({actionID:"redo",keyBinding:new g.KeyBinding("y",!0),predefined:!0});
a.push({actionID:"deletePrevious",keyBinding:new c(8),predefined:!0});a.push({actionID:"deletePrevious",keyBinding:new c(8,null,!0),predefined:!0});a.push({actionID:"deleteNext",keyBinding:new c(46),predefined:!0});a.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0),predefined:!0});a.push({actionID:"deleteWordPrevious",keyBinding:new c(8,!0,!0),predefined:!0});a.push({actionID:"deleteWordNext",keyBinding:new c(46,!0),predefined:!0});a.push({actionID:"tab",keyBinding:new c(9),predefined:!0});
a.push({actionID:"shiftTab",keyBinding:new c(9,null,!0),predefined:!0});a.push({actionID:"enter",keyBinding:new c(13),predefined:!0});a.push({actionID:"enter",keyBinding:new c(13,null,!0),predefined:!0});a.push({actionID:"selectAll",keyBinding:new c("a",!0),predefined:!0});a.push({actionID:"toggleTabMode",keyBinding:new c("m",!0),predefined:!0});k.isMac&&(a.push({actionID:"deleteNext",keyBinding:new c(46,null,!0),predefined:!0}),a.push({actionID:"deleteWordPrevious",keyBinding:new c(8,null,null,!0),
predefined:!0}),a.push({actionID:"deleteWordNext",keyBinding:new c(46,null,null,!0),predefined:!0}));a.push({actionID:"toggleWrapMode",keyBinding:new g.KeyBinding("w",!0,!1,!0)});a.push({actionID:"toggleOverwriteMode",keyBinding:new g.KeyBinding(45)});if(!k.isFirefox){var b=k.isMac&&k.isChrome;a.push({actionID:"noop",keyBinding:new c("u",!b,!1,!1,b),predefined:!0});a.push({actionID:"noop",keyBinding:new c("i",!b,!1,!1,b),predefined:!0});a.push({actionID:"noop",keyBinding:new c("b",!b,!1,!1,b),predefined:!0})}k.isFirefox&&
(a.push({actionID:"copy",keyBinding:new c(45,!0),predefined:!0}),a.push({actionID:"paste",keyBinding:new c(45,null,!0),predefined:!0}),a.push({actionID:"cut",keyBinding:new c(46,null,!0),predefined:!0}));k.isMac&&(a.push({actionID:"lineStart",keyBinding:new c("a",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineEnd",keyBinding:new c("e",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineUp",keyBinding:new c("p",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"lineDown",keyBinding:new c("n",!1,!1,
!1,!0),predefined:!0}),a.push({actionID:"charPrevious",keyBinding:new c("b",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"charNext",keyBinding:new c("f",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deletePrevious",keyBinding:new c("h",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteNext",keyBinding:new c("d",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteLineEnd",keyBinding:new c("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(a.push({actionID:"scrollPageDown",keyBinding:new c("v",!1,
!1,!1,!0),predefined:!0}),a.push({actionID:"deleteLineStart",keyBinding:new c("u",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"deleteWordPrevious",keyBinding:new c("w",!1,!1,!1,!0),predefined:!0})):(a.push({actionID:"pageDown",keyBinding:new c("v",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"centerLine",keyBinding:new c("l",!1,!1,!1,!0),predefined:!0}),a.push({actionID:"enterNoCursor",keyBinding:new c("o",!1,!1,!1,!0),predefined:!0})));return a};return{KeyMode:j,DefaultKeyMode:d}});
define("orion/editor/contentAssist","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/eventTarget,orion/Deferred,orion/objects,orion/util".split(","),function(g,k,j,d,c,a,b){var i,h,f;function e(a){this.textView=a;this.state=i;this.providers=[];var c=this;this.contentAssistListener={onModelChanging:function(a){c.isDeactivatingChange(a)?c.setState(i):c.state===h&&c.setState(f)},onScroll:function(){c.setState(i)},onSelection:function(){var a=c.state;if(a===h||a===f)c.computeProposals(),
c.setState(f)}};a.setKeyBinding(b.isMac?new k.KeyBinding(" ",!1,!1,!1,!0):new k.KeyBinding(" ",!0),"contentAssist");a.setAction("contentAssist",function(){c.activate();return!0},{name:g.contentAssist})}function n(a,b){var c=a.textView;j.KeyMode.call(this,c);this.contentAssist=a;this.widget=b;this.proposals=[];var e=this;this.contentAssist.addEventListener("ProposalsComputed",function(a){e.proposals=a.data.proposals;e.selectedIndex=e.proposals.length?0:-1});c.setAction("contentAssistApply",function(){return this.enter()}.bind(this));
c.setAction("contentAssistCancel",function(){return this.cancel()}.bind(this));c.setAction("contentAssistNextProposal",function(){return this.lineDown()}.bind(this));c.setAction("contentAssistPreviousProposal",function(){return this.lineUp()}.bind(this));c.setAction("contentAssistTab",function(){return this.tab()}.bind(this))}function o(a,c){this.contentAssist=a;this.textView=this.contentAssist.getTextView();this.isShowing=this.textViewListenerAdded=!1;var e=this.textView.getOptions("parent").ownerDocument;
this.parentNode=typeof c==="string"?e.getElementById(c):c;if(!this.parentNode){this.parentNode=b.createElement(e,"div");this.parentNode.className="contentassist";var d=e.getElementsByTagName("body")[0];if(d)d.appendChild(this.parentNode);else throw Error("parentNode is required");}var f=this;this.textViewListener={onMouseDown:function(a){a.event.target.parentElement!==f.parentNode&&f.contentAssist.deactivate()}};this.contentAssist.addEventListener("ProposalsComputed",function(a){f.setProposals(a.data.proposals);
f.show();if(!f.textViewListenerAdded)f.textView.addEventListener("MouseDown",f.textViewListener.onMouseDown),f.textViewListenerAdded=!0});this.contentAssist.addEventListener("Deactivating",function(){f.setProposals([]);f.hide();if(f.textViewListenerAdded)f.textView.removeEventListener("MouseDown",f.textViewListener.onMouseDown),f.textViewListenerAdded=!1;f.textViewListenerAdded=!1});this.scrollListener=function(){f.isShowing&&f.position()};e.addEventListener&&e.addEventListener("scroll",this.scrollListener)}
i=1;h=2;f=3;var p={selected:" selected",hr:"proposal-hr",emphasis:"proposal-emphasis",noemphasis:"proposal-noemphasis",dfault:"proposal-default"};e.prototype={apply:function(a){if(!a)return!1;var b=this.textView.getSelection(),c=Math.min(b.start,b.end),b=Math.max(b.start,b.end);a.overwrite&&(c=this.getPrefixStart(c));var e={proposal:a,start:c,end:b};this.setState(i);this.textView.setText(typeof a==="string"?a:a.proposal,c,b);this.dispatchEvent({type:"ProposalApplied",data:e});return!0},activate:function(){this.state===
i&&this.setState(h)},deactivate:function(){this.setState(i)},getTextView:function(){return this.textView},isActive:function(){return this.state===h||this.state===f},isDeactivatingChange:function(a){var b=a.removedCharCount>0&&a.addedCharCount===0,c=this.textView,c=a.start+1<=c.getModel().getCharCount()&&/^\s*$/.test(c.getText(a.start,a.start+1));return a.removedLineCount>0||a.addedLineCount>0||b&&c},setState:function(a){var b;a===h?(b="Activating",this._mode&&this._mode.setActive(!0)):a===i&&(b="Deactivating",
this._mode&&this._mode.setActive(!1));b&&this.dispatchEvent({type:b});this.state=a;this.onStateChange(a)},setMode:function(a){this._mode=a},onStateChange:function(a){if(a===i){if(this.listenerAdded)this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging),this.textView.removeEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.removeEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!1}else if(a===h){if(!this.listenerAdded)this.textView.addEventListener("ModelChanging",
this.contentAssistListener.onModelChanging),this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll),this.textView.addEventListener("Selection",this.contentAssistListener.onSelection),this.listenerAdded=!0;this.computeProposals()}},computeProposals:function(){var a=this;this._computeProposals(this.textView.getCaretOffset()).then(function(b){a.isActive()&&a.dispatchEvent({type:"ProposalsComputed",data:{proposals:b}})})},getPrefixStart:function(a){for(;a>0&&/[A-Za-z0-9_]/.test(this.textView.getText(a-
1,a));)a--;return a},handleError:function(a){typeof console!=="undefined"&&(console.log("Error retrieving content assist proposals"),console.log(a))},_computeProposals:function(a){for(var b=this.providers,e=this.textView,d=e.getModel(),f=e.getText(),l=d.getLine(d.getLineAtOffset(a)),h=0;h<l.length&&/\s/.test(l.charAt(h));)h++;var h=l.substring(0,h),i=e.getOptions("tabSize","expandTab"),i=i.expandTab?Array(i.tabSize+1).join(" "):"\t",v={line:l,prefix:e.getText(this.getPrefixStart(a),a),selection:e.getSelection(),
delimiter:d.getLineDelimiter(),tab:i,indentation:h},g=this,b=b.map(function(b){var l=b.computeProposals||b.getProposals,e;try{typeof l==="function"&&(e=g.progress?g.progress.progress(l.apply(b,[f,a,v]),"Generating content assist proposal"):l.apply(b,[f,a,v]))}catch(d){g.handleError(d)}return c.when(e)});return c.all(b,this.handleError).then(function(a){return a.reduce(function(a,b){return b instanceof Array?a.concat(b):a},[])})},setProviders:function(a){this.providers=a.slice(0)},setProgress:function(a){this.progress=
a}};d.EventTarget.addMixin(e.prototype);n.prototype=new j.KeyMode;a.mixin(n.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"contentAssistApply",keyBinding:new a(13)});b.push({actionID:"contentAssistCancel",keyBinding:new a(27)});b.push({actionID:"contentAssistNextProposal",keyBinding:new a(40)});b.push({actionID:"contentAssistPreviousProposal",keyBinding:new a(38)});b.push({actionID:"contentAssistTab",keyBinding:new a(9)});return b},cancel:function(){this.getContentAssist().deactivate()},
getContentAssist:function(){return this.contentAssist},isActive:function(){return this.getContentAssist().isActive()},setActive:function(a){a?this.contentAssist.textView.addKeyMode(this):this.contentAssist.textView.removeKeyMode(this)},lineUp:function(){for(var a=this.selectedIndex===0?this.proposals.length-1:this.selectedIndex-1;this.proposals[a].unselectable&&a>0;)a--;this.selectedIndex=a;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},lineDown:function(){for(var a=this.selectedIndex===
this.proposals.length-1?0:this.selectedIndex+1;this.proposals[a].unselectable&&a<this.proposals.length-1;)a++;this.selectedIndex=a;this.widget&&this.widget.setSelectedIndex(this.selectedIndex);return!0},enter:function(){return this.contentAssist.apply(this.proposals[this.selectedIndex]||null)},tab:function(){return this.widget?(this.widget.createAccessible(this),this.widget.parentNode.focus(),!0):!1}});o.prototype={onClick:function(a){this.contentAssist.apply(this.getProposal(a.target));this.textView.focus()},
createDiv:function(a,c,e,d){var f=e.ownerDocument,l=b.createElement(f,"div");l.id="contentoption"+d;l.setAttribute("role","option");a.style==="hr"?a=b.createElement(f,"hr"):(l.className=this.calculateClasses(a.style,c),a=f.createTextNode(this.getDisplayString(a)),c&&this.parentNode.setAttribute("aria-activedescendant",l.id));l.appendChild(a,l);e.appendChild(l)},createAccessible:function(a){this._isAccessible||this.parentNode.addEventListener("keydown",function(b){b.preventDefault();if(b.keyCode===
27)return a.cancel();else if(b.keyCode===38)return a.lineUp();else if(b.keyCode===40)return a.lineDown();else if(b.keyCode===13)return a.enter();return!1});this._isAccessible=!0},calculateClasses:function(a,b){var c=p[a];if(!c)c=p.dfault;return b?c+p.selected:c},getDisplayString:function(a){return typeof a==="string"?a:a.description&&typeof a.description==="string"?a.description:a.proposal},getProposal:function(a){for(var b=0,c=this.parentNode.firstChild;c!==null;c=c.nextSibling){if(c===a)return this.proposals[b]||
null;b++}return null},setSelectedIndex:function(a){this.selectedIndex=a;this.selectNode(this.parentNode.childNodes[this.selectedIndex])},selectNode:function(a){for(var b=this.parentNode.childNodes,c=0;c<b.length;c++){var e=b[c],d=e.className.indexOf(p.selected);if(d>=0)e.className=e.className.substring(0,d)+e.className.substring(d+p.selected.length);e===a&&(e.className+=p.selected,this.parentNode.setAttribute("aria-activedescendant",e.id),e.focus(),e.offsetTop<this.parentNode.scrollTop?e.scrollIntoView(!0):
e.offsetTop+e.offsetHeight>this.parentNode.scrollTop+this.parentNode.clientHeight&&e.scrollIntoView(!1))}},setProposals:function(a){this.proposals=a},show:function(){if(this.proposals.length===0)this.hide();else{this.parentNode.innerHTML="";for(var a=0;a<this.proposals.length;a++)this.createDiv(this.proposals[a],a===0,this.parentNode,a);this.position();this.parentNode.onclick=this.onClick.bind(this);this.isShowing=!0}},hide:function(){this.parentNode.ownerDocument.activeElement===this.parentNode&&
this.textView.focus();this.parentNode.style.display="none";this.parentNode.onclick=null;this.isShowing=!1},position:function(){var a=this.contentAssist,a=this.textView.getLocationAtOffset(a.offset!==void 0?a.offset:this.textView.getCaretOffset());a.y+=this.textView.getLineHeight();this.textView.convert(a,"document","page");this.parentNode.style.position="fixed";this.parentNode.style.left=a.x+"px";this.parentNode.style.top=a.y+"px";this.parentNode.style.display="block";this.parentNode.scrollTop=0;
var b=this.parentNode.ownerDocument,c=b.documentElement.clientWidth;if(a.y+this.parentNode.offsetHeight>b.documentElement.clientHeight)this.parentNode.style.top=a.y-this.parentNode.offsetHeight-this.textView.getLineHeight()+"px";if(a.x+this.parentNode.offsetWidth>c)this.parentNode.style.left=c-this.parentNode.offsetWidth+"px"}};return{ContentAssist:e,ContentAssistMode:n,ContentAssistWidget:o}});
define("orion/editor/undoStack",[],function(){function g(d,c,a){this.offset=d;this.text=c;this.previousText=a}function k(d){this.owner=d;this.changes=[]}function j(d,c){this.view=d;this.size=c!==void 0?c:100;this.reset();var a=d.getModel();a.getBaseModel&&(a=a.getBaseModel());this.model=a;var b=this;this._listener={onChanging:function(a){b._onChanging(a)},onDestroy:function(a){b._onDestroy(a)}};a.addEventListener("Changing",this._listener.onChanging);d.addEventListener("Destroy",this._listener.onDestroy)}
g.prototype={undo:function(d,c){this._doUndoRedo(this.offset,this.previousText,this.text,d,c);return!0},redo:function(d,c){this._doUndoRedo(this.offset,this.text,this.previousText,d,c);return!0},_doUndoRedo:function(d,c,a,b,i){var h=b.getModel();if(h.mapOffset&&b.annotationModel){var f=h.mapOffset(d,!0);if(f<0)for(var e=b.annotationModel.getAnnotations(d,d+1);e.hasNext();){var g=e.next();if(g.type==="orion.annotation.folding"){g.expand();f=h.mapOffset(d,!0);break}}if(f<0)return;d=f}h.setText(c,d,
d+a.length);i&&b.setSelection(d,d+c.length)}};k.prototype={add:function(d){this.changes.push(d)},end:function(d){this.endSelection=d.getSelection();this.endCaret=d.getCaretOffset();(d=this.owner)&&d.end&&d.end()},undo:function(d,c){this.changes.length>1&&d.setRedraw(!1);for(var a=this.changes.length-1;a>=0;a--)this.changes[a].undo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(c){var a=this.startSelection.start,b=this.startSelection.end;d.setSelection(this.startCaret?a:b,this.startCaret?b:a)}(a=
this.owner)&&a.undo&&a.undo();return this.changes.length>0},redo:function(d,c){this.changes.length>1&&d.setRedraw(!1);for(var a=0;a<this.changes.length;a++)this.changes[a].redo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(c){var a=this.endSelection.start,b=this.endSelection.end;d.setSelection(this.endCaret?a:b,this.endCaret?b:a)}(a=this.owner)&&a.redo&&a.redo();return this.changes.length>0},start:function(d){this.startSelection=d.getSelection();this.startCaret=d.getCaretOffset();(d=this.owner)&&
d.start&&d.start()}};j.prototype={add:function(d){this.compoundChange?this.compoundChange.add(d):(this.stack.splice(this.index,this.stack.length-this.index,d),this.index++,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=void 0},getSize:function(){var d=this.index,c=this.stack.length;this._undoStart!==void 0&&d++;return{undo:d,redo:c-d}},undo:function(){this._commitUndo();var d;d=!1;this._ignoreUndo=!0;do{if(this.index<=0)break;d=this.stack[--this.index]}while(!(d=d.undo(this.view,!0)));this._ignoreUndo=!1;return d},redo:function(){this._commitUndo();var d;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;
d=this.stack[this.index++]}while(!d.redo(this.view,!0));this._ignoreUndo=!1;return!0},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=void 0;this._undoText="";this._undoType=0;this._ignoreUndo=!1;this._compoundChange=void 0},startCompoundChange:function(d){this._commitUndo();d=new k(d);this.add(d);this.compoundChange=d;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){if(this._undoStart!==void 0)this._undoType===-1?this.add(new g(this._undoStart,
"",this._undoText)):this.add(new g(this._undoStart,this._undoText,"")),this._undoStart=void 0,this._undoText="",this._undoType=0;this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(d){var c=d.text,a=d.start,b=d.removedCharCount,d=d.addedCharCount;if(!this._ignoreUndo){this._undoStart!==void 0&&!(d===1&&b===0&&this._undoType===1&&a===this._undoStart+
this._undoText.length||d===0&&b===1&&this._undoType===-1&&(a+1===this._undoStart||a===this._undoStart))&&this._commitUndo();if(!this.compoundChange)if(d===1&&b===0){if(this._undoStart===void 0)this._undoStart=a;this._undoText+=c;this._undoType=1;return}else if(d===0&&b===1){c=this._undoText.length>0&&this._undoStart===a;this._undoStart=a;this._undoType=-1;c?this._undoText+=this.model.getText(a,a+b):this._undoText=this.model.getText(a,a+b)+this._undoText;return}this.add(new g(a,c,this.model.getText(a,
a+b)))}}};return{UndoStack:j}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/globalCommands,orion/extensionCommands,orion/contentTypes,orion/editor/undoStack,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/util".split(","),function(g,k,j,d,c,a,b,i,h,f,e,n,o,p,m,q,r){function s(a,b,c,e,d,f,h,i,g,n){this.serviceRegistry=a;this.commandService=
b;this.fileClient=c;this.inputManager=e;this.toolbarId=d;this.pageNavId=h;this.isReadOnly=f;this._localSearcher=i;this._searcher=g;this.editorSettings=n}var f={},t=null;s.prototype={generateEditorCommands:function(a){this._generateSearchFilesCommand(a);this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this.isReadOnly||this._generateEditCommands(a)},_generateUndoStackCommands:function(a){this.commandService.addCommand(new b.Command({name:g.Undo,
id:"orion.undo",callback:function(){a.getTextView().invokeAction("undo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.undo",400,null,!0,a.getTextView().getKeyBindings("undo")[0]);this.commandService.addCommand(new b.Command({name:g.Redo,id:"orion.redo",callback:function(){a.getTextView().invokeAction("redo")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.redo",401,null,!0,a.getTextView().getKeyBindings("redo")[0])},_generateSearchFilesCommand:function(a){var c=
this;if(c._searcher){var e=!1,f=new b.Command({name:g["Search Files"],tooltip:g["Search Files"],id:"orion.searchFiles",callback:function(){a.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(f);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new i.KeyBinding("h",!0));a.getTextView().setKeyBinding(new i.KeyBinding("h",!0),"searchFiles");a.getTextView().setAction("searchFiles",function(){if(!e){var b=a.getSelection(),b=a.getText(b.start,
b.end),f=c.serviceRegistry,h=f.getService("orion.page.progress"),f=f.getService("orion.core.favorite"),v=new d.OpenResourceDialog({searcher:c._searcher,progress:h,favoriteService:f,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:g["Search Files"],message:g["Enter search term:"],initialText:b,onHide:function(){e=!1;a&&a.getTextView()&&a.getTextView().focus()}});window.setTimeout(function(){e=!0;v.show(j.node(c.toolbarId))},0);return!0}},f)}},_generateSaveCommand:function(a){var c=this;
a.getTextView().setKeyBinding(new i.KeyBinding("s",!0),"save");a.getTextView().setAction("save",function(){if(c.inputManager.save)c.inputManager.save();else if(c.inputManager.onSave){var b=a.getText();c.inputManager.onSave(c.inputManager.getInput(),b,function(){a.setInput(c.inputManager.getInput(),null,b,!0);c.inputManager.afterSave&&c.inputManager.afterSave()},function(a){a.log=!0})}return!0},{name:g.Save});this.commandService.addCommand(new b.Command({name:g.Save,tooltip:g["Save this file"],id:"orion.save",
visibleWhen:function(){return!c.editorSettings||!c.editorSettings().autoSaveEnabled},callback:function(){a.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new i.KeyBinding("s",!0))},_generateGotoLineCommnand:function(a){var c=this,e=new h.ParametersDescription([new h.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var b=a.getModel().getLineAtOffset(a.getCaretOffset())+1;return[new h.CommandParameter("line",
"number","Line:",b.toString())]}),e=new b.Command({name:g["Go to Line"],tooltip:g["Go to specified line number"],id:"orion.gotoLine",parameters:e,callback:function(b){var c=a.getModel();b.parameters&&b.parameters.valueFor("line")?b=b.parameters.valueFor("line"):(b=c.getLineAtOffset(a.getCaretOffset()),(b=prompt(g["Go to line:"],b+1))&&(b=parseInt(b,10)));if(b)a.onGotoLine(b-1,0)}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.pageNavId,"orion.gotoLine",1,
null,!0,new i.KeyBinding("l",!r.isMac,!1,!1,r.isMac),new h.URLBinding("gotoLine","line"));a.getTextView().setAction("gotoLine",function(b){if(b)return a.onGotoLine(b.line-1,0,void 0,b.callback),!0;c.commandService.runCommand("orion.gotoLine");return!0},e)},_generateFindCommnand:function(a){var c=this,e=new h.ParametersDescription([new h.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var b=a.getSelection(),c="";b.end>b.start&&(c=a.getModel().getText(b.start,b.end));return[new h.CommandParameter("find",
"text","Find:",c)]}),e=new b.Command({name:g.Find,tooltip:g.Find,id:"orion.editor.find",parameters:e,callback:function(b){if(c._localSearcher){var e="",d=null,f=a.getSelection();f.end>f.start?e=a.getModel().getText(f.start,f.end):b.parameters&&b.parameters.valueFor("find")&&(e=b.parameters.valueFor("find"),d=m.matchResourceParameters(),p.convertFindURLBinding(d));if(d){b={regex:d.regEx,caseInsensitive:!d.caseSensitive};if(d.atLine)b.start=a.getModel().getLineStart(d.atLine-1);c._localSearcher.show({findString:e,
replaceString:d.replaceWith});c._localSearcher.find(!0,b)}else c._localSearcher.show({findString:e});return!0}return!1}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.pageNavId,"orion.editor.find",2,null,!0,new i.KeyBinding("f",!0),new h.URLBinding("find","find"));a.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find");return!0},e)},_generateEditCommands:function(l){function d(a){var b=
new i.KeyBinding;i.KeyBinding.apply(b,a);return b}function f(a,b){!b&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var c=h.serviceRegistry.getService("orion.page.message");c?c.setProgressResult(a):window.console.log(a)}var h=this,m=this.serviceRegistry.getServiceReferences("orion.edit.command"),p=this.inputManager,o=this.serviceRegistry.getService("orion.page.progress"),I=function(c,e,d){d.callback=function(){l=this;var b=l.getSelection(),d=l.getModel(),h=d.getText(),u=function(a){a&&a.text?(l.setText(a.text),
a.selection&&(l.setSelection(a.selection.start,a.selection.end),l.getTextView().focus())):typeof a==="string"&&(l.setText(a,b.start,b.end),l.setSelection(b.start,b.start+a.length),l.getTextView().focus())};o.showWhile(e.run(d.getText(b.start,b.end),h,b,p.getInput()),k.formatMessage(g["Running {0}"],c.name)).then(function(b){if(b&&b.uriTemplate){var l=new a(b.uriTemplate),e=p.getFileMetadata();e.OrionHome=e.OrionHome||q.getOrionHome();var l=window.decodeURIComponent(l.expand(e)),d=document.createElement("iframe");
d.id=c.id;d.name=c.id;d.type="text/html";d.sandbox="allow-scripts allow-same-origin";d.frameborder=1;d.src=l;d.className="delegatedUI";if(b.width)d.style.width=b.width;if(b.height)d.style.height=b.height;d.style.visibility="hidden";window.document.body.appendChild(d);d.style.left=(window.innerWidth-parseInt(d.clientWidth,10))/2+"px";d.style.top=(window.innerHeight-parseInt(d.clientHeight,10))/2+"px";d.style.visibility="";window.addEventListener("message",function E(a){if(a.source===d.contentWindow&&
typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===c.id)){if(!a.cancelled)if(a.result)u(a.result);else if(a.Status||a.status)f(a.Status||a.status);window.removeEventListener("message",E,!1);window.document.body.removeChild(d)}},!1)}else b.Status||b.status?f(b.Status||b.status):u(b)});return!0};d.callback=d.callback.bind(l);return new b.Command(d)};c.when(function(a){if(t)return t;var b=a.getService("orion.core.contenttypes");b||(b=new n.ContentTypeService(a),
b=a.getService("orion.core.contenttypes"));return b.getContentTypes().then(function(a){return t=a})}(this.serviceRegistry),function(){var a=[],b=100;m.forEach(function(c){for(var f=h.serviceRegistry.getService(c),i={},w=c.getPropertyKeys(),g=0;g<w.length;g++)i[w[g]]=c.getProperty(w[g]);i.forceSingleItem=!0;c=e._createCommandOptions(i,c,h.serviceRegistry,t,!1,function(){return p.getFileMetadata()});a.push(c);c.then(function(a){a=I(i,f,a);h.commandService.addCommand(a);h.commandService.registerCommandContribution(h.toolbarId,
a.id,b);if(i.key){var c=l.getTextView();c.setKeyBinding(d(i.key),a.id);c.setAction(a.id,a.callback,a)}});b++});c.all(a,function(a){return{_error:a}}).then(function(){var a;if(a=p.getFileMetadata()){var b=j.node("pageActions");b&&(h.commandService.destroy(b),h.commandService.renderCommands(b.id,b,a,l,"button"));if(b=j.node("pageNavigationActions"))h.commandService.destroy(b),h.commandService.renderCommands(b.id,b,l,l,"button")}})})}};f.EditorCommandFactory=s;return f});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(g,k){function j(a,b,c){this.start=a;this.end=b;this._projectionModel=c;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(){}function c(a,b){var c=a.lastIndexOf("."),c=a.substring(c+1),h={title:g[c],style:{styleClass:"annotation "+c},html:"<div class='annotationHTML "+c+"'></div>",overviewStyle:{styleClass:"annotationOverview "+c}};b?h.lineStyle={styleClass:"annotationLine "+
c}:h.rangeStyle={styleClass:"annotationRange "+c};d.registerType(a,h)}function a(){}function b(a){this._annotations=[];var b=this;this._listener={onChanged:function(a){b._onChanged(a)}};this.setTextModel(a)}function i(a,b){this._view=a;this._annotationModel=b;var c=this;this._listener={onDestroy:function(a){c._onDestroy(a)},onLineStyle:function(a){c._onLineStyle(a)},onChanged:function(a){c._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);b.addEventListener("Changed",this._listener.onChanged)}j.prototype={_expandedHTML:"<div class='annotationHTML expanded'></div>",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"<div class='annotationHTML collapsed'></div>",_collapsedStyle:{styleClass:"annotation collapsed"},collapse:function(){if(this.expanded){this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var a=this._projectionModel,b=a.getBaseModel();this._projection=
{start:b.getLineStart(b.getLineAtOffset(this.start)+1),end:b.getLineEnd(b.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},expand:function(){if(!this.expanded)this.expanded=!0,this.html=this._expandedHTML,this.style=this._expandedStyle,this._projectionModel.removeProjection(this._projection)}};d.ANNOTATION_ERROR="orion.annotation.error";d.ANNOTATION_WARNING="orion.annotation.warning";d.ANNOTATION_TASK="orion.annotation.task";d.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";
d.ANNOTATION_BOOKMARK="orion.annotation.bookmark";d.ANNOTATION_FOLDING="orion.annotation.folding";d.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";d.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";d.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";d.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";d.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";d.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";d.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";
d.ANNOTATION_SELECTED_LINKED_GROUP="orion.annotation.selectedLinkedGroup";d.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";d.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";var h={};d.registerType=function(a,b){var c=b;if(typeof c!=="function")c=function(a,b,c){this.start=a;this.end=b;if(c!==void 0)this.title=c},c.prototype=b;c.prototype.type=a;h[a]=c;return a};d.createAnnotation=function(a,b,c,d){return new (this.getType(a))(b,c,d)};d.getType=function(a){return h[a]};
c(d.ANNOTATION_ERROR);c(d.ANNOTATION_WARNING);c(d.ANNOTATION_TASK);c(d.ANNOTATION_BREAKPOINT);c(d.ANNOTATION_BOOKMARK);c(d.ANNOTATION_CURRENT_BRACKET);c(d.ANNOTATION_MATCHING_BRACKET);c(d.ANNOTATION_CURRENT_SEARCH);c(d.ANNOTATION_MATCHING_SEARCH);c(d.ANNOTATION_READ_OCCURRENCE);c(d.ANNOTATION_WRITE_OCCURRENCE);c(d.ANNOTATION_SELECTED_LINKED_GROUP);c(d.ANNOTATION_CURRENT_LINKED_GROUP);c(d.ANNOTATION_LINKED_GROUP);c(d.ANNOTATION_CURRENT_LINE,!0);d.registerType(d.ANNOTATION_FOLDING,j);a.addMixin=function(b){var c=
a.prototype,d;for(d in c)c.hasOwnProperty(d)&&(b[d]=c[d])};a.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a)return b+1;return 0},getAnnotationsByType:function(a,b,c){a=a.getAnnotations(b,c);for(c=[];a.hasNext();)b=a.next(),this.getAnnotationTypePriority(b.type)!==0&&c.push(b);var d=
this;c.sort(function(a,b){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(b.type)});return c},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var b=0;b<this._annotationTypes.length;b++)if(this._annotationTypes[b]===a){this._annotationTypes.splice(b,1);break}}};b.prototype={addAnnotation:function(a){if(a){var b=this._annotations,c=this._binarySearch(b,a.start);b.splice(c,0,a);this.onChanged({type:"Changed",
added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,b){var c=this._annotations,d,h=0,i=function(){for(;h<c.length;){var d=c[h++];if(a===d.start||(a>d.start?a<d.end:d.start<b))return d;if(d.start>=b)break}return null};d=i();return{next:function(){var a=d;a&&(d=i());return a},hasNext:function(){return d!==null}}},modifyAnnotation:function(a){if(a&&!(this._getAnnotationIndex(a)<0))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},
onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var b=this._annotations,c,d;if(a){c=[];for(d=b.length-1;d>=0;d--){var h=b[d];h.type===a&&b.splice(d,1);c.splice(0,0,h)}}else c=b;this.onChanged({type:"Changed",removed:c,added:[],changed:[]})},removeAnnotation:function(a){if(a&&(a=this._getAnnotationIndex(a),!(a<0)))this.onChanged({type:"Changed",removed:this._annotations.splice(a,1),added:[],changed:[]})},replaceAnnotations:function(a,b){var c=this._annotations,d,h,
i,g=[];if(a)for(d=a.length-1;d>=0;d--)i=a[d],h=this._getAnnotationIndex(i),h<0||(c.splice(h,1),g.splice(0,0,i));b||(b=[]);for(d=0;d<b.length;d++)i=b[d],h=this._binarySearch(c,i.start),c.splice(h,0,i);this.onChanged({type:"Changed",removed:g,added:b,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(a,b){for(var c=a.length,d=
-1,h;c-d>1;)h=Math.floor((c+d)/2),b<=a[h].start?c=h:d=h;return c},_getAnnotationIndex:function(a){for(var b=this._annotations,c=this._binarySearch(b,a.start);c<b.length&&b[c].start===a.start;){if(b[c]===a)return c;c++}return-1},_onChanged:function(a){var b=a.start,c=a.removedCharCount,d=this._annotations,h=b+c;if(0<d.length){for(var i={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a},a=a.addedCharCount-c,c=0;c<d.length;c++){var g=d[c];g.start>=h?(g.start+=a,g.end+=a,i.changed.push(g)):
g.end<=b||(g.start<b&&h<g.end?(g.end+=a,i.changed.push(g)):(d.splice(c,1),i.removed.push(g),c--))}if(i.added.length>0||i.removed.length>0||i.changed.length>0)this.onChanged(i)}}};k.EventTarget.addMixin(b.prototype);i.prototype={destroy:function(){var a=this._view;if(a)a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null;(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,
b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.tagName&&!a.tagName)a.tagName=b.tagName;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||(a.attributes[c]=b.attributes[c])}}return a},_mergeStyleRanges:function(a,b){a||(a=[]);var c,d;for(d=0;d<a.length&&b;d++){var h=a[d];if(b.end<=
h.start)break;if(!(b.start>=h.end)){c=this._mergeStyle({},h.style);c=this._mergeStyle(c,b.style);var i=[];i.push(d,1);b.start<h.start&&i.push({start:b.start,end:h.start,style:b.style});b.start>h.start&&i.push({start:h.start,end:b.start,style:h.style});i.push({start:Math.max(h.start,b.start),end:Math.min(h.end,b.end),style:c});b.end<h.end&&i.push({start:b.end,end:h.end,style:h.style});b=b.end>h.end?{start:h.end,end:b.end,style:b.style}:null;Array.prototype.splice.apply(a,i)}}b&&(c=this._mergeStyle({},
b.style),a.splice(d,0,{start:b.start,end:b.end,style:c}));return a},_onAnnotationModelChanged:function(a){function b(a){for(var e=0;e<a.length;e++)if(d.isAnnotationTypeVisible(a[e].type)){var f=a[e].start,i=a[e].end;h.getBaseModel&&(f=h.mapOffset(f,!0),i=h.mapOffset(i,!0));f!==-1&&i!==-1&&c.redrawRange(f,i)}}if(!a.textModelChangedEvent){var c=this._view;if(c){var d=this,h=c.getModel();b(a.added);b(a.removed);b(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var b=this._annotationModel,
c=a.textView.getModel(),d=b.getTextModel(),h=a.lineStart,i=a.lineStart+a.lineText.length;d!==c&&(h=c.mapOffset(h),i=c.mapOffset(i));for(b=b.getAnnotations(h,i);b.hasNext();)if(h=b.next(),this.isAnnotationTypeVisible(h.type)){if(h.rangeStyle){var i=h.start,g=h.end;d!==c&&(i=c.mapOffset(i,!0),g=c.mapOffset(g,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:i,end:g,style:h.rangeStyle})}if(h.lineStyle)a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,h.lineStyle)}}};a.addMixin(i.prototype);
return{FoldingAnnotation:j,AnnotationType:d,AnnotationTypeList:a,AnnotationModel:b,AnnotationStyler:i}});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(g,k){function j(d,c){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(c)}j.prototype={find:function(d){if(this._text.length>1)this._text=[this._text.join("")];var c=d.string,a=c,b=d.caseInsensitive;!d.regex&&c&&(a=c.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),b&&(a=a.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var i=null,h;if(a){var c=d.reverse,f=d.wrap,e=d.wholeWord,
g=d.start||0,d=d.end,o=d!==null&&d!==void 0,p="";p.indexOf("g")===-1&&(p+="g");b&&p.indexOf("i")===-1&&(p+="i");e&&(a="\\b"+a+"\\b");var m=this._text[0],j,k,s=0;o&&(b=g<d?g:d,m=m.substring(b,g<d?d:g),s=b);var t=RegExp(a,p);if(c)h=function(){var a=null;for(t.lastIndex=0;;){k=t.lastIndex;j=t.exec(m);if(k===t.lastIndex)return null;if(j){if(!(j.index+s<g)){if(!f||a)break;g=m.length+s}a={start:j.index+s,end:t.lastIndex+s}}else break}if(a)g=a.start;return a};else{if(!o)t.lastIndex=g;h=function(){for(;;){k=
t.lastIndex;j=t.exec(m);if(k===t.lastIndex)break;if(j)return{start:j.index+s,end:t.lastIndex+s};if(!(k!==0&&f))break}return null}}i=h()}return{next:function(){var a=i;a&&(i=h());return a},hasNext:function(){return i!==null}}},getCharCount:function(){for(var d=0,c=0;c<this._text.length;c++)d+=this._text[c].length;return d},getLine:function(d,c){var a=this.getLineCount();if(!(0<=d&&d<a))return null;var b=this._lineOffsets[d];if(d+1<a){a=this.getText(b,this._lineOffsets[d+1]);if(c)return a;for(var b=
a.length,i;(i=a.charCodeAt(b-1))===10||i===13;)b--;return a.substring(0,b)}else return this.getText(b)},getLineAtOffset:function(d){var c=this.getCharCount();if(!(0<=d&&d<=c))return-1;var a=this.getLineCount();if(d===c)return a-1;var b,i,h=this._lastLineIndex;if(0<=h&&h<a&&(b=this._lineOffsets[h],i=h+1<a?this._lineOffsets[h+1]:c,b<=d&&d<i))return h;for(var f=a,e=-1;f-e>1;)if(h=Math.floor((f+e)/2),b=this._lineOffsets[h],i=h+1<a?this._lineOffsets[h+1]:c,d<=b)f=h;else if(d<i){f=h;break}else e=h;return this._lastLineIndex=
f},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,c){var a=this.getLineCount();if(!(0<=d&&d<a))return-1;if(d+1<a){a=this._lineOffsets[d+1];if(c)return a;for(var b=this.getText(Math.max(this._lineOffsets[d],a-2),a),i=b.length,h;(h=b.charCodeAt(i-1))===10||h===13;)i--;return a-(b.length-i)}else return this.getCharCount()},getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,
c){d===void 0&&(d=0);c===void 0&&(c=this.getCharCount());if(d===c)return"";for(var a=0,b=0,i;b<this._text.length;){i=this._text[b].length;if(d<=a+i)break;a+=i;b++}for(var h=a,f=b;b<this._text.length;){i=this._text[b].length;if(c<=a+i)break;a+=i;b++}if(f===b)return this._text[f].substring(d-h,c-a);h=this._text[f].substring(d-h);a=this._text[b].substring(0,c-a);return h+this._text.slice(f+1,b).join("")+a},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},
setLineDelimiter:function(d,c){d==="auto"&&(d=void 0,this.getLineCount()>1&&(d=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=d?d:k.platformDelimiter;if(c){var a=this.getLineCount();if(a>1){for(var b=Array(a),i=0;i<a;i++)b[i]=this.getLine(i);this.setText(b.join(this._lineDelimiter))}}},setText:function(d,c,a){d===void 0&&(d="");c===void 0&&(c=0);a===void 0&&(a=this.getCharCount());if(!(c===a&&d==="")){for(var b=this.getLineAtOffset(c),i=this.getLineAtOffset(a),h=c,f=
a-c,e=i-b,g=d.length,o=0,p=this.getLineCount(),m=0,j=0,k=0,s=[];;){m!==-1&&m<=k&&(m=d.indexOf("\r",k));j!==-1&&j<=k&&(j=d.indexOf("\n",k));if(j===-1&&m===-1)break;k=m!==-1&&j!==-1?m+1===j?j+1:(m<j?m:j)+1:m!==-1?m+1:j+1;s.push(c+k);o++}this.onChanging({type:"Changing",text:d,start:h,removedCharCount:f,addedCharCount:g,removedLineCount:e,addedLineCount:o});s.length===0&&(k=this.getLineStart(b),i=i+1<p?this.getLineStart(i+1):this.getCharCount(),c!==k&&(d=this.getText(k,c)+d,c=k),a!==i&&(d+=this.getText(a,
i),a=i));k=g-f;for(i=b+e+1;i<p;i++)this._lineOffsets[i]+=k;if(s.length<5E4)b=[b+1,e].concat(s),Array.prototype.splice.apply(this._lineOffsets,b);else{k=b+1;this._lineOffsets.splice(k,e);for(p=0;p<s.length;p+=5E4)b=[k,0].concat(s.slice(p,Math.min(s.length,p+5E4))),Array.prototype.splice.apply(this._lineOffsets,b),k+=5E4}for(k=p=0;k<this._text.length;){i=this._text[k].length;if(c<=p+i)break;p+=i;k++}b=p;for(s=k;k<this._text.length;){i=this._text[k].length;if(a<=p+i)break;p+=i;k++}i=this._text[k];c=
this._text[s].substring(0,c-b);a=i.substring(a-p);s=[s,k-s+1];c&&s.push(c);d&&s.push(d);a&&s.push(a);Array.prototype.splice.apply(this._text,s);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:h,removedCharCount:f,addedCharCount:g,removedLineCount:e,addedLineCount:o})}}};g.EventTarget.addMixin(j.prototype);return{TextModel:j}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/util".split(","),function(g,k,j,d,c,a){function b(a,b,c,d){typeof a.addEventListener==="function"?a.addEventListener(b,c,d===!0):a.attachEvent("on"+b,c)}function i(b,c,d){if(d){c.className="";for(var d=c.attributes,e=d.length;e-- >0;)(!a.isIE||a.isIE>=9||a.isIE<9&&d[e].specified)&&c.removeAttribute(d[e].name)}if(b){if(b.styleClass)c.className=
b.styleClass;if(d=b.style)for(var f in d)d.hasOwnProperty(f)&&(c.style[f]=d[f]);if(b=b.attributes)for(var h in b)b.hasOwnProperty(h)&&c.setAttribute(h,b[h])}}function h(a){return a instanceof Array?a.slice(0):a}function f(a,b){if(!a)return b;if(!b)return a;for(var c in b)b.hasOwnProperty(c)&&(a.hasOwnProperty(c)||(a[c]=b[c]));return a}function e(a,b){if(a===b)return!0;if(a&&!b||!a&&b)return!1;if(a&&a.constructor===String||b&&b.constructor===String)return!1;if(a instanceof Array||b instanceof Array){if(!(a instanceof
Array&&b instanceof Array))return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(!e(a[c],b[c]))return!1;return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(c in a)if(a.hasOwnProperty(c)){if(!b.hasOwnProperty(c))return!1;if(!e(a[c],b[c]))return!1}for(c in b)if(!a.hasOwnProperty(c))return!1;return!0}function n(a,b,c){for(var d=0,e=0,f=0,h=a.length;f<h;){d!==-1&&d<=f&&(d=a.indexOf("\r",f));e!==-1&&e<=f&&(e=a.indexOf("\n",f));var i=f,g;if(e===-1&&d===-1){b(a.substring(f));
break}d!==-1&&e!==-1?d+1===e?(g=d,f=e+1):(g=d<e?d:e,f=(d<e?d:e)+1):d!==-1?(g=d,f=d+1):(g=e,f=e+1);b(a.substring(i,g));c()}}function o(a){var b,c,d,e,f=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(f.getComputedStyle)a=f.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),c=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),e=a.getPropertyValue("padding-bottom");else if(a.currentStyle)b=a.currentStyle.paddingLeft,c=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,
e=a.currentStyle.paddingBottom;return{left:parseInt(b,10)||0,top:parseInt(c,10)||0,right:parseInt(d,10)||0,bottom:parseInt(e,10)||0}}function p(a){var b,c,d,e,f=a._trim;if(!f){var f=o(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)e=h.getComputedStyle(a,null),b=e.getPropertyValue("border-left-width"),c=e.getPropertyValue("border-top-width"),d=e.getPropertyValue("border-right-width"),e=e.getPropertyValue("border-bottom-width");else if(a.currentStyle)b=a.currentStyle.borderLeftWidth,
c=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,e=a.currentStyle.borderBottomWidth;b=parseInt(b,10)||0;c=parseInt(c,10)||0;d=parseInt(d,10)||0;e=parseInt(e,10)||0;f.left+=b;f.top+=c;f.right+=d;f.bottom+=e;a._trim=f}return f}function m(a,b,c){this.start=a;this.end=b;this.caret=c}function q(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function r(a,b,c){this.view=a;this.lineIndex=b;this._lineDiv=c}function s(a){this._init(a||{})}var t=function(){function a(b){this.options=
b}a.prototype.play=function(){var a=typeof this.options.duration==="number"?this.options.duration:350,b=this.options.easing||this.defaultEasing,c=this.options.onAnimate||function(){},l=this.options.curve[0],d=this.options.curve[1],e=d-l,f=-1,h,i=this;this.interval=this.options.window.setInterval(function(){f=f===-1?(new Date).getTime():f;var g=((new Date).getTime()-f)/a;g<1?(g=b(g),h=l+g*e,c(h)):(c(d),i.stop())},typeof this.options.rate==="number"?this.options.rate:20)};a.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};a.prototype.defaultEasing=function(a){return Math.sin(a*(Math.PI/2))};return a}();m.prototype={clone:function(){return new m(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;if(this.start>this.end)a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret},setCaret:function(a){this.end=this.start=a;this.caret=!1},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(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};q.prototype={toString:function(){return"{l="+this.left+", t="+this.top+", r="+this.right+", b="+this.bottom+"}"}};r.prototype={create:function(a,b){if(!this._lineDiv){var c=this._lineDiv=this._createLine(a,b,this.lineIndex);c._line=
this;return c}},_createLine:function(b,c,d){var f=this.view,h=f._model,g=h.getLine(d),m=h.getLineStart(d),n={type:"LineStyle",textView:f,lineIndex:d,lineText:g,lineStart:m};if(g.length<2E3)f.onLineStyle(n);h=c||a.createElement(b.ownerDocument,"div");if(!c||!e(c.viewStyle,n.style)){i(n.style,h,c);if(c)c._trim=null;h.viewStyle=n.style;h.setAttribute("role","presentation")}h.lineIndex=d;d=[];this._createRanges(n.ranges,g,0,g.length,m,{tabOffset:0,ranges:d});g=" ";!f._fullSelection&&a.isIE<9&&(g="\ufeff");
a.isWebkit&&(g="\u200c");n={text:g,style:f._metrics.largestFontStyle,ignoreChars:1};d.length===0||!d[d.length-1].style||d[d.length-1].style.tagName!=="div"?d.push(n):d.splice(d.length-1,0,n);var p,o,j,k,q,g=f=0,r,s;if(c){if(o=c.modelChangedEvent)o.removedLineCount===0&&o.addedLineCount===0?(s=o.start-m,r=o.addedCharCount-o.removedCharCount):s=-1,c.modelChangedEvent=void 0;o=c.firstChild}for(m=0;m<d.length;m++){n=d[m];k=n.text;f+=k.length;p=n.style;if(o)if(q=o.firstChild.data,j=o.viewStyle,q===k&&
e(p,j)){g+=q.length;o._rectsCache=void 0;p=o=o.nextSibling;continue}else for(;o;){if(s!==-1){j=f;j>=s&&(j-=r);q=(q=o.firstChild.data)?q.length:0;if(g+q>j)break;g+=q}j=o.nextSibling;h.removeChild(o);o=j}p=this._createSpan(h,k,p,n.ignoreChars);o?h.insertBefore(p,o):h.appendChild(p);if(c)c.lineWidth=void 0}if(c)for(b=p?p.nextSibling:null;b;)j=b.nextSibling,c.removeChild(b),b=j;else b.appendChild(h);return h},_createRanges:function(a,b,c,d,f,h){if(!(c>d)){if(a)for(var i=0;i<a.length;i++){var g=a[i];if(!(g.end<
f+c)){var m=Math.max(f+c,g.start)-f;if(m>d)break;var n=Math.min(f+d,g.end)-f;if(m<=n){m=Math.max(c,m);n=Math.min(d,n);for(c<m&&this._createRange(b,c,m,null,h);i+1<a.length&&a[i+1].start-f===n&&e(g.style,a[i+1].style);)g=a[i+1],n=Math.min(f+d,g.end)-f,i++;this._createRange(b,m,n,g.style,h);c=n}}}c<d&&this._createRange(b,c,d,null,h)}},_createRange:function(a,b,c,d,e){if(!(b>c)){var f=this.view._customTabSize;if(f&&f!==8)for(var h=a.indexOf("\t",b);h!==-1;){b<h&&(b={text:a.substring(b,h),style:d},e.ranges.push(b),
e.tabOffset+=b.text.length);b=f-e.tabOffset%f;if(b>0){for(var i="\u00a0",g=1;g<b;g++)i+=" ";b={text:i,style:d,ignoreChars:b-1};e.ranges.push(b);e.tabOffset+=b.text.length}b=h+1;if(b===c)return;h=a.indexOf("\t",b)}b<=c&&(b={text:a.substring(b,c),style:d},e.ranges.push(b),e.tabOffset+=b.text.length)}},_createSpan:function(c,d,e,f){var h=this.view,g="span";e&&e.tagName&&(g=e.tagName.toLowerCase());var m=g==="a";if(m)c.hasLink=!0;m&&!h._linksVisible&&(g="span");m=c.ownerDocument;c=a.createElement(c.ownerDocument,
g);e&&e.html?(c.innerHTML=e.html,c.ignore=!0):e&&e.node?(c.appendChild(e.node),c.ignore=!0):c.appendChild(m.createTextNode(e&&e.text?e.text:d));i(e,c);if(g==="a"){var n=h._getWindow();b(c,"click",function(a){return h._handleLinkClick(a?a:n.event)},!1)}c.viewStyle=e;if(f)c.ignoreChars=f;return c},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(b,c){var d=this._ensureCreated(),e=this.view;if(b===void 0)return this._getLineBoundingClientRect(d,
!0);var f=e._model,h=d.ownerDocument,i=this.lineIndex,g=null;if(b<f.getLineEnd(i)){f=f.getLineStart(i);for(i=d.firstChild;i;){if(!i.ignore){var m=i.firstChild,n=m.length;i.ignoreChars&&(n-=i.ignoreChars);if(f+n>b){g=b-f;if(e._isRangeRects)h=h.createRange(),h.setStart(m,g),h.setEnd(m,g+1),g=new q(h.getBoundingClientRect());else if(a.isIE)h=h.body.createTextRange(),h.moveToElementText(i),h.collapse(),h.moveEnd("character",g+1),h.moveStart("character",g),g=new q(h.getBoundingClientRect());else{var o=
m.data;i.removeChild(m);i.appendChild(h.createTextNode(o.substring(0,g)));var p=a.createElement(h,"span");p.appendChild(h.createTextNode(o.substring(g,g+1)));i.appendChild(p);i.appendChild(h.createTextNode(o.substring(g+1)));g=new q(p.getBoundingClientRect());i.innerHTML="";i.appendChild(m);this._createdDiv||(h=e._getSelection(),(f<=h.start&&h.start<f+n||f<=h.end&&h.end<f+n)&&e._updateDOMSelection())}a.isIE&&(h=d.ownerDocument.defaultView||d.ownerDocument.parentWindow,d=h.screen.logicalXDPI/h.screen.deviceXDPI,
h=h.screen.logicalYDPI/h.screen.deviceYDPI,g.left*=d,g.right*=d,g.top*=h,g.bottom*=h);break}f+=n}i=i.nextSibling}}d=this.getBoundingClientRect();if(!g)e._wrapMode?(e=this.getClientRects(),g=e[e.length-1],g.left=g.right,g.left+=d.left,g.top+=d.top,g.right+=d.left,g.bottom+=d.top):(g=new q(d),g.left=g.right);if(c||c===void 0)g.left-=d.left,g.top-=d.top,g.right-=d.left,g.bottom-=d.top;return g},_getClientRects:function(a,b){var c,d,e,f;if(!a._rectsCache){c=a.getClientRects();d=Array(c.length);for(f=
0;f<c.length;f++)e=d[f]=new q(c[f]),e.left-=b.left,e.top-=b.top,e.right-=b.left,e.bottom-=b.top;a._rectsCache=d}c=a._rectsCache;d=[c.length];for(f=0;f<c.length;f++)d[f]=new q(c[f]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var b=this._ensureCreated(),c=[],d=b.firstChild,e,f=b.getBoundingClientRect();d;){if(!d.ignore)for(var h=this._getClientRects(d,f),b=0;b<h.length;b++){var i=h[b],g;if(i.top!==i.bottom){var m=i.top+(i.bottom-i.top)/2;for(g=
0;g<c.length;g++)if(e=c[g],e.top<=m&&m<e.bottom)break;if(g===c.length)c.push(i);else{if(i.left<e.left)e.left=i.left;if(i.top<e.top)e.top=i.top;if(i.right>e.right)e.right=i.right;if(i.bottom>e.bottom)e.bottom=i.bottom}}}d=d.nextSibling}return a!==void 0?c[a]:c},_getLineBoundingClientRect:function(a,b){var c=new q(a.getBoundingClientRect());if(!this.view._wrapMode){c.right=c.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;if(d)d=d.getBoundingClientRect(),c.right=
d.right+p(a).right}b&&(d=p(a),c.left+=d.left,c.right-=d.right);return c},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var b=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,c=0;c<b.length;c++)if(b[c].top<=a&&a<b[c].bottom)return c;return b.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var b=this.getClientRects();
return this.getOffset(b[a].left+1,b[a].top+1)},getOffset:function(b,c){var d=this.view,e=d._model,f=this.lineIndex,h=e.getLineStart(f),i=e.getLineEnd(f);if(h===i)return h;var g=this._ensureCreated(),m=this.getBoundingClientRect(),n,o;if(d._wrapMode){n=this.getClientRects();if(c<n[0].top)c=n[0].top;for(var p=0;p<n.length;p++)if(o=n[p],o.top<=c&&c<o.bottom)break;if(b<o.left)b=o.left;b>o.right&&(b=o.right-1)}else b<0&&(b=0),b>m.right-m.left&&(b=m.right-m.left);var j=g.ownerDocument,p=j.defaultView||
j.parentWindow,k=a.isIE?p.screen.logicalXDPI/p.screen.deviceXDPI:1,q=a.isIE?p.screen.logicalYDPI/p.screen.deviceYDPI:1,p=h,r=g.firstChild;a:for(;r;){if(!r.ignore){var s=r.firstChild,g=s.length;r.ignoreChars&&(g-=r.ignoreChars);var t,D,F;n=this._getClientRects(r,m);for(var E=0;E<n.length;E++)if(o=n[E],o.left<=b&&b<o.right&&(!d._wrapMode||o.top<=c&&c<o.bottom)){if(a.isIE||d._isRangeRects){for(var j=d._isRangeRects?j.createRange():j.body.createTextRange(),E=g,T=-1;E-T>1;){var R=Math.floor((E+T)/2);n=
T+1;o=R===g-1&&r.ignoreChars?s.length:R+1;d._isRangeRects?(j.setStart(s,n),j.setEnd(s,o)):(j.moveToElementText(r),j.move("character",n),j.moveEnd("character",o-n));n=j.getClientRects();for(var Y=!1,W=0;W<n.length;W++)if(o=n[W],t=o.left*k-m.left,F=o.right*k-m.left,D=o.top*q-m.top,o=o.bottom*q-m.top,t<=b&&b<F&&(!d._wrapMode||D<=c&&c<o)){Y=!0;break}Y?E=R:T=R}p+=E;n=E;o=E===g-1&&r.ignoreChars?s.length:Math.min(E+1,s.length);d._isRangeRects?(j.setStart(s,n),j.setEnd(s,o)):(j.moveToElementText(r),j.move("character",
n),j.moveEnd("character",o-n));o=j.getClientRects()[0];t=o.left*k-m.left;F=o.right*k-m.left;d=b>t+(F-t)/2;m=p-h;e=e.getLine(f);f=e.charCodeAt(m);55296<=f&&f<=56319&&d?m<e.length&&(f=e.charCodeAt(m+1),56320<=f&&f<=57343&&(p+=1)):56320<=f&&f<=57343&&!d&&m>0&&(f=e.charCodeAt(m-1),55296<=f&&f<=56319&&(p-=1));d&&p++}else{e=[];for(f=0;f<g;f++)e.push("<span>"),f===g-1?e.push(s.data.substring(f)):e.push(s.data.substring(f,f+1)),e.push("</span>");r.innerHTML=e.join("");for(e=r.firstChild;e;){o=e.getBoundingClientRect();
t=o.left-m.left;F=o.right-m.left;if(t<=b&&b<F){b>t+(F-t)/2&&p++;break}p++;e=e.nextSibling}if(!this._createdDiv)r.innerHTML="",r.appendChild(s),m=d._getSelection(),(p<=m.start&&m.start<p+g||p<=m.end&&m.end<p+g)&&d._updateDOMSelection()}break a}p+=g}r=r.nextSibling}return Math.min(i,Math.max(h,p))},getNextOffset:function(b,c){if(c.unit==="line"){var d=this.view._model,e=d.getLineAtOffset(b);if(c.count>0)return c.count--,d.getLineEnd(e);c.count++;return d.getLineStart(e)}return c.unit==="wordend"||c.unit===
"wordWS"||c.unit==="wordendWS"?this._getNextOffset_W3C(b,c):a.isIE?this._getNextOffset_IE(b,c):this._getNextOffset_W3C(b,c)},_getNextOffset_W3C:function(a,b){function c(a){return 33<=a&&a<=47||58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function d(a){return a===32||a===9}var e=this.view._model,f=e.getLineAtOffset(a),h=e.getLine(f),i=e.getLineStart(f),e=e.getLineEnd(f),f=h.length,g=a-i,m,n=b.count<0?-1:1;if(b.unit==="word"||b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS")for(var o,
p,j;b.count!==0;){if(b.count>0){if(g===f)return e;m=h.charCodeAt(g);o=c(m);p=!o&&!d(m);for(g++;g<f;){m=h.charCodeAt(g);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){j=c(m);if(b.unit==="wordend"){if(!j&&o)break}else if(j&&!o)break;m=!j&&!d(m)}else m=!d(m);if(b.unit==="wordend"||b.unit==="wordendWS"){if(!m&&p)break}else if(m&&!p)break;p=m;o=j;g++}}else{if(g===0)return i;g--;m=h.charCodeAt(g);o=c(m);for(p=!o&&!d(m);0<g;){m=h.charCodeAt(g-1);if(b.unit!=="wordWS"&&b.unit!=="wordendWS"){j=c(m);if(b.unit===
"wordend"){if(j&&!o)break}else if(!j&&o)break;m=!j&&!d(m)}else m=!d(m);if(b.unit==="wordend"||b.unit==="wordendWS"){if(m&&!p)break}else if(!m&&p)break;p=m;o=j;g--}}b.count-=n}else for(;b.count!==0&&0<=g+n&&g+n<=f;)g+=n,m=h.charCodeAt(g),56320<=m&&m<=57343&&g>0&&(m=h.charCodeAt(g-1),55296<=m&&m<=56319&&(g+=n)),b.count-=n;return i+g},_getNextOffset_IE:function(a,b){var c=this._ensureCreated(),d=this.view._model,e=this.lineIndex,f=0,h;h=d.getLineStart(e);var g=c.ownerDocument,i=b.count<0?-1:1;if(a===
d.getLineEnd(e)){for(c=c.lastChild;c&&c.ignoreChars;)c=c.previousSibling;if(!c)return h;f=g.body.createTextRange();f.moveToElementText(c);h=f.text.length;f.moveEnd(b.unit,i);f=a+f.text.length-h}else if(a===h&&b.count<0)f=h;else for(c=c.firstChild;c;){d=c.firstChild.length;c.ignoreChars&&(d-=c.ignoreChars);if(h+d>a){f=g.body.createTextRange();a===h&&b.count<0?f.moveToElementText(c.previousSibling):(f.moveToElementText(c),f.collapse(),f.moveEnd("character",a-h));h=f.text.length;f.moveEnd(b.unit,i);
f=a+f.text.length-h;break}h=d+h;c=c.nextSibling}b.count-=i;return f},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};s.prototype={addKeyMode:function(a,b){var c=this._keyModes;b!==void 0?c.splice(b,0,a):c.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var c=this._rulers;if(b!==void 0){var d,e;for(d=0,e=0;d<c.length&&e<b;d++)a.getLocation()===c[d].getLocation()&&e++;c.splice(e,0,a);b=e}else c.push(a);this._createRuler(a,
b);this._update()},computeSize:function(){var b=0,c=0,d=this._model,e=this._clientDiv;if(!e)return{width:b,height:c};var f=e.style.width;if(a.isWebkit)e.style.width="0x7fffffffpx";for(var d=d.getLineCount(),h=0;h<d;h++){var i=this._getLine(h),g=i.getBoundingClientRect(),b=Math.max(b,g.right-g.left);c+=g.bottom-g.top;i.destroy()}if(a.isWebkit)e.style.width=f;e=this._getViewPadding();b+=e.right+e.left+this._metrics.scrollWidth;c+=e.bottom+e.top+this._metrics.scrollWidth;return{width:b,height:c}},convert:function(a,
b,c){if(this._clientDiv){var d=this._getScroll(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect();b==="document"&&(a.x!==void 0&&(a.x+=-d.x+f.left+e.left),a.y!==void 0&&(a.y+=-d.y+f.top+e.top));c==="document"&&(a.x!==void 0&&(a.x+=d.x-f.left-e.left),a.y!==void 0&&(a.y+=d.y-f.top-e.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._actions=this._keyModes=
this._doubleClickSelection=this._selection=this._theme=this._model=this._parent=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),a.isOpera&&this._clientDiv.blur(),this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],c=this._actions,d;for(d in c)c.hasOwnProperty(d)&&(a||!c[d].defaultHandler)&&b.push(d);return b},getBottomIndex:function(a){return!this._clientDiv?
0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0: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 a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],c=this._keyModes,
d=0;d<c.length;d++)b=b.concat(c[d].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model,a=Math.min(Math.max(0,a),b.getCharCount()),b=b.getLineAtOffset(a),c=this._getLine(b),
a=c.getBoundingClientRect(a);c.destroy();c=a.left;b=this._getLinePixel(b)+a.top;return{x:c,y:b}},getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return h(this["_"+a])}else{a={};for(var b in arguments)arguments.hasOwnProperty(b)&&(a[arguments[b]]=void 0)}for(var c in a)a.hasOwnProperty(c)&&(a[c]=h(this["_"+c]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;
var c=this._getLineIndex(b),d=this._getLine(c),c=d.getOffset(a,b-this._getLinePixel(c));d.destroy();return c},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,b,c){if(this._clientDiv){if(a=this._actions[a]){if(!b&&
a.handler&&a.handler(c))return!0;if(a.defaultHandler)return typeof a.defaultHandler(c)==="boolean"}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},onDragLeave:function(a){return this.dispatchEvent(a)},
onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},onMouseDown:function(a){return this.dispatchEvent(a)},
onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},redraw:function(){if(!(this._redrawCount>
0)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(this._redrawCount>0))for(var c=this.getRulers(),d=0;d<c.length;d++)this.redrawLines(a,b,c[d])},redrawLines:function(a,b,c){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),b===void 0&&(b=this._model.getLineCount()),a!==b)){var d=this._clientDiv;if(d){if(c)for(d=(c.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild;d;){if(d._ruler===c)break;d=d.nextSibling}c?d.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!c||c.getOverview()==="page")for(d=d.firstChild;d;){var e=d.lineIndex;if(a<=e&&e<b)d.lineChanged=!0;d=d.nextSibling}if(!c&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,b){if(!(this._redrawCount>0)){var c=this._model;a===void 0&&(a=0);b===void 0&&(b=c.getCharCount());var d=c.getLineAtOffset(a),c=c.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(d,c)}},removeKeyMode:function(a){for(var b=this._keyModes,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,c){if(a){var d=this._actions,e=d[a];e||(e=d[a]={});e.handler=b;if(c!==void 0)e.actionDescription=
c}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,c){var d=this._model.getCharCount(),a=Math.max(0,Math.min(a,d));this._setSelection(new m(a,a,!1),b===void 0||b,!0,c)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?--this._redrawCount===0&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",this._modelListener.onChanging);
this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),c=this._model.getCharCount(),d=a.getLineCount(),e=a.getCharCount(),f={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:d};this.onModelChanging(f);this._model=a;f={type:"ModelChanged",start:0,removedCharCount:c,addedCharCount:e,removedLineCount:b,addedLineCount:d};this.onModelChanged(f);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(a){var b=this._defaultOptions(),c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!e(this["_"+c],d)){var f=b[c]?b[c].update:null;f?f.call(this,d):this["_"+c]=h(d)}}},setSelection:function(a,b,c,d){var e=a>b;if(e)var f=a,a=b,b=f;f=this._model.getCharCount();a=Math.max(0,Math.min(a,f));b=Math.max(0,Math.min(b,f));this._setSelection(new m(a,b,e),
c===void 0||c,!0,d)},setText:function(b,c,d){var e=c===void 0&&d===void 0;c===void 0&&(c=0);d===void 0&&(d=this._model.getCharCount());if(e)this._variableLineHeight=!1;this._modifyContent({text:b,start:c,end:d,_code:!0},!e);if(e)this._columnX=-1,this._setSelection(new m(0,0,!1),!0),a.isFirefox&&this._fixCaret()},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(){return this._showCaret(!0)},update:function(a,b){this._clientDiv&&(a&&this._updateStyle(),b===void 0||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(b){if(!this._ignoreEvent(b)){if(a.isFirefox&&b.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var c=this._overlayDiv||this._clientDiv;if(a.isIE<9)c=this._viewDiv;for(var d=b.target?b.target:b.srcElement;d;){if(c===d)return;
d=d.parentNode}b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if(!this._isW3CEvents){var e=this;this._getWindow().setTimeout(function(){e._clientDiv.focus()},0)}}},_handleRootMouseUp:function(b){if(!this._ignoreEvent(b)&&a.isFirefox&&b.which===1)this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),this._ignoreBlur=!1},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=!1;if(a.isIE<9&&!this._getSelection().isEmpty()){var b=
this._rootDiv,c=a.createElement(b.ownerDocument,"div");b.appendChild(c);b.removeChild(c)}if(this._cursorDiv)this._cursorDiv.style.display="none";if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",b=this._getWindow(),c=this._selDiv1.ownerDocument,b.getSelection){c=b.getSelection();for(b=c.anchorNode;b;){if(b===this._clientDiv){c.rangeCount>0&&c.removeAllRanges();break}b=b.parentNode}}else if(c.selection){this._ignoreSelect=
!1;for(b=c.selection.createRange().parentElement();b;){if(b===this._clientDiv){c.selection.empty();break}b=b.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(b){if(!this._ignoreEvent(b)){a.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var c=!1;this.isListening("ContextMenu")?(c=this._createMouseEvent("ContextMenu",b),c.screenX=b.screenX,c.screenY=b.screenY,this.onContextMenu(c),c=c.defaultPrevented):a.isMac&&a.isFirefox&&
b.button===0&&(c=!0);if(c)return b.preventDefault&&b.preventDefault(),!1}},_handleCopy:function(a){if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){if(!this._ignoreEvent(a)&&(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),
this._clickCount!==2))this._clickCount=2,this._handleMouse(a)},_handleDragStart:function(b){if(!this._ignoreEvent(b)){if(a.isFirefox){var c=this;this._getWindow().setTimeout(function(){c._clientDiv.contentEditable=!0;c._clientDiv.draggable=!1;c._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",b)),this._dragOffset=-1;else return b.preventDefault&&b.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&
this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(b){if(!this._ignoreEvent(b)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",b));a.isFirefox&&(this._fixCaret(),b.dataTransfer.dropEffect==="none"&&!b.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(b){if(!this._ignoreEvent(b)){var c=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(c=!1,this.onDragEnter(this._createMouseEvent("DragEnter",
b)));if(a.isWebkit||c)return b.preventDefault&&b.preventDefault(),!1}},_handleDragOver:function(b){if(!this._ignoreEvent(b)){var c=!0;this.isListening("DragOver")&&(c=!1,this.onDragOver(this._createMouseEvent("DragOver",b)));if(a.isWebkit||c){if(c)b.dataTransfer.dropEffect="none";b.preventDefault&&b.preventDefault();return!1}}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=
!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(){this._hasFocus=!0;a.isIOS&&this._lastTouchOffset!==void 0?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();if(this._cursorDiv)this._cursorDiv.style.display="block";if(this._selDiv1){var b=this._highlightRGB;this._selDiv1.style.background=b;this._selDiv2.style.background=b;this._selDiv3.style.background=
b}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyDown")){var c=this._createKeyEvent("KeyDown",b);this.onKeyDown(c);if(c.defaultPrevented){if(a.isFirefox)this._keyDownPrevented=!0;b.preventDefault();return}}c=!1;switch(b.keyCode){case 16:case 17:case 18:case 91:c=!0;break;default:this._setLinksVisible(!1)}if(b.keyCode===229){if(this._readonly)return b.preventDefault&&b.preventDefault(),!1;c=!0;if(a.isSafari&&a.isMac&&
b.ctrlKey)c=!1,b.keyCode=129;c&&this._startIME()}else c||this._commitIME();if((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)return this._keyDownEvent=b,!0;if(this._doAction(b))return b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1}},_handleKeyPress:function(b){if(!this._ignoreEvent(b))if(this._keyDownPrevented)b.preventDefault&&(b.preventDefault(),b.stopPropagation()),this._keyDownPrevented=void 0;else{if(a.isMac&&a.isWebkit&&(63232<=
b.keyCode&&b.keyCode<=63487||b.keyCode===13||b.keyCode===8))return b.preventDefault&&b.preventDefault(),!1;if(((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)&&this._doAction(this._keyDownEvent))return b.preventDefault&&b.preventDefault(),!1;var c=a.isMac?b.metaKey:b.ctrlKey;if(b.charCode!==void 0&&c)switch(b.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(c=this._createKeyEvent("KeyPress",b),this.onKeyPress(c),c.defaultPrevented)){b.preventDefault();return}if(this._doAction(b))return b.preventDefault?
(b.preventDefault(),b.stopPropagation()):(b.cancelBubble=!0,b.returnValue=!1,b.keyCode=0),!1;c=!1;if(a.isMac){if(b.ctrlKey||b.metaKey)c=!0}else if(a.isFirefox){if(b.ctrlKey||b.altKey)c=!0}else b.ctrlKey^b.altKey&&(c=!0);if(!c&&(c=a.isOpera?b.which:b.charCode!==void 0?b.charCode:b.keyCode,c>31))return this._doContent(String.fromCharCode(c)),b.preventDefault&&b.preventDefault(),!1}},_handleKeyUp:function(b){if(!this._ignoreEvent(b)){if(this.isListening("KeyUp")){var c=this._createKeyEvent("KeyUp",b);
this.onKeyUp(c);if(c.defaultPrevented){b.preventDefault();return}}(a.isMac?b.metaKey:b.ctrlKey)||this._setLinksVisible(!1);b.keyCode===13&&this._commitIME()}},_handleLinkClick:function(b){if(!(a.isMac?b.metaKey:b.ctrlKey))return b.preventDefault&&b.preventDefault(),!1},_handleMouse:function(b){var c=this._getWindow(),d=!0,e=c;if(a.isIE||a.isFirefox&&!this._overlayDiv)e=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var f=this;c.setTimeout(function(){f.focus();f._ignoreFocus=
!1},0)}this._clickCount===1?(d=this._setSelectionTo(b.clientX,b.clientY,b.shiftKey,!a.isOpera&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(e):(this._isW3CEvents&&this._setGrab(e),this._doubleClickSelection=null,this._setSelectionTo(b.clientX,b.clientY,b.shiftKey),this._doubleClickSelection=this._getSelection());return d},_handleMouseDown:function(b){if(!this._ignoreEvent(b)){if(this._linksVisible)if((b.target||b.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();
var c=b.which;c||(b.button===4&&(c=2),b.button===2&&(c=3),b.button===1&&(c=1));var d=c!==2&&b.timeStamp?b.timeStamp:(new Date).getTime(),e=d-this._lastMouseTime,f=Math.abs(this._lastMouseX-b.clientX),h=Math.abs(this._lastMouseY-b.clientY),g=this._lastMouseButton===c;this._lastMouseX=b.clientX;this._lastMouseY=b.clientY;this._lastMouseTime=d;this._lastMouseButton=c;if(c===1)this._isMouseDown=!0,g&&e<=this._clickTime&&f<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&
(d=this._createMouseEvent("MouseDown",b),this.onMouseDown(d),d.defaultPrevented)){b.preventDefault();return}if(c===1&&this._handleMouse(b)&&(a.isIE>=9||a.isOpera||a.isChrome||a.isSafari||a.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),b.preventDefault();a.isFirefox&&this._lastMouseButton===3&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(b){if(!this._animation){var c=this._isClientDiv(b);if(this.isListening("MouseMove")&&c)this.onMouseMove(this._createMouseEvent("MouseMove",b));if(!this._dropTarget){var d=this._linksVisible||this._lastMouseMoveX!==b.clientX||this._lastMouseMoveY!==b.clientY;this._lastMouseMoveX=b.clientX;this._lastMouseMoveY=b.clientY;this._setLinksVisible(d&&!this._isMouseDown&&(a.isMac?
b.metaKey:b.ctrlKey));if(!this._isW3CEvents){if(b.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&b.button===1&&(this._clickCount&1)!==0&&c)return this._clickCount=2,this._handleMouse(b,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var c=b.clientX,b=b.clientY,e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),g=this._getClientHeight(),d=f.left+e.left,i=f.top+e.top,h=f.left+e.left+h,e=f.top+e.top+g;b<i?this._doAutoScroll("up",
c,b-i):b>e?this._doAutoScroll("down",c,b-e):c<d&&!this._wrapMode?this._doAutoScroll("left",c-d,b):c>h&&!this._wrapMode?this._doAutoScroll("right",c-h,b):(this._endAutoScroll(),this._setSelectionTo(c,b,!0))}}}},_isClientDiv:function(a){for(var b=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(b===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var c=
this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:c.x,y:c.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(b){var c=b.which?b.button===0:b.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(b)||c&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",b));if(!this._linksVisible&&c&&this._isMouseDown){if(this._dragOffset!==-1)c=this._getSelection(),c.extend(this._dragOffset),c.collapse(),
this._setSelection(c,!0,!0),this._dragOffset=-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);a.isFirefox&&b.preventDefault()}},_handleMouseWheel:function(b){var c=this._getLineHeight(),d=0,e=0;a.isIE||a.isOpera?e=-b.wheelDelta/40*c:a.isFirefox?(c=a.isMac?b.detail*3:Math.max(-256,Math.min(256,b.detail))*c,b.axis===b.HORIZONTAL_AXIS?d=c:e=c):a.isMac?(e=b.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=b.timeStamp,d=b.wheelDeltaX%120!==0?1:e<40?40/(40-e):40,e=
b.wheelDeltaY%120!==0?1:e<40?40/(40-e):40,d=Math.ceil(-b.wheelDeltaX/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1),e=Math.ceil(-b.wheelDeltaY/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1)):(d=-b.wheelDeltaX,e=-b.wheelDeltaY/120*8*c);if(a.isSafari){for(c=b.target;c&&c.lineIndex===void 0;)c=c.parentNode;this._mouseWheelLine=c}c=this._getScroll();this._scrollView(d,e);d=this._getScroll();if(c.x!==d.x||c.y!==d.y)return b.preventDefault&&b.preventDefault(),!1},_handlePaste:function(b){if(!this._ignoreEvent(b)&&!this._ignorePaste&&
this._doPaste(b)){if(a.isIE){var c=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){c._updateDOMSelection();c._ignoreFocus=!1},0)}b.preventDefault&&b.preventDefault();return!1}},_handleResize:function(){var b=this._parent.clientWidth,c=this._parent.clientHeight;if(this._parentWidth!==b||this._parentHeight!==c)this._parentWidth!==b&&this._wrapMode&&this._resetLineHeight(),this._parentWidth=b,this._parentHeight=c,a.isIE<9?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,c=b.lineIndex;b&&!b._ruler;){if(c===void 0&&b.lineIndex!==void 0)c=b.lineIndex;b=b.parentNode}b=b?b._ruler:null;if(c===void 0&&b&&b.getOverview()==="document"){var c=this._getClientHeight(),d=this._model.getLineCount(),e=this._getViewPadding(),f=this._viewDiv.getBoundingClientRect(),c=Math.floor((a.clientY-f.top-this._metrics.scrollWidth)*d/(c+e.top+e.bottom-2*this._metrics.scrollWidth));0<=c&&c<d||(c=void 0)}if(b)switch(a.type){case "click":if(b.onClick)b.onClick(c,
a);break;case "dblclick":if(b.onDblClick)b.onDblClick(c,a);break;case "mousemove":if(b.onMouseMove)b.onMouseMove(c,a);break;case "mouseover":if(b.onMouseOver)b.onMouseOver(c,a);break;case "mouseout":if(b.onMouseOut)b.onMouseOut(c,a)}},_handleScroll:function(){var a=this._getScroll(!1),b=this._hScroll,c=this._vScroll;if(b!==a.x||c!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(c===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:c},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&
a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var c;c=a.tagName==="DIV"?a:a.parentNode.parentNode;var d=0,e=c.lineIndex;if(a.tagName!=="DIV")for(c=c.firstChild;c;){var f=c.firstChild;if(f===a){c.ignoreChars&&(d-=c.ignoreChars);d+=b;break}c.ignoreChars&&(d-=c.ignoreChars);d+=f.data.length;c=c.nextSibling}return Math.max(0,d)+this._model.getLineStart(e)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),
a=this._getModelOffset(a.focusNode,a.focusOffset);b===void 0||a===void 0||this._setSelection(new m(b,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(a.isAndroid){var b=this._getWindow();this._selTimer&&b.clearTimeout(this._selTimer);var c=this;this._selTimer=b.setTimeout(function(){if(c._clientDiv)c._selTimer=null,c._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(b){if(!this._ignoreEvent(b)){this._imeOffset=-1;if(a.isAndroid){for(var c=
this._getWindow().getSelection(),d=c.anchorNode;d;){if(d.lineIndex!==void 0)break;d=d.parentNode}if(d){var e=this._model,f=d.lineIndex,h=e.getLine(f),g=h,i=0,e=e.getLineStart(f);if(c.rangeCount>0)c.getRangeAt(0).deleteContents(),f=d.ownerDocument.createTextNode(b.data),c.getRangeAt(0).insertNode(f),i=this._getDOMText(d,f),g=i.text,i=i.offset,f.parentNode.removeChild(f);d.lineRemoved=!0;for(d=0;h.charCodeAt(d)===g.charCodeAt(d)&&d<i;)d++;c=h.length-1;for(f=g.length-h.length;h.charCodeAt(c)===g.charCodeAt(c+
f)&&c+f>=i+b.data.length;)c--;c++;h=g.substring(d,c+f);d+=e;c+=e;this._modifyContent({text:h,start:d,end:c,_ignoreDOMSelection:!0},!0)}}else this._doContent(b.data);b.preventDefault()}},_handleTouchStart:function(b){this._commitIME();var c=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",c.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var d=b.touches;if(d.length===1){var d=d[0],e=d.clientX,f=d.clientY;this._touchStartX=
e;this._touchStartY=f;if(a.isAndroid&&(f<d.pageY-c.pageYOffset||e<d.pageX-c.pageXOffset))e=d.pageX-c.pageXOffset,f=d.pageY-c.pageYOffset;c=this.convert({x:e,y:f},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(c.x,c.y);this._touchStartTime=b.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(b.length===1){b=b[0];this._touchCurrentX=b.clientX;this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display=
"block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var c=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,b=0;if(c._touching)a=c._touchStartX-c._touchCurrentX,b=c._touchStartY-c._touchCurrentY,c._touchSpeedX=a/10,c._touchSpeedY=b/10,c._touchStartX=c._touchCurrentX,c._touchStartY=c._touchCurrentY;else if(Math.abs(c._touchSpeedX)<0.1&&Math.abs(c._touchSpeedY)<0.1){c._vScrollDiv.style.display="none";c._hScrollDiv.style.display="none";d.clearInterval(c._touchScrollTimer);
c._touchScrollTimer=null;return}else a=c._touchSpeedX*10,b=c._touchSpeedY*10,c._touchSpeedX*=0.95,c._touchSpeedY*=0.95;c._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var b,c,d=this._keyModes;for(c=d.length-1;c>=0;c--)if(b=d[c],typeof b.match==="function"&&(b=b.match(a),b!==void 0))return this.invokeAction(b);return!1},_doMove:function(a,b){var c=this._model,d=b.getCaret(),e=c.getLineAtOffset(d);
if(!a.count)a.count=1;for(;a.count!==0;){var f=c.getLineStart(e);if(a.count<0&&d===f)if(e>0)a.unit==="character"&&a.count++,e--,b.extend(c.getLineEnd(e));else break;else if(a.count>0&&d===c.getLineEnd(e))if(e+1<c.getLineCount())a.unit==="character"&&a.count--,e++,b.extend(c.getLineStart(e));else break;else{var h=!1;a.expandTab&&a.unit==="character"&&(d-f)%this._tabSize===0&&(h=!/[^ ]/.test(c.getText(f,d)));h?(b.extend(d-this._tabSize),a.count+=a.count<0?1:-1):(f=this._getLine(e),b.extend(f.getNextOffset(d,
a)),f.destroy())}d=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();if(b.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,b)}this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var c=this.getText(b.start,b.end);this._setSelection(b,!0);switch(a.type){case "lower":c=c.toLowerCase();break;case "capitalize":c=c.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});
break;case "reverse":a="";for(b=0;b<c.length;b++){var d=c[b],e=d.toLowerCase(),d=e!==d?e:d.toUpperCase();a+=d}c=a;break;default:c=c.toUpperCase()}this._doContent(c);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var c=this._model,d=c.getLineAtOffset(b.end);b.end<c.getLineEnd(d)&&(c=this._getLine(d),b.extend(c.getNextOffset(b.getCaret(),{unit:"character",count:1})),c.destroy())}this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},
!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?this._setClipboardText(this._getBaseText(b.start,b.end),a):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=this._getSelection();if(!b.isEmpty()&&!a.select)b.end=b.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,b)}a.select||b.collapse();this._setSelection(b,!0);
return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),c=this._model,d;if(a.ctrl)b.extend(c.getCharCount()),d=function(){};else{var e=b.getCaret(),f=c.getLineAtOffset(e);if(this._wrapMode){var h=this._getLine(f),
e=h.getLineIndex(e),e=e===h.getLineCount()-1?c.getLineEnd(f):h.getLineStart(e+1)-1;h.destroy()}else a.count&&a.count>0&&(f=Math.min(f+a.count-1,c.getLineCount()-1)),e=c.getLineEnd(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doEnter:function(a){var b=this._model,c=this._getSelection();this._doContent(b.getLineDelimiter());if(a&&a.noCursor)c.end=c.start,this._setSelection(c,!0);return!0},_doHome:function(a){var b=this._getSelection(),c=this._model,d;if(a.ctrl)b.extend(0),
d=function(){};else{var e=b.getCaret(),f=c.getLineAtOffset(e);this._wrapMode?(c=this._getLine(f),e=c.getLineIndex(e),e=c.getLineStart(e),c.destroy()):e=c.getLineStart(f);b.extend(e)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doLineDown:function(b){var c=this._model,d=this._getSelection(),e=d.getCaret(),f=c.getLineAtOffset(e),h=this._getLine(f),g=this._columnX,i=1,m=!1;if(g===-1||b.wholeLine||b.select&&a.isIE)g=b.wholeLine?c.getLineEnd(f+1):e,g=h.getBoundingClientRect(g).left;
(e=h.getLineIndex(e))<h.getLineCount()-1?i=h.getClientRects(e+1).top+1:(e=c.getLineCount()-1,m=f===e,b.count&&b.count>0?f=Math.min(f+b.count,e):f++);e=!1;if(m){if(b.select||a.isMac||a.isLinux)d.extend(c.getCharCount()),e=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),d.extend(h.getOffset(g,i)),e=!0;e&&(b.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=g;h.destroy();return!0},_doLineUp:function(b){var c=this._model,d=this._getSelection(),e=d.getCaret(),f=c.getLineAtOffset(e),
h=this._getLine(f),g=this._columnX,i=!1,m;if(g===-1||b.wholeLine||b.select&&a.isIE)g=b.wholeLine?c.getLineStart(f-1):e,g=h.getBoundingClientRect(g).left;(e=h.getLineIndex(e))>0?m=h.getClientRects(e-1).top+1:(i=f===0,i||(b.count&&b.count>0?f=Math.max(f-b.count,0):f--,m=this._getLineHeight(f)-1));e=!1;if(i){if(b.select||a.isMac||a.isLinux)d.extend(0),e=!0}else h.lineIndex!==f&&(h.destroy(),h=this._getLine(f)),d.extend(h.getOffset(g,m)),e=!0;e&&(b.select||d.collapse(),this._setSelection(d,!0,!0));this._columnX=
g;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(b){var c=this,d=this._model,e=this._getSelection(),f=e.getCaret(),h=d.getLineAtOffset(f),g=d.getLineCount(),i=this._getScroll(),d=this._getClientHeight(),m,n;if(this._lineHeight){m=this._columnX;i=this._getBoundsAtOffset(f);if(m===-1||b.select&&a.isIE)m=i.left;f=this._getLineIndex(i.top+d);n=this._getLine(f);h=this._getLinePixel(f);f=n.getOffset(m,i.top+d-h);d=n.getBoundingClientRect(f);n.destroy();e.extend(f);b.select||e.collapse();
this._setSelection(e,!0,!0,function(){c._columnX=m},d.top+h-i.top);return!0}if(h<g-1){var o=this._getLineHeight(),p=Math.min(g-h-1,Math.floor(d/o)),p=Math.max(1,p);m=this._columnX;if(m===-1||b.select&&a.isIE)n=this._getLine(h),m=n.getBoundingClientRect(f).left,n.destroy();n=this._getLine(h+p);e.extend(n.getOffset(m,0));n.destroy();b.select||e.collapse();b=g*o;f=i.y+p*o;f+d>b&&(f=b-d);this._setSelection(e,!0,!0,function(){c._columnX=m},f-i.y)}return!0},_doPageUp:function(b){var c=this,d=this._model,
e=this._getSelection(),f=e.getCaret(),h=d.getLineAtOffset(f),g=this._getScroll(),i=this._getClientHeight(),m;if(this._lineHeight){m=this._columnX;g=this._getBoundsAtOffset(f);if(m===-1||b.select&&a.isIE)m=g.left;f=this._getLineIndex(g.bottom-i);d=this._getLine(f);h=this._getLinePixel(f);f=d.getOffset(m,g.bottom-i-h);i=d.getBoundingClientRect(f);d.destroy();e.extend(f);b.select||e.collapse();this._setSelection(e,!0,!0,function(){c._columnX=m},i.top+h-g.top);return!0}if(h>0){var n=this._getLineHeight(),
i=Math.max(1,Math.min(h,Math.floor(i/n)));m=this._columnX;if(m===-1||b.select&&a.isIE)d=this._getLine(h),m=d.getBoundingClientRect(f).left,d.destroy();d=this._getLine(h-i);e.extend(d.getOffset(m,this._getLineHeight(h-i)-1));d.destroy();b.select||e.collapse();b=Math.max(0,g.y-i*n);this._setSelection(e,!0,!0,function(){c._columnX=m},b-g.y)}return!0},_doPaste:function(b){var c=this;return this._getClipboardText(b,function(b){b&&(a.isLinux&&c._lastMouseButton===2&&(new Date).getTime()-c._lastMouseTime<=
c._clickTime&&c._setSelectionTo(c._lastMouseX,c._lastMouseY),c._doContent(b))})!==null},_doScroll:function(a){var b=a.type,c=this._model,d=c.getLineCount(),a=this._getClientHeight(),e=this._getLineHeight();d*=e;var f=this._getScroll().y,h;switch(b){case "textStart":h=0;break;case "textEnd":h=d-a;break;case "pageDown":h=f+a;break;case "pageUp":h=f-a;break;case "lineDown":h=f+e;break;case "lineUp":h=f-e;break;case "centerLine":b=this._getSelection(),h=c.getLineAtOffset(b.start),c=(c.getLineAtOffset(b.end)-
h+1)*e,h=h*e-a/2+c/2}h!==void 0&&(h=Math.min(Math.max(0,h),d-a),this._scrollViewAnimated(0,h-f,function(){}));return!0},_doSelectAll:function(){var a=this._model,b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var b=this._model,a=this._getSelection().getCaret(),c=b.getLineAtOffset(a),b=b.getLineStart(c),a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ");this._doContent(a);
return!0}},_doShiftTab:function(){return!this._tabMode||this._readonly?void 0:!0},_doOverwriteMode:function(){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var b=this._model,c=this._getSelection(),d=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),e=c.getCaret(),
f=b.getLineCount(),h=b.getLineAtOffset(e),g;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")e=this._autoScrollY/this._getLineHeight(),e=e<0?Math.floor(e):Math.ceil(e),g=Math.max(0,Math.min(f-1,h+e));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")g=this._getLineIndex(d.y),h=this._getLine(h),d.x+=h.getBoundingClientRect(e,!1).left,h.destroy();g===0&&(a.isMac||a.isLinux)?c.extend(0):g===f-1&&(a.isMac||a.isLinux)?c.extend(b.getCharCount()):(h=this._getLine(g),c.extend(h.getOffset(d.x,
d.y-this._getLinePixel(g))),h.destroy());this._setSelection(c,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),c=0;if(a){for(var a=0,d=(new Date).getTime(),e=0;c<b;)if(this._lineHeight[c]||(a++,e||(e=c),this._lineHeight[c]=this._calculateLineHeight(c)),c++,(new Date).getTime()-
d>100)break;this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(c!==b){var f=this;this._calculateLHTimer=a.setTimeout(function(){f._calculateLHTimer=null;f._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var b=this._clientDiv,c=b.ownerDocument,
d=a.createElement(c,"div");d.style.lineHeight="normal";var e={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(e);i(e.style,d);d.style.position="fixed";d.style.left="-1000px";var f=a.createElement(c,"span");f.appendChild(c.createTextNode(" "));d.appendChild(f);var h=a.createElement(c,"span");h.style.fontStyle="italic";h.appendChild(c.createTextNode(" "));d.appendChild(h);var g=a.createElement(c,"span");g.style.fontWeight="bold";g.appendChild(c.createTextNode(" "));
d.appendChild(g);e=a.createElement(c,"span");e.style.fontWeight="bold";e.style.fontStyle="italic";e.appendChild(c.createTextNode(" "));d.appendChild(e);b.appendChild(d);var m=d.getBoundingClientRect(),f=f.getBoundingClientRect(),h=h.getBoundingClientRect(),g=g.getBoundingClientRect(),e=e.getBoundingClientRect(),f=f.bottom-f.top,h=h.bottom-h.top,g=g.bottom-g.top,n=e.bottom-e.top,j=0,e=m.bottom-m.top<=0,m=Math.max(1,m.bottom-m.top);h>f&&(j=1);g>h&&(j=2);n>g&&(j=3);var k;if(j!==0){k={style:{}};if((j&
1)!==0)k.style.fontStyle="italic";if((j&2)!==0)k.style.fontWeight="bold"}f=p(d);b.removeChild(d);h=o(this._viewDiv);d=a.createElement(c,"div");d.style.position="fixed";d.style.left="-1000px";d.style.paddingLeft=h.left+"px";d.style.paddingTop=h.top+"px";d.style.paddingRight=h.right+"px";d.style.paddingBottom=h.bottom+"px";d.style.width="100px";d.style.height="100px";g=a.createElement(c,"div");g.style.width="100%";g.style.height="100%";d.appendChild(g);b.appendChild(d);c=d.getBoundingClientRect();h=
g.getBoundingClientRect();d.style.overflow="hidden";g.style.height="200px";g=d.clientWidth;d.style.overflow="scroll";n=d.clientWidth;b.removeChild(d);h={left:h.left-c.left,top:h.top-c.top,right:c.right-h.right,bottom:c.bottom-h.bottom};return{lineHeight:m,largestFontStyle:k,lineTrim:f,viewPadding:h,scrollWidth:g-n,invalid:e}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var b=this._getSelection();if(b.isEmpty())return!1;a===
"next"?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,b=a.getLineAtOffset(this._imeOffset),c=a.getLineStart(b),d=this._getDOMText(this._getLineNode(b)).text,a=a.getLine(b),c=this._imeOffset-c,a=c+d.length-a.length;c!==a&&this._doContent(d.substring(c,a));this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new j.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},
lineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!1}))},actionDescription:{name:g.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!1}))},actionDescription:{name:g.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineStart}},lineEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!1,ctrl:!1}))},actionDescription:{name:g.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,
{select:!1,unit:"character"}))},actionDescription:{name:g.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!1,unit:"character"}))},actionDescription:{name:g.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(f(b,{select:!1}))},actionDescription:{name:g.pageUp}},pageDown:{defaultHandler:function(b){return a._doPageDown(f(b,{select:!1}))},actionDescription:{name:g.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(f(b,{type:"pageUp"}))},
actionDescription:{name:g.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(f(b,{type:"pageDown"}))},actionDescription:{name:g.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(f(b,{type:"lineUp"}))},actionDescription:{name:g.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(f(b,{type:"lineDown"}))},actionDescription:{name:g.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!1,
unit:"word"}))},actionDescription:{name:g.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!1,unit:"word"}))},actionDescription:{name:g.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!1,ctrl:!0}))},actionDescription:{name:g.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(f(b,{type:"textStart"}))},
actionDescription:{name:g.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(f(b,{type:"textEnd"}))},actionDescription:{name:g.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(f(b,{type:"centerLine"}))},actionDescription:{name:g.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!0}))},actionDescription:{name:g.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!0}))},actionDescription:{name:g.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(f(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(f(b,{select:!0,wholeLine:!0}))},actionDescription:{name:g.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!0,ctrl:!1}))},actionDescription:{name:g.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(f(b,{select:!0,ctrl:!1}))},
actionDescription:{name:g.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!0,unit:"character"}))},actionDescription:{name:g.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(f(b,{select:!0}))},actionDescription:{name:g.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(f(b,
{select:!0}))},actionDescription:{name:g.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(f(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(f(b,{select:!0,unit:"word"}))},actionDescription:{name:g.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(f(b,{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(f(b,
{select:!0,ctrl:!0}))},actionDescription:{name:g.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"character"}))},actionDescription:{name:g.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(f(b,{unit:"character"}))},actionDescription:{name:g.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"word"}))},actionDescription:{name:g.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(f(b,
{unit:"word"}))},actionDescription:{name:g.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(f(b,{unit:"line"}))},actionDescription:{name:g.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(f(b,{unit:"line"}))},actionDescription:{name:g.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:g.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:g.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:g.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(f(b,{noCursor:!0}))},actionDescription:{name:g.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:g.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:g.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:g.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:g.paste}},
uppercase:{defaultHandler:function(b){return a._doCase(f(b,{type:"upper"}))},actionDescription:{name:g.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(f(b,{type:"lower"}))},actionDescription:{name:g.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(f(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:g.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(f(b,{type:"reverse"}))},actionDescription:{name:g.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:g.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:g.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:g.toggleWrapMode}}}},_createRuler:function(b,c){if(this._clientDiv){var d=b.getLocation()==="left"?this._leftDiv:this._rightDiv;d.style.display="block";var e=a.createElement(d.ownerDocument,"div");e._ruler=b;e.rulerChanged=!0;e.style.position="relative";e.style.cssFloat=
"left";e.style.styleFloat="left";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";if(c===void 0||c<0||c>=d.children.length)d.appendChild(e);else{for(var f=d.firstChild;f&&--c>0;)f=f.nextSibling;d.insertBefore(e,f)}}},_createView:function(){if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var c=b.ownerDocument,d=a.createElement(c,"div");this._rootDiv=d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";
d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);b=a.createElement(c,"div");b.className="textviewLeftRuler";this._leftDiv=b;b.tabIndex=-1;b.style.overflow="hidden";b.style.MozUserSelect="none";b.style.WebkitUserSelect="none";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.cursor="default";b.style.display="none";b.setAttribute("aria-hidden","true");d.appendChild(b);
b=a.createElement(c,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.overflow="auto";b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline="none";b.style.background="transparent";if(a.isMac&&a.isWebkit)b.style.pointerEvents="none",b.style.zIndex="2";d.appendChild(b);var e=a.createElement(c,"div");e.className="textviewRightRuler";this._rightDiv=e;e.tabIndex=-1;e.style.display="none";e.style.overflow=
"hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.right="0px";e.setAttribute("aria-hidden","true");d.appendChild(e);this._scrollDiv=e=a.createElement(c,"div");e.style.margin="0px";e.style.borderWidth="0px";e.style.padding="0px";b.appendChild(e);if(a.isFirefox)this._clipboardDiv=b=a.createElement(c,"div"),b.style.position="fixed",b.style.whiteSpace="pre",b.style.left="-1000px",d.appendChild(b);
if(!a.isIE&&!a.isIOS)this._clipDiv=b=a.createElement(c,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth="0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=e=a.createElement(c,"div"),e.style.position="absolute",e.style.height="1px",e.style.top="-1000px",e.style.background="transparent",b.appendChild(e);this._setFullSelection(this._fullSelection,!0);b=a.createElement(c,"div");b.className="textviewContent";
this._clientDiv=b;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(a.isIOS||a.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(a.isIOS||a.isAndroid)this._vScrollDiv=e=a.createElement(c,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",
e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",e.style.outline="none",e.style.zIndex="3",e.style.width="8px",e.style.display="none",d.appendChild(e),this._hScrollDiv=e=a.createElement(c,"div"),e.style.position="absolute",e.style.borderWidth="1px",e.style.borderColor="white",e.style.borderStyle="solid",e.style.borderRadius="4px",e.style.backgroundColor="black",e.style.opacity="0.5",e.style.margin="0px",e.style.padding="0px",
e.style.outline="none",e.style.zIndex="3",e.style.height="8px",e.style.display="none",d.appendChild(e);if(a.isFirefox&&!b.setCapture)this._overlayDiv=c=a.createElement(c,"div"),c.style.position=b.style.position,c.style.borderWidth=b.style.borderWidth,c.style.margin=b.style.margin,c.style.padding=b.style.padding,c.style.cursor="text",c.style.zIndex="2",(this._clipDiv||d).appendChild(c);b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,
!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._hookEvents();d=this._rulers;for(c=0;c<d.length;c++)this._createRuler(d[c]);this._update()}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,
update:this._setTabSize},expandTab:{value:!1,update:null},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:c.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=a.getLocation()==="left"?this._leftDiv:this._rightDiv;if(b)for(var c=b.firstChild;c;){if(c._ruler===a){c._ruler=
void 0;b.removeChild(c);if(b.children.length===0)b.style.display="none";break}c=c.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();if(this._autoScrollTimerID)a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null;if(this._updateTimer)a.clearTimeout(this._updateTimer),this._updateTimer=null;a=this._rootDiv;a.parentNode.removeChild(a);this._hScrollDiv=this._vScrollDiv=this._rightDiv=this._leftDiv=this._overlayDiv=
this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,c){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=c;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;
if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var c=this._model;c.getBaseModel&&(a=c.mapOffset(a),b=c.mapOffset(b),c=c.getBaseModel());return c.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._clientDiv.getBoundingClientRect();a.bottom>c.bottom&&(b=this._getLinePrevious(b)||
b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a)),a=b.getBoundingClientRect(a),c=this._getLinePixel(b.lineIndex);a.top+=c;a.bottom+=c;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(b,c){var d=this._model.getLineDelimiter(),
e,f,h=this._getWindow();if(h.clipboardData)return e=[],f=h.clipboardData.getData("Text"),n(f,function(a){e.push(a)},function(){e.push(d)}),f=e.join(""),c&&c(f),f;if(a.isFirefox){this._ignoreFocus=!0;var g=this._clipboardDiv;g.innerHTML="<pre contenteditable=''></pre>";g.firstChild.focus();var i=this,m=function(){var a=i._getTextFromElement(g);g.innerHTML="";e=[];n(a,function(a){e.push(a)},function(){e.push(d)});return e.join("")},o=!1;this._ignorePaste=!0;if(!a.isLinux||this._lastMouseButton!==2)try{o=
g.ownerDocument.execCommand("paste",!1,null)}catch(p){o=g.childNodes.length>1||g.firstChild&&g.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!o)return b?(h.setTimeout(function(){i.focus();(f=m())&&c&&c(f);i._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(f=m())&&c&&c(f);return f}return b&&b.clipboardData?(e=[],f=b.clipboardData.getData("text/plain"),n(f,function(a){e.push(a)},function(){e.push(d)}),(f=e.join(""))&&c&&c(f),f):""},_getDOMText:function(a,
b){for(var c=a.firstChild,d="",e=0;c;){var f;if(!c.ignore)if(c.ignoreChars){f=c.lastChild;for(var h=0,g=[],i=-1;f;){for(var m=f.data,n=m.length-1;n>=0;n--){var o=m.substring(n,n+1);h<c.ignoreChars&&(o===" "||o==="\u200c"||o==="\ufeff")?h++:g.push(o==="\u00a0"?"\t":o)}if(b===f)i=g.length;f=f.previousSibling}g=g.reverse().join("");i!==-1&&(e=d.length+g.length-i);d+=g}else for(f=c.firstChild;f;){if(b===f)e=d.length;d+=f.data;f=f.nextSibling}c=c.nextSibling}return{text:d,offset:e}},_getTextFromElement:function(a){var b=
a.ownerDocument,c=b.defaultView;if(!c.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);var a=c.getSelection(),c=[],d;for(d=0;d<a.rangeCount;d++)c.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);b=a.toString();a.removeAllRanges();for(d=0;d<c.length;d++)a.addRange(c[d]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?
b._line:new r(this,a)},_getLineHeight:function(a,b){if(a!==void 0&&this._lineHeight){var c=this._lineHeight[a];if(c)return c;if(b||b===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&a.lineIndex===-1;)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?
a.previousSibling:this._clientDiv.lastChild;a&&a.lineIndex===-1;)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),c=-this._topIndexY+this._getScroll().y;if(a>b)for(;b<a;b++)c+=this._getLineHeight(b);else for(b-=1;b>=a;b--)c-=this._getLineHeight(b);return c}return this._getLineHeight()*a},_getLineIndex:function(a){var b,c=0,d=this._model.getLineCount();if(this._lineHeight){var c=this._getTopIndex(),
e=-this._topIndexY+this._getScroll().y;if(a!==e)if(a<e)for(;a<e&&c>0;)a+=this._getLineHeight(--c);else for(b=this._getLineHeight(c);a-b>=e&&c<d-1;)a-=b,b=this._getLineHeight(++c)}else b=this._getLineHeight(),c=Math.floor(a/b);return Math.max(0,Math.min(d-1,c))},_getScroll:function(a){(a===void 0||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>
this._getLineHeight()){var a=b.getBoundingClientRect(),c=this._getViewPadding(),d=this._viewDiv.getBoundingClientRect();a.top<d.top+c.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var c=this;this._modelListener={onChanging:function(a){c._onModelChanging(a)},onChanged:function(a){c._onModelChanged(a)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener=
{onChanged:function(){c._setThemeClass(c._themeClass)}};this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);var d=this._handlers=[],e=this._clientDiv,f=this._viewDiv,h=this._rootDiv,g=this._overlayDiv||e,i=e.ownerDocument,m=this._getWindow(),n=a.isIE?i:m;d.push({target:m,type:"resize",handler:function(a){return c._handleResize(a?a:m.event)}});d.push({target:e,type:"blur",handler:function(a){return c._handleBlur(a?a:m.event)}});d.push({target:e,type:"focus",handler:function(a){return c._handleFocus(a?
a:m.event)}});d.push({target:f,type:"focus",handler:function(){e.focus()}});d.push({target:f,type:"scroll",handler:function(a){return c._handleScroll(a?a:m.event)}});d.push({target:e,type:"textInput",handler:function(a){return c._handleTextInput(a?a:m.event)}});d.push({target:e,type:"keydown",handler:function(a){return c._handleKeyDown(a?a:m.event)}});d.push({target:e,type:"keypress",handler:function(a){return c._handleKeyPress(a?a:m.event)}});d.push({target:e,type:"keyup",handler:function(a){return c._handleKeyUp(a?
a:m.event)}});d.push({target:e,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:m.event)}});d.push({target:e,type:"copy",handler:function(a){return c._handleCopy(a?a:m.event)}});d.push({target:e,type:"cut",handler:function(a){return c._handleCut(a?a:m.event)}});d.push({target:e,type:"paste",handler:function(a){return c._handlePaste(a?a:m.event)}});if(a.isIOS||a.isAndroid)d.push({target:i,type:"selectionchange",handler:function(a){return c._handleSelectionChange(a?a:m.event)}}),
d.push({target:e,type:"touchstart",handler:function(a){return c._handleTouchStart(a?a:m.event)}}),d.push({target:e,type:"touchmove",handler:function(a){return c._handleTouchMove(a?a:m.event)}}),d.push({target:e,type:"touchend",handler:function(a){return c._handleTouchEnd(a?a:m.event)}});else{d.push({target:e,type:"selectstart",handler:function(a){return c._handleSelectStart(a?a:m.event)}});d.push({target:e,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:m.event)}});d.push({target:e,
type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:m.event)}});d.push({target:e,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:m.event)}});d.push({target:n,type:"mouseup",handler:function(a){return c._handleMouseUp(a?a:m.event)}});d.push({target:n,type:"mousemove",handler:function(a){return c._handleMouseMove(a?a:m.event)}});d.push({target:h,type:"mousedown",handler:function(a){return c._handleRootMouseDown(a?a:m.event)}});d.push({target:h,type:"mouseup",handler:function(a){return c._handleRootMouseUp(a?
a:m.event)}});d.push({target:g,type:"dragstart",handler:function(a){return c._handleDragStart(a?a:m.event)}});d.push({target:g,type:"drag",handler:function(a){return c._handleDrag(a?a:m.event)}});d.push({target:g,type:"dragend",handler:function(a){return c._handleDragEnd(a?a:m.event)}});d.push({target:g,type:"dragenter",handler:function(a){return c._handleDragEnter(a?a:m.event)}});d.push({target:g,type:"dragover",handler:function(a){return c._handleDragOver(a?a:m.event)}});d.push({target:g,type:"dragleave",
handler:function(a){return c._handleDragLeave(a?a:m.event)}});d.push({target:g,type:"drop",handler:function(a){return c._handleDrop(a?a:m.event)}});d.push({target:this._clientDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:m.event)}});if(a.isFirefox&&(!a.isWindows||a.isFirefox>=15))(f=m.MutationObserver||m.MozMutationObserver)?(this._mutationObserver=new f(function(a){c._handleDataModified(a)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):
d.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return c._handleDataModified(a?a:m.event)}});this._overlayDiv&&(d.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:m.event)}}),d.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:m.event)}}),d.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:m.event)}}),d.push({target:this._overlayDiv,
type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:m.event)}}));this._isW3CEvents||d.push({target:this._clientDiv,type:"dblclick",handler:function(a){return c._handleDblclick(a?a:m.event)}})}f=this._leftDiv;h=this._rightDiv;a.isIE&&d.push({target:f,type:"selectstart",handler:function(){return!1}});d.push({target:f,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:m.event)}});d.push({target:f,type:"click",handler:function(a){c._handleRulerEvent(a?
a:m.event)}});d.push({target:f,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:f,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:f,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:f,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:m.event)}});a.isIE&&d.push({target:h,type:"selectstart",handler:function(){return!1}});d.push({target:h,type:a.isFirefox?"DOMMouseScroll":"mousewheel",
handler:function(a){return c._handleMouseWheel(a?a:m.event)}});d.push({target:h,type:"click",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:h,type:"dblclick",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:h,type:"mousemove",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:h,type:"mouseover",handler:function(a){c._handleRulerEvent(a?a:m.event)}});d.push({target:h,type:"mouseout",handler:function(a){c._handleRulerEvent(a?a:m.event)}});
for(f=0;f<d.length;f++)h=d[f],b(h.target,h.type,h.handler,h.capture)},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(b){var c=b.parent;typeof c==="string"&&(c=(b.document||document).getElementById(c));if(!c)throw"no parent";b.parent=c;b.model=b.model||new k.TextModel;var d=this._defaultOptions(),e;for(e in d)d.hasOwnProperty(e)&&
(this["_"+e]=b[e]!==void 0?b[e]:d[e].value);this._keyModes=[];this._rulers=[];this._selection=new m(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!a.isIE||a.isIE>=9)&&typeof c.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=c.addEventListener;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=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_modifyContent:function(a,b){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var c=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=
!0;c.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}b&&(c=this._getSelection(),c.setCaret(a.start+a.text.length),this._setSelection(c,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var b=a.start,c=a.addedCharCount,d=a.removedCharCount,e=a.addedLineCount,f=a.removedLineCount,h=this._getSelection();h.end>b&&(h.end>b&&h.start<b+d?h.setCaret(b+c):(h.start+=c-d,h.end+=c-d),this._setSelection(h,
!1,!1));b=this._model.getLineAtOffset(b);for(c=this._getLineNext();c;){d=c.lineIndex;if(b<=d&&d<=b+f)b===d&&!c.modelChangedEvent&&!c.lineRemoved?(c.modelChangedEvent=a,c.lineChanged=!0):(c.lineRemoved=!0,c.lineChanged=!1,c.modelChangedEvent=null);if(d>b+f)c.lineIndex=d+e-f,c._line.lineIndex=c.lineIndex;c=this._getLineNext(c)}this._lineHeight&&(a=[b,f].concat(Array(e)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&b<=this._maxLineIndex&&this._maxLineIndex<=b+f)this._checkMaxLineIndex=
this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&b!==void 0)for(var c=a;c<b;c++)this._lineHeight[c]=void 0;
else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new m(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=
0;var b=this._clientDiv;if(b){for(var c=b.firstChild;c;)c.lineRemoved=!0,c=c.nextSibling;if(a.isFirefox)this._ignoreFocus=!1,(c=this._hasFocus)&&b.blur(),b.contentEditable=!1,b.contentEditable=!0,c&&b.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,b,c){if(c&&this._scrollAnimation){var d=this;this._animation=new t({window:this._getWindow(),duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);d._scrollView(0,a);b-=a},onEnd:function(){d._animation=null;d._scrollView(a,
b);c&&c()}});this._animation.play()}else this._scrollView(a,b),c&&c()},_scrollView:function(a,b){this._ensureCaretVisible=!1;var c=this._viewDiv;a&&(c.scrollLeft+=a);b&&(c.scrollTop+=b)},_setClipboardText:function(b,c){var d,e=this._parent.ownerDocument,f=this._getWindow();if(f.clipboardData)return d=[],n(b,function(a){d.push(a)},function(){d.push(a.platformDelimiter)}),f.clipboardData.setData("Text",d.join(""));if(c&&c.clipboardData&&(d=[],n(b,function(a){d.push(a)},function(){d.push(a.platformDelimiter)}),
c.clipboardData.setData("text/plain",d.join(""))))return!0;var h=a.createElement(e,"pre");h.style.position="fixed";h.style.left="-1000px";n(b,function(a){h.appendChild(e.createTextNode(a))},function(){h.appendChild(a.createElement(e,"br"))});h.appendChild(e.createTextNode(" "));this._clientDiv.appendChild(h);var g=e.createRange();g.setStart(h.firstChild,0);g.setEndBefore(h.lastChild);var i=f.getSelection();i.rangeCount>0&&i.removeAllRanges();i.addRange(g);var m=this,g=function(){h&&h.parentNode===
m._clientDiv&&m._clientDiv.removeChild(h);m._updateDOMSelection()},i=!1;this._ignoreCopy=!0;try{i=e.execCommand("copy",!1,null)}catch(o){}this._ignoreCopy=!1;if(!i&&c)return f.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(b,c,d,e,f){for(var h,g,i,m,n=0,o=b.firstChild,p,j,k=this._model.getLine(b.lineIndex).length;o;){if(!o.ignore){p=o.firstChild;j=p.length;o.ignoreChars&&(j-=o.ignoreChars);if(n+j>c||n+j>=k){h=p;g=c-n;o.ignoreChars&&j>0&&g===j&&(g+=o.ignoreChars);break}n+=j}o=o.nextSibling}for(var n=
0,o=d.firstChild,q=this._model.getLine(d.lineIndex).length;o;){if(!o.ignore){p=o.firstChild;j=p.length;o.ignoreChars&&(j-=o.ignoreChars);if(j+n>e||n+j>=q){i=p;m=e-n;o.ignoreChars&&j>0&&m===j&&(m+=o.ignoreChars);break}n+=j}o=o.nextSibling}this._setDOMFullSelection(b,c,k,d,e,q);b=this._getWindow();c=this._parent.ownerDocument;if(b.getSelection){d=b.getSelection();b=c.createRange();b.setStart(h,g);b.setEnd(i,m);if(this._hasFocus&&(d.anchorNode!==h||d.anchorOffset!==g||d.focusNode!==i||d.focusOffset!==
m||d.anchorNode!==i||d.anchorOffset!==m||d.focusNode!==h||d.focusOffset!==g))this._ignoreSelect=!1,d.rangeCount>0&&d.removeAllRanges(),d.addRange(b),this._ignoreSelect=!0;if(this._cursorDiv&&(b=c.createRange(),f?(b.setStart(h,g),b.setEnd(h,g)):(b.setStart(i,m),b.setEnd(i,m)),i=b.getClientRects()[0],m=this._cursorDiv.parentNode,h=m.getBoundingClientRect(),i&&h))this._cursorDiv.style.top=i.top-h.top+m.scrollTop+"px",this._cursorDiv.style.left=i.left-h.left+m.scrollLeft+"px"}else if(c.selection&&this._hasFocus)f=
c.body,b=a.createElement(c,"div"),f.appendChild(b),f.removeChild(b),b=f.createTextRange(),b.moveToElementText(h.parentNode),b.moveStart("character",g),h=f.createTextRange(),h.moveToElementText(i.parentNode),h.moveStart("character",m),b.setEndPoint("EndToStart",h),this._ignoreSelect=!1,b.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,b,c,d,e){if(this._selDiv1&&(c=this._selDiv1,c.style.width="0px",c.style.height="0px",c=this._selDiv2,c.style.width="0px",c.style.height="0px",c=this._selDiv3,
c.style.width="0px",c.style.height="0px",!(a===d&&b===e))){var f=this._model,h=this._getViewPadding(),g=this._clientDiv.getBoundingClientRect(),i=this._viewDiv.getBoundingClientRect(),c=i.left+h.left,m=g.right,h=i.top+h.top,n=g.bottom,i=g=0;this._clipDiv?(i=this._clipDiv.getBoundingClientRect(),g=i.left-this._clipDiv.scrollLeft):(i=this._rootDiv.getBoundingClientRect(),g=i.left);i=i.top;this._ignoreDOMSelection=!0;var a=(new r(this,a.lineIndex,a)).getBoundingClientRect(f.getLineStart(a.lineIndex)+
b,!1),o=a.left,e=(new r(this,d.lineIndex,d)).getBoundingClientRect(f.getLineStart(d.lineIndex)+e,!1),b=e.left;this._ignoreDOMSelection=!1;var f=this._selDiv1,o=Math.min(m,Math.max(c,o)),p=Math.min(n,Math.max(h,a.top)),j=m,d=Math.min(n,Math.max(h,a.bottom));f.style.left=o-g+"px";f.style.top=p-i+"px";f.style.width=Math.max(0,j-o)+"px";f.style.height=Math.max(0,d-p)+"px";if(a.top===e.top)j=Math.min(b,m),f.style.width=Math.max(0,j-o)+"px";else if(a=Math.min(n,Math.max(h,e.top)),b=Math.min(m,Math.max(c,
b)),h=Math.min(n,Math.max(h,e.bottom)),n=this._selDiv3,n.style.left=c-g+"px",n.style.top=a-i+"px",n.style.width=Math.max(0,b-c)+"px",n.style.height=Math.max(0,h-a)+"px",a-d>0)h=this._selDiv2,h.style.left=c-g+"px",h.style.top=d-i+"px",h.style.width=Math.max(0,m-c)+"px",h.style.height=Math.max(0,a-d)+"px"}},_setGrab:function(a){if(a!==this._grabControl)a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null)},
_setLinksVisible:function(b){if(this._linksVisible!==b){this._linksVisible=b;if(a.isIE&&b)this._hadFocus=this._hasFocus;var c=this._clientDiv;c.contentEditable=!b;this._hadFocus&&!b&&c.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=b?"-1":"1";for(b=this._getLineNext();b;){if(b.hasLink)for(c=b.firstChild;c;)if(c.ignore)c=c.nextSibling;else{var d=c.nextSibling,e=c.viewStyle;e&&e.tagName&&e.tagName.toLowerCase()==="a"&&b.replaceChild(b._line._createSpan(b,c.firstChild.data,e),c);c=d}b=this._getLineNext(b)}this._updateDOMSelection()}},
_setSelection:function(a,b,c,d,e){if(a){this._columnX=-1;c===void 0&&(c=!0);var f=this._selection;this._selection=a;b!==!1&&this._showCaret(!1,d,b,e);c&&this._updateDOMSelection();if(!f.equals(a))this.onSelection({type:"Selection",oldValue:{start:f.start,end:f.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,b,c,d){var e=this._model,f=this._getSelection(),b=this.convert({x:a,y:b},"page","document"),a=this._getLineIndex(b.y);if(this._clickCount===1){e=this._getLine(a);a=e.getOffset(b.x,
b.y-this._getLinePixel(a));e.destroy();if(d&&!c&&f.start<=a&&a<f.end)return this._dragOffset=a,!1;f.extend(a);c||f.collapse()}else(this._clickCount&1)===0?(e=this._getLine(a),a=e.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(c=this._doubleClickSelection.start,d=e.getNextOffset(a,{unit:"wordend",count:1})):(c=e.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(c=e.getNextOffset(a,{unit:"word",count:-1}),d=e.getNextOffset(c,
{unit:"wordend",count:1})),e.destroy()):this._doubleClickSelection?(d=e.getLineAtOffset(this._doubleClickSelection.start),a>=d?(c=e.getLineStart(d),d=e.getLineEnd(a)):(c=e.getLineStart(a),d=e.getLineEnd(d))):(c=e.getLineStart(a),d=e.getLineEnd(a)),f.setCaret(c),f.extend(d);this._setSelection(f,!0,!0);return!0},_setFullSelection:function(b,c){this._fullSelection=b;if(a.isWebkit)this._fullSelection=!0;var d=this._clipDiv||this._rootDiv;if(d)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&
!a.isIOS){var e=d.ownerDocument;this._highlightRGB=a.isWebkit?"transparent":"Highlight";var f=a.createElement(e,"div");this._selDiv1=f;f.style.position="absolute";f.style.borderWidth="0px";f.style.margin="0px";f.style.padding="0px";f.style.outline="none";f.style.background=this._highlightRGB;f.style.width="0px";f.style.height="0px";f.style.zIndex="0";d.appendChild(f);var h=a.createElement(e,"div");this._selDiv2=h;h.style.position="absolute";h.style.borderWidth="0px";h.style.margin="0px";h.style.padding=
"0px";h.style.outline="none";h.style.background=this._highlightRGB;h.style.width="0px";h.style.height="0px";h.style.zIndex="0";d.appendChild(h);this._selDiv3=e=a.createElement(e,"div");e.style.position="absolute";e.style.borderWidth="0px";e.style.margin="0px";e.style.padding="0px";e.style.outline="none";e.style.background=this._highlightRGB;e.style.width="0px";e.style.height="0px";e.style.zIndex="0";d.appendChild(e);if(a.isFirefox&&a.isMac){d=this._getWindow().getComputedStyle(e,null).getPropertyValue("background-color");
switch(d){case "rgb(119, 141, 168)":d="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":d="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":d="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":d="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":d="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":d="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":d="rgb(232, 184, 255)";break;default:d="rgb(180, 213, 255)"}this._highlightRGB=d;f.style.background=d;h.style.background=d;e.style.background=
d}c||this._updateDOMSelection()}}else{if(this._selDiv1)d.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)d.removeChild(this._selDiv2),this._selDiv2=null;if(this._selDiv3)d.removeChild(this._selDiv3),this._selDiv3=null}},_setBlockCursor:function(a){this._blockCursorVisible=a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var b=
a.createElement(document,"div");b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="&nbsp;";this._viewDiv.appendChild(b);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setTabSize:function(b,
c){this._tabSize=b;this._customTabSize=void 0;var d=this._clientDiv;if(a.isOpera){if(d)d.style.OTabSize=this._tabSize+""}else if(a.isWebkit>=537.1){if(d)d.style.tabSize=this._tabSize+""}else if(a.isFirefox>=4){if(d)d.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==8)this._customTabSize=this._tabSize;c||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var c="textview",d=this._theme.getThemeClass();d&&(c+=" "+d);this._themeClass&&d!==this._themeClass&&(c+=" "+this._themeClass);this._rootDiv.className=c;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var c=this._clientDiv,d=this._viewDiv;a?(c.style.whiteSpace="pre-wrap",c.style.wordWrap="break-word",d.style.overflowX="hidden",d.style.overflowY="scroll"):
(c.style.whiteSpace="pre",c.style.wordWrap="normal",d.style.overflowX="auto",d.style.overflowY="auto");b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,c,d){if(this._clientDiv){var e=this._model,f=this._getSelection(),h=this._getScroll(),g=f.getCaret(),i=f.start,m=f.end,n=e.getLineAtOffset(m),o=Math.max(Math.max(i,e.getLineStart(n)),m-1),e=this._getClientWidth(),n=this._getClientHeight(),p=e/4,j=this._getBoundsAtOffset(g===i?i:o),k=j.left,q=j.right,r=j.top,
s=j.bottom;a&&!f.isEmpty()&&(j=this._getBoundsAtOffset(g===m?i:o),j.top===r?g===i?q=k+Math.min(j.right-k,e):k=q-Math.min(q-j.left,e):g===i?s=r+Math.min(j.bottom-r,n):r=s-Math.min(s-j.top,n));a=0;k<h.x&&(a=Math.min(k-h.x,-p));q>h.x+e&&(a=Math.max(q-h.x-e,p));f=0;r<h.y?f=r-h.y:s>h.y+n&&(f=s-h.y-n);d&&(d>0?f>0&&(f=Math.max(f,d)):f<0&&(f=Math.min(f,d)));if(a!==0||f!==0)return f!==0&&typeof c==="number"&&(c<0&&(c=0),c>1&&(c=1),f+=Math.floor(f>0?c*n:-c*n)),this._scrollViewAnimated(a,f,b),n!==this._getClientHeight()||
e!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else b&&b();return!1}},_startIME:function(){if(this._imeOffset===-1){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);
this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a],c=b.target,d=b.type,b=b.handler;typeof c.removeEventListener==="function"?c.removeEventListener(d,b,!1):c.detachEvent("on"+d,b)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,c=b.getLineAtOffset(a.start),d=b.getLineAtOffset(a.end),
e=this._getLineNext();if(e){var f=this._getLinePrevious(),h;c<e.lineIndex?(h=e,c=0):c>f.lineIndex?(h=f,c=0):(h=this._getLineNode(c),c=a.start-b.getLineStart(c));d<e.lineIndex?b=0:d>f.lineIndex?(e=f,b=0):(e=this._getLineNode(d),b=a.end-b.getLineStart(d));this._setDOMSelection(h,c,e,b,a.caret)}}},_update:function(b){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=null,b=!1;var c=this._clientDiv;if(c){if(this._metrics.invalid)this._ignoreQueueUpdate=
!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var d=this._model,e=this._getScroll(!1),f=this._getViewPadding(),h=d.getLineCount(),g=this._getLineHeight(),i=this._getClientWidth();if(this._wrapMode)c.style.width=i+"px";var m,n,o,p,j=0,k=0;if(this._lineHeight){for(;k<h;){n=this._getLineHeight(k);if(j+n>e.y)break;j+=n;k++}m=k;n=Math.max(0,m-1);o=d=e.y-j;m>0&&(d+=this._getLineHeight(m-1))}else p=Math.max(0,e.y)/g,m=Math.floor(p),n=Math.max(0,m-1),d=Math.round((p-n)*g),o=Math.round((p-m)*g);this._topIndexY=
o;p=this._parent;var q=p.clientWidth,s=p.clientHeight;p=this._getClientHeight();if(b){g=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),g=m.right-m.left);m=i;for(this._wrapMode||(m=Math.max(this._maxLineWidth,m));k<h;)n=this._getLineHeight(k,!1),j+=n,k++;h=j}else{i=this._viewDiv;o=Math.min(m+Math.floor((p+o)/g),h-1);for(var e=Math.min(o+1,h-1),t,x=c.firstChild;x;){t=x.lineIndex;var D=x.nextSibling;if(!(n<=t&&t<=e)||x.lineRemoved||x.lineIndex===-1)this._mouseWheelLine===x?(x.style.display=
"none",x.lineIndex=-1):c.removeChild(x);x=D}var x=this._getLineNext(),D=i.ownerDocument,F=D.createDocumentFragment();for(t=n;t<=e;t++)if(!x||x.lineIndex>t)(new r(this,t)).create(F,null);else{F.firstChild&&(c.insertBefore(F,x),F=D.createDocumentFragment());if(x&&x.lineChanged)x=(new r(this,t)).create(F,x),x.lineChanged=!1;x=this._getLineNext(x)}F.firstChild&&c.insertBefore(F,x);if(a.isWebkit&&!this._wrapMode)c.style.width="0x7fffffffpx";x=this._getLineNext();t=p+d;for(F=!1;x;){n=x.lineWidth;if(n===
void 0)if(D=x._line.getBoundingClientRect(),n=x.lineWidth=Math.ceil(D.right-D.left),D=D.bottom-D.top,this._lineHeight)this._lineHeight[x.lineIndex]=D;else if(g!==0&&D!==0&&Math.ceil(g)!==Math.ceil(D))this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[x.lineIndex]=D;if(this._lineHeight&&!F&&(t-=this._lineHeight[x.lineIndex],t<0))o=x.lineIndex,F=!0;if(!this._wrapMode){if(n>=this._maxLineWidth)this._maxLineWidth=n,this._maxLineIndex=x.lineIndex;if(this._checkMaxLineIndex===x.lineIndex)this._checkMaxLineIndex=
-1}if(x.lineIndex===m)this._topChild=x;if(x.lineIndex===o)this._bottomChild=x;x=this._getLineNext(x)}if(this._checkMaxLineIndex!==-1&&(t=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=t&&t<h)){g=new r(this,t);D=g.getBoundingClientRect();n=D.right-D.left;if(n>=this._maxLineWidth)this._maxLineWidth=n,this._maxLineIndex=t;g.destroy()}for(;k<h;)n=this._getLineHeight(k,k<=o),j+=n,k++;h=j;this._updateRuler(this._leftDiv,m,e,s);this._updateRuler(this._rightDiv,m,e,s);g=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),
g=m.right-m.left);e=0;this._rightDiv&&(e=this._rightDiv.getBoundingClientRect(),e=e.right-e.left);i.style.left=g+"px";i.style.right=e+"px";e=this._scrollDiv;e.style.height=h+"px";j=i=this._getClientWidth();this._wrapMode||(j=Math.max(this._maxLineWidth,j));m=j;if((!a.isIE||a.isIE>=9)&&this._maxLineWidth>i)j+=f.right+f.left;e.style.width=j+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=j+"px";e=this._getScroll(!1)}if(this._vScrollDiv)j=p-8,k=Math.max(15,Math.ceil(Math.min(1,j/(h+f.top+
f.bottom))*j)),this._vScrollDiv.style.left=g+i-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,e.y*j/h))+"px",this._vScrollDiv.style.height=k+"px";if(!this._wrapMode&&this._hScrollDiv)j=i-8,k=Math.max(15,Math.ceil(Math.min(1,j/(this._maxLineWidth+f.left+f.right))*j)),this._hScrollDiv.style.left=g+Math.floor(Math.max(0,Math.floor(e.x*j/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=p-9+"px",this._hScrollDiv.style.width=k+"px";x=e.x;n=this._clipDiv;j=this._overlayDiv;if(n){n.scrollLeft=
x;n.scrollTop=0;k=g+f.left;o=f.top;b=i;g=p;x=0;t=-d;if(e.x===0)k-=f.left,b+=f.left,x=f.left;e.x+i===m&&(b+=f.right);e.y===0&&(o-=f.top,g+=f.top,t+=f.top);e.y+p===h&&(g+=f.bottom);n.style.left=k+"px";n.style.top=o+"px";n.style.right=q-b-k+"px";n.style.bottom=s-g-o+"px";c.style.left=x+"px";c.style.top=t+"px";c.style.width=m+"px";c.style.height=p+d+"px";if(j)j.style.left=c.style.left,j.style.top=c.style.top,j.style.width=c.style.width,j.style.height=c.style.height}else{k=x;o=d;q=x+i;s=d+p;k===0&&(k-=
f.left);o===0&&(o-=f.top);q===m&&(q+=f.right);e.y+p===h&&(s+=f.bottom);c.style.clip="rect("+o+"px,"+q+"px,"+s+"px,"+k+"px)";c.style.left=-x+g+f.left+"px";c.style.width=(a.isWebkit?m:i+x)+"px";if(!b)c.style.top=-d+f.top+"px",c.style.height=p+d+"px";if(j&&(j.style.clip=c.style.clip,j.style.left=c.style.left,j.style.width=c.style.width,!b))j.style.top=c.style.top,j.style.height=c.style.height}this._updateDOMSelection();c=this._ensureCaretVisible;this._ensureCaretVisible=!1;p!==this._getClientHeight()&&
(this._update(),c&&this._showCaret())}}},_updateRuler:function(b,c,d,e){if(b)for(var f=this._parent.ownerDocument,h=this._getLineHeight(),g=this._getViewPadding(),b=b.firstChild;b;){var m=b._ruler,n=h,o=m.getOverview();o==="page"&&(n+=this._topIndexY);b.style.top=-n+"px";b.style.height=e+n+"px";b.rulerChanged&&i(m.getRulerStyle(),b);var p,j=b.firstChild;j?(p=j,j=j.nextSibling):(p=a.createElement(f,"div"),p.style.visibility="hidden",b.appendChild(p));var k;if(b.rulerChanged&&p){n=-1;if(k=m.getWidestAnnotation())if(i(k.style,
p),k.html)p.innerHTML=k.html;p.lineIndex=n;p.style.height=h+g.top+"px"}var q;if(o==="page"){for(m=m.getAnnotations(c,d+1);j;)n=j.lineIndex,k=j.nextSibling,(!(c<=n&&n<=d)||j.lineChanged)&&b.removeChild(j),j=k;j=b.firstChild.nextSibling;q=f.createDocumentFragment();for(n=c;n<=d;n++)if(!j||j.lineIndex>n){p=a.createElement(f,"div");if(k=m[n]){i(k.style,p);if(k.html)p.innerHTML=k.html;p.annotation=k}p.lineIndex=n;p.style.height=this._getLineHeight(n)+"px";q.appendChild(p)}else if(q.firstChild&&(b.insertBefore(q,
j),q=f.createDocumentFragment()),j)j=j.nextSibling;q.firstChild&&b.insertBefore(q,j)}else{k=this._getClientHeight();n=this._model.getLineCount();j=k+g.top+g.bottom-2*this._metrics.scrollWidth;o=h*n<j?h:j/n;if(b.rulerChanged){for(k=b.childNodes.length;k>1;)b.removeChild(b.lastChild),k--;m=m.getAnnotations(0,n);q=f.createDocumentFragment();for(var r in m)if(n=r>>>0,!(n<0)){p=a.createElement(f,"div");k=m[r];i(k.style,p);p.style.position="absolute";p.style.top=this._metrics.scrollWidth+h+Math.floor(n*
o)+"px";if(k.html)p.innerHTML=k.html;p.annotation=k;p.lineIndex=n;q.appendChild(p)}b.appendChild(q)}else if(b._oldTrackHeight!==j)for(p=b.firstChild?b.firstChild.nextSibling:null;p;)p.style.top=this._metrics.scrollWidth+h+Math.floor(p.lineIndex*o)+"px",p=p.nextSibling;b._oldTrackHeight=j}b.rulerChanged=!1;b=b.nextSibling}},_updateStyleSheet:function(){var b="";a.isWebkit&&this._metrics.scrollWidth>0&&(b+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");a.isFirefox&&a.isMac&&this._highlightRGB&&
this._highlightRGB!=="Highlight"&&(b+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(b){var c=document.getElementById("_textviewStyle");if(c)c.removeChild(c.firstChild),c.appendChild(document.createTextNode(b));else{c=a.createElement(document,"style");c.id="_textviewStyle";var d=document.getElementsByTagName("head")[0]||document.documentElement;c.appendChild(document.createTextNode(b));d.insertBefore(c,d.firstChild)}}},_updateStyle:function(b){if(!b&&a.isIE)this._rootDiv.style.lineHeight=
"normal";var c=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=a.isIE?c.lineHeight-(c.lineTrim.top+c.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();b||(this.redraw(),this._resetLineWidth())}};d.EventTarget.addMixin(s.prototype);return{TextView:s}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(g,k){function j(d){this._model=d;this._projections=[]}j.prototype={addProjection:function(d){if(d){var c=this._model,a=this._projections;d._lineIndex=c.getLineAtOffset(d.start);d._lineCount=c.getLineAtOffset(d.end)-d._lineIndex;var b=d.text;b||(b="");d._model=typeof b==="string"?new g.TextModel(b,c.getLineDelimiter()):b;var c=this.mapOffset(d.start,!0),b=d.end-d.start,i=d._lineCount,h=d._model.getCharCount(),
f=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:d._model.getText(),start:c,removedCharCount:b,addedCharCount:h,removedLineCount:i,addedLineCount:f});var e=this._binarySearch(a,d.start);a.splice(e,0,d);this.onChanged({type:"Changed",start:c,removedCharCount:b,addedCharCount:h,removedLineCount:i,addedLineCount:f})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(d,c){var a=this._projections,b=0,g,h;if(c){for(g=
0;g<a.length;g++){h=a[g];if(h.start>d)break;if(h.end>d)return-1;b+=h._model.getCharCount()-(h.end-h.start)}return d+b}for(g=0;g<a.length;g++){h=a[g];if(h.start>d-b)break;var f=h._model.getCharCount();if(h.start+f>d-b)return-1;b+=f-(h.end-h.start)}return d-b},removeProjection:function(d){var c,a=0;for(c=0;c<this._projections.length;c++){var b=this._projections[c];if(b===d){d=b;break}a+=b._model.getCharCount()-(b.end-b.start)}if(c<this._projections.length){var b=this._model,a=d.start+a,g=d.end-d.start,
h=d._lineCount,f=d._model.getCharCount(),e=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:b.getText(d.start,d.end),start:a,removedCharCount:f,addedCharCount:g,removedLineCount:e,addedLineCount:h});this._projections.splice(c,1);this.onChanged({type:"Changed",start:a,removedCharCount:f,addedCharCount:g,removedLineCount:e,addedLineCount:h})}},_binarySearch:function(d,c){for(var a=d.length,b=-1,g;a-b>1;)g=Math.floor((a+b)/2),c<=d[g].start?a=g:b=g;return a},getCharCount:function(){for(var d=
this._model.getCharCount(),c=this._projections,a=0;a<c.length;a++){var b=c[a];d+=b._model.getCharCount()-(b.end-b.start)}return d},getLine:function(d,c){if(d<0)return null;var a=this._model,b=this._projections,g=0,h=[],f=0,e,n,o;for(e=0;e<b.length;e++){o=b[e];if(o._lineIndex>=d-g)break;n=o._model.getLineCount()-1;if(o._lineIndex+n>=d-g)if(f=d-(o._lineIndex+g),f<n)return o._model.getLine(f,c);else h.push(o._model.getLine(n));f=o.end;g+=n-o._lineCount}for(f=Math.max(f,a.getLineStart(d-g));e<b.length;e++){o=
b[e];if(o._lineIndex>d-g)break;h.push(a.getText(f,o.start));n=o._model.getLineCount()-1;if(o._lineIndex+n>d-g)return h.push(o._model.getLine(0,c)),h.join("");h.push(o._model.getText());f=o.end;g+=n-o._lineCount}b=a.getLineEnd(d-g,c);f<b&&h.push(a.getText(f,b));return h.join("")},getLineAtOffset:function(d){for(var c=this._model,a=this._projections,b=0,g=0,h=0;h<a.length;h++){var f=a[h];if(f.start>d-b)break;var e=f._model.getCharCount();if(f.start+e>d-b){a=d-(f.start+b);g+=f._model.getLineAtOffset(a);
b+=a;break}g+=f._model.getLineCount()-1-f._lineCount;b+=e-(f.end-f.start)}return c.getLineAtOffset(d-b)+g},getLineCount:function(){for(var d=this._projections,c=this._model.getLineCount(),a=0;a<d.length;a++){var b=d[a];c+=b._model.getLineCount()-1-b._lineCount}return c},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,c){if(d<0)return-1;for(var a=this._model,b=this._projections,g=0,h=0,f=0;f<b.length;f++){var e=b[f];if(e._lineIndex>d-g)break;var n=e._model.getLineCount()-
1;if(e._lineIndex+n>d-g)return e._model.getLineEnd(d-(e._lineIndex+g),c)+e.start+h;h+=e._model.getCharCount()-(e.end-e.start);g+=n-e._lineCount}return a.getLineEnd(d-g,c)+h},getLineStart:function(d){if(d<0)return-1;for(var c=this._model,a=this._projections,b=0,g=0,h=0;h<a.length;h++){var f=a[h];if(f._lineIndex>=d-b)break;var e=f._model.getLineCount()-1;if(f._lineIndex+e>=d-b)return f._model.getLineStart(d-(f._lineIndex+b))+f.start+g;g+=f._model.getCharCount()-(f.end-f.start);b+=e-f._lineCount}return c.getLineStart(d-
b)+g},getText:function(d,c){d===void 0&&(d=0);var a=this._model,b=this._projections,g=0,h=[],f,e,n;for(f=0;f<b.length;f++){e=b[f];if(e.start>d-g)break;n=e._model.getCharCount();if(e.start+n>d-g)if(c!==void 0&&e.start+n>c-g)return e._model.getText(d-(e.start+g),c-(e.start+g));else h.push(e._model.getText(d-(e.start+g))),d=e.end+g+n-(e.end-e.start);g+=n-(e.end-e.start)}var o=d-g;if(c!==void 0){for(;f<b.length;f++){e=b[f];if(e.start>c-g)break;h.push(a.getText(o,e.start));n=e._model.getCharCount();if(e.start+
n>c-g)return h.push(e._model.getText(0,c-(e.start+g))),h.join("");h.push(e._model.getText());o=e.end;g+=n-(e.end-e.start)}h.push(a.getText(o,c-g))}else{for(;f<b.length;f++)e=b[f],h.push(a.getText(o,e.start)),h.push(e._model.getText()),o=e.end;h.push(a.getText(o))}return h.join("")},_onChanging:function(d,c,a,b,g,h){for(var f=this._model,e=this._projections,n,o=0,p,m=c+a;n<e.length;n++){a=e[n];if(a.start>c)break;o+=a._model.getCharCount()-(a.end-a.start)}c+=o;for(var j=n;n<e.length;n++){a=e[n];if(a.start>
m)break;o+=a._model.getCharCount()-(a.end-a.start);p+=a._model.getLineCount()-1-a._lineCount}a=m+o;o=n;this.onChanging(c,a-c,b,g+p,h);e.splice(e,o-j);for(d=d.length-(a-c);n<e.length;n++)a=e[n],a.start+=d,a.end+=d,a._lineIndex=f.getLineAtOffset(a.start)},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},setLineDelimiter:function(d){this._model.setLineDelimiter(d)},setText:function(d,c,a){d===void 0&&(d="");c===void 0&&(c=0);var b=c,g=a,h=this._model,
f=this._projections,e=0,n=0,o,p,m,j,k,s=0;for(o=0;o<f.length;o++){p=f[o];if(p.start>c-e)break;m=p._model.getCharCount();if(p.start+m>c-e)if(a!==void 0&&p.start+m>a-e){p._model.setText(d,c-(p.start+e),a-(p.start+e));return}else s=p._model.getLineCount()-1-p._model.getLineAtOffset(c-(p.start+e)),j={projection:p,start:c-(p.start+e)},c=p.end+e+m-(p.end-p.start);n+=p._model.getLineCount()-1-p._lineCount;e+=m-(p.end-p.start)}c-=e;var t=o,s=h.getLineAtOffset(c)+n-s;if(a!==void 0)for(;o<f.length;o++){p=f[o];
if(p.start>a-e)break;m=p._model.getCharCount();if(p.start+m>a-e){n+=p._model.getLineAtOffset(a-(p.start+e));m=a-(p.start+e);a=p.end+e;k={projection:p,end:m};break}n+=p._model.getLineCount()-1-p._lineCount;e+=m-(p.end-p.start)}else{for(;o<f.length;o++)p=f[o],n+=p._model.getLineCount()-1-p._lineCount,e+=p._model.getCharCount()-(p.end-p.start);a=g=h.getCharCount()+e}a-=e;p=h.getLineAtOffset(a)+n;g-=b;for(var n=p-s,s=d.length,l=m=p=e=0;;){p!==-1&&p<=l&&(p=d.indexOf("\r",l));m!==-1&&m<=l&&(m=d.indexOf("\n",
l));if(m===-1&&p===-1)break;l=p!==-1&&m!==-1?p+1===m?m+1:(p<m?p:m)+1:p!==-1?p+1:m+1;e++}this.onChanging({type:"Changing",text:d,start:b,removedCharCount:g,addedCharCount:s,removedLineCount:n,addedLineCount:e});h.setText(d,c,a);if(j)p=j.projection,p._model.setText("",j.start);if(k)p=k.projection,p._model.setText("",0,k.end),p.start=p.end,p._lineCount=0;f.splice(t,o-t);for(d=d.length-(a-c);o<f.length;o++)p=f[o],p.start+=d,p.end+=d,p._lineIndex=h.getLineAtOffset(p.start);this.onChanged({type:"Changed",
start:b,removedCharCount:g,addedCharCount:s,removedLineCount:n,addedLineCount:e})}};k.EventTarget.addMixin(j.prototype);return{ProjectionTextModel:j}});
define("orion/editor/tooltip",["i18n!orion/editor/nls/messages","orion/editor/textView","orion/editor/textModel","orion/editor/projectionTextModel","orion/util"],function(g,k,j,d,c){function a(a){this._view=a;this._create(a.getOptions("parent").ownerDocument);a.addEventListener("Destroy",this,this.destroy)}a.getTooltip=function(b){if(!b._tooltip)b._tooltip=new a(b);return b._tooltip};a.prototype={_create:function(a){if(!this._tooltipDiv){var d=this._tooltipDiv=c.createElement(a,"div");d.className=
"textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var h=this._tooltipContents=c.createElement(a,"div");d.appendChild(h);a.body.appendChild(d);this.hide()}},_getWindow:function(){var a=this._tooltipDiv.ownerDocument;return a.defaultView||a.parentWindow},destroy:function(){if(this._tooltipDiv){this.hide();var a=this._tooltipDiv.parentNode;a&&a.removeChild(this._tooltipDiv);this._tooltipDiv=null}},hide:function(){if(this._contentsView)this._contentsView.destroy(),
this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";if(this._tooltipDiv)this._tooltipDiv.style.visibility="hidden";var a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),this._showTimeout=null;if(this._hideTimeout)a.clearTimeout(this._hideTimeout),this._hideTimeout=null;if(this._fadeTimeout)a.clearInterval(this._fadeTimeout),this._fadeTimeout=null},isVisible:function(){return this._tooltipDiv&&this._tooltipDiv.style.visibility==="visible"},setTarget:function(a,
c){if(this.target!==a&&(this._target=a,this.hide(),a)){var d=this;if(c===0)d.show(!0);else{var f=this._getWindow();d._showTimeout=f.setTimeout(function(){d.show(!0)},c?c:500)}}},show:function(a){if(this._target){var c=this._target.getTooltipInfo();if(c){var h=this._tooltipDiv,f=this._tooltipContents;h.style.left=h.style.right=h.style.width=h.style.height=f.style.width=f.style.height="auto";var e=c.contents;e instanceof Array&&(e=this._getAnnotationContents(e));if(typeof e==="string")f.innerHTML=e;
else if(this._isNode(e))f.appendChild(e);else if(e instanceof d.ProjectionTextModel){var g=this._view,o=g.getOptions();o.wrapMode=!1;o.parent=f;var p=o.themeClass;p?((p=p.replace("tooltip",""))&&(p=" "+p),p="tooltip"+p):p="tooltip";o.themeClass=p;o=this._contentsView=new k.TextView(o);o._clientDiv.contentEditable=!1;o.addEventListener("LineStyle",function(a){g.onLineStyle(a)});o.setModel(e);e=o.computeSize();f.style.width=e.width+"px";f.style.height=e.height+"px";o.resize()}else return;f=h.ownerDocument.documentElement;
c.anchor==="right"?(e=f.clientWidth-c.x,h.style.right=e+"px"):(e=parseInt(this._getNodeStyle(h,"padding-left","0"),10),e+=parseInt(this._getNodeStyle(h,"border-left-width","0"),10),e=c.x-e,h.style.left=e+"px");h.style.maxWidth=f.clientWidth-e-10+"px";e=parseInt(this._getNodeStyle(h,"padding-top","0"),10);e+=parseInt(this._getNodeStyle(h,"border-top-width","0"),10);e=c.y-e;h.style.top=e+"px";h.style.maxHeight=f.clientHeight-e-10+"px";h.style.opacity="1";h.style.visibility="visible";if(a){var m=this,
j=this._getWindow();m._hideTimeout=j.setTimeout(function(){var a=parseFloat(m._getNodeStyle(h,"opacity","1"));m._fadeTimeout=j.setInterval(function(){h.style.visibility==="visible"&&a>0?(a-=0.1,h.style.opacity=a):m.hide()},50)},5E3)}}}},_getAnnotationContents:function(a){function c(a){var b=a.title;if(b==="")return null;var d="<div>";a.html&&(d+=a.html+"&nbsp;");if(!b)b=a.end,a=f.getLineStart(f.getLineAtOffset(a.start)),b=f.getLineEnd(f.getLineAtOffset(b),!0),b=f.getText(a,b);b=b.replace(/</g,"&lt;").replace(/>/g,
"&gt;");d+="<span style='vertical-align:middle;'>"+b+"</span><div>";return d}if(a.length===0)return null;var h=this._view.getModel(),f=h.getBaseModel?h.getBaseModel():h;if(a.length===1)if(h=a[0],h.title!==void 0)return c(h);else{var a=new d.ProjectionTextModel(f),e=f.getLineStart(f.getLineAtOffset(h.start)),n=f.getCharCount();h.end!==n&&a.addProjection({start:h.end,end:n});e>0&&a.addProjection({start:0,end:e});return a}else{e="<div><em>"+g.multipleAnnotations+"</em></div>";for(n=0;n<a.length;n++)h=
a[n],(h=c(h))&&(e+=h);return e}},_getNodeStyle:function(a,c,d){var f;if(a&&(f=a.style[c],!f))if(a.currentStyle){for(f=0;(f=c.indexOf("-",f))!==-1;)c=c.substring(0,f)+c.substring(f+1,f+2).toUpperCase()+c.substring(f+2);f=a.currentStyle[c]}else f=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(c):null;return f||d},_isNode:function(a){return typeof Node==="object"?a instanceof Node:a&&typeof a==="object"&&typeof a.nodeType==="number"&&typeof a.nodeName==="string"}};return{Tooltip:a}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/regex,orion/objects,orion/util".split(","),function(g,k,j,d,c,a,b){function i(a){var b=a.getTextView();j.KeyMode.call(this,b);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";b.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));b.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var b=d.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=d._prefix.match(RegExp("^"+c.escape(e),"i")))&&e.length>0)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.setActive(!1)}}}function h(a,b,c){if(a){this._editor=a;this._undoStack=b;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var d=this;this._listeners={onEditorFocus:function(a){d._removeCurrentAnnotation(a)}};this.setOptions(c)}}var f={};i.prototype=new j.KeyMode;a.mixin(i.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});b.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});b.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});b.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});b.push({actionID:"incrementalFind",keyBinding:new a(40)});b.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});b.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return b},find:function(a,b){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var c=this._prefix;if(c.length===0)return!1;var d=this.editor,f=d.getModel(),f=a?this._success?b?this._start:d.getCaretOffset()+
1:0:this._success?b?this._start:d.getCaretOffset():f.getCharCount()-1;if(c=d.getModel().find({string:c,start:f,reverse:!a,caseInsensitive:c.toLowerCase()===c}).next()){if(!b)this._start=f;this._ignoreSelection=this._success=!0;d.moveSelection(a?c.start:c.end,a?c.end:c.start);this._ignoreSelection=!1}else this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){if(this._active!==a)this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status()},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return a.length===0?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?g.incrementalFindStr:g.incrementalFindStrNotFound:this._success?g.incrementalFindReverseStr:g.incrementalFindReverseStrNotFound;a=b.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
f.IncrementalFind=i;h.prototype={find:function(a,b,c){this.setOptions({reverse:!a});var d=this.getFindString(),f;if(b)d=b.findString||d,f=b.count;a=this.getOptions();this.setOptions(b);b=c?this._startOffset:this.getStartOffset();if((f=this._doFind(d,b,f))&&!c)this._startOffset=f.start;this.setOptions(a);this._hideAfterFind&&this.hide();return f},getStartOffset:function(){return this._start!==void 0?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection();return this._editor.getText(a.start,a.end)||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},hide:function(){this._visible=!1;
if(this._savedOptions&&(this.setOptions(this._savedOptions.pop()),this._savedOptions.length===0))this._savedOptions=null;this._removeAllAnnotations();this._editor.getTextView().removeEventListener("Focus",this._listeners.onEditorFocus);this._editor.getTextView().focus()},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,c=this.getReplaceString(),d=b.getSelection().start;if(b=b.getModel().find({string:a,start:d,reverse:!1,wrap:this._wrap,
regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),this._doReplace(b.start,b.end,a,c),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var c=this._editor,d=c.getTextView();c.reportStatus(g.replaceAll);var f=this.getReplaceString(),h=this;window.setTimeout(function(){for(var i=0,j=0;;){var k=h._doFind(a,i);if(!k)break;j++;j===1&&(d.setRedraw(!1),
h.startUndo());h._doReplace(k.start,k.end,a,f);i=h.getStartOffset()}j>0&&(h.endUndo(),d.setRedraw(!0));i>0?c.reportStatus(b.formatMessage(g.replacedMatches,j)):c.reportStatus(g.nothingReplaced,"error");h._replacingAll=!1},100)}},setOptions:function(a){if(a){if((a.showAll===!0||a.showAll===!1)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var b=this._editor.getAnnotationModel();b&&b.removeAnnotations(d.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(a.caseInsensitive===
!0||a.caseInsensitive===!1)this._caseInsensitive=a.caseInsensitive;if(a.wrap===!0||a.wrap===!1)this._wrap=a.wrap;if(a.wholeWord===!0||a.wholeWord===!1)this._wholeWord=a.wholeWord;if(a.incremental===!0||a.incremental===!1)this._incremental=a.incremental;if(a.regex===!0||a.regex===!1)this._regex=a.regex;if(a.findAfterReplace===!0||a.findAfterReplace===!1)this._findAfterReplace=a.findAfterReplace;if(a.hideAfterFind===!0||a.hideAfterFind===!1)this._hideAfterFind=a.hideAfterFind;if(a.reverse===!0||a.reverse===
!1)this._reverse=a.reverse;if(a.hasOwnProperty("findCallback"))this._findCallback=a.findCallback;if(a.hasOwnProperty("start"))this._start=a.start;if(a.hasOwnProperty("end"))this._end=a.end}},show:function(a){this._visible=!0;if(a){if(!this._savedOptions)this._savedOptions=[];this._savedOptions.push(this.getOptions());this.setOptions(a)}this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var b=this;window.setTimeout(function(){b._incremental&&
b.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_doFind:function(a,b,c){var c=c||1,f=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;for(var a=f.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}),h,b=0;b<c&&a.hasNext();b++)h=
a.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(g.notFound,"error");if(this.isVisible()){c=d.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(a=f.getAnnotationModel())a.removeAnnotations(c),h&&a.addAnnotation(d.AnnotationType.createAnnotation(c,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var i=this;this._timer=window.setTimeout(function(){i._markAllOccurrences();i._timer=null},500)}}this._findCallback?this._findCallback(h):
h&&f.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,b,c,d){var f=this._editor;if(this._regex&&(d=f.getText(a,b).replace(RegExp(c,this._caseInsensitive?"i":""),d),!d))return;f.setText(d,a,b);f.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=d.AnnotationType.ANNOTATION_MATCHING_SEARCH,c=a.getAnnotations(0,a.getTextModel().getCharCount()),f=[],h;c.hasNext();){var g=c.next();g.type===b&&f.push(g)}if(this.isVisible()){c=
this.getFindString();c=this._editor.getModel().find({string:c,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(h=[];c.hasNext();)g=c.next(),h.push(d.AnnotationType.createAnnotation(b,g.start,g.end))}a.replaceAnnotations(f,h)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(d.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(){var a=
this._editor.getAnnotationModel();a&&a.removeAnnotations(d.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};f.Find=h;return f});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(g,k,j,d,c,a){function b(a,b,d){this.editor=a;this.undoStack=b;this._incrementalFind=new c.IncrementalFind(a);this._find=d?d:new c.Find(a,b);this._lastEditLocation=null;this.init()}function i(a,b,c,d){this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var h={};b.prototype={init:function(){var b=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};b.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);b.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:g.undo});b.setAction("redo",function(){return this.undoStack?(this.undoStack.redo(),
!0):!1}.bind(this),{name:g.redo});b.setKeyBinding(new k.KeyBinding("f",!0),"find");b.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(g.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:g.find});b.setKeyBinding(new k.KeyBinding("k",!0),"findNext");b.setAction("findNext",function(a){return this._find?(this._find.find(!0,a),!0):!1}.bind(this),{name:g.findNext});b.setKeyBinding(new k.KeyBinding("k",!0,!0),"findPrevious");
b.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:g.findPrevious});b.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");b.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:g.incrementalFind});b.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");b.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),
{name:g.incrementalFindReverse});b.setAction("tab",function(){return this.indentLines()}.bind(this));b.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:g.unindentLines});b.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");b.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:g.moveLinesUp});b.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");b.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:g.moveLinesDown});
b.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");b.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:g.copyLinesUp});b.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");b.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:g.copyLinesDown});b.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");b.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:g.deleteLines});b.setKeyBinding(new k.KeyBinding("l",
!a.isMac,!1,!1,a.isMac),"gotoLine");b.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:g.gotoLine});b.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");b.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:g.nextAnnotation});b.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");b.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:g.prevAnnotation});b.setKeyBinding(new k.KeyBinding("e",
!0,!1,!0,!1),"expand");b.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:g.expand});b.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");b.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:g.collapse});b.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");b.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:g.expandAll});b.setKeyBinding(new k.KeyBinding("c",!0,!0,!0,!1),"collapseAll");
b.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:g.collapseAll});b.setKeyBinding(new k.KeyBinding("q",!a.isMac,!1,!1,a.isMac),"lastEdit");b.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:g.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),h=b.getLineStart(d),
d=b.getLineEnd(c,!0),g=b.getLineCount(),i="",h=b.getText(h,d);c===g-1&&(h=(i=b.getLineDelimiter())+h);a.setText(h,d,d);a.setSelection(d+i.length,d+h.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),c=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),d=b.getLineStart(d),h=b.getLineEnd(c,!0),g=b.getLineCount(),i="",h=b.getText(d,h);c===g-1&&(h+=i=b.getLineDelimiter());a.setText(h,
d,d);a.setSelection(d,d+h.length-i.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var c=1;if(a&&a.count)c=a.count;var d=b.getSelection(),h=b.getModel(),g=h.getLineAtOffset(d.start),a=h.getLineStart(g),c=d.start!==d.end||c===1?h.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(g+c-1,h.getLineCount()-1),c=h.getLineEnd(c,!0);b.setText("",a,c);return!0},expandAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;
var d=b.getModel(),h=b.getCaretOffset(),g=d.getLineAtOffset(h),h=d.getLineStart(g),g=d.getLineEnd(g,!0);d.getBaseModel&&(h=d.mapOffset(h),g=d.mapOffset(g),d.getBaseModel());for(var i,d=c.getAnnotations(h,g);!i&&d.hasNext();)h=d.next(),h.type===j.AnnotationType.ANNOTATION_FOLDING&&(i=h);i&&a!==i.expanded&&(a?i.expand():(b.setCaretOffset(i.start),i.collapse()),c.modifyAnnotation(i));return!0},expandAnnotations:function(a){var b=this.editor,c=b.getTextView(),d=b.getAnnotationModel();if(!d)return!0;var b=
b.getModel(),h=d.getAnnotations(0,b.getCharCount());for(c.setRedraw(!1);h.hasNext();)b=h.next(),b.type===j.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),d.modifyAnnotation(b));c.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var c=a.getModel(),d=a.getSelection(),h=c.getLineAtOffset(d.start),g=c.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(h!==g){var i=[];i.push("");
for(var j=h;j<=g;j++)i.push(c.getLine(j,!0));j=c.getLineStart(h);c=c.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(i.join(b),j,c);a.setSelection(j===d.start?d.start:d.start+b.length,d.end+(g-h+1)*b.length);return!0}return!1}},gotoLastEdit:function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,b=a.getModel().getLineAtOffset(a.getCaretOffset());
if(b=prompt(g.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),h=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount();if(h===g-1)return!0;var d=b.getLineStart(d),c=b.getLineEnd(h,!0),i=b.getLineEnd(h+1,!0)-(c-d),j=0;h!==g-2?b=b.getText(d,c):(h=b.getLineEnd(h),b=b.getText(h,c)+b.getText(d,h),j+=c-h);this.startUndo();
a.setText("",d,c);a.setText(b,i,i);a.setSelection(i+j,i+j+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start);if(d===0)return!0;var h=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=b.getLineCount(),c=b.getLineStart(d-1),i=b.getLineStart(d),j=b.getLineEnd(h,!0),k=b.getText(i,j),t=0;h===g-1&&(h=b.getLineEnd(d-1),d=b.getLineEnd(d-1,!0),k+=b.getText(h,d),i=h,
t=d-h);this.startUndo();a.setText("",i,j);a.setText(k,c,c);a.setSelection(c,c+k.length-t);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,c=b.getAnnotationModel();if(!c)return!0;for(var h=b.getModel(),g=b.getCaretOffset(),c=c.getAnnotations(a?g:0,a?h.getCharCount():g),i=null;c.hasNext();){var k=c.next();if(a){if(k.start<=g)continue}else if(k.start>=g)continue;switch(k.type){case j.AnnotationType.ANNOTATION_ERROR:case j.AnnotationType.ANNOTATION_WARNING:case j.AnnotationType.ANNOTATION_TASK:case j.AnnotationType.ANNOTATION_BOOKMARK:break;
default:continue}i=k;if(a)break}if(i){var r=b.getTextView(),s=h.getLineAtOffset(i.start),t=d.Tooltip.getTooltip(r);if(!t)return b.moveSelection(i.start),!0;b.moveSelection(i.start,i.start,function(){t.setTarget({getTooltipInfo:function(){var a=r.convert({x:r.getLocationAtOffset(i.start).x,y:r.getLocationAtOffset(h.getLineStart(s)).y},"document","page");return{contents:[i],x:a.x,y:a.y+Math.floor(r.getLineHeight(s)*1.33)}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();
if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var c=a.getModel(),d=a.getSelection(),h=c.getLineAtOffset(d.start),g=c.getLineAtOffset(d.end>d.start?d.end-1:d.end),i=b.getOptions("tabSize"),j=Array(i+1).join(" "),k=[],t=b=0,l=h;l<=g;l++){var u=c.getLine(l,!0);if(c.getLineStart(l)!==c.getLineEnd(l))if(u.indexOf("\t")===0)u=u.substring(1),b++;else if(u.indexOf(j)===0)u=u.substring(i),b+=i;else return!0;l===h&&(t=b);k.push(u)}h=c.getLineStart(h);i=c.getLineEnd(g,!0);c=c.getLineStart(g);
a.setText(k.join(""),h,i);g=h===d.start?d.start:d.start-t;d=Math.max(g,d.end-b+(d.end===c+1&&d.start!==d.end?1:0));a.setSelection(g,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};h.TextActions=b;i.prototype={init:function(){var b=this.editor.getTextView();b.setAction("lineStart",function(){return this.lineStart()}.bind(this));b.setAction("enter",function(){return this.autoIndent()}.bind(this));
b.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");b.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:g.toggleLineComment});b.setKeyBinding(new k.KeyBinding(191,!0,!a.isMac,!1,a.isMac),"addBlockComment");b.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:g.addBlockComment});b.setKeyBinding(new k.KeyBinding(220,!0,!a.isMac,!1,a.isMac),"removeBlockComment");b.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),
{name:g.removeBlockComment})},autoIndent:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start===b.end){for(var c=a.getModel(),d=c.getLineAtOffset(b.start),h=c.getLine(d,!0),g=c.getLineStart(d),d=0,g=b.start-g,i;d<g&&((i=h.charCodeAt(d))===32||i===9);)d++;if(d>0){for(var j=h.substring(0,d),d=g;d<h.length&&((i=h.charCodeAt(d++))===32||i===9);)b.end++;a.setText(c.getLineDelimiter()+j,b.start,b.end);return!0}}return!1},addBlockComment:function(){var a=
this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=this._findEnclosingComment(b,c.start,c.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;b=b.getText(c.start,c.end);if(b.length===0)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),h=b.length;a.setText("/*"+b+"*/",c.start,c.end);a.setSelection(c.start+2,c.end+2+(h-d));return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],c=0;c<a.positions.length;++c)b[c]={positions:[{offset:a.positions[c].offset,length:a.positions[c].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&a.groups.length>0&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);return!0},_findEnclosingComment:function(a,b,c){var d=a.getLineAtOffset(b),h=a.getLineAtOffset(c),g,i,j,
k,t,l;for(g=d;g>=0;g--)if(i=a.getLine(g),j=g===d?b-a.getLineStart(d):i.length,k=i.lastIndexOf("/*",j),i=i.lastIndexOf("*/",j),i>k)break;else if(k!==-1){t=a.getLineStart(g)+k;break}for(g=h;g<a.getLineCount();g++)if(i=a.getLine(g),j=g===h?c-a.getLineStart(h):0,k=i.indexOf("/*",j),i=i.indexOf("*/",j),k!==-1&&k<i)break;else if(i!==-1){l=a.getLineStart(g)+i;break}return{commentStart:t,commentEnd:l}},lineStart:function(){for(var a=this.editor,b=a.getModel(),c=a.getCaretOffset(),d=b.getLineAtOffset(c),h=
b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var g=b.charCodeAt(d);if(!(g===32||g===9))break}d+=h;return c!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),c=a.getSelection(),d=b.getText(c.start,c.end),h,g,i;for(i=0;i<d.length;i++)if(d.substring(i,i+2)==="/*"){h=c.start+i;break}for(;i<d.length;i++)if(d.substring(i,i+2)==="*/"){g=c.start+i;break}if(h!==void 0&&g!==void 0)a.setText(b.getText(h+
2,g),h,g+2),a.setSelection(h,g);else{d=this._findEnclosingComment(b,c.start,c.end);if(d.commentStart===void 0||d.commentEnd===void 0)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(c.start-2,c.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),c=a.getSelection(),d=b.getLineAtOffset(c.start),h=b.getLineAtOffset(c.end>c.start?c.end-1:c.end),g=!0,i=[],j,
k,t=d;t<=h;t++)if(j=b.getLine(t,!0),i.push(j),!g||(k=j.indexOf("//"))===-1)g=!1;else if(k!==0){var l;for(l=0;l<k;l++)if(g=j.charCodeAt(l),!(g===32||g===9))break;g=l===k}t=b.getLineStart(d);l=b.getLineEnd(h,!0);if(g){for(g=0;g<i.length;g++)j=i[g],k=j.indexOf("//"),i[g]=j.substring(0,k)+j.substring(k+2);i=i.join("");j=b.getLineStart(h);b=t===c.start?c.start:c.start-2;c=c.end-2*(h-d+1)+(c.end===j+1?2:0)}else i.splice(0,0,""),i=i.join("//"),b=t===c.start?c.start:c.start+2,c=c.end+2*(h-d+1);a.setText(i,
t,l);a.setSelection(b,c);return!0},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};h.SourceCodeActions=i;return h});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(g,k,j,d){function c(a,b,c,d){this._location=b||"left";this._overview=c||"page";this._rulerStyle=d;this._view=null;var h=this;this._listener={onTextModelChanged:function(a){h._onTextModelChanged(a)},onAnnotationModelChanged:function(a){h._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function a(a,b,d,h,g){c.call(this,a,b,"page",d);this._oddStyle=h||{style:{backgroundColor:"white"}};
this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0}function b(a,b,d){c.call(this,a,b,"page",d)}function i(a,b,d){c.call(this,a,b,"document",d)}function h(a,c,d){b.call(this,a,c,d)}c.prototype={getAnnotations:function(a,b){var c=this._annotationModel;if(!c)return[];var d=this._view.getModel(),h=d.getLineStart(a),g=d.getLineEnd(b-1),i=d;d.getBaseModel&&(i=d.getBaseModel(),h=d.mapOffset(h),g=d.mapOffset(g));for(var j=[],c=this.getAnnotationsByType(c,h,g),h=0;h<c.length;h++)for(var g=
c[h],k=i.getLineAtOffset(g.start),t=i.getLineAtOffset(Math.max(g.start,g.end-1)),l=k;l<=t;l++){var u=l;if(d!==i){u=i.getLineStart(l);u=d.mapOffset(u,!0);if(u===-1)continue;u=d.getLineAtOffset(u)}if(a<=u&&u<b){var w=this._mergeAnnotation(j[u],g,l-k,t-k+1);w&&(j[u]=w)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var v in j)j[v]._multiple&&(j[v].html+=this._multiAnnotationOverlay.html);return j},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a){if(a!==void 0){var b=this._view,c=b.getModel(),d=c,h=c.getLineStart(a),g=h,i=this._annotationModel;if(i){g=b.getSelection();b=Math.max(g.start,g.end);g=c.getLineEnd(a,!0);h<=b&&b<c.getLineEnd(a)&&(h=b+1);c.getBaseModel&&
(h=c.mapOffset(h),g=c.mapOffset(g),d=c.getBaseModel());for(var k,a=i.getAnnotations(h,g);!k&&a.hasNext();)g=a.next(),this.isAnnotationTypeVisible(g.type)&&(k=g);k&&d.getLineAtOffset(k.start)===d.getLineAtOffset(h)?(h=k.start,g=k.end):g=h;c.getBaseModel&&(h=c.mapOffset(h,!0),g=c.mapOffset(g,!0))}(c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null);this._view.setSelection(g,h,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,b){var c=j.Tooltip.getTooltip(this._view);if(c&&!(c.isVisible()&&
this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var d=this;c.setTarget({y:b.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b)},onMouseOut:function(){var a=j.Tooltip.getTooltip(this._view);a&&a.setTarget(null)},_getTooltipInfo:function(a,b){if(a!==void 0){var c=this._view,d=c.getModel(),h=this._annotationModel,g=[];if(h){var g=d.getLineStart(a),i=d.getLineEnd(a);d.getBaseModel&&(g=d.mapOffset(g),i=d.mapOffset(i));
g=this.getAnnotationsByType(h,g,i)}h=this._getTooltipContents(a,g);if(!h)return null;h={contents:h,anchor:this.getLocation()};g=c.getClientArea();g.y=this.getOverview()==="document"?c.convert({y:b},"view","document").y:c.getLocationAtOffset(d.getLineStart(a)).y;c.convert(g,"document","page");h.x=g.x;h.y=g.y;h.anchor==="right"&&(h.x+=g.width);return h}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var e=0;e<a.length;e++)if(h.isAnnotationTypeVisible(a[e].type)){var f=
a[e].start,g=a[e].end;d.getBaseModel&&(f=d.mapOffset(f,!0),g=d.mapOffset(g,!0));f!==-1&&g!==-1&&c.redrawLines(d.getLineAtOffset(f),d.getLineAtOffset(Math.max(f,g-1))+1,h)}}var c=this._view;if(c){var d=c.getModel(),h=this,g=d.getLineCount();a.textModelChangedEvent?(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),c.redrawLines(a,g,h)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,c){a||(a={});if(c===0)if(a.html&&b.html){if(b.html!==
a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=b.html;a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?a.styleClass+=" "+b.styleClass:a.styleClass=b.styleClass;var c;if(b.style){if(!a.style)a.style={};for(c in b.style)a.style[c]||(a.style[c]=b.style[c])}if(b.attributes){if(!a.attributes)a.attributes={};for(c in b.attributes)a.attributes[c]||
(a.attributes[c]=b.attributes[c])}}return a}};k.AnnotationTypeList.addMixin(c.prototype);a.prototype=new c;a.prototype.getAnnotations=function(a,b){for(var d=c.prototype.getAnnotations.call(this,a,b),h=this._view.getModel(),g=a;g<b;g++){var i=g&1?this._oddStyle:this._evenStyle,j=g;h.getBaseModel&&(j=h.getLineStart(j),j=h.getBaseModel().getLineAtOffset(h.mapOffset(j)));d[g]||(d[g]={});d[g].html=j+1+"";if(!d[g].style)d[g].style=i}return d};a.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};a.prototype._onTextModelChanged=function(a){var a=a.start,b=this._view.getModel(),c=((b.getBaseModel?b.getBaseModel().getLineCount():b.getLineCount())+"").length;if(this._numOfDigits!==c)this._numOfDigits=c,this._view.redrawLines(b.getLineAtOffset(a),b.getLineCount(),this)};b.prototype=new c;i.prototype=new c;i.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};i.prototype._getTooltipContents=
function(a,b){if(b.length===0){var h=this._view.getModel(),i=a;h.getBaseModel&&(i=h.getLineStart(i),i=h.getBaseModel().getLineAtOffset(h.mapOffset(i)));return d.formatMessage(g.line,i+1)}return c.prototype._getTooltipContents.call(this,a,b)};i.prototype._mergeAnnotation=function(a,b,c,d){if(c===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle);return a}};h.prototype=new b;h.prototype.onClick=function(a){if(a!==void 0){var b=this._annotationModel;
if(b){var c=this._view.getModel(),d=c.getLineStart(a),a=c.getLineEnd(a,!0);c.getBaseModel&&(d=c.mapOffset(d),a=c.mapOffset(a),c=c.getBaseModel());for(var h,b=b.getAnnotations(d,a);!h&&b.hasNext();)a=b.next(),this.isAnnotationTypeVisible(a.type)&&(h=a);h&&c.getLineAtOffset(h.start)===c.getLineAtOffset(d)&&((c=j.Tooltip.getTooltip(this._view))&&c.setTarget(null),h.expanded?h.collapse():h.expand(),this._annotationModel.modifyAnnotation(h))}}};h.prototype._getTooltipContents=function(a,c){return c.length===
1&&c[0].expanded?null:b.prototype._getTooltipContents.call(this,a,c)};h.prototype._onAnnotationModelChanged=function(a){function c(a){for(i=0;i<a.length;i++)if(g.isAnnotationTypeVisible(a[i].type)){var b=a[i].start;h.getBaseModel&&(b=h.mapOffset(b,!0));b!==-1&&(k=Math.min(k,h.getLineAtOffset(b)))}}if(a.textModelChangedEvent)b.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var h=d.getModel(),g=this,i,j=h.getLineCount(),k=j;c(a.added);c(a.removed);c(a.changed);a=d.getRulers();
for(i=0;i<a.length;i++)d.redrawLines(k,j,a[i])}}};return{Ruler:c,AnnotationRuler:b,LineNumberRuler:a,OverviewRuler:i,FoldingRuler:h}});
define("orion/editor/textDND",[],function(){function g(g,j){this._view=g;this._undoStack=j;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var d=this;this._listener={onDragStart:function(c){d._onDragStart(c)},onDragEnd:function(c){d._onDragEnd(c)},onDragEnter:function(c){d._onDragEnter(c)},onDragOver:function(c){d._onDragOver(c)},onDrop:function(c){d._onDrop(c)},onDestroy:function(c){d._onDestroy(c)}};g.addEventListener("DragStart",this._listener.onDragStart);g.addEventListener("DragEnd",
this._listener.onDragEnd);g.addEventListener("DragEnter",this._listener.onDragEnter);g.addEventListener("DragOver",this._listener.onDragOver);g.addEventListener("Drop",this._listener.onDrop);g.addEventListener("Destroy",this._listener.onDestroy)}g.prototype={destroy:function(){var g=this._view;if(g)g.removeEventListener("DragStart",this._listener.onDragStart),g.removeEventListener("DragEnd",this._listener.onDragEnd),g.removeEventListener("DragEnter",this._listener.onDragEnter),g.removeEventListener("DragOver",
this._listener.onDragOver),g.removeEventListener("Drop",this._listener.onDrop),g.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(g){var j=this._view,d=j.getSelection(),j=j.getModel();if(j.getBaseModel)d.start=j.mapOffset(d.start),d.end=j.mapOffset(d.end),j=j.getBaseModel();if(j=j.getText(d.start,d.end))this._dragSelection=d,g.event.dataTransfer.effectAllowed="copyMove",g.event.dataTransfer.setData("Text",j)},_onDragEnd:function(g){var j=
this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(g=g.event.dataTransfer.dropEffect==="move")&&j.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var d=this._dropText,c=this._dropOffset;if(g)if(c>=this._dragSelection.end)c-=this._dragSelection.end-this._dragSelection.start;else if(c>=this._dragSelection.start)c=this._dragSelection.start;j.setText(d,c,c);j.setSelection(c,c+d.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&
this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(g){this._onDragOver(g)},_onDragOver:function(g){var j=g.event.dataTransfer.types;if(j){var d=!this._view.getOptions("readonly");d&&(d=j.contains?j.contains("text/plain"):j.indexOf("text/plain")!==-1);if(!d)g.event.dataTransfer.dropEffect="none"}},_onDrop:function(g){var j=this._view,d=g.event.dataTransfer.getData("Text");if(d)g=j.getOffsetAtLocation(g.x,g.y),this._dragSelection?(this._dropOffset=g,this._dropText=d):
(j.setText(d,g,g),j.setSelection(g,g+d.length))}};return{TextDND:g}});
define("orion/editor/templates",[],function(){function g(g,d,c){this.prefix=g;this.description=d;this.template=c;this._parse()}function k(g,d){this._keywords=g||[];this._templates=[];this.addTemplates(d||[])}g.prototype={getProposal:function(g,d,c){var g=d-g.length,d={},a,b=c.delimiter!==void 0?c.delimiter:"\n";c.indentation&&(b+=c.indentation);for(var i=c.tab!==void 0?c.tab:"\t",h=0,f=this.variables,e=this.segments,c=[],n=0;n<e.length;n++){var k=e[n],p=f[k];if(p!==void 0)switch(k){case "${tab}":k=
i;break;case "${delimiter}":k=b;break;case "${cursor}":k="";a=h;break;default:var m=d[k];m||(m=d[k]={data:p.data,positions:[]});k=p.substitution;m.data&&m.data.values&&(k=m.data.values[0]);m.positions.push({offset:g+h,length:k.length})}c.push(k);h+=k.length}var b=[],q;for(q in d)d.hasOwnProperty(q)&&b.push(d[q]);c=c.join("");if(a===void 0)a=c.length;return{proposal:c,description:this.description,groups:b,escapePosition:g+a}},match:function(g){return this.prefix.indexOf(g)===0},_parse:function(){var g=
this.template,d=[],c={},a,b=0,g=g.replace(/\n/g,"${delimiter}"),g=g.replace(/\t/g,"${tab}");g.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(i,h,f){var e=i.substring(2,i.length-1),h=i,n=e,k=null,p=n.indexOf(":");p!==-1&&(n=n.substring(0,p),h="${"+n+"}",k=JSON.parse(e.substring(p+1).replace("\\}","}").trim()));(e=c[h])||(e=c[h]={});e.substitution=n;if(k)e.data=k;(a=g.substring(b,f))&&d.push(a);d.push(h);b=f+i.length;return n});(a=g.substring(b,g.length))&&d.push(a);this.segments=d;this.variables=c}};
k.prototype={addTemplates:function(j){for(var d=this.getTemplates(),c=0;c<j.length;c++)d.push(new g(j[c].prefix,j[c].description,j[c].template))},computeProposals:function(g,d,c){var a=this.getPrefix(g,d,c),b=[];if(!this.isValid(a,g,d,c))return b;b=b.concat(this.getTemplateProposals(a,d,c));return b=b.concat(this.getKeywordProposals(a))},getKeywords:function(){return this._keywords},getKeywordProposals:function(g){var d=[],c=this.getKeywords();if(c)for(var a=0;a<c.length;a++)c[a].indexOf(g)===0&&
d.push({proposal:c[a].substring(g.length),description:c[a]});return d},getPrefix:function(g,d,c){return c.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(g,d,c){for(var a=[],b=this.getTemplates(),i=0;i<b.length;i++){var h=b[i];h.match(g)&&(h=h.getProposal(g,d,c),this.removePrefix(g,h),a.push(h))}return a},removePrefix:function(g,d){if(!(d.overwrite=d.proposal.substring(0,g.length)!==g))d.proposal=d.proposal.substring(g.length)},isValid:function(){return!0}};return{Template:g,
TemplateContentAssist:k}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/editor/templates,orion/objects,orion/util".split(","),function(g,k,j,d,c,a){function b(a,b,c){var d=a.getTextView();j.KeyMode.call(this,d);this.editor=a;this.undoStack=b;this.contentAssist=c;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);return!0}.bind(this));
d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(a.selectedGroupIndex>0?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),this.contentAssist.setProgress(null))}.bind(this),
onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.start+a.removedCharCount),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;d=a.addedCharCount-a.removedCharCount;c=c.positions;for(var e,h,f=0;f<c.length;++f){h=c[f];e=h.position;var g=e.offset<=a.start&&a.start<=e.offset+e.length;g&&!h.ansestor?(e.offset+=b,e.length+=d,b+=d):(e.offset+=b,h.ansestor&&g&&(e.length+=
d));if(h.escape)h.model.escapePosition=e.offset}this._updateAnnotations(c)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.linkedModeModel,c,d;b;)if(c=this._getPositionChanged(b,a.start,a.end),d=c.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){var e=this._compoundChange;e?e.owner.model===b&&e.owner.group===d.group||(this.endUndo(),this.startUndo()):this.startUndo();b.selectedGroupIndex=d.group;var e=0,h=a.text.length-(a.end-
a.start);c=c.positions;for(var f,g,i=a.start-d.position.offset,j=a.end-d.position.offset,n=0;n<c.length;++n)if(g=c[n],f=g.position,g.oldOffset=f.offset,g.model===b&&g.group===d.group?(f.offset+=e,f.length+=h,e+=h):(f.offset+=e,g.ansestor&&(f.length+=d.count*h)),g.escape)g.model.escapePosition=f.offset;this.ignoreVerify=!0;e=this.editor.getTextView();for(n=c.length-1;n>=0;n--)g=c[n],g.model===b&&g.group===d.group&&e.setText(a.text,g.oldOffset+i,g.oldOffset+j);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(c)}}}.bind(this)}}
var i={};b.prototype=new j.KeyMode;a.mixin(b.prototype,{createKeyBindings:function(){var a=k.KeyBinding,b=[];b.push({actionID:"linkedModeEnter",keyBinding:new a(13)});b.push({actionID:"linkedModeCancel",keyBinding:new a(27)});b.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});b.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return b},enterLinkedMode:function(a){if(!this.linkedModeModel){var b=this.editor.getTextView();b.addKeyMode(this);b.addEventListener("Verify",
this.linkedModeListener.onVerify);b.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(g.linkedModeEntered,null,!0)}this._sortedPositions=null;if(this.linkedModeModel)a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a;this.linkedModeModel=a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){if(this._compoundChange)this.endUndo(),
this._compoundChange=null;this._sortedPositions=null;var b=this.linkedModeModel;this.linkedModeModel=b.previousModel;b.parentGroup=b.previousModel=void 0;if(this.linkedModeModel)this.linkedModeModel.nextModel=void 0;if(!this.linkedModeModel){var c=this.editor.getTextView();c.removeKeyMode(this);c.removeEventListener("Verify",this.linkedModeListener.onVerify);c.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);var d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);
d.offset=void 0;this.editor.reportStatus(g.linkedModeExited,null,!0);a&&c.setCaretOffset(b.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,b=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:b,group:b.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},
selectLinkedGroup:function(a){var b=this.linkedModeModel;if(b){b.selectedGroupIndex=a;var a=b.groups[a],d=a.positions[0],g=this.editor.getTextView();g.setSelection(d.offset,d.offset+d.length);if(b=this.contentAssist)if(b.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new c.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=g.getSelection();return a.start===a.end&&(a=g.getCaretOffset(),d.offset<=a&&a<=d.offset+d.length)?g.getText(d.offset,
a):""},b.offset=d.offset,b.deactivate(),b.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,b.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,c){for(var d=b.groups,g=0;g<d.length;g++)for(var i=d[g].positions,j=0;j<i.length;j++){var k=i[j];c&&(k={offset:k.offset+c,length:k.length});k={index:j,group:g,count:i.length,model:b,position:k};a.push(k);if(b.nextModel&&b.nextModel.parentGroup===g)k.ansestor=!0,this._getModelPositions(a,b.nextModel,
(c||0)+i[j].offset-i[0].offset)}},_getSortedPositions:function(a){var b=this._sortedPositions;if(!b){for(b=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(b,a);a;)a.escapePosition!==void 0&&b.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;b.sort(function(a,b){return a.position.offset-b.position.offset});this._sortedPositions=b}return b},_getPositionChanged:function(a,b,c){for(var d,a=this._getSortedPositions(a),g=a.length-1;g>=0;g--){var i=a[g].position;
if(i.offset<=b&&c<=i.offset+i.length){d=a[g];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var c=[],g=[],i=b.getTextModel(),i=b.getAnnotations(0,i.getCharCount()),j;i.hasNext();)switch(j=i.next(),j.type){case d.AnnotationType.ANNOTATION_LINKED_GROUP:case d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(j)}if(i=this.linkedModeModel)for(var a=a||this._getSortedPositions(i),
m=0;m<a.length;m++)if(j=a[m],j.model===i){var k=d.AnnotationType.ANNOTATION_LINKED_GROUP;j.group===i.selectedGroupIndex&&(k=j.index===0?d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);j=j.position;j=d.AnnotationType.createAnnotation(k,j.offset,j.offset+j.length,"");g.push(j)}b.replaceAnnotations(c,g)}}});i.LinkedMode=b;return i});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(g,k,j,d,c,a){function b(){}function i(){}function h(){}function f(){}function e(){}function n(){}var o={};b.prototype={createKeyBindings:function(b,c,d,e){var e=new g.TextActions(b,c,e),h=new a.LinkedMode(b,c,d),b=new g.SourceCodeActions(b,c,d,h);return{textActions:e,linkedMode:h,sourceCodeActions:b}}};o.KeyBindingsFactory=
b;i.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};o.UndoFactory=i;h.prototype={createLineNumberRuler:function(a){return new j.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};o.LineNumberRulerFactory=h;f.prototype={createFoldingRuler:function(a){return new j.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};o.FoldingRulerFactory=f;e.prototype={createAnnotationModel:function(a){return new d.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new d.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new j.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new j.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};o.AnnotationFactory=e;n.prototype={createTextDND:function(a,b){return new c.TextDND(a.getTextView(),b)}};o.TextDNDFactory=n;return o});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode"],function(g,k,j){var d={};d.KeyBindingsFactory=g.KeyBindingsFactory;d.UndoFactory=g.UndoFactory;d.LineNumberRulerFactory=g.LineNumberRulerFactory;d.FoldingRulerFactory=g.FoldingRulerFactory;d.AnnotationFactory=g.AnnotationFactory;d.TextDNDFactory=g.TextDNDFactory;d.TextActions=k.TextActions;d.SourceCodeActions=k.SourceCodeActions;d.LinkedMode=j.LinkedMode;return d});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/util".split(","),function(g,k,j,d,c,a){function b(a){this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=
a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._statusReporter=a.statusReporter;this._domNode=a.domNode;this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null;this._dirty=!1;this._title=this._contentAssist=null}function i(a){var b=this,c=Array.prototype.slice.call(arguments,1);return c.length?function(){return arguments.length?b.apply(a,c.concat(Array.prototype.slice.call(arguments))):b.apply(a,
c)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}b.prototype={destroy:function(){this.uninstallTextView();this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=this._statusReporter=this._domNode=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getTitle:function(){return this._title},getKeyModes:function(){return this._textView.getKeyModes()},isDirty:function(){return this._dirty},setAnnotationRulerVisible:function(a){if(this._annotationRulerVisible!==
a&&(this._annotationRulerVisible=a,this._annotationRuler)){var b=this._textView;a?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a){if(this._foldingRulerVisible!==a&&(this._foldingRulerVisible=a,this._foldingRuler)){var b=this._textView;b.getModel().getBaseModel&&(a?b.addRuler(this._foldingRuler,100):b.removeRuler(this._foldingRuler))}},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},setLineNumberRulerVisible:function(a){if(this._lineNumberRulerVisible!==
a&&(this._lineNumberRulerVisible=a,this._lineNumberRuler)){var b=this._textView;a?b.addRuler(this._lineNumberRuler,1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a){if(this._overviewRulerVisible!==a&&(this._overviewRulerVisible=a,this._overviewRuler)){var b=this._textView;a?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var c=this._textView.getModel();c.getBaseModel&&(a=c.mapOffset(a,b));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,b=a.getSelection(),a=a.getModel();if(a.getBaseModel)b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end);return b},getText:function(a,b){var c=this._textView.getModel();c.getBaseModel&&(c=c.getBaseModel());return c.getText(a,b)},_expandOffset:function(a){var b=this._textView.getModel(),d=this._annotationModel;if(d&&b.getBaseModel)for(a=d.getAnnotations(a,a+1);a.hasNext();)b=a.next(),b.type===c.AnnotationType.ANNOTATION_FOLDING&&b.expand&&(b.expand(),d.modifyAnnotation(b))},
setCaretOffset:function(a,b,c){var d=this._textView,g=d.getModel();g.getBaseModel&&(this._expandOffset(a),a=g.mapOffset(a,!0));d.setCaretOffset(a,b,c)},setText:function(a,b,c){var d=this._textView,g=d.getModel();g.getBaseModel&&(b!==void 0&&(this._expandOffset(b),b=g.mapOffset(b,!0)),c!==void 0&&(this._expandOffset(c),c=g.mapOffset(c,!0)));d.setText(a,b,c)},setFoldingEnabled:function(a){this.setFoldingRulerVisible(a)},setSelection:function(a,b,c,d){var g=this._textView,i=g.getModel();i.getBaseModel&&
(this._expandOffset(a),this._expandOffset(b),a=i.mapOffset(a,!0),b=i.mapOffset(b,!0));g.setSelection(a,b,c,d)},moveSelection:function(a,b,c,d){var g=this._textView;this.setSelection(a,b||a,1/3,function(){(d===void 0||d)&&g.focus();c&&c()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},reportStatus:function(a,b,c){this._statusReporter&&this._statusReporter(a,b,c)},_getTooltipInfo:function(a,b){var c=this._textView,d=this.getAnnotationModel();if(!d)return null;var g=this._annotationStyler;
if(!g)return null;var i=c.getOffsetAtLocation(a,b);if(i===-1)return null;i=this.mapOffset(i);g=g.getAnnotationsByType(d,i,i+1);d=[];for(i=0;i<g.length;i++)g[i].rangeStyle&&d.push(g[i]);if(d.length===0)return null;c=c.convert({x:a,y:b},"document","page");return{contents:d,anchor:"left",x:c.x+10,y:c.y+20}},_highlightCurrentLine:function(a,b){var d=this._annotationModel;if(d){var g=this._textView.getModel(),i=b?g.getLineAtOffset(b.start):-1,j=g.getLineAtOffset(a.start),m=a.start===a.end,k=!b||b.start===
b.end,r=g.getLineStart(j),s=g.getLineEnd(j);g.getBaseModel&&(r=g.mapOffset(r),s=g.mapOffset(s));g=this._currentLineAnnotation;if(!(i===j&&k&&m&&g&&g.start===r&&g.end===s)){var i=g?[g]:null,t;m&&(g=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_CURRENT_LINE,r,s),t=[g]);this._currentLineAnnotation=g;d.replaceAnnotations(i,t)}}},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.createContentAssistMode(this).getContentAssist();var a=this,b=this._textView,e=this;this._listener={onModelChanged:function(){e.checkDirty()},onMouseOver:function(a){e._listener.onMouseMove(a)},onMouseMove:function(a){var c=d.Tooltip.getTooltip(b);if(c&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,
e._listener.lastMouseY=a.event.clientY,c.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return e._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var c=d.Tooltip.getTooltip(b);if(c&&!(e._listener.lastMouseX===a.event.clientX&&e._listener.lastMouseY===a.event.clientY))e._listener.lastMouseX=a.event.clientX,e._listener.lastMouseY=a.event.clientY,c.setTarget(null)},onScroll:function(){var a=d.Tooltip.getTooltip(b);a&&a.setTarget(null)},onSelection:function(a){e._updateCursorStatus();e._highlightCurrentLine(a.newValue,
a.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",this._listener.onScroll);this._keyBindingFactory&&(typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):
this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist));var g=function(b){if(b!==void 0&&b!==-1){for(var d=this.getView().getModel(),e=this.getAnnotationModel(),f=a.mapOffset(d.getLineStart(b)),b=a.mapOffset(d.getLineEnd(b)),d=e.getAnnotations(f,b),g=null;d.hasNext();){var i=d.next();if(i.type===c.AnnotationType.ANNOTATION_BOOKMARK){g=i;break}}g?e.removeAnnotation(g):(g=c.AnnotationType.createAnnotation(c.AnnotationType.ANNOTATION_BOOKMARK,f,b),g.title=void 0,e.addAnnotation(g))}};
if(this._annotationFactory){var i=b.getModel();i.getBaseModel&&(i=i.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(i))if(i=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),i.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),i.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),i.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),i.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),
i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),i.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),i.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE),i.addAnnotationType(c.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP),i.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP),i.addAnnotationType(c.AnnotationType.ANNOTATION_LINKED_GROUP),i.addAnnotationType("orion.annotation.highlightError");
b.annotationModel=this._annotationModel;var i=this._annotationFactory.createAnnotationRulers(this._annotationModel),j=this._annotationRuler=i.annotationRuler;if(j)j.onDblClick=g,j.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),j.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),j.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),j.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(!0);
if(j=this._overviewRuler=i.overviewRuler)j.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_SEARCH),j.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_SEARCH),j.addAnnotationType(c.AnnotationType.ANNOTATION_ERROR),j.addAnnotationType(c.AnnotationType.ANNOTATION_WARNING),j.addAnnotationType(c.AnnotationType.ANNOTATION_TASK),j.addAnnotationType(c.AnnotationType.ANNOTATION_BOOKMARK),j.addAnnotationType(c.AnnotationType.ANNOTATION_MATCHING_BRACKET),j.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_BRACKET),
j.addAnnotationType(c.AnnotationType.ANNOTATION_CURRENT_LINE),j.addAnnotationType(c.AnnotationType.ANNOTATION_READ_OCCURRENCE),j.addAnnotationType(c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE);this.setOverviewRulerVisible(!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.onDblClick=g,this.setLineNumberRulerVisible(!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),
this._foldingRuler.addAnnotationType(c.AnnotationType.ANNOTATION_FOLDING),this.setFoldingRulerVisible(!1);this.dispatchEvent({type:"TextViewInstalled",textView:b})},uninstallTextView:function(){var a=this._textView;if(a)a.destroy(),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this.dispatchEvent({type:"TextViewUninstalled",
textView:a})},_updateCursorStatus:function(){var b=this.getModel(),c=this.getCaretOffset(),d=b.getLineAtOffset(c),b=b.getLineStart(d);c-=b;for(var b=this.getKeyModes(),i=0;i<b.length;i++){var j=b[i];if(j.isActive()&&j.isStatusActive&&j.isStatusActive())return}this.reportStatus(a.formatMessage(g.lineColumn,d+1,c+1))},showProblems:function(a){var b=this._annotationModel;if(b){for(var d=[],g=[],i=b.getTextModel(),j=b.getAnnotations(0,i.getCharCount()),m;j.hasNext();)m=j.next(),(m.type===c.AnnotationType.ANNOTATION_ERROR||
m.type===c.AnnotationType.ANNOTATION_WARNING)&&d.push(m);if(a)for(j=0;j<a.length;j++)if(m=a[j]){var k=m.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),r=i.getLineStart(m.line-1);m=c.AnnotationType.createAnnotation(m.severity==="error"?c.AnnotationType.ANNOTATION_ERROR:c.AnnotationType.ANNOTATION_WARNING,r+m.start-1,r+m.end,k);g.push(m)}b.replaceAnnotations(d,g)}},showOccurrences:function(a){var b=this._annotationModel;if(b){for(var d=[],g=[],i=b.getTextModel(),j=b.getAnnotations(0,i.getCharCount()),
m;j.hasNext();)m=j.next(),(m.type===c.AnnotationType.ANNOTATION_READ_OCCURRENCE||m.type===c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE)&&d.push(m);if(a)for(j=0;j<a.length;j++)if(m=a[j]){var k=i.getLineStart(m.line-1);m=c.AnnotationType.createAnnotation(m.readAccess===!0?c.AnnotationType.ANNOTATION_READ_OCCURRENCE:c.AnnotationType.ANNOTATION_WRITE_OCCURRENCE,k+m.start-1,k+m.end,m.description);g.push(m)}b.replaceAnnotations(d,g)}},showSelection:function(a,b,c,d,g){typeof a==="number"?(typeof b!=="number"&&
(b=a),this.moveSelection(a,b)):typeof c==="number"&&(a=this.getModel().getLineStart(c-1),typeof d==="number"&&(a+=d),typeof g!=="number"&&(g=0),this.moveSelection(a,a+g))},setInput:function(a,b,c,d){this._title=a;this._textView&&(d?(this._undoStack.markClean(),this.checkDirty()):(b?this._textView.setText(b):c!==null&&c!==void 0&&(this._textView.setText(c),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this.checkDirty(),
this._textView.focus()));this.onInputChanged({type:"InputChanged",title:a,message:b,contents:c,contentsSaved:d})},onInputChanged:function(a){return this.dispatchEvent(a)},onGotoLine:function(a,b,c,d){if(this._textView){var g=this.getModel(),a=Math.max(0,Math.min(a,g.getLineCount()-1)),i=g.getLineStart(a),j=0;c===void 0&&(c=0);typeof b==="string"?(a=g.getLine(a).indexOf(b),a!==-1&&(j=a,c=j+b.length)):(j=b,b=g.getLineEnd(a)-i,j=Math.min(j,b),c=Math.min(c,b));this.moveSelection(i+j,i+c,d)}},onDirtyChanged:function(a){return this.dispatchEvent(a)}};
j.EventTarget.addMixin(b.prototype);if(!Function.prototype.bind)Function.prototype.bind=i;return{Editor:b}});
define("orion/syntaxchecker",["orion/Deferred"],function(g){return{SyntaxChecker:function(){function k(g,d){this.registry=g;this.editor=d}k.prototype={checkSyntax:function(j,d,c,a){function b(a,b){function c(a,b,d){a=b.getProperty("contentType");return i.isSomeExtensionOf(d,a).then(function(a){return a?b:null})}for(var i=a.getService("orion.core.contenttypes"),j=a.getServiceReferences("orion.edit.validator"),k=[],m=0;m<j.length;m++){var q=j[m],r=q.getProperty("pattern");q.getProperty("contentType")?
k.push(c(a,q,b)):r&&RegExp(r).test(d)&&(r=new g,r.resolve(q),k.push(r))}return g.all(k,function(a){return{_error:a}}).then(function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];d&&!d._error&&b.push(d)}return b})}if(j&&!c){var i=this;b(this.registry,j).then(function(b){for(var c=function(a){return a.problems||a.errors},e=[],j=i.registry.getService("orion.page.progress"),k=0;k<b.length;k++)e.push(j.progress(i.registry.getService(b[k]).checkSyntax(d,a),"Validating "+d).then(c));g.all(e,function(a){return{_error:a}}).then(function(a){var b=
[];for(k=0;k<a.length;k++){var c=a[k];c._error||(i._fixup(c),b=b.concat(c))}i.registry.getService("orion.core.marker")._setProblems(b)})})}},_fixup:function(g){for(var d=this.editor.getModel(),c=0;c<g.length;c++){var a=g[c];a.description=a.description||a.reason;a.severity=a.severity||"error";a.start=typeof a.start==="number"?a.start:a.character;a.end=typeof a.end==="number"?a.end:a.start+1;var b=d.getLine(a.line-1,!1).length;a.start=Math.max(1,a.start);a.start=Math.min(a.start,b);a.end=Math.min(a.end,
b);a.end=Math.max(a.start,a.end)}}};return k}()}});
define("orion/editor/emacs",["i18n!orion/editor/nls/messages","orion/editor/keyModes","orion/keyBinding","orion/util"],function(g,k,j,d){function c(a){k.KeyMode.call(this,a)}c.prototype=new k.KeyMode;c.prototype.createKeyBindings=function(){var a=[];a.push({actionID:"emacs-beginning-of-line",keyBinding:this._createStroke("a",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-end-of-line",keyBinding:this._createStroke("e",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-forward-char",keyBinding:this._createStroke("f",
!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-backward-char",keyBinding:this._createStroke("b",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-forward-word",keyBinding:this._createStroke("f",!1,!1,!0)});a.push({actionID:"emacs-backward-word",keyBinding:this._createStroke("b",!1,!1,!0)});a.push({actionID:"emacs-next-line",keyBinding:this._createStroke("n",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-previous-line",keyBinding:this._createStroke("p",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-beginning-of-buffer",
keyBinding:this._createStroke(188,!1,!0,!0)});a.push({actionID:"emacs-end-of-buffer",keyBinding:this._createStroke(190,!1,!0,!0)});a.push({actionID:"emacs-delete-backward-char",keyBinding:this._createStroke(46,!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-delete-char",keyBinding:this._createStroke("d",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-kill-line",keyBinding:this._createStroke("k",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-kill-word",keyBinding:this._createStroke("d",!1,!1,
!0)});a.push({actionID:"emacs-backward-kill-word",keyBinding:this._createStroke(46,!1,!1,!0)});a.push({actionID:"undo",keyBinding:this._createSequence([this._createStroke("x",!0),this._createStroke("u")])});a.push({actionID:"redo",keyBinding:this._createSequence([this._createStroke("x",!0),this._createStroke("r")])});a.push({actionID:"emacs-scroll-up",keyBinding:this._createStroke("v",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-scroll-down",keyBinding:this._createStroke("v",!1,!1,!0)});a.push({actionID:"emacs-set-mark-command",
keyBinding:this._createStroke(" ",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-reset-mark-command",keyBinding:this._createStroke("g",!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-exchange-point-and-mark",keyBinding:this._createSequence([this._createStroke("x",!d.isMac,!1,!1,d.isMac),this._createStroke("x",!d.isMac,!1,!1,d.isMac)])});for(var b=0;b<=9;b++)a.push({actionID:"emacs-digit-argument-"+b,keyBinding:this._createStroke(48+b,!d.isMac,!1,!1,d.isMac)}),a.push({actionID:"emacs-digit-argument-"+
b,keyBinding:this._createStroke(48+b,!1,!1,!0)}),a.push({actionID:"emacs-digit-argument-"+b,keyBinding:this._createStroke(48+b,!d.isMac,!1,!0,d.isMac)});a.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!d.isMac,!1,!1,d.isMac)});a.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!1,!1,!0)});a.push({actionID:"emacs-negative-argument",keyBinding:this._createStroke(189,!d.isMac,!1,!0,d.isMac)});a.push({actionID:"emacs-uppercase",keyBinding:this._createStroke("u",
!1,!1,!0)});a.push({actionID:"emacs-lowercase",keyBinding:this._createStroke("l",!1,!1,!0)});a.push({actionID:"emacs-capitalize",keyBinding:this._createStroke("c",!1,!1,!0)});a.push({actionID:"contentAssist",keyBinding:this._createStroke(191,!1,!1,!0)});a.push({actionID:"find",keyBinding:this._createStroke("r",!1,!1,!0)});a.push({actionID:"incrementalFind",keyBinding:this._createStroke("s",!0)});a.push({actionID:"incrementalFindReverse",keyBinding:this._createStroke("r",!0)});a.push({actionID:"save",
keyBinding:this._createSequence([this._createStroke("x",!d.isMac,!1,!1,d.isMac),this._createStroke("s",!d.isMac,!1,!1,d.isMac)])});this._createActions(this.getView());return a};c.prototype._createStroke=function(a,b,c,d,f){a=new j.KeyStroke(a,b,c,d,f);a.scopeName=g.emacs;return a};c.prototype._createSequence=function(a){a=new j.KeySequence(a);a.scopeName=g.emacs;return a};c.prototype._getData=function(){var a={count:(this._argument||1)*(this._sign||1)};this._argument=0;this._sign=1;return a};c.prototype._moveCursor=
function(a){var b=this._getData();if(this._marker)b.select=!0;return this.getView().invokeAction(a,!1,b)};c.prototype._digitArgument=function(a){this._argument=(this._argument||0)*10+a;return!0};c.prototype._negativeArgument=function(){this._sign=(this._sign||1)*-1;return!0};c.prototype._createActions=function(a){var b=this;a.setAction("emacs-beginning-of-line",function(){return b._moveCursor("lineStart")},{name:g.lineStart});a.setAction("emacs-end-of-line",function(){return b._moveCursor("lineEnd")},
{name:g.lineEnd});a.setAction("emacs-forward-char",function(){return b._moveCursor("charNext")},{name:g.charNext});a.setAction("emacs-backward-char",function(){return b._moveCursor("charPrevious")},{name:g.charPrevious});a.setAction("emacs-forward-word",function(){return b._moveCursor("wordNext")},{name:g.wordNext});a.setAction("emacs-backward-word",function(){return b._moveCursor("wordPrevious")},{name:g.wordPrevious});a.setAction("emacs-next-line",function(){return b._moveCursor("lineDown")},{name:g.lineDown});
a.setAction("emacs-previous-line",function(){return b._moveCursor("lineUp")},{name:g.lineUp});a.setAction("emacs-beginning-of-buffer",function(){return b._moveCursor("textStart")},{name:g.textStart});a.setAction("emacs-end-of-buffer",function(){return b._moveCursor("textEnd")},{name:g.textEnd});a.setAction("emacs-delete-backward-char",function(){return a.invokeAction("deletePrevious")},{name:g.deletePrevious});a.setAction("emacs-delete-char",function(){return a.invokeAction("deletePrevious")},{name:g.deletePrevious});
a.setAction("emacs-kill-line",function(){return a.invokeAction("deleteLineEnd")},{name:g.deleteLineEnd});a.setAction("emacs-kill-word",function(){return a.invokeAction("deleteWordNext")},{name:g.deleteWordNext});a.setAction("emacs-backward-kill-word",function(){return a.invokeAction("deleteWordPrevious")},{name:g.deleteWordPrevious});a.setAction("emacs-scroll-up",function(){return b._moveCursor("pageDown")},{name:g.pageDown});a.setAction("emacs-scroll-down",function(){return b._moveCursor("pageUp")},
{name:g.pageUp});a.setAction("emacs-set-mark-command",function(){var c=a.getCaretOffset();a.setCaretOffset(c);b._marker=c;return!0},{name:g.setMarkCommand});a.setAction("emacs-exchange-point-and-mark",function(){if(b._marker!==void 0){var c=a.getCaretOffset(),d=a.getSelection();if(d.end===c){var f=d.start;d.start=d.end;d.end=f}b._marker=c;a.setSelection(d.start,d.end)}return!0},{name:g.exchangeMarkPoint});a.setAction("emacs-reset-mark-command",function(){var c=a.getCaretOffset();a.setCaretOffset(c);
b._marker=void 0;return!0},{name:g.clearMark});a.setAction("emacs-digit-argument-0",function(){return b._digitArgument(0)},{name:d.formatMessage(g.digitArgument,"0")});a.setAction("emacs-digit-argument-1",function(){return b._digitArgument(1)},{name:d.formatMessage(g.digitArgument,"1")});a.setAction("emacs-digit-argument-2",function(){return b._digitArgument(2)},{name:d.formatMessage(g.digitArgument,"2")});a.setAction("emacs-digit-argument-3",function(){return b._digitArgument(3)},{name:d.formatMessage(g.digitArgument,
"3")});a.setAction("emacs-digit-argument-4",function(){return b._digitArgument(4)},{name:d.formatMessage(g.digitArgument,"4")});a.setAction("emacs-digit-argument-5",function(){return b._digitArgument(5)},{name:d.formatMessage(g.digitArgument,"5")});a.setAction("emacs-digit-argument-6",function(){return b._digitArgument(6)},{name:d.formatMessage(g.digitArgument,"6")});a.setAction("emacs-digit-argument-7",function(){return b._digitArgument(7)},{name:d.formatMessage(g.digitArgument,"7")});a.setAction("emacs-digit-argument-8",
function(){return b._digitArgument(8)},{name:d.formatMessage(g.digitArgument,"8")});a.setAction("emacs-digit-argument-9",function(){return b._digitArgument(9)},{name:d.formatMessage(g.digitArgument,"9")});a.setAction("emacs-negative-argument",function(){return b._negativeArgument()},{name:g.negativeArgument});a.setAction("emacs-uppercase",function(){var c=b._getData();c.unit="word";return a.invokeAction("uppercase",!1,c)},{name:g.uppercase});a.setAction("emacs-lowercase",function(){var c=b._getData();
c.unit="word";return a.invokeAction("lowercase",!1,c)},{name:g.lowercase});a.setAction("emacs-capitalize",function(){var c=b._getData();c.unit="word";return a.invokeAction("capitalize",!1,c)},{name:g.capitalize})};return{EmacsMode:c}});
define("orion/editor/vi",["i18n!orion/editor/nls/messages","orion/editor/keyModes","orion/keyBinding","orion/util"],function(g,k,j,d){function c(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function a(a,b,c,d,e,f,h){a=new j.KeyStroke(a,b,c,d,e,f);a.scopeName=h||g.vi;return a}function b(a,b){var c=new j.KeySequence(a);c.scopeName=b||g.vi;return c}function i(a,b,c){this.key=b;this.msg=c;this.number="";k.KeyMode.call(this,a);a&&this._createActions(a)}function h(a){var b=a.getView();this.viMode=
a;k.KeyMode.call(this,b);this._createActions(b)}function f(a,b,c,d){this.viMode=a;this.nextMode=b;i.call(this,a.getView(),c,d)}function e(a){var b=a.getView();k.KeyMode.call(this,b);this.viMode=a;this._createActions(b)}function n(a,b){i.call(this,a,"",g.vimove);this.insertMode=new e(this);this.changeMode=new f(this,this.insertMode,"c",g.vichange);this.deleteMode=new f(this,this,"d",g.videlete);this.yankMode=new f(this,this,"y",g.viyank);this.statusReporter=b}var o,p;i.prototype=new k.KeyMode;c(i.prototype,
{_msg:function(a){return{name:d.formatMessage(g[a],this.msg)}},createKeyBindings:function(){for(var b=[],c=this.key,c=c?"-"+c+"-":"-",d=0;d<=9;d++)b.push({actionID:"vi"+c+d,keyBinding:a(d+"",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi"+c+"Left",keyBinding:a("h",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"Left",keyBinding:a("h",!0,!1,!1,!1)});b.push({actionID:"vi"+c+"Left",keyBinding:a(8)});b.push({actionID:"vi"+c+"Left",keyBinding:a(37)});b.push({actionID:"vi"+c+"Down",keyBinding:a("j",
!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"Down",keyBinding:a(40)});b.push({actionID:"vi"+c+"Up",keyBinding:a("k",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"Up",keyBinding:a(38)});b.push({actionID:"vi"+c+"Right",keyBinding:a("l",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"Right",keyBinding:a(39)});b.push({actionID:"vi"+c+"Right",keyBinding:a(32)});b.push({actionID:"vi"+c+"w",keyBinding:a("w",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"b",keyBinding:a("b",!1,!1,!1,!1,
"keypress")});b.push({actionID:"vi"+c+"W",keyBinding:a("W",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"B",keyBinding:a("B",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"e",keyBinding:a("e",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"E",keyBinding:a("E",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"$",keyBinding:a("$",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"^_",keyBinding:a("^",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"^_",keyBinding:a("_",!1,!1,!1,!1,"keypress")});
b.push({actionID:"vi"+c+"+",keyBinding:a("+",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"+",keyBinding:a(13)});b.push({actionID:"vi"+c+"-",keyBinding:a("-",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"|",keyBinding:a("|",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"H",keyBinding:a("H",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"M",keyBinding:a("M",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"L",keyBinding:a("L",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"/",
keyBinding:a("/",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"?",keyBinding:a("?",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"n",keyBinding:a("n",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"N",keyBinding:a("N",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"f",keyBinding:a("f",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"F",keyBinding:a("F",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"t",keyBinding:a("t",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"T",keyBinding:a("T",
!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+",",keyBinding:a(",",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+";",keyBinding:a(";",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi"+c+"G",keyBinding:a("G",!1,!1,!1,!1,"keypress")});return b},_createActions:function(a){function b(c){for(var c=a.getModel().getLine(c),d=0,e=c.charCodeAt(d);e===32||e===9;)d++,e=c.charCodeAt(d);return d}function c(a,b){a&&e.getView().setCaretOffset(a.start);b.editDone&&b.editDone()}var d=this.key,d=d?"-"+d+"-":
"-",e=this;a.setAction("vi"+d+"0",function(){return e._storeNumber(0)});a.setAction("vi"+d+"1",function(){return e._storeNumber(1)});a.setAction("vi"+d+"2",function(){return e._storeNumber(2)});a.setAction("vi"+d+"3",function(){return e._storeNumber(3)});a.setAction("vi"+d+"4",function(){return e._storeNumber(4)});a.setAction("vi"+d+"5",function(){return e._storeNumber(5)});a.setAction("vi"+d+"6",function(){return e._storeNumber(6)});a.setAction("vi"+d+"7",function(){return e._storeNumber(7)});a.setAction("vi"+
d+"8",function(){return e._storeNumber(8)});a.setAction("vi"+d+"9",function(){return e._storeNumber(9)});a.setAction("vi"+d+"Left",function(){return e._invoke("charPrevious",{unit:"character"})},this._msg("viLeft"));a.setAction("vi"+d+"Right",function(){return e._invoke("charNext",{unit:"character"})},this._msg("viRight"));a.setAction("vi"+d+"Up",function(){return e._invoke("lineUp",{editLine:!0})},this._msg("viUp"));a.setAction("vi"+d+"Down",function(){return e._invoke("lineDown",{editLine:!0})},
this._msg("viDown"));a.setAction("vi"+d+"w",function(){return e._invoke("wordNext",{unit:"word"})},this._msg("viw"));a.setAction("vi"+d+"b",function(){return e._invoke("wordPrevious",{unit:"word"})},this._msg("vib"));a.setAction("vi"+d+"W",function(){return e._invoke("wordNext",{unit:"wordWS"})},this._msg("viW"));a.setAction("vi"+d+"B",function(){return e._invoke("wordPrevious",{unit:"wordWS"})},this._msg("viB"));a.setAction("vi"+d+"e",function(){return e._invoke("wordNext",{unit:"wordend"})},this._msg("vie"));
a.setAction("vi"+d+"E",function(){return e._invoke("wordNext",{unit:"wordendWS"})},this._msg("viE"));a.setAction("vi"+d+"$",function(){return e._invoke("lineEnd")},this._msg("vi$"));a.setAction("vi"+d+"^_",function(){return e._invoke(function(){var c=a.getModel(),d=a.getCaretOffset(),d=c.getLineAtOffset(d);a.setCaretOffset(c.getLineStart(d)+b(d))})},this._msg("vi^_"));a.setAction("vi"+d+"+",function(){return e._invoke(function(c){var d=a.getModel(),e=a.getCaretOffset(),f=d.getLineCount()-1,c=Math.min(d.getLineAtOffset(e)+
c.count,f);a.setCaretOffset(d.getLineStart(c)+b(c))},{editLine:!0})},this._msg("vi+"));a.setAction("vi"+d+"-",function(){return e._invoke(function(c){var d=a.getModel(),e=a.getCaretOffset(),c=Math.max(d.getLineAtOffset(e)-c.count,0);a.setCaretOffset(d.getLineStart(c)+b(c))},{editLine:!0})},this._msg("vi-"));a.setAction("vi"+d+"|",function(){return e._invoke(function(b){var c=a.getModel(),d=a.getCaretOffset(),d=c.getLineAtOffset(d);a.setCaretOffset(Math.min(c.getLineStart(d)+b.count-1,c.getLineEnd(d)))})},
this._msg("vi|"));a.setAction("vi"+d+"H",function(){return e._invoke(function(b){b=a.getModel().getLineStart(a.getTopIndex(!0)+(b.count-1));a.setCaretOffset(b)},{editLine:!0})},this._msg("viH"));a.setAction("vi"+d+"M",function(){return e._invoke(function(){var b=Math.ceil((a.getBottomIndex(!0)-a.getTopIndex(!0))/2)+a.getTopIndex(!0);a.setCaretOffset(a.getModel().getLineStart(b))},{editLine:!0})},this._msg("viM"));a.setAction("vi"+d+"L",function(){return e._invoke(function(b){a.setCaretOffset(a.getModel().getLineStart(a.getBottomIndex(!0)-
(b.count-1)))},{editLine:!0})},this._msg("viL"));a.setAction("vi"+d+"/",function(){var a={hideAfterFind:!0,incremental:!1,reverse:!1,findCallback:function(b){e._searchFwd=!0;c(b,a)}};return e._invoke("find",a)},this._msg("vi/"));a.setAction("vi"+d+"?",function(){var a={hideAfterFind:!0,incremental:!1,reverse:!0,findCallback:function(b){e._searchFwd=!1;c(b,a)}};return e._invoke("find",a)},this._msg("vi?"));a.setAction("vi"+d+"n",function(){var b,d=a.getCaretOffset();e._searchFwd?(b="findNext",d++):
b="findPrevious";var f={start:d,findCallback:function(a){c(a,f)}};return e._invoke(b,f)},this._msg("vin"));a.setAction("vi"+d+"N",function(){var b,d=a.getCaretOffset();e._searchFwd?b="findPrevious":(b="findNext",d++);var f={start:d,findCallback:function(a){c(a,f)}};return e._invoke(b,f)},this._msg("viN"));a.setAction("vi"+d+"f",function(){var b=a.getModel(),c=a.getCaretOffset();return e._findChar(c,b.getLineEnd(b.getLineAtOffset(c)),!1,0)},this._msg("vif"));a.setAction("vi"+d+"F",function(){var b=
a.getModel(),c=a.getCaretOffset();return e._findChar(b.getLineStart(b.getLineAtOffset(c)),c,!0,0)},this._msg("viF"));a.setAction("vi"+d+"t",function(){var b=a.getModel(),c=a.getCaretOffset();return e._findChar(c,b.getLineEnd(b.getLineAtOffset(c)),!1,-1)},this._msg("vit"));a.setAction("vi"+d+"T",function(){var b=a.getModel(),c=a.getCaretOffset();return e._findChar(b.getLineStart(b.getLineAtOffset(c)),c,!0,1)},this._msg("viT"));a.setAction("vi"+d+",",function(){return e._findNextChar(e._charTempOptions.reverse)},
this._msg("vi,"));a.setAction("vi"+d+";",function(){return e._findNextChar(!e._charTempOptions.reverse)},this._msg("vi;"));a.setAction("vi"+d+"G",function(){if(e.number===""){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());e.number=b.getLineCount()}return e._invoke(function(b){b=b||{};b.line=b.count;b.editLine=!0;b.callback=function(){b.editDone&&b.editDone()};a.invokeAction("gotoLine",!1,b)})},this._msg("viG"))},_invoke:function(a,b){var c=this.getView(),b=b||{};b.count=this._getCount();
typeof a==="function"?a(b):c.invokeAction(a,!1,b);return!0},_getCount:function(){var a=1;this.number!==""&&(a=this.number>>0);this.number="";return a},_findChar:function(a,b,c,d){this._charTempOptions={};this._charTempOptions.start=a;this._charTempOptions.end=b;this._charTempOptions.hideAfterFind=!0;this._charTempOptions.incremental=!1;this._charTempOptions.reverse=c;this._charTempOptions.offset=d;var e=this._charTempOptions,f=this;this._charTempOptions.findCallback=function(a){a&&f.getView().setCaretOffset(a.start+
d);e.editDone&&e.editDone()};return this._invoke("find",this._charTempOptions)},_findNextChar:function(a){if(this._charTempOptions){var b=this.getView(),c={};c.hideAfterFind=this._charTempOptions.hideAfterFind;c.incremental=this._charTempOptions.incremental;c.reverse=this._charTempOptions.reverse;c.wrap=!1;var d=this;c.findCallback=function(a){a&&d.getView().setCaretOffset(a.start+d._charTempOptions.offset);c.editDone&&c.editDone()};var e=b.getModel();return a?(c.start=b.getCaretOffset()+1-this._charTempOptions.offset,
c.end=e.getLineEnd(e.getLineAtOffset(c.start)),c.reverse=!1,this._invoke("findNext",c)):(c.start=b.getCaretOffset()-this._charTempOptions.offset,c.end=e.getLineStart(e.getLineAtOffset(c.start)),c.reverse=!0,this._invoke("findPrevious",c))}return!0},_storeNumber:function(a){var b=this;if(a===0&&!this.number)return this._invoke(function(){b.getView().invokeAction("lineStart",!0)});this.number+=a;return!0}});h.prototype=new k.KeyMode;c(h.prototype,{createKeyBindings:function(){var b=[];b.push({actionID:"vi-:-ESC",
keyBinding:a(27),predefined:!0});return b},_createActions:function(a){var b=this;a.setAction("vi-:-ESC",function(){a.removeKeyMode(b);a.addKeyMode(b.viMode);return!0})},match:function(a){var b=k.KeyMode.prototype.match.call(this,a);b||(b=this.getView().getKeyModes()[0].match(a));return b},storeNumber:function(a){this.number=a}});f.prototype=new i;c(f.prototype,{createKeyBindings:function(){var b=i.prototype.createKeyBindings.call(this);b.push({actionID:"vi-"+this.key+"ESC",keyBinding:a(27),predefined:!0});
b.push({actionID:"vi-"+this.key+"-"+this.key,keyBinding:a(this.key,!1,!1,!1,!1,"keypress")});return b},_invoke:function(a,b){var b=b||{},c=this.getView(),d=c.getCaretOffset(),e=d,f=c.getModel(),h=this;b.editDone=function(){var a=c.getCaretOffset();if(e>a){var g=e;e=a;a=g}b.editLine&&(e=f.getLineStart(f.getLineAtOffset(e)),a=f.getLineEnd(f.getLineAtOffset(a),h.key==="c"?!1:!0));h.key==="y"?(o=c.getText(e,a),p=b.editLine,c.setCaretOffset(d)):c.setText("",e,a);c.removeKeyMode(h);c.addKeyMode(h.nextMode)};
i.prototype._invoke.call(this,a,b);b.editDone();return!0},_getCount:function(){var a=1;this.firstNumber!==""&&(a=this.firstNumber>>0);var b=1;this.number!==""&&(b=this.number>>0);a*=b;this.number=this.firstNumber="";return a},_createActions:function(a){i.prototype._createActions.call(this,a);var b=this;a.setAction("vi-"+b.key+"ESC",function(){a.removeKeyMode(b);a.addKeyMode(b.viMode);return!0});a.setAction("vi-"+b.key+"-"+b.key,function(){return b._invoke("lineEnd",{editLine:!0})},this._msg("viycd"))},
storeNumber:function(a){this.firstNumber=a},_modeAdded:function(){this.secondNumber=""},_modeRemoved:function(){this.number=this.firstNumber=this.command=""}});e.prototype=new k.KeyMode;c(e.prototype,{createKeyBindings:function(){var b=[];b.push({actionID:"vi-insert-ESC",keyBinding:a(27),predefined:!0});return b},_createActions:function(a){var b=this;a.setAction("vi-insert-ESC",function(){a.removeKeyMode(b);a.addKeyMode(b.viMode);return!0})},match:function(a){var b=k.KeyMode.prototype.match.call(this,
a);b||(b=this.getView().getKeyModes()[0].match(a));return b},storeNumber:function(){}});n.prototype=new i;c(n.prototype,{createKeyBindings:function(){var b=i.prototype.createKeyBindings.call(this);b.push({actionID:"vi-ctrl-f",keyBinding:a("f",!0)});b.push({actionID:"vi-ctrl-b",keyBinding:a("b",!0)});b.push({actionID:"vi-ctrl-e",keyBinding:a("e",!0)});b.push({actionID:"vi-ctrl-y",keyBinding:a("y",!0)});b.push({actionID:"statusLineMode",keyBinding:a(":",!1,!1,!1,!1,"keypress")});b.push({actionID:"vi-a",
keyBinding:a("a",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-A",keyBinding:a("A",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-i",keyBinding:a("i",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-I",keyBinding:a("I",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-o",keyBinding:a("o",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-O",keyBinding:a("O",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-R",keyBinding:a("R",
!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-s",keyBinding:a("s",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-S",keyBinding:a("S",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-p",keyBinding:a("p",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-P",keyBinding:a("P",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-c",keyBinding:a("c",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-d",keyBinding:a("d",!1,!1,!1,!1,"keypress"),
predefined:!0});b.push({actionID:"vi-y",keyBinding:a("y",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-~",keyBinding:a("~",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-x",keyBinding:a("x",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-X",keyBinding:a("X",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-C",keyBinding:a("C",!1,!1,!1,!1,"keypress"),predefined:!0});b.push({actionID:"vi-D",keyBinding:a("D",!1,!1,!1,!1,"keypress"),predefined:!0});
return b},getKeyBindings:function(c){var d=k.KeyMode.prototype.getKeyBindings.call(this,c),d=d||[],e=this.changeMode.getKeyBindings(c),f;if(!this.changeMode.isActive())for(f=0;f<e.length;f++)e[f]=b([a("c",!1,!1,!1,!1,"keypress"),e[f]]);d=d.concat(e);e=this.deleteMode.getKeyBindings(c);if(!this.deleteMode.isActive())for(f=0;f<e.length;f++)e[f]=b([a("d",!1,!1,!1,!1,"keypress"),e[f]]);d=d.concat(e);e=this.yankMode.getKeyBindings(c);if(!this.yankMode.isActive())for(f=0;f<e.length;f++)e[f]=b([a("y",!1,
!1,!1,!1,"keypress"),e[f]]);return d=d.concat(e)},match:function(a){var b=k.KeyMode.prototype.match.call(this,a);!b&&a.type==="keypress"&&(b="noop");return b},_createActions:function(a){i.prototype._createActions.call(this,a);var b=this;a.setAction("vi-ctrl-f",function(){return b._invoke("pageDown")},{name:g.pageDown});a.setAction("vi-ctrl-b",function(){return b._invoke("pageUp")},{name:g.pageUp});a.setAction("vi-ctrl-e",function(){return b._invoke("scrollLineDown")},{name:g.scrollLineDown});a.setAction("vi-ctrl-y",
function(){return b._invoke("scrollLineUp")},{name:g.scrollLineUp});a.setAction("vi-a",function(){return b._toInsertMode("charNext")},{name:g.via});a.setAction("vi-A",function(){return b._toInsertMode("lineEnd")},{name:g.viA});a.setAction("vi-i",function(){return b._toInsertMode("noop")},{name:g.vii});a.setAction("vi-I",function(){return b._toInsertMode("lineStart")},{name:g.viI});a.setAction("vi-O",function(){return b._toInsertMode("enter",{insert:"above"})},{name:g.viO});a.setAction("vi-o",function(){return b._toInsertMode("enter",
{insert:"below"})},{name:g.vio});a.setAction("vi-R",function(){return b._toInsertMode("toggleOverwriteMode")},{name:g.viR});a.setAction("vi-s",function(){return b._toInsertMode("deleteNext",{unit:"char"})},{name:g.vis});a.setAction("vi-S",function(){return b._toInsertMode("deleteLines",{unit:"line"})},{name:g.viS});a.setAction("vi-p",function(){return b._invoke(function(){var a=b.getView(),c=a.getSelection();if(c.start===c.end){var d=a.getModel(),e=a.getCaretOffset();p?c.start=c.end=d.getLineEnd(d.getLineAtOffset(e),
!0):(c.start++,c.end++)}a.setText(o,c.start,c.end)})},{name:g.vip});a.setAction("vi-P",function(){return b._invoke(function(){var a=b.getView(),c=a.getSelection();if(c.start===c.end){var d=a.getModel(),e=a.getCaretOffset();if(p)c.start=c.end=d.getLineStart(d.getLineAtOffset(e))}a.setText(o,c.start,c.end)})},{name:g.viP});a.setAction("vi-c",function(){a.removeKeyMode(b);a.addKeyMode(b.changeMode);b.changeMode.storeNumber(b.number);b.number="";return!0});a.setAction("vi-d",function(){a.removeKeyMode(b);
a.addKeyMode(b.deleteMode);b.deleteMode.storeNumber(b.number);b.number="";return!0});a.setAction("vi-y",function(){a.removeKeyMode(b);a.addKeyMode(b.yankMode);b.yankMode.storeNumber(b.number);b.number="";return!0});a.setAction("vi-~",function(){return b._invoke("reversecase")},{name:g.reversecase});a.setAction("vi-x",function(){return b._invoke("deleteNext")},{name:g.deleteNext});a.setAction("vi-X",function(){return b._invoke("deletePrevious")},{name:g.deletePrevious});a.setAction("vi-C",function(){return b._toInsertMode("deleteLineEnd")},
{name:g.viC});a.setAction("vi-D",function(){return b._invoke("deleteLineEnd")},{name:g.deleteLineEnd})},_reportStatus:function(a){this.statusReporter&&this.statusReporter(a)},_toInsertMode:function(a,b){var b=b||{},c=1;this.number!==""&&(c=this.number>>0);b.count=c;c=this.getView();this.insertMode.storeNumber(this.number);c.invokeAction(a,!1,b);c.removeKeyMode(this);c.addKeyMode(this.insertMode);this.number="";return!0},_modeAdded:function(){this.getView().setOptions({blockCursorVisible:!0})},_modeRemoved:function(){var a=
this.getView();a.setOptions({blockCursorVisible:!1});a.removeKeyMode(this.insertMode);a.removeKeyMode(this.changeMode);a.removeKeyMode(this.deleteMode)}});return{VIMode:n}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(g,k,j,d,c){function a(a,c,d,f){k.Find.call(this,a,d,f);this._commandService=c}a.prototype=new k.Find;d.mixin(a.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?k.Find.prototype.getFindString.call(this):a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");
return!a?k.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();k.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){k.Find.prototype.show.call(this,a);var c=a.findString,a=a.replaceString,d=document.getElementById("localSearchFindWith");d||(this._createActionTable(),d=document.getElementById("localSearchFindWith"));if(c)d.value=c;if(a)document.getElementById("localSearchReplaceWith").value=a;window.setTimeout(function(){d.select();
d.focus()},10)},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(c){var d=document.createElement("input");d.type="text";d.name=g["Find:"];d.className="parameterInput";d.id="localSearchFindWith";d.placeholder=g["Find With"];d.oninput=function(c){return a._handleInput(c)};d.onkeydown=function(c){return a._handleKeyDown(c)};c.appendChild(d);a._createButton("Next",c,function(){a.find(!0)});a._createButton("Previous",c,function(){a.find(!1)});
var f=a._editor.getTextView().getOptions("readonly");if(!f){var e=document.createElement("input");e.type="text";e.name=g["ReplaceWith:"];e.className="parameterInput";e.id="localSearchReplaceWith";e.placeholder=g["Replace With"];e.onkeydown=function(c){return a._handleKeyDown(c)};c.appendChild(e);a._createButton(g.Replace,c,function(){a.replace()});a._createButton(g["Replace All"],c,function(){a.replaceAll()})}e=document.createElement("div");c.appendChild(e);e.classList.add("findOptionsDiv");var k=
j.createDropdownMenu(e,g.Options,null,"dismissButton",null,!0);k.menuButton.classList.add("parameterInlineButton");j.createCheckedMenuItem(k.menu,g["Show all"],a._showAll,function(c){a.setOptions({showAll:c.target.checked});k.dropdown.close(!0)});j.createCheckedMenuItem(k.menu,g["Case sensitive"],!a._caseInsensitive,function(c){a.setOptions({caseInsensitive:!c.target.checked});k.dropdown.close(!0);a.find(!0)});j.createCheckedMenuItem(k.menu,g["Wrap search"],a._wrap,function(c){a.setOptions({wrap:c.target.checked});
k.dropdown.close(!0)});j.createCheckedMenuItem(k.menu,g["Incremental search"],a._incremental,function(c){a.setOptions({incremental:c.target.checked});k.dropdown.close(!0)});j.createCheckedMenuItem(k.menu,g["Whole Word"],a._wholeWord,function(c){a.setOptions({wholeWord:c.target.checked});k.dropdown.close(!0);a.find(!0)});j.createCheckedMenuItem(k.menu,g["Regular expression"],a._regex,function(c){a.setOptions({regex:c.target.checked});k.dropdown.close(!0);a.find(!0)});f||j.createCheckedMenuItem(k.menu,
g["Find after replace"],a._findAfterReplace,function(c){a.setOptions({findAfterReplace:c.target.checked});k.dropdown.close(!0)});return d},function(){a.hide()})},_createButton:function(a,d,h){var f=document.createElement("button");f.addEventListener("click",h.bind(this),!1);var e=this;f.addEventListener("keydown",function(a){a.keyCode===c.KEY.ESCAPE&&e.hide()});f.appendChild(document.createTextNode(a));f.className="dismissButton parameterInlineButton";d.appendChild(f)},_handleInput:function(){this._incremental&&
this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var c=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(c&&a.keyCode===70)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,!1;if((this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&a.keyCode===75||a.keyCode===13)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,a.keyCode===13?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1;if(c&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),
a.cancelBubble=!0,this.replace(),!1;return a.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:a}});
define("orion/edit/dispatcher",["orion/edit/dispatcher"],function(){function g(g,j,d){this.serviceRegistry=g;this.editor=j;this.contentType=d;this.contentTypeService=g.getService("orion.core.contenttypes");this.serviceReferences={};var c=this;this.listener={onServiceAdded:function(a){c._onServiceAdded(a.serviceReference)},onServiceRemoved:function(a){c._onServiceRemoved(a.serviceReference)}};this.serviceRegistry.addEventListener("registered",this.listener.onServiceAdded);this.serviceRegistry.addEventListener("unregistering",
this.listener.onServiceRemoved);this._init()}g.prototype={_init:function(){var g=this;this.editor.getTextView()?this._wire(this.serviceRegistry):this.editor.addEventListener("TextViewInstalled",function(){g._wire(g.serviceRegistry)})},_wire:function(g){for(var g=g.getServiceReferences("orion.edit.model"),j=0;j<g.length;j++)this._wireServiceReference(g[j])},_wireServiceReference:function(g){var j=g.getProperty("contentType");if(typeof j!==void 0&&j!==null){var d=this;this.contentTypeService.isSomeExtensionOf(this.contentType,
j).then(function(c){c&&d._wireService(g,d.serviceRegistry.getService(g))})}},_wireService:function(g,j){var d=g.getProperty("types"),c=this.editor.getTextView();if(d){for(var a=0;a<d.length;a++){var b=d[a],i=j["on"+b];i&&this._wireServiceMethod(g,j,i,c,b)}this._initService(j,c)}},_wireServiceMethod:function(g,j,d,c,a){j=function(a){d(a).then()};g=g.getProperty("service.id");this.serviceReferences[g]=this.serviceReferences[g]||[];this.serviceReferences[g].push([c,a,j]);c.addEventListener(a,j)},_onServiceRemoved:function(g){var g=
g.getProperty("service.id"),j=this.serviceReferences[g];if(j){for(var d=0;d<j.length;d++){var c=j[d];c[0].removeEventListener(c[1],c[2])}delete this.serviceReferences[g]}},_onServiceAdded:function(g){g.getProperty("objectClass").indexOf("orion.edit.model")!==-1&&this._wireServiceReference(g)},_initService:function(g,j){var d=g.onModelChanging;if(typeof d==="function"){var c=j.getModel(),a=c.getText(),c={type:"Changing",text:a,start:0,removedCharCount:0,addedCharCount:a.length,removedLineCount:0,addedLineCount:c.getLineCount()};
d.call(g,c)}}};return{Dispatcher:g}});
define("orion/editor/keywords",[],function(){return{JSKeywords:"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".split(","),CSSKeywords:"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".split(","),JAVAKeywords:"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".split(",")}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/keywords"],function(g,k){function j(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function d(){j.call(this,null,!0)}function c(a){j.call(this,null,a)}function a(){j.call(this,null,!1)}function b(b,e,g){this.commentStart="/*";this.commentEnd="*/";var l=[];switch(e){case "java":l=h;break;case "js":l=i;break;case "css":l=f}this.whitespacesVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=
this.foldingEnabled=!0;this._scanner=new j(l,this.whitespacesVisible);this._firstScanner=new a;this._commentScanner=new c(this.whitespacesVisible);this._whitespaceScanner=new d;if(e==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=b;this.annotationModel=g;this._bracketAnnotations=void 0;var k=this;this._listener={onChanged:function(a){k._onModelChanged(a)},onDestroy:function(a){k._onDestroy(a)},onLineStyle:function(a){k._onLineStyle(a)},onMouseDown:function(a){k._onMouseDown(a)},
onSelection:function(a){k._onSelection(a)}};e=b.getModel();e.getBaseModel&&(e=e.getBaseModel());e.addEventListener("Changed",this._listener.onChanged);b.addEventListener("MouseDown",this._listener.onMouseDown);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("Destroy",this._listener.onDestroy);b.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();b.redrawLines()}var i=k.JSKeywords,h=k.JAVAKeywords,f=k.CSSKeywords,e={styleClass:"token_singleline_comment"},
n={styleClass:"token_multiline_comment"},o={styleClass:"token_doc_comment"},p={styleClass:"token_doc_html_markup"},m={styleClass:"token_task_tag"},q={styleClass:"token_doc_tag"},r={styleClass:"token_string"},s={styleClass:"token_number"},t={styleClass:"token_keyword"},l={styleClass:"token_space"},u={styleClass:"token_tab"},w={styleClass:"line_caret"};j.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(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===9);this._unread(a);return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,c=this.offset-1;if(!b&&48<=a&&a<=57){var d=b=!1,e=!1,f=a;do if(a=this._read(),a===46&&!b)b=!0;else if(a===101&&!d)b=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===
120&&f===48&&this.offset-c===2)b=d=e=!0;else if(!(48<=a&&a<=57||e&&(65<=a&&a<=70||97<=a&&a<=102)))break;while(1);this._unread(a);return 3}if(97<=a&&a<=122||65<=a&&a<=90||a===95||45===a&&b){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&b);this._unread(a);a=this.keywords;if(a.length>0){c=this.text.substring(c,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===c)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):
-1},_unread:function(a){a!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&a===47)for(;;)if(a=this._read(),a===-1||a===10||a===13)return this._unread(a),6;if(a===42){a=this._read();b=7;for(a===42&&(b=8);;){for(;a===42;)if(a=this._read(),a===47)return b;if(a===-1)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),a!==10&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};d.prototype=new j(null);d.prototype.nextToken=
function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(a===32||a===9||a===-1));this._unread(a);return 1}}};c.prototype=new j(null);c.prototype.setType=function(a){this._type=a};c.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return a===32?11:10;do a=this._read();while(a===32||a===
9);this._unread(a);return 9;case 60:if(this._type===8){do a=this._read();while(!(a===62||a===-1));if(a===62)return 12}return 1;case 64:if(this._type===8){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57);this._unread(a);return 13}return 1;case 84:if((a=this._read())===79)if((a=this._read())===68)if((a=this._read())===79)if(a=this._read(),!(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(a===32||
a===9||a===-1||a===60||a===64||a===84));this._unread(a);return 1}}};a.prototype=new j(null);a.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};b.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);
a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a){this.whitespacesVisible=a;this._scanner.whitespacesVisible=a;this._commentScanner.whitespacesVisible=a},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,
b,c,d,e){var f;d===void 0&&(d=-1);if(e===void 0)e=a.length;for(;e-d>1;)if(f=Math.floor((e+d)/2),b<=a[f].start)e=f;else if(c&&b<a[f].end){e=f;break}else d=f;return e},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(g.AnnotationType.ANNOTATION_FOLDING);for(var c=
[],d=a.getBaseModel(),e=this.comments,f=0;f<e.length;f++){var h=e[f];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&c.push(h)}b.replaceAnnotations(null,c)}}}},_createFoldingAnnotation:function(a,b,c,d){var e=b.getLineAtOffset(c),b=b.getLineAtOffset(d);return e===b?null:new (g.AnnotationType.getType(g.AnnotationType.ANNOTATION_FOLDING))(c,d,a)},_computeTasks:function(a,b,c){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),f=e;e.getBaseModel&&(f=e.getBaseModel());
for(var h=d.getAnnotations(b,c),e=[],i=g.AnnotationType.ANNOTATION_TASK;h.hasNext();){var j=h.next();j.type===i&&e.push(j)}h=[];j=this._commentScanner;j.setText(f.getText(b,c));for(var l;l=j.nextToken();){var k=j.getStartOffset()+b;l===14&&(l=f.getLineEnd(f.getLineAtOffset(k)),a!==6&&(l=Math.min(l,c-this.commentEnd.length)),h.push(g.AnnotationType.createAnnotation(i,k,l,f.getText(k,l))))}d.replaceAnnotations(e,h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,c=b.getModel(),
b=b.getSelection();if(b.start===b.end&&c.getLineAtOffset(b.start)===a)return w}return null},_getStyles:function(a,b,c){a.getBaseModel&&(c=a.mapOffset(c));for(var d=c+b.length,e=[],f=c,h=this.comments,g=this._binarySearch(h,c,!0);g<h.length;g++){if(h[g].start>=d)break;var i=h[g].start,j=h[g].end;f<i&&this._parse(b.substring(f-c,i-c),f,e);var l=h[g].type,k;switch(l){case 8:k=o;break;case 7:k=n;break;case 5:k=r}f=Math.max(f,i);i=Math.min(d,j);(l===8||l===7)&&(this.whitespacesVisible||this.detectHyperlinks)?
this._parseComment(b.substring(f-c,i-c),f,e,k,l):l===5&&this.whitespacesVisible?this._parseString(b.substring(f-c,i-c),f,e,r):e.push({start:f,end:i,style:k});f=j}f<d&&this._parse(b.substring(f-c,d-c),f,e);if(a.getBaseModel)for(b=0;b<e.length;b++)c=e[b].end-e[b].start,e[b].start=a.mapOffset(e[b].start,!0),e[b].end=e[b].start+c;return e},_parse:function(a,b,c){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var f=d.getStartOffset()+b,h=null;switch(a){case 2:h=t;break;case 3:h=s;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),
f,c,r);continue}else h=r;break;case 8:this._parseComment(d.getData(),f,c,o,a);continue;case 6:this._parseComment(d.getData(),f,c,e,a);continue;case 7:this._parseComment(d.getData(),f,c,n,a);continue;case 10:this.whitespacesVisible&&(h=u);break;case 11:this.whitespacesVisible&&(h=l)}c.push({start:f,end:d.getOffset()+b,style:h})}},_parseComment:function(a,b,c,d,e){var f=this._commentScanner;f.setText(a);for(f.setType(e);a=f.nextToken();){var e=f.getStartOffset()+b,h=d;switch(a){case 10:this.whitespacesVisible&&
(h=u);break;case 11:this.whitespacesVisible&&(h=l);break;case 12:h=p;break;case 13:h=q;break;case 14:h=m;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(f.getData(),e,c,h))}h&&c.push({start:e,end:f.getOffset()+b,style:h})}},_parseString:function(a,b,c,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var f=e.getStartOffset()+b,h=d;switch(a){case 10:this.whitespacesVisible&&(h=u);break;case 11:this.whitespacesVisible&&(h=l)}h&&c.push({start:f,end:e.getOffset()+b,style:h})}},
_detectHyperlinks:function(a,b,c,d){var e=null,f;if((f=a.indexOf("://"))>0){for(var e=a,h=f;h>0;){f=e.charCodeAt(h-1);if(!(97<=f&&f<=122||65<=f&&f<=90||45===f||48<=f&&f<=57))break;h--}if(h>0&&(f="\"\"''(){}[]<>".indexOf(e.substring(h-1,h)),f!==-1&&(f&1)===0&&(f=e.lastIndexOf("\"\"''(){}[]<>".substring(f+1,f+2)))!==-1)){var g=f;f=this._clone(d);f.tagName="a";f.attributes={href:e.substring(h,g)};c.push({start:b,end:b+h,style:d});c.push({start:b+h,end:b+g,style:f});c.push({start:b+g,end:b+a.length,style:d});
return null}}else a.toLowerCase().indexOf("bug#")===0&&(e="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(a.substring(4),10));return e?(f=this._clone(d),f.tagName="a",f.attributes={href:e},f):d},_clone:function(a){if(!a)return a;var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},_findComments:function(a,b){var b=b||0,c=this._firstScanner,d;c.setText(a);for(var e=[];d=c.nextToken();)(d===7||d===8||d===5)&&e.push({start:c.getStartOffset()+b,end:c.getOffset()+b,type:d}),(d===
6||d===7||d===8)&&this._computeTasks(d,c.getStartOffset()+b,c.getOffset()+b);return e},_findMatchingBracket:function(a,b){var c="{}()[]<>",d=a.getText(b,b+1),e=c.indexOf(d,0);if(e===-1)return-1;var f;f=e&1?c.substring(e-1,e):c.substring(e+1,e+2);for(var h=a.getLineAtOffset(b),c=a.getLine(h),g=a.getLineStart(h),i=a.getLineEnd(h),c=this._findBrackets(d,f,c,g,g,i),i=0;i<c.length;i++)if(g=c[i]>=0?1:-1,c[i]*g-1===b){var j=1;if(e&1){for(i--;i>=0;i--)if(g=c[i]>=0?1:-1,j+=g,j===0)return c[i]*g-1;for(h-=1;h>=
0;){c=a.getLine(h);g=a.getLineStart(h);i=a.getLineEnd(h);c=this._findBrackets(d,f,c,g,g,i);for(e=c.length-1;e>=0;e--)if(g=c[e]>=0?1:-1,j+=g,j===0)return c[e]*g-1;h--}}else{for(i++;i<c.length;i++)if(g=c[i]>=0?1:-1,j+=g,j===0)return c[i]*g-1;h+=1;for(e=a.getLineCount();h<e;){c=a.getLine(h);g=a.getLineStart(h);i=a.getLineEnd(h);c=this._findBrackets(d,f,c,g,g,i);for(i=0;i<c.length;i++)if(g=c[i]>=0?1:-1,j+=g,j===0)return c[i]*g-1;h++}}break}return-1},_findBrackets:function(a,b,c,d,e,f){for(var h=[],a=
a.charCodeAt(0),b=b.charCodeAt(0),g=e,i=this._scanner,j,l=this.comments,k=this._binarySearch(l,e,!0);k<l.length;k++){if(l[k].start>=f)break;j=l[k].start;var n=l[k].end;if(g<j)for(i.setText(c.substring(g-e,j-e));j=i.nextToken();)j===a?h.push(i.getStartOffset()+g-e+d+1):j===b&&h.push(-(i.getStartOffset()+g-e+d+1));g=n}if(g<f)for(i.setText(c.substring(g-e,f-e));j=i.nextToken();)j===a?h.push(i.getStartOffset()+g-e+d+1):j===b&&h.push(-(i.getStartOffset()+g-e+d+1));return h},_onDestroy:function(){this.destroy()},
_onLineStyle:function(a){if(a.textView===this.view)a.style=this._getLineStyle(a.lineIndex);a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,c=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var f=a.getLineAtOffset(b.start);e=a.getLineAtOffset(c.start);var h=c.start===c.end,b=b.start===b.end;f===e&&b&&h||(b&&d.redrawLines(f,f+1),(f!==e||!b)&&h&&d.redrawLines(e,e+1))}if(this.annotationModel){var b=this._bracketAnnotations,
i,j;if(c.start===c.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),a=this._findMatchingBracket(a,j),a!==-1&&(i=[g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),g.AnnotationType.createAnnotation(g.AnnotationType.ANNOTATION_CURRENT_BRACKET,j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(b,i)}},_onMouseDown:function(a){if(a.clickCount===2){var b=this.view,c=b.getModel(),d=b.getOffsetAtLocation(a.x,
a.y);if(d>0){var e=d-1,f=c;c.getBaseModel&&(e=c.mapOffset(e),f=c.getBaseModel());e=this._findMatchingBracket(f,e);e!==-1&&(a.preventDefault(),a=e,c.getBaseModel&&(a=c.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=a.start,c=a.removedCharCount,d=a.addedCharCount-c,e=this.view,a=e.getModel(),f=a.getBaseModel?a.getBaseModel():a,c=b+c,h=f.getCharCount(),i=this.comments.length,j=f.getLineStart(f.getLineAtOffset(b)),l=this._binarySearch(this.comments,j,!0),k=this._binarySearch(this.comments,
c,!1,l-1,i);l<i&&this.comments[l].start<=j&&j<this.comments[l].end?(j=this.comments[l].start,j>b&&(j+=d)):j=l===i&&i>0&&h-d===this.comments[i-1].end?this.comments[i-1].start:j;var n;k<i?(n=this.comments[k].end,n>b&&(n+=d),k+=1):(k=i,n=h);for(var m,h=this._findComments(f.getText(j,n),j),i=l;i<this.comments.length;i++)m=this.comments[i],m.start>b&&(m.start+=d),m.start>b&&(m.end+=d);var p=k-l!==h.length;if(!p)for(i=0;i<h.length;i++){m=this.comments[l+i];var o=h[i];if(m.start!==o.start||m.end!==o.end||
m.type!==o.type){p=!0;break}}i=[l,k-l].concat(h);Array.prototype.splice.apply(this.comments,i);p&&(i=j,m=n,a!==f&&(i=a.mapOffset(i,!0),m=a.mapOffset(m,!0)),e.redrawRange(i,m));if(this.foldingEnabled&&f!==a&&this.annotationModel){e=this.annotationModel;l=e.getAnnotations(j,n);j=[];for(n=[];l.hasNext();)if(m=l.next(),m.type===g.AnnotationType.ANNOTATION_FOLDING){n.push(m);for(i=0;i<h.length;i++)if(m.start===h[i].start&&m.end===h[i].end)break;i===h.length?(j.push(m),m.expand()):(i=m.start,k=m.end,i>
b&&(i-=d),k>b&&(k-=d),i<=b&&b<k&&i<=c&&c<k&&(i=f.getLineAtOffset(m.start),k=f.getLineAtOffset(m.end),i!==k?m.expanded||(m.expand(),e.modifyAnnotation(m)):e.removeAnnotation(m)))}b=[];for(i=0;i<h.length;i++){m=h[i];for(d=0;d<n.length;d++)if(n[d].start===m.start&&n[d].end===m.end)break;d===n.length&&(m=this._createFoldingAnnotation(a,f,m.start,m.end))&&b.push(m)}e.replaceAnnotations(j,b)}}};return{TextStyler:b}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(g){function k(c){var a;if(c instanceof Array){a=Array(c.length);for(var b=0;b<c.length;b++)a[b]=k(c[b])}else for(b in a={},c)if(Object.prototype.hasOwnProperty.call(c,b)){var d=c[b];a[b]=typeof d==="object"&&d!==null?k(d):d}return a}function j(c,a,b){this.initialize(c);this.grammar=k(a);this.externalGrammars=b?k(b):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var d={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function a(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var b="",g,c=d.processGlobalFlag("x",c,function(a){for(var b="",c=!1,d=a.length,h=0;h<d;){var g=a.charAt(h);if(!c&&g==="#")for(;h<d&&g!=="\r"&&g!=="\n";)g=a.charAt(++h);
else if(!c&&/\s/.test(g))for(;h<d&&/\s/.test(g);)g=a.charAt(++h);else g==="\\"?(b+=g,/\s/.test(a.charAt(h+1))||(b+=a.charAt(h+1),h+=1)):(g==="["?c=!0:g==="]"&&(c=!1),b+=g),h+=1}return b}),c=d.processGlobalFlag("i",c,function(a){b+="i";return a});for(g=0;g<this.unsupported.length;g++){var h;(h=this.unsupported[g].regex.exec(c))&&a(this.unsupported[g].func(h),h)}return RegExp(c,b)},processGlobalFlag:function(c,a,b){function d(a,b){for(var c=0,h=a.length,g=-1,i=b;i<h&&g===-1;i++)switch(a.charAt(i)){case "\\":i++;
break;case "(":c++;break;case ")":c--,c===0&&(g=i)}return g}var h="(?"+c+")",c="(?"+c+":";if(a.substring(0,h.length)===h)return b(a.substring(h.length));else if(a.substring(0,c.length)===c){h=d(a,0);if(h<a.length-1)throw Error("Only a "+c+") group that encloses the entire regex is supported in: "+a);return b(a.substring(c.length,h))}return a},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,a,b){for(var b=typeof b==="undefined"?!0:!1,c=c.source.split(/(\\\d+)/g),
d=[],h=0;h<c.length;h++){var f=c[h],e=/\\(\d+)/.exec(f);e?(f=a[e[1]]||"",d.push(b?g.escape(f):f)):d.push(f)}return RegExp(d.join(""))},groupify:function(c,a){for(var b=c.source,d=b.length,h=[],f=0,e=[],g=1,j=1,k=[],m={},q={},r=0;r<d;r++){var s=h[h.length-1],t=b.charAt(r);switch(t){case "(":if(s===4)h.pop(),k.push(")"),e[e.length-1].end=r;var l=r+2<d?b.charAt(r+1)+""+b.charAt(r+2):null;if(l==="?:"||l==="?="||l==="?!"){var u;l==="?:"?u=1:(u=3,f++);h.push(u);e.push({start:r,end:-1,type:u});k.push(t);
k.push(l);r+=l.length}else h.push(2),e.push({start:r,end:-1,type:2,oldNum:g,num:j}),k.push(t),f===0&&(q[j]=null),m[g]=j,g++,j++;break;case ")":s=h.pop();s===3&&f--;e[e.length-1].end=r;k.push(t);break;case "*":case "+":case "?":case "}":var w=t,v=b.charAt(r-1),l=r-1;if(t==="}"){for(u=r-1;b.charAt(u)!=="{"&&u>=0;u--);v=b.charAt(u-1);l=u-1;w=b.substring(u,r+1)}u=e[e.length-1];if(v===")"&&(u.type===2||u.type===4)){k.splice(u.start,0,"(");k.push(w);k.push(")");t={start:u.start,end:k.length-1,type:4,num:u.num};
for(v=0;v<e.length;v++)if(s=e[v],(s.type===2||s.type===4)&&s.start>=u.start&&s.end<=l)if(s.start+=1,s.end+=1,s.num+=1,s.type===2)m[s.oldNum]=s.num;e.push(t);j++;break}default:t!=="|"&&s!==2&&s!==4&&f===0&&(h.push(4),e.push({start:r,end:-1,type:4,num:j}),k.push("("),q[j]=null,j++),k.push(t),t==="\\"&&(t=b.charAt(r+1),k.push(t),r+=1)}}for(;h.length;)h.pop(),k.push(")");var b=RegExp(k.join("")),d={},a=a||m,y;for(y in a)a.hasOwnProperty(y)&&(d[y]="\\"+a[y]);b=this.getSubstitutedRegex(b,d,!1);return[b,
m,q]},complexCaptures:function(c){if(!c)return!1;for(var a in c)if(c.hasOwnProperty(a)&&a!=="0")return!0;return!1}};j.prototype={initialize:function(c){this.textView=c;this.textView.stylerOptions=this;var a=this;this._listener={onModelChanged:function(b){a.onModelChanged(b)},onDestroy:function(b){a.onDestroy(b)},onLineStyle:function(b){a.onLineStyle(b)},onStorage:function(b){a.onStorage(b)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);
c.addEventListener("LineStyle",this._listener.onLineStyle);c.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},preprocess:function(c){for(c=[c];c.length!==0;){var a=
c.pop();if(!a._resolvedRule||!a._typedRule)if(a._resolvedRule=this._resolve(a),a._typedRule=this._createTypedRule(a),this.addStyles(a.name),this.addStyles(a.contentName),this.addStylesForCaptures(a.captures),this.addStylesForCaptures(a.beginCaptures),this.addStylesForCaptures(a.endCaptures),a._resolvedRule!==a&&c.push(a._resolvedRule),a.patterns)for(var b=0;b<a.patterns.length;b++)c.push(a.patterns[b])}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var a=c.split("."),b=0;b<
a.length;b++)this._styles[c].push(a.slice(0,b+1).join("-"))}},addStylesForCaptures:function(c){for(var a in c)c.hasOwnProperty(a)&&this.addStyles(c[a].name)},ContainerRule:function(){function c(a){this.rule=a;this.subrules=a.patterns}c.prototype.valueOf=function(){return"aa"};return c}(),BeginEndRule:function(){function c(a){this.rule=a;this.beginRegex=d.toRegExp(a.begin);this.endRegex=d.toRegExp(a.end);this.subrules=a.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var b=d.complexCaptures(a.captures),
a=d.complexCaptures(a.beginCaptures)||d.complexCaptures(a.endCaptures);if(this.isComplex=b||a)b=d.groupify(this.beginRegex),this.beginRegex=b[0],this.beginOld2New=b[1],this.beginConsuming=b[2],b=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=b[0],this.endOld2New=b[1],this.endConsuming=b[2]}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(a){this.rule=a;this.matchRegex=d.toRegExp(a.match);if(this.isComplex=d.complexCaptures(a.captures))a=
d.groupify(this.matchRegex),this.matchRegex=a[0],this.matchOld2New=a[1],this.matchConsuming=a[2]}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var a=c;if(c.include){if(c.begin||c.end||c.match)throw Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c.charAt(0)==="#"){if(a=this.grammar.repository&&this.grammar.repository[c.substring(1)],
!a)throw Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")a=this.grammar;else if(c==="$base")throw Error('Include "$base" is not supported');else if(a=this._allGrammars[c],!a)for(var b=0;b<this.externalGrammars.length;b++){var d=this.externalGrammars[b];if(d.scopeName===c){this.preprocess(d);a=this._allGrammars[c]=d;break}}}return a},ContainerNode:function(){function c(a,b){this.parent=a;this.rule=b;this.children=[];this.end=this.start=null}c.prototype.addChild=
function(a){this.children.push(a)};c.prototype.valueOf=function(){var a=this.rule;return"ContainerNode { "+(a.include||"")+" "+(a.name||"")+(a.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(a,b,c){this.parent=a;this.rule=b;this.children=[];this.setStart(c);this.endMatch=this.end=null;this.endRegexSubstituted=b.endRegexHasBackRef?d.getSubstitutedRegex(b.endRegex,c):null}c.prototype.addChild=function(a){this.children.push(a)};c.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};c.prototype.setStart=function(a){this.start=a.index;this.beginMatch=a};c.prototype.setEnd=function(a){a&&typeof a==="object"?(this.endMatch=a,this.end=a.index+a[0].length):(this.endMatch=null,this.end=a)};c.prototype.shiftStart=function(a){this.start+=a;this.beginMatch.index+=a};c.prototype.shiftEnd=function(a){this.end+=a;this.endMatch&&(this.endMatch.index+=a)};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return c}(),push:function(c,a){if(a)for(var b=a.length;b>0;)c.push(a[--b])},exec:function(c,a,b){(a=c.exec(a))&&(a.index+=b);c.lastIndex=0;return a},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,a,b){if(c instanceof this.BeginEndNode){var d=c.rule,c=c.endRegexSubstituted||d.endRegex;return!c?null:this.exec(c,a,b)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,
!1,0)},onModelChanged:function(c){var a=c.addedCharCount,b=c.removedCharCount,c=c.start;if(this._tree){var d=this.textView.getModel(),h=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(c)-1),f=this.getFirstDamaged(d,d),d=d===-1?0:d,a=f?this.parse(f,!0,d,c,a,b):h;this.textView.redrawRange(d,a)}else this.initialParse()},getFirstDamaged:function(c,a){if(c<0)return this._tree;for(var b=[this._tree],d=null;b.length;){var h=b.pop();if(!h.parent||this.isDamaged(h,c,a)){h instanceof this.BeginEndNode&&(d=
h);for(var f=0;f<h.children.length;f++)b.push(h.children[f])}}return d||this._tree},isDamaged:function(c,a,b){return c.start<=b&&c.end>a},parse:function(c,a,b,d,h,f){var e=this.textView.getModel(),g=e.getLineStart(e.getLineCount()-1),j=e.getCharCount(),k=this.getInitialExpected(c,b),m=-1;if(a)c.repaired=!0,c.endNeedsUpdate=!0,m=(m=c.children[c.children.length-1])?e.getLineEnd(e.getLineAtOffset(m.end+(h-f))):-1,d=e.getLineEnd(e.getLineAtOffset(d+f)),m=Math.max(m,d);for(var m=m===-1?j:m,d=k,q=c,r=!1,
s=b,t=-1;q&&(!a||s<m);){var l=this.getNextMatch(e,q,s);l||(s=s>=g?j:e.getLineStart(e.getLineAtOffset(s)+1));var u=l&&l.match,w=l&&l.rule,v=l&&l.isEnd;if(l&&l.isSub){if(s=this.afterMatch(u),w instanceof this.BeginEndRule)r=!0,a&&w===d.rule&&q===d.parent?(q=d,q.setStart(u),q.repaired=!0,q.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(a&&(this.prune(q,d),a=!1),u=new this.BeginEndNode(q,w,u),q.addChild(u),q=u)}else if(v||s===j){if(q instanceof this.BeginEndNode)u?(r=!0,t=Math.max(t,q.end),q.setEnd(u),
s=this.afterMatch(u),a&&q===d&&q.parent===d.parent?(q.repaired=!0,delete q.endNeedsUpdate,d=this.getNextExpected(d,"end")):a&&(this.prune(q,d),a=!1)):(q.setEnd(j),delete q.endNeedsUpdate);q=q.parent}a&&s>=m&&!r&&(this.prune(c,k),a=!1)}this.removeUnrepairedChildren(c,a,b);this.cleanup(a,c,b,m,j,h,f);return a?Math.max(t,s):s},removeUnrepairedChildren:function(c,a,b){if(a){for(var a=c.children,d=-1,h=0;h<a.length;h++){var f=a[h];if(!f.repaired&&this.isDamaged(f,b,Number.MAX_VALUE)){d=h;break}}if(d!==
-1)c.children.length=d}},cleanup:function(c,a,b,d,h,f,e){if(c){c=f-e;h=this.getIntersecting(d-c+1,h);a=this.getIntersecting(b,d);for(b=0;b<h.length;b++)d=h[b],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(c),d.shiftStart(c));for(b=0;b<a.length;b++)d=a[b],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(c),delete d.endNeedsUpdate,delete d.repaired}else{a=this.getIntersecting(b,d);for(b=0;b<a.length;b++)delete a[b].repaired}},getNextMatch:function(c,a,b,d){var h=c.getLineAtOffset(b),h=c.getLineEnd(h),
f=c.getText(b,h),e=[],g=[],c=[],h=[];for(this.push(e,a.rule.subrules);e.length;){var j=e.length?e.pop():null,j=j&&j._resolvedRule._typedRule;if(j instanceof this.ContainerRule&&g.indexOf(j)===-1)g.push(j),this.push(e,j.subrules);else if(!j||!d||j.matchRegex){var k=j&&this.exec(j.matchRegex||j.beginRegex,f,b);k&&(c.push(k),h.push(j))}}e=Number.MAX_VALUE;g=-1;for(j=0;j<c.length;j++)if(k=c[j],k.index<e)e=k.index,g=j;if(!d&&(b=this.getEndMatch(a,f,b)))if(d=a.rule.applyEndPatternLast,g===-1||b.index<e||
!d&&b.index===e)return{isEnd:!0,rule:a.rule,match:b};return g===-1?null:{isSub:!0,rule:h[g],match:c[g]}},getInitialExpected:function(c,a){var b,d;if(c===this._tree)for(b=0;b<c.children.length;b++){if(d=c.children[b],d.start>=a)return d}else if(c instanceof this.BeginEndNode&&c.endMatch){var h=c.endMatch.index;for(b=0;b<c.children.length;b++)if(d=c.children[b],d.start>=a)break;if(d&&d.start<h)return d}return c},getNextExpected:function(c,a){if(a==="begin"){var b=c.children[0];return b?b:c}else if(a===
"end"&&(b=c.parent)){var d=b.children[b.children.indexOf(c)+1];return d?d:b}return null},prune:function(c,a){if(a.parent===c)c.children.length=a.getIndexInParent();else if(c instanceof this.BeginEndNode)c.endMatch=null,c.end=null;if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){this._tree||this.initialParse();var a=c.lineStart,b=this.textView.getModel(),d=b.getLineEnd(c.lineIndex),h=b.getLineEnd(b.getLineAtOffset(a)-1),h=this.getFirstDamaged(h,h),a=this.getLineScope(b,
h,a,d);c.ranges=this.toStyleRanges(a);c.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(c,a,b,d){for(var h=b,f=this.getInitialExpected(a,b),e=[],g=[];a&&h<d;){var j=this.getNextMatch(c,a,h);if(!j)break;var k=j&&j.match,m=j&&j.rule,q=j&&j.isSub,j=j&&j.isEnd;k.index!==h&&g.push({start:h,end:k.index,node:a});if(q)h=this.afterMatch(k),m instanceof this.BeginEndRule?(this.addBeginScope(e,k,m),a=f,f=this.getNextExpected(f,"begin")):this.addMatchScope(e,k,m);else if(j)h=this.afterMatch(k),
this.addEndScope(e,k,m),f=this.getNextExpected(f,"end"),a=a.parent}h<d&&g.push({start:h,end:d,node:a});c=this.getInheritedLineScope(g,b,d);return e.concat(c)},getInheritedLineScope:function(c){for(var a=[],b=0;b<c.length;b++)for(var d=c[b],h=d.node;h;){var f=h.rule.rule,e=f.name;if(f=f.contentName||e){this.addScopeRange(a,d.start,d.end,f);break}h=h.parent}return a},addBeginScope:function(c,a,b){var d=b.rule;this.addCapturesScope(c,a,d.beginCaptures||d.captures,b.isComplex,b.beginOld2New,b.beginConsuming)},
addEndScope:function(c,a,b){var d=b.rule;this.addCapturesScope(c,a,d.endCaptures||d.captures,b.isComplex,b.endOld2New,b.endConsuming)},addMatchScope:function(c,a,b){var d=b.rule,h=d.name;(d=d.captures)?this.addCapturesScope(c,a,d,b.isComplex,b.matchOld2New,b.matchConsuming):this.addScope(c,a,h)},addScope:function(c,a,b){b&&c.push({start:a.index,end:this.afterMatch(a),scope:b})},addScopeRange:function(c,a,b,d){d&&c.push({start:a,end:b,scope:d})},addCapturesScope:function(c,a,b,d,h,f){if(b)if(d){for(var d=
{1:0},e=0,g=1;a[g]!==void 0;g++)f[g]!==void 0&&(e+=a[g].length),a[g+1]!==void 0&&(d[g+1]=e);f=a.index;for(e=1;b[e];e++){var g=b[e].name,j=h[e],k=f+d[j];typeof a[j]!=="undefined"&&this.addScopeRange(c,k,k+a[j].length,g)}}else this.addScope(c,a,b[0]&&b[0].name)},getIntersecting:function(c,a){for(var b=[],d=this._tree?[this._tree]:[];d.length;){var h=d.pop(),f=!1;h instanceof this.ContainerNode?f=!0:this.isDamaged(h,c,a)&&(f=!0,b.push(h));if(f)for(var f=h.children.length,e=0;e<f;e++)d.push(h.children[e])}return b.reverse()},
toStyleRanges:function(c){for(var a=[],b=0;b<c.length;b++){var d=c[b],h=this._styles[d.scope];if(!h)throw Error("styles not found for "+d.scope);h=h.join(" ");a.push({start:d.start,end:d.end,style:{styleClass:h}})}return a}};return{RegexUtil:d,TextMateStyler:j}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(g,k){function j(a){return a.getProperty("objectClass").indexOf(c)!==-1&&a.getProperty("type")==="highlighter"}function d(a,c,d){this.initialize(a,c,d);this.lineStyles=[]}var c="orion.edit.highlighter",a=c+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:g.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
d.prototype={initialize:function(a,d,h){this.textView=a;this.serviceRegistry=d;this.annotationModel=h;this.services=[];var f=this;this.listener={onModelChanging:function(a){f.onModelChanging(a)},onModelChanged:function(a){f.onModelChanged(a)},onDestroy:function(a){f.onDestroy(a)},onLineStyle:function(a){f.onLineStyle(a)},onStyleReady:function(a){f.onStyleReady(a)},onServiceAdded:function(a){f.onServiceAdded(a.serviceReference,f.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){f.onServiceRemoved(a.serviceReference,
f.serviceRegistry.getService(a.serviceReference))}};a.addEventListener("ModelChanging",this.listener.onModelChanging);a.addEventListener("ModelChanged",this.listener.onModelChanged);a.addEventListener("Destroy",this.listener.onDestroy);a.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);a=d.getServiceReferences(c);for(h=0;h<a.length;h++){var e=a[h];j(e)&&this.addServiceListener(d.getService(e))}},
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 a=0;a<this.services.length;a++)this.removeServiceListener(this.services[a]);this.services=
null}if(this.serviceRegistry)this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null;this.lineStyles=this.listener=null},onModelChanging:function(a){this.startLine=this.textView.getModel().getLineAtOffset(a.start)},onModelChanged:function(a){var c=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[c,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var c=a.lineStyles||a.style,a=Number.MAX_VALUE,d=-1,f=this.textView.getModel(),e;for(e in c)c.hasOwnProperty(e)&&(this.lineStyles[e]=c[e],a=Math.min(a,e),d=Math.max(d,e));a=Math.max(a,0);d=Math.min(d,f.getLineCount());if(c=this.annotationModel){for(var g=c.getAnnotations(f.getLineStart(a),f.getLineEnd(d)),j=[];g.hasNext();){var p=g.next();p.type==="orion.annotation.highlightError"&&j.push(p)}g=[];for(p=a;p<=d;p++){e=p;var m=this.lineStyles[e],m=m&&m.errors;e=f.getLineStart(e);
if(m)for(var q=0;q<m.length;q++){var r=m[q];g.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",r.start+e,r.end+e))}}c.replaceAnnotations(j,g)}this.textView.redrawLines(a,d+1)},onLineStyle:function(a){function c(a,b){for(var d=a.length,h=[],g=0;g<d;g++){var i=a[g];h.push({start:i.start+b,end:i.end+b,style:i.style})}return h}var d=this.lineStyles[a.lineIndex];if(d)if(d.ranges)a.ranges=c(d.ranges,a.lineStart);else if(d.style)a.style=d.style},_getEmptyStyle:function(a){for(var c=
[],d=0;d<a;d++)c.push(null);return c},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var c=this.services[a];if(c.setContentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(c.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):c.setContentType(this.contentType)}}},onServiceAdded:function(a,c){j(a)&&this.addServiceListener(c)},onServiceRemoved:function(a,
c){this.services.indexOf(c)!==-1&&this.removeServiceListener(c)},addServiceListener:function(b){if(typeof b.addEventListener==="function"){if(b.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(b),b.setContentType&&this.contentType){var c=this.serviceRegistry.getService("orion.page.progress");c?c.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(a))},removeServiceListener:function(b){typeof b.removeEventListener==="function"?(b.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),b=this.services.indexOf(b),b!==-1&&this.services.splice(b,1)):typeof console!=="undefined"&&console.log(Error(a))}};return d});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(g,k,j,d){function c(a,c,h,f,e,n,o){function p(a,b){var e=a.getProperty("contentType"),f=a.getProperty("fileTypes");if(e)return c.isSomeExtensionOf(h,e).then(function(b){return b?a:null});else if(b&&f&&f.indexOf(b)!==-1)return e=new d,e.resolve(a),e;return null}var m=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new g.TextStyler(f,"js",e);break;case "text/x-java-source":b=new g.TextStyler(f,"java",e);break;case "text/css":b=new g.TextStyler(f,"css",e)}return b}(h);if(m)return n=new d,n.resolve(m),n;for(var m=n&&n.split(".").pop().toLowerCase(),n=a.getServiceReferences("orion.edit.highlighter"),q=[],r=[],s=0;s<n.length;s++){var t=n[s];t.getProperty("type")==="grammar"&&q.push(t.getProperty("grammar"));(t=p(t,m))&&r.push(t)}return d.all(r,function(a){return{_error:a}}).then(function(c){for(var d,g=c.length-
1;g>=0;g--){var i=c[g];if(i&&!i._error&&(o||i.getProperty("type")!=="highlighter")){d=i;break}}var m;if(d)if(c=d.getProperty("type"),c==="highlighter")m=new j(f,a,e),m.setContentType(h);else if(c==="grammar"||typeof c==="undefined")d=d.getProperty("grammar"),m=new k.TextMateStyler(f,d,q);return m})}function a(a){this.serviceRegistry=a;this.styler=null}a.prototype={setup:function(a,d,g,f,e){e=typeof e==="undefined"?!0:e;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var j=
this;return c(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contenttypes"),a,d,g,f,e).then(function(a){return j.styler=a})},getStyler:function(){return this.styler}};return{createStyler:c,SyntaxHighlighter:a}});
define("orion/edit/syntaxmodel",["orion/serviceTracker"],function(g){function k(a){return(a=a.getProperty("contentType"))?Array.isArray(a)?a:[a]:null}function j(a){var b=this.contentTypesMap={},i=new g(a,d),h=new g(a,c),f=this.notifySyntaxModelListeners.bind(this);i.addingService=function(c){var d=a.getService(c);(c=k(c))&&c.forEach(function(a){var c=b[a];c?c.push(d):b[a]=[d]})};i.removedService=function(a,c){var d=k(a);d&&d.forEach(function(a){var a=b.hasOwnProperty(a.id)?b[a.id]:null,d=a.indexOf(c);
d!==-1&&a.splice(d,1)})};h.addingService=function(b){var d=a.getService(b);k(b)&&(typeof d.addEventListener!=="function"?console.log(Error("A "+c+' service must provide an "addEventListener" method')):d.addEventListener("orion.edit.syntaxmodel.modelReady",f))};h.removedService=function(a,b){b&&typeof b.removeEventListener==="function"&&b.removeEventListener("orion.edit.syntaxmodel.modelReady",f)};i.open();h.open()}var d="orion.edit.syntaxmodel.listener",c="orion.edit.syntaxmodel.provider";j.prototype.notifySyntaxModelListeners=
function(a){var b=a.contentType,c=a.syntaxModel;typeof b!=="string"?console.log(Error('SyntaxModelReadyEvent must provide a "contentType" field')):(a=this.contentTypesMap.hasOwnProperty(b)?this.contentTypesMap[b]:null)&&a.forEach(function(a){a.setSyntaxModel(c)})};return j});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/globalCommands,orion/edit/dispatcher,orion/highlight,orion/edit/syntaxmodel,orion/PageUtil".split(","),function(g,k,j,d,c,a,b,i,h,f){function e(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),b=function(){this._resetTimer()}.bind(this),c=0;c<a.length;c++)this._document.addEventListener(a[c],
b,!0);d.attach(this)}function n(a,b){if(a){if(b.status===0)b={Severity:"Error",Message:g["No response from server.  Check your internet connection and try again."]};else{var c=b.responseText;if(c)try{b=JSON.parse(c)}catch(d){b={Severity:"Error",Message:c}}}a.setProgressResult(b)}else window.console.log(b)}function o(a){this.editor=a.editor;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeService=a.contentTypeService;this.selection=
a.selection;this.syntaxHighlighter=new i.SyntaxHighlighter(this.serviceRegistry);this.syntaxModelWirer=new h(this.serviceRegistry);this._input=this._title="";this.dispatcher=null;d.attach(this)}e.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;if(this._timer)a.clearTimeout(this._timer),this._timer=null;if(this._timeout!==-1)this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout)},
onIdle:function(a){return this.dispatchEvent(a)},setTimeout:function(a){this._timeout=a;this._resetTimer()}};c.mixin(o.prototype,{load:function(){var a=this.getInput();if(a){var b=this.fileClient,c=this.progressService,d=this.getEditor();if(this._fileMetadata)c.progress(b.read(a,!0),k.formatMessage(g["Reading metedata of"],a)).then(function(e){if(this._fileMetadata.ETag!==e.ETag)this._fileMetadata=e,(!d.isDirty()||window.confirm(g.loadOutOfSync))&&c.progress(b.read(a),k.formatMessage(g.Reading,a)).then(function(b){d.setInput(a,
null,b)})}.bind(this));else{var e=window.setTimeout(function(){d.reportStatus(k.formatMessage(g.Fetching,a))},800);(new j.all([c.progress(b.read(a),k.formatMessage(g.Reading,a)),c.progress(b.read(a,!0),k.formatMessage(g["Reading metedata of"],a))],function(a){return{_error:a}})).then(function(b){e&&window.clearTimeout(e);var c=b[0],b=b[1];if(c._error||b._error){var f=this.serviceRegistry.getService("orion.page.message");n(f,c._error||b._error);this._setNoInput()}else this._setInputContents(this._parsedLocation,
a,c,b);d.reportStatus("")}.bind(this))}}},processParameters:function(a){for(var b=this.getEditor(),c=["start","end","line","offset","length"],d=0;d<c.length;d++){var e=c[d];a[e]&&(a[e]=parseInt(a[e],10))}b.showSelection(a.start,a.end,a.line,a.offset,a.length)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getContentType:function(){return this._contentType},save:function(){function a(b){j.getFileMetadata().ETag=
b.ETag;c.setInput(d,null,e,!0);c.reportStatus("");j.afterSave&&j.afterSave();j._saving=!1}function b(a){c.reportStatus("");n(i,a);j._saving=!1;j._errorSaving=!0}if(!this._saving){var c=this.getEditor();if(c.isDirty()){this._saving=!0;this._errorSaving=!1;var d=this.getInput();c.reportStatus(g["Saving..."]);var e=c.getText(),f={ETag:this.getFileMetadata().ETag},f=this.fileClient.write(d,e,f),h=this.progressService,i=this.serviceRegistry.getService("orion.page.message");h&&(f=h.progress(f,k.formatMessage(g["Saving file {0}"],
d)));var j=this;f.then(a,function(c){c.status===412?window.confirm(g["Resource is out of sync with the server. Do you want to save it anyway?"])?(c=j.fileClient.write(d,e),h&&(c=h.progress(c,k.formatMessage(g["Saving file {0}"],d))),c.then(a,b)):j._saving=!1:b(c)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=a!==-1;if(this._idle)this._idle.setTimeout(a);else{var b=this.getEditor(),c=b.getTextView(),d=function(){b.removeEventListener("TextViewInstalled",
d);var c={document:b.getTextView().getOptions("parent").ownerDocument,timeout:a};this._idle=new e(c);this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this));this._idle.setTimeout(a)}.bind(this);c?d():b.addEventListener("TextViewInstalled",d)}},setDirty:function(b){a.setDirtyIndicator(b)},setInput:function(a){if(!this._ignoreInput){if(!a)a=window.location.hash;if(typeof a==="string"){var b=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var c=f.matchResourceParameters(a);
if(b.isDirty()&&(b=this._location,f.matchResourceParameters(b).resource!==c.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(g["There are unsaved changes.  Do you still want to navigate away?"])){window.location.hash=b;return}this._location=a;this._parsedLocation=c;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=c.resource)?a===this._input?this.processParameters(c):(this._input=a,this._fileMetadata=null,this.load()):this._setNoInput()}}},_setNoInput:function(){this._input=
this._title=this._contentType=null;this.editor.uninstallTextView();this.dispatchEvent({type:"InputChanged",input:null})},_setInputContents:function(a,c,d,e){var f;e?(this._fileMetadata=e,this.setTitle(e.Location||String(e)),this._contentType=this.contentTypeService.getFileContentType(e),f=e.Name):(this._fileMetadata=null,this.setTitle(c),this._contentType=this.contentTypeService.getFilenameContentType(this.getTitle()),f=this.getTitle());var g=this.getEditor();g.getTextView()||(g.installTextView(),
g.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)));this.dispatchEvent({type:"InputChanged",input:a,name:f,metadata:e,contents:d});var h=this;this.syntaxHighlighter.setup(this._contentType,g.getTextView(),g.getAnnotationModel(),c,!0).then(function(){var e=h.syntaxHighlighter.getStyler();g.setFoldingEnabled(e&&e.foldingEnabled);h.dispatchEvent({type:"ContentTypeChanged",contentType:h._contentType,
location:window.location});if(!h.dispatcher)h.dispatcher=new b.Dispatcher(h.serviceRegistry,g,h._contentType);g.setInput(c,null,d);h.processParameters(a)});this.setDirty(!1)},setTitle:function(a){var b=a.lastIndexOf("/");b!==-1&&(a=a.substring(b+1));this._title=a}});return{InputManager:o}});
define("orion/widgets/themes/editor/ThemeData",["orion/editor/textTheme"],function(g){function k(){}function j(){this.styles=[];var b=new k;b.name="Eclipse";b.annotationRuler="white";b.background="white";b.comment="green";b.keyword="#7f0055";b.text="darkSlateGray";b.string="blue";b.overviewRuler="white";b.lineNumberOdd="#444";b.lineNumberEven="#444";b.lineNumber="#444";b.currentLine="#EAF2FE";b.tag="darkorange";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);b=new k;b.name=
"Prospecto";b.annotationRuler="white";b.background="white";b.comment="#3C802C";b.keyword="#CC4C07";b.text="#333";b.string="#446FBD";b.overviewRuler="white";b.lineNumberOdd="silver";b.lineNumberEven="silver";b.lineNumber="silver";b.currentLine="#EAF2FE";b.tag="#CC4C07";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);b=new k;b.name="Blue";b.annotationRuler="lavender";b.background="aliceBlue";b.comment="indigo";b.keyword="cornFlowerBlue";b.text="navy";b.string="cornFlowerBlue";
b.overviewRuler="lavender";b.lineNumberOdd="darkSlateGray";b.lineNumberEven="darkSlateGray";b.lineNumber="darkSlateGray";b.currentLine="white";b.tag="cornFlowerBlue";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);b=new k;b.name="Ambience";b.annotationRuler="#3D3D3D";b.background="#202020";b.comment="mediumslateblue";b.keyword="cornFlowerBlue";b.text="darkseagreen";b.string="lightcoral";b.overviewRuler="white";b.lineNumberOdd="black";b.lineNumberEven="black";b.lineNumber="black";
b.currentLine="lightcyan";b.tag="cornFlowerBlue";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);b=new k;b.name="Tierra";b.annotationRuler="moccasin";b.background="lemonchiffon";b.comment="darkseagreen";b.keyword="darkred";b.text="#555555";b.string="orangered";b.overviewRuler="moccasin";b.lineNumberOdd="chocolate";b.lineNumberEven="chocolate";b.lineNumber="chocolate";b.currentLine="#baa289";b.tag="darkred";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);
b=new k;b.name="Nimbus";b.annotationRuler="#444";b.background="dimgray";b.comment="darkseagreen";b.keyword="darkorange";b.text="white";b.string="cornflowerblue";b.overviewRuler="#444";b.lineNumberOdd="#aaa";b.lineNumberEven="#aaa";b.lineNumber="#aaa";b.currentLine="#aabfbb";b.tag="darkorange";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);b=new k;b.name="Adelante";b.annotationRuler="#E2D2B2";b.background="#F1E7C8";b.comment="#5D774E";b.keyword="#AF473B";b.text="dimgray";b.string=
"#DE5D3B";b.overviewRuler="#E2D2B2";b.lineNumberOdd="#AF473B";b.lineNumberEven="#AF473B";b.lineNumber="#AF473B";b.currentLine="#9e937b";b.tag="#AF473B";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b);b=new k;b.name="Raspberry Pi";b.annotationRuler="seashell";b.background="seashell";b.comment="#66B32F";b.keyword="#E73E36";b.text="dimgray";b.string="darkorange";b.overviewRuler="seashell";b.lineNumberOdd="#E73E36";b.lineNumberEven="#E73E36";b.lineNumber="#E73E36";b.currentLine=
"#F5B1AE";b.tag="#E73E36";b.attribute="cadetBlue";b.fontFamily=c;b.fontSize=a;this.styles.push(b)}function d(){return this.styles}var c='"Consolas", "Monaco", "Vera Mono", "monospace"',a="10pt";j.prototype.styles=[];j.prototype.getStyles=d;j.prototype.fontSettable=!0;j.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"editorstyles",defaultTheme:"Prospecto",selectedKey:"editorSelected"}};j.prototype.parseToXML=function(a){try{var c=null;if(window.DOMParser){var c=(new DOMParser).parseFromString(a,
"text/xml"),d=c.getElementsByTagName("parsererror");return!d||!d.length||!d[0].childNodes.length?c:null}else return c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a),c}catch(f){}};j.prototype.selectFontSize=function(a){console.log("fontsize: "+a)};j.prototype.importTheme=function(a){console.log("import theme");console.log(a);var c=this.parseToXML(a.parameters.valueFor("name")),d=new k;d.name=c.getElementsByTagName("colorTheme")[0].attributes[1].value;d.annotationRuler=c.getElementsByTagName("background")[0].attributes[0].value;
d.background=c.getElementsByTagName("background")[0].attributes[0].value;d.comment=c.getElementsByTagName("singleLineComment")[0].attributes[0].value;d.keyword=c.getElementsByTagName("keyword")[0].attributes[0].value;d.text=c.getElementsByTagName("foreground")[0].attributes[0].value;d.string=c.getElementsByTagName("string")[0].attributes[0].value;d.overviewRuler=c.getElementsByTagName("background")[0].attributes[0].value;d.lineNumberOdd=c.getElementsByTagName("lineNumber")[0].attributes[0].value;
d.lineNumberEven=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.lineNumber=c.getElementsByTagName("lineNumber")[0].attributes[0].value;d.currentLine=c.getElementsByTagName("selectionBackground")[0].attributes[0].value;a.items.addTheme(d)};j.prototype.processSettings=function(a){var c=g.TextTheme.getTheme();c.setThemeClass("editorTheme",c.buildStyleSheet("editorTheme",a))};j.prototype.getViewData=function(){var a={top:10,left:10,width:400,height:350},c=a.left,d=a.top;a.shapes=[{type:"TEXT",
name:"Line Numbers",label:"1",x:c+20,y:d+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Background",x:c+46,y:d,width:290,height:a.height,family:"background",fill:"white"},{type:"TEXT",name:"Strings",label:"'text/javascript'",x:c+134,y:d+20,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:c+124,y:d+20,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:c+46,y:d+
87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"HTML Attribute",label:"type",x:c+98,y:d+20,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Overview Ruler",x:c+336,y:d,width:14,height:a.height,family:"overviewRuler",fill:"white"},{type:"TEXT",name:"Comments",label:"/* comment */",x:c+75,y:d+40,fill:"darkSeaGreen",family:"comment",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<script",x:c+55,y:d+20,fill:"darkorange",family:"keyword",
font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:c+213,y:d+20,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Current Line",x:c+46,y:d+87,width:290,height:18,family:"currentLine",fill:"#eaf2fd"},{type:"TEXT",name:"Strings",label:"'Result'",x:c+164,y:d+80,fill:"cornflowerBlue",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"multiply(a,b){",x:c+120,y:d+60,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",
name:"keywords",label:"function",x:c+75,y:d+60,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Keywords",label:"var",x:c+95,y:d+80,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output = ",x:c+115,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:";",x:c+205,y:d+80,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"var",x:c+95,
y:d+100,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"result = a*b;",x:c+115,y:d+100,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"keywords",label:"return",x:c+95,y:d+120,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"output + result;",x:c+135,y:d+120,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"}",x:c+75,y:d+140,fill:"darkSlateGray",
family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<\/script>",x:c+55,y:d+160,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"<style",x:c+55,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Attribute",label:"type",x:c+95,y:d+200,fill:"darkGray",family:"attribute",font:"9pt sans-serif"},{type:"TEXT",name:"Foreground",label:"=",x:c+121,y:d+200,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},
{type:"TEXT",name:"Strings",label:"'text/css'",x:c+131,y:d+200,fill:"darkorange",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:">",x:c+180,y:d+200,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:".some-class",x:c+75,y:d+220,fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"{",x:c+145,y:d+220,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Attribute",
label:"color:",x:c+95,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Value",label:"#123456",x:c+130,y:d+240,fill:"darkSlateGray",family:"string",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Text",label:";",x:c+180,y:d+240,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"CSS Class Name",label:"}",x:c+75,y:d+260,fill:"darkSlateGray",family:"text",font:"9pt sans-serif"},{type:"TEXT",name:"HTML Tag",label:"</style>",x:c+55,y:d+280,
fill:"darkorange",family:"keyword",font:"9pt sans-serif"},{type:"RECTANGLE",name:"Annotation Ruler",x:c,y:d,width:46,height:a.height,family:"annotationRuler",fill:"white"}];for(var f=0;f<16;f++)a.shapes.push({type:"TEXT",name:"Line Numbers",label:f+1,x:c+20,y:d+20*f+20,fill:"darkSlateGray",family:"lineNumber",font:"9pt sans-serif"});return a};return{ThemeData:j,getStyles:d}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile","Git Settings":"Git Settings",General:"General",Navigation:"Navigation","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Links:"Links",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",Color:"Color",
Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",EditorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",FileMgt:"File Management","Autosave Enabled":"Auto Save","Save interval":"Save interval (ms)","Autoload Enabled":"Auto Load",Restore:"Restore Defaults",Default:"Default",Scheme:"Scheme",Tabs:"Tabs",TabSize:"Tab Size",ExpandTab:"Insert spaces for tabs",ScrollAnimation:"Smooth scrolling",ScrollAnimationEnabled:"Scrolling Animation",ScrollAnimationTimeout:"Scrolling Duration (ms)",KeyBindings:"Key Bindings","Invalid save interval.":"Invalid save interval.",
"Invalid scrolling duration.":"Invalid scrolling duration.","Invalid tab size.":"Invalid tab size.","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored"});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(g,k){var j={root:k};Object.keys(g).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=g[d])});return j});
define("orion/widgets/input/Select",["orion/objects","orion/webui/littlelib"],function(g,k){function j(d,c){g.mixin(this,d);this.node=c||document.createElement("div");this.node.innerHTML=this.templateString;this.select=k.$(".setting-control",this.node)}g.mixin(j.prototype,{templateString:'<select class="setting-control" id="selection"></select>',addOptions:function(d){var c=document.createElement("option");c.value=d.value;c.appendChild(document.createTextNode(typeof d.label==="string"?d.label:d.value));
if(d.selected)c.selected="selected";this.select.appendChild(c)},show:function(){this.postCreate()},postCreate:function(){this.options.forEach(this.addOptions.bind(this));this.select.addEventListener("change",this.change.bind(this))},destroy:function(){if(this.node)k.empty(this.node),this.node=this.select=null},setStorageItem:function(){},getSelected:function(){return this.select.value},getSelectedIndex:function(){return this.select.selectedIndex},setSelectedIndex:function(d){this.select.selectedIndex=
d},change:function(){var d=this.select.value;this.category?this.setStorageItem(this.category,this.item,this.element,d,this.ui):this.setStorageItem(d)}});return j});
define("orion/widgets/input/Checkbox",["orion/objects","orion/webui/littlelib"],function(g,k){function j(d,c){g.mixin(this,d);this.node=c||document.createElement("div");this.node.innerHTML=this.templateString;this.myfield=k.$(".setting-control",this.node)}g.mixin(j.prototype,{templateString:'<label><input class="setting-control settingsCheckbox" type="checkbox"/></label>',show:function(){this.myfield.addEventListener("change",this.change.bind(this));this.postCreate()},destroy:function(){if(this.node)k.empty(this.node),
this.myfield=this.node=null},setStorageItem:function(){},isChecked:function(){return this.myfield.checked},setChecked:function(d){this.myfield.checked=d},change:function(){},postCreate:function(){this.myfield.style.width="20px";this.editmode&&this.editmode==="readonly"&&this.myfield.setAttribute("disabled","disabled")}});return j});
define("orion/widgets/themes/editor/LocalEditorSettings",["i18n!orion/settings/nls/messages","orion/widgets/input/Select","orion/widgets/input/Checkbox"],function(g,k,j){function d(a,b){this.preferences=a;this.editorPreferences=b}function c(a,b){for(var c=b.parentNode;c!==null;){if(c===a)return!0;c=c.parentNode}return!1}d.prototype.template='<div id="themeContainer"><span class="settingsPanelLabel">Theme:</span><div class="settingsPanelValue" id="themepicker"></div></div><div id="sizecontainer"><span class="settingsPanelLabel">Font Size:</span><div class="settingsPanelValue" id="fontsizepicker"></div></div><div id="keyscontainer"><span class="settingsPanelLabel">Key Bindings:</span><div class="settingsPanelValue" id="keyspicker"></div></div><div id="autoSaveContainer" style="display:none;"><span class="settingsPanelLabel">Auto Save:</span><div class="settingsPanelValue" id="autosavecheck"></div></div>';
d.prototype.isDescendant=c;d.prototype.removeSettings=function(a){if(!c(this.container,a.target)&&(this.destroy(),window.removeEventListener(this.listener),this.container))this.container.parentNode.removeChild(this.container),this.container=null};d.prototype.onRemove=function(a){this.removeCall=a};d.prototype.updateContent=function(a,b){this.container=a;this.preferences.getTheme(function(c){this.editorPreferences.getPrefs(function(d){this.editorPrefs=d;a.innerHTML=this.template;this.addThemePicker(c);
this.addFontSizePicker(c);this.addKeysPicker(d);if(d.autoSaveVisible)document.getElementById("autoSaveContainer").style.display="block",this.addAutoSave(d);b()}.bind(this))}.bind(this))};d.prototype.selectTheme=function(a){this.preferences.setTheme(a)};d.prototype.selectFontSize=function(a){this.preferences.setFontSize(a)};d.prototype.selectKeys=function(a){this.editorPrefs.keyBindings=a;this.editorPreferences.setPrefs(this.editorPrefs)};d.prototype.addFontSizePicker=function(a){this.fontSize=a.style.fontSize;
for(var a=[],b=8;b<19;b++){var c={value:b+"pt",label:b+"pt"};if(c.label===this.fontSize)c.selected=!0;a.push(c)}b=document.getElementById("fontsizepicker");this.sizeSelect=new k({options:a},b);this.sizeSelect.setStorageItem=this.selectFontSize.bind(this);this.sizeSelect.show()};d.prototype.addThemePicker=function(a){for(var b=a.styles,c=[],d=0;d<b.length;d++){var f={value:b[d].name,label:b[d].name};if(b[d].name===a.style.name)f.selected=!0;c.push(f)}a=document.getElementById("themepicker");this.themeSelect=
new k({options:c},a);this.themeSelect.setStorageItem=this.selectTheme.bind(this);this.themeSelect.show()};d.prototype.addKeysPicker=function(a){for(var b=[g.Default,"Emacs","vi"],c=[],d=0;d<b.length;d++){var f=b[d],e={value:f,label:f};if(f===a.keyBindings)e.selected=!0;c.push(e)}a=document.getElementById("keyspicker");this.keysSelect=new k({options:c},a);this.keysSelect.setStorageItem=this.selectKeys.bind(this);this.keysSelect.show()};d.prototype.addAutoSave=function(a){var b=document.getElementById("autosavecheck");
this.autoSaveCheck=new j({},b);this.autoSaveCheck.setChecked(a.autoSaveEnabled);this.autoSaveCheck.myfield.addEventListener("change",function(){this.editorPrefs.autoSaveEnabled=this.autoSaveCheck.myfield.checked;this.editorPreferences.setPrefs(this.editorPrefs)}.bind(this));this.autoSaveCheck.show()};d.prototype.destroy=function(){};return d});
define("edit/editorPreferences",[],function(){function g(d,c){this._preferences=d;if(this._callback=c)var a=d.listenForChangedSettings(k,function(b){b.key===a&&c()}.bind(this))}var k="/editor/settings",j={autoSaveEnabled:!1,autoSaveTimeout:1E3,autoSaveVisible:!0,autoLoadEnabled:!0,autoLoadVisible:!0,tabSize:4,tabSizeVisible:!0,expandTab:!1,expandTabVisible:!0,scrollAnimationEnabled:!0,scrollAnimation:300,scrollAnimationVisible:!0,keyBindingsVisible:!0,keyBindings:"Default"};g.prototype={_initialize:function(d){var d=
d.get("editorSettings")||{},c;for(c in j)d.hasOwnProperty(c)||(d[c]=j[c]);return d},getPrefs:function(d){this._preferences.getPreferences(k).then(function(c){c=this._initialize(c);typeof c==="string"&&(c=JSON.parse(c));d(c)}.bind(this))},setPrefs:function(d,c){this._preferences.getPreferences(k).then(function(a){a.put("editorSettings",d);d=this._initialize(a);c&&c(d);this._callback&&this._callback(d)}.bind(this))}};return{EditorPreferences:g}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/i18nUtil,orion/fileUtils,orion/explorers/explorer,orion/EventTarget".split(","),function(g,k,j,d,c,a,b,i){function h(a,b,c,d,f,g){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!f;this.excludeFolders=!!g}function f(a){i.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=a.fileClient;
this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=this.modelEventDispatcher=new i,c=this;"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,c.modelHandler[a].bind(c))});var d=this.renderer;
this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){d.setTarget(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self")}},{pid:"nav.config"})}h.prototype=new b.ExplorerModel;h.prototype.getRoot=function(a){a(this.root)};h.prototype.processParent=function(a,b){if(this.excludeFiles||this.excludeFolders){var c=[],d;for(d in b)if(!(b[d].Directory?this.excludeFolders:this.excludeFiles))c.push(b[d]),b[d].parent=a;b=c}else for(c in b)b[c].parent=
a;a.children=b;a.children.sort(function(a,b){var c=a.Directory;if(c!==b.Directory)return c?-1:1;var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0});return b};h.prototype.getChildren=function(a,b){var c=this;a.children?b(a.children):a.Directory!==void 0&&a.Directory===!1?b([]):a.Location?this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+a.Name).then(function(d){b(c.processParent(a,
d))}):b([])};h.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};h.prototype.constructor=h;f.prototype=Object.create(b.Explorer.prototype);f.prototype.modelHandler={copy:function(){},copyMultiple:function(a){var b=this,c={};a.items.forEach(function(a){a=a.newValue.Parents[0]||b.treeRoot;c[a.Location]=a});Object.keys(c).forEach(function(a){b.changedItem(c[a],!0)})},create:function(a){this.changedItem(a.parent,!0,a.newValue)},"delete":function(){},
deleteMultiple:function(a){var a=a.items,b=this,c;if(a.some(function(a){return a.oldValue.Location===b.treeRoot.Location?(c=a.parent,!0):!1}))this.loadResourceList(c);else{var d={};a.forEach(function(a){a=a.parent;d[a.Location]=a});Object.keys(d).forEach(function(a){b.changedItem(d[a],!0)})}},"import":function(a){this.changedItem(a.target,!0)},move:function(a){var b=a.oldValue,c=a.newValue,a=a.parent,d=this,f=null;if(a.Projects)if(d.treeRoot.Location===b.Location){var g=d.treeRoot,b=c.ChildrenLocation?
c:this.fileClient.read(c.ContentLocation,!0);j.when(b,function(a){d.dispatchEvent({type:"rootMoved",oldValue:g,newValue:a});d.loadResourceList(a)})}else f=d.isExpanded(b)&&b;else b.Directory&&(f=d.isExpanded(b)&&c);d.changedItem(a,!0);f&&d.changedItem(f,!0)},moveMultiple:function(){this.changedItem(this.treeRoot,!0)}};f.prototype._makeDropTarget=function(b,f,h){function i(b,d,e,f,h,j){d=d||"";if(b.isFile)a.isAtRoot(e.Location)?f.registry.getService("orion.page.message").setProgressResult({Severity:"Error",
Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):b.file(function(a){h(e,a,f,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(c.formatMessage(g["Unzip ${0}?"],a.name)))});else if(b.isDirectory){var k=b.createReader(),m=function(a){k.readEntries(function(c){for(var e=0;e<c.length;e++)i(c[e],d+b.name+"/",a,f,h,j)})},n=f.registry.getService("orion.page.progress");a.isAtRoot(e.Location)?n.progress(j.createProject(e.ChildrenLocation,b.name),"Initializing project "+
b.name).then(function(a){f.loadResourceList(f.treeRoot.Path,!0);n.progress(j.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){m(a)})}):n.progress(j.createFolder(e.Location,b.name),"Creating folder "+b.name).then(function(a){f.changedItem(e,!0);m(a)})}}if(this.dragAndDrop){var j=this,k=this.dragAndDrop,r=function(a){f.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};if(h)this._oldDragLeave&&f.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=
r;f.addEventListener("dragleave",r,!1);r=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";f.classList.add("dragOver");d.stop(a)};if(h)this._oldDragEnter&&f.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=r;f.addEventListener("dragenter",r,!1);r=function(a){if(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||
a.dataTransfer.effectAllowed.indexOf("copy")>=0)a.dataTransfer.dropEffect="copy";d.stop(a)};if(h&&!this._oldDragOver)f.addEventListener("dragover",r,!1),this._oldDragOver=r;r=function(h){f.classList.remove("dragOver");if(h.dataTransfer.items&&h.dataTransfer.items.length>0)for(var o=0;o<h.dataTransfer.items.length;o++){var l=null;typeof h.dataTransfer.items[o].getAsEntry==="function"?l=h.dataTransfer.items[o].getAsEntry():typeof h.dataTransfer.items[o].webkitGetAsEntry==="function"&&(l=h.dataTransfer.items[o].webkitGetAsEntry());
l&&i(l,null,b,j,k,j.fileClient)}else if(h.dataTransfer.files&&h.dataTransfer.files.length>0)for(o=0;o<h.dataTransfer.files.length;o++)l=h.dataTransfer.files[o],!l.length&&(!l.type||l.type==="")?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:c.formatMessage(g["Did not drop ${0}.  Folder drop is not supported in this browser."],l.name)}):a.isAtRoot(b.Location)?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:g["You cannot copy files directly into the workspace.  Create a folder first."]}):
k(b,l,j,l.name.indexOf(".zip")===l.name.length-4&&window.confirm(c.formatMessage(g["Unzip ${0}?"],l.name)));d.stop(h)};if(h)this._oldDrop&&f.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=r;f.addEventListener("drop",r,!1)}};f.prototype.changedItem=function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this;return this.registry.getService("orion.page.progress").progress(this.fileClient.fetchChildren(a.ChildrenLocation),"Fetching children of "+
a.Name).then(function(d){d=c.model.processParent(a,d);c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,d,b);return(new j).resolve(d)})};f.prototype.isExpanded=function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};f.prototype.getNameNode=function(a){if(a=this.model.getId(a))return d.node(a+"NameLink")};f.prototype.scopeUp=function(){};f.prototype.loadResourceList=function(b,c,d){b&&typeof b==="object"&&(b=b.ChildrenLocation||b.ContentLocation);b=a.makeRelative(b);if(!c&&b===
this._lastPath)return(new j).resolve(this.treeRoot);this._lastPath=b;var f=this;return c||b!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(b),"Loading "+b).then(function(){f.treeRoot.Path=b;typeof d==="function"&&d();f.dispatchEvent({type:"rootChanged",root:f.treeRoot});return(new j).resolve(f.treeRoot)},function(a){f.treeRoot.Path=null;f.dispatchEvent({type:"rootChanged",root:f.treeRoot});return(new j).reject(a)}):(new j).resolve(f.treeRoot)};f.prototype.load=function(a,b,c){var f=
d.node(this.parentId),i=d.node("progress");if(!i)i=document.createElement("div"),i.id="progress",d.empty(f),f.appendChild(i);d.empty(i);var k=setTimeout(function(){d.empty(i);i.appendChild(document.createTextNode(b))},500),r=this;return j.when(a,function(a){r.treeRoot={};clearTimeout(k);for(var b in a)r.treeRoot[b]=a[b];r.model=new h(r.registry,r.treeRoot,r.fileClient,r.parentId,r.excludeFiles,r.excludeFolders);r.model.processParent(r.treeRoot,a.Children);if(r.dragAndDrop)r._hookedDrag?r._makeDropTarget(r.treeRoot,
f,!0):(a=(a=f&&("draggable"in f||"ondragstart"in f&&"ondrop"in f))&&!(!window.File||!window.FileList||!window.FileReader),r._hookedDrag=!0,a?r._makeDropTarget(r.treeRoot,f,!0):(r.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));r.model.hasChildren()?r.createTree(r.parentId,r.model,{navHandlerFactory:r.navHandlerFactory,setFocus:typeof r.setFocus==="undefined"?!0:r.setFocus,selectionPolicy:r.renderer.selectionPolicy,onCollapse:function(a){if(r.getNavHandler())r.getNavHandler().onCollapse(a)}}):
(d.empty(f),a=document.createElement("div"),a.classList.add("noFile"),a.textContent=g.NoFile,b=document.createElement("span"),b.classList.add("core-sprite-addcontent"),b.classList.add("icon-inline"),b.classList.add("imageSprite"),d.processDOMNodes(a,[b]),f.appendChild(a));if(typeof c==="function")try{c()}catch(e){r.registry&&r.registry.getService("orion.page.message").setErrorMessage(e)}if(typeof r.onchange==="function")r.onchange(r.treeRoot);return(new j).resolve(r.treeRoot)},function(a){clearTimeout(k);
r.registry.getService("orion.page.message").setProgressResult(a);return(new j).reject(a)})};f.prototype.onchange=function(){};f.prototype.constructor=f;return{FileExplorer:f,FileModel:h}});
define("orion/compare/compareUtils",["orion/URITemplate"],function(g){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(g,d,c){for(var a=0,b=0;b<g.length;b++){var i=g[b][d];i===0&&(i=1);if(c>=a&&c<a+i)return{mapperIndex:b,startFrom:a};if(b===g.length-1)break;a+=g[b][d]}return{mapperIndex:g.length-1,startFrom:a}};k.compareUtils.lookUpLineIndex=function(g,d,c){if(c===0)return 0;for(var a=0,b=0;b<c;b++)a+=g[b][d];return a};k.compareUtils.updateMapper=function(g,d,c,a,
b){if(a!==b&&(a>0||b>0)){var i=k.compareUtils.lookUpMapper(g,d,c);if(!(i.mapperIndex<0)){if(a>0)for(var h=c-i.startFrom,c=i.mapperIndex;c<g.length;c++){h=g[c][d]-h;if(a<=h){g[c][d]-=a;break}g[c][d]-=h;a-=h;h=0}b>0&&(g[i.mapperIndex][d]+=b)}}};k.compareUtils.overlapMapper=function(g,d,c,a,b){g=c+g[d]-1;g<c&&(g=c);b<a&&(b=a);return g<a||b<c?!1:!0};k.compareUtils.findFirstDiff=function(g,d,c,a){for(var b=0,i=null,h=0;h<g.length;h++){if(b>a)break;if(k.compareUtils.overlapMapper(g[h],d,b,c,a)&&(i={mapperIndex:h,
startFrom:b},g[h][2]!==0))break;b+=g[h][d]}return i};k.compareUtils.matchMapper=function(g,d,c,a){if(g.length===0)return c;var b=c+Math.round((a-c)/3),i=k.compareUtils.findFirstDiff(g,d,c,a),h=g[i.mapperIndex][d]===0?i.startFrom:i.startFrom+g[i.mapperIndex][d]-1,f=k.compareUtils.lookUpLineIndex(g,1-d,i.mapperIndex),e=i.startFrom-c;return g[i.mapperIndex][2]===0?f-e:b>=i.startFrom&&b<=h?f-Math.round((a-c)/3):b<i.startFrom?f-e:(g[i.mapperIndex][1-d]===0?f:f+g[i.mapperIndex][1-d]-1)-(h-c)};k.compareUtils.getMapperLineCount=
function(g){for(var d=0,c=0;c<g.length;c++)d+=Math.max(g[c][0],g[c][1]);return d};k.compareUtils.getAnnotationIndex=function(g,d){for(var c=0;c<g.length;c++)if(g[c][0]===d)return c;return-1};k.compareUtils.getAnnotationMapperIndex=function(g,d){return g[d][1]};k.compareUtils.getAnnotationIndexByMapper=function(g,d){for(var c=0;c<g.length;c++)if(g[c][1]===d)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(g,d){return d<0?!1:!g[d][3]?!1:
g[d][3]===1};k.compareUtils.mergeDiffBlocks=function(g,d,c,a,b,i){for(var h=0;h<d.length;h++){var f=d[h][0],e=c[d[h][1]];if(e[0]>0){for(var k="",o=0;o<e[0];o++)k=k+a[e[2]-1+o].substring(b)+i;e=g.getLineCount();f>=e&&(f=e-1);f=g.getLineStart(f);g.setText(k,f,f)}}};k.compareUtils.generateCompareHref=function(j,d){var c=require.toUrl("compare/compare.html");if(!d.conflict)d.conflict=void 0;if(!d.readonly)d.readonly=void 0;return(new g(c+"#{,resource,params*}")).expand({resource:j,params:d})};k.compareUtils.generateCompareTreeHref=
function(j,d){var c=require.toUrl("compare-tree/compare-tree.html");return(new g(c+"#{,resource,params*}")).expand({resource:j,params:d})};return k.compareUtils});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages,orion/webui/littlelib,orion/webui/dialog,orion/fileUtils,orion/selection,orion/explorers/navigationUtils,orion/explorers/explorer,orion/explorers/explorer-table".split(","),function(g,k,j,d,c,a,b,i){function h(a,b){this.explorer=b;this._init(a)}function f(a){this._init(a)}h.prototype=new b.SelectionRenderer;h.prototype.constructor=h;h.prototype.getLabelColumnIndex=function(){return 0};h.prototype.getCellElement=
function(a,b,c){a=document.createElement("td");c.appendChild(a);var d=document.createElement("span");d.id=c.id+"navSpan";a.appendChild(d);d.className="mainNavColumn singleNavColumn";this.getExpandImage(c,d);d.appendChild(document.createTextNode(b.Name))};f.prototype=new j.Dialog;f.prototype.TEMPLATE='<div id="message" style="width: 25em; padding-bottom: 5px;"></div><div id="directoryTree" class="explorerTreeClass" style="width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"></div>';
f.prototype._init=function(a){this.title=a.title||g["Choose a Folder"];this.modal=!0;this.buttons=[{text:g.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};f.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
f.prototype.loadFolderList=function(a){a=d.makeRelative(a);this.selection=new c.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new i.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new h({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};f.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};f.prototype.constructor=f;return{DirectoryPrompterDialog:f}});
define("orion/webui/dialogs/SFTPConnectionDialog",["i18n!orion/widgets/nls/messages","orion/webui/littlelib","orion/webui/popupdialog","orion/webui/dialog"],function(g,k,j,d){function c(a,c){this.messages=g;this._initialize(a);this._notify=c}function a(a){this._init(a)}localStorage.getItem("orion.sftpConnections")||localStorage.setItem("orion.sftpConnections",JSON.stringify({identifier:"name",label:g.name,items:[]}));c.prototype=new j.PopupDialog;c.prototype.TEMPLATE='<div><label for="sftpHost">${Remote host:}</label><input id="sftpHost" /></div><div><label for="sftpPort">${Port:}</label><input id="sftpPort" /></div><div><label for="sftpPath">${Remote path:}</label><input id="sftpPath" /></div><div><label for="sftpUser">${User name:}</label><input id="sftpUser" /></div><div class="layoutBlock layoutRight"><button id="addSftpConnection" class="dropdownTrigger orionButton commandButton">${Add}</button></div>';
c.prototype._bindToDom=function(){this.$addSftpConnection.addEventListener("click",function(){this._notify({name:this.$sftpUser.value+"@"+this.$sftpHost.value+":"+this.$sftpPort.value+this.$sftpPath.value});this.hide()}.bind(this),!1)};c.prototype.constructor=c;a.prototype=new d.Dialog;a.prototype.TEMPLATE='<div><div><label for="sftpPath">${Location:}</label></div><div><select id="sftpConnectionList" name="sftpConnectionList"></select><button id="newSftpConnection" style="margin-left: 16px;" class="dropdownTrigger orionButton commandButton">${New}<span class="dropdownArrowDown"></span></button></div><div><label for="sftpPassword">${Password:}</label></div><div><input id="sftpPassword" type="password" /></div><p>${If the same file exists in both the source and destination:}</p><input type="radio" name="overwriteOption" id="overwriteCancel" checked value="overwriteCancel" /><label for="overwriteCancel">${Cancel the transfer}</label><br /><input type="radio" name="overwriteOption" id="overwriteAll" value="overwriteAll" /><label for="overwriteAll">${Always overwrite destination}</label><br /><input type="radio" name="overwriteOption" id="overwriteOlder" value="overWriteOlder" /><label for="overwriteOlder">${Overwrite if source is newer}</label></div>';
a.prototype._init=function(a){this.title="SFTP Transfer";this.messages=g;this.modal=!0;this.buttons=[{text:g["Start Transfer"],callback:this.done.bind(this)}];this.sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"));this._func=a.func;this._initialize()};a.prototype._bindToDom=function(){this.$sftpConnectionList.style.minWidth="220px";this._popupDialog=new c(this.$newSftpConnection,this.onAddConnection.bind(this));this._addChildDialog(this._popupDialog);this._populateSelect()};
a.prototype._afterHiding=function(){this._popupDialog.hide()};a.prototype.done=function(){var a=this.$sftpConnectionList.value.split("@"),c,d,f;if(a.length===2)f=a[0],d=a[1];else if(a.length===3)f=a[0]+"@"+a[1],d=a[2];else{this.hide();return}var e=d.indexOf(":");e<=0&&(c=22);var g=d.indexOf("/");g<=0||(c?a=d.substring(0,g):(a=d.substring(0,e),c=d.substring(e+1,g)),d=d.substring(g),this._func(a,c,d,f,this.$sftpPassword.value,this._computeOverwriteValue()));this.hide()};a.prototype._computeOverwriteValue=
function(){if(this.$overwriteCancel.checked)return"no-overwrite";else if(this.$overwriteOlder.checked)return"overwrite-older";return""};a.prototype._populateSelect=function(){k.empty(this.$sftpConnectionList);for(var a=0;a<this.sftpConnectionStoreData.items.length;a++){var c=this.sftpConnectionStoreData.items[a].name,d=document.createElement("option");d.appendChild(document.createTextNode(c));d.value=c;this.$sftpConnectionList.appendChild(d)}};a.prototype.onAddConnection=function(a){for(var c=!1,
d=0;d<this.sftpConnectionStoreData.items.length;d++)if(this.sftpConnectionStoreData.items[d].name===a.name){c=!0;break}if(!c)this.sftpConnectionStoreData.items.unshift(a),localStorage.setItem("orion.sftpConnections",JSON.stringify(this.sftpConnectionStoreData)),this._populateSelect(),this.$sftpConnectionList.value=a.name};a.prototype.constructor=a;return{SFTPConnectionDialog:a}});
define("orion/webui/dialogs/ImportDialog",["i18n!orion/widgets/nls/messages","orion/webui/littlelib","orion/webui/dialog"],function(g,k,j){function d(c){this._init(c)}d.prototype=new j.Dialog;d.prototype.TEMPLATE='<div ondragover="event.preventDefault()"><div class="uploadContainer" id="uploadContainer"><div class="dottedOutline"><div id="dragArea" class="floatingSection"><div class="uploadInstruction">${Drag a file here}</div><div class="uploadOptions">(<input style="height: 20px;" class="uploadOptionsItem" id="unzipCheckbox" checked="true" type="checkbox"><label style="line-height: 20px;" class="uploadOptionsItem" for="${id}_unzipCheckbox">${unzip zips}</label>)</div><div class="tipInstruction">${or if you prefer}</div></div></div></div><div class="layoutBlock layoutRight"><input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /><span id="uploadButton" role="button" class="commandButton disabled" tabindex="0">${Upload}</span></div></div>';
d.prototype._init=function(c){this.title=g["Import a file or zip"];this.messages=g;this.modal=!0;this._importLocation=c.importLocation;this._func=c.func;this._initialize()};d.prototype._bindToDom=function(){this.$uploadContainer.addEventListener("dragenter",this.dragEnter.bind(this),!1);this.$uploadContainer.addEventListener("dragover",this.dragOver.bind(this),!1);this.$uploadContainer.addEventListener("dragleave",this.dragLeave.bind(this),!1);this.$uploadContainer.addEventListener("drop",this.drop.bind(this),
!1);this.$selectedFile.addEventListener("change",this.checkUploadState.bind(this),!1);this.$uploadButton.addEventListener("click",this.uploadSelected.bind(this),!1)};d.prototype.handleReadyState=function(c,a){if(this.req.readyState===4){if(this.req.status===400){var b={};try{b=JSON.parse(this.req.responseText)}catch(d){}if(b.JsonData&&b.JsonData.ExistingFiles&&confirm(b.Message+"\nWould you like to retry the import with force overwriting?")){this.uploadFile.bind(this)(a,!0);return}}this.hide();this._func()}};
d.prototype.checkUploadState=function(){this.$selectedFile.files&&this.$selectedFile.files.length>0?this.$uploadButton.classList.remove(this.DISABLED):this.$uploadButton.classList.add(this.DISABLED)};d.prototype.uploadFile=function(c,a){var b=this.$unzipCheckbox.checked&&c.name.indexOf(".zip")===c.name.length-4;this.req=new XMLHttpRequest;this.req.open("post",a?this._importLocation+(this._importLocation.indexOf("?")>0?"&force=true":"?force=true"):this._importLocation,!0);this.req.setRequestHeader("X-Requested-With",
"XMLHttpRequest");this.req.setRequestHeader("Slug",c.name);b||this.req.setRequestHeader("X-Xfer-Options","raw");this.req.setRequestHeader("Content-Type",c.type);this.req.onreadystatechange=function(a){this.handleReadyState.bind(this)(a,c)}.bind(this);this.req.send(c)};d.prototype.uploadSelected=function(){this.$uploadButton.classList.contains(this.DISABLED)||this.$selectedFile.files&&this.$selectedFile.files.length>0&&this.uploadFile(this.$selectedFile.files[0])};d.prototype.dragEnter=function(c){if(c.dataTransfer.effectAllowed===
"all"||c.dataTransfer.effectAllowed==="uninitialized"||c.dataTransfer.effectAllowed.indexOf("copy")>=0)c.dataTransfer.dropEffect="copy";k.stop(c)};d.prototype.dragLeave=function(c){k.stop(c)};d.prototype.dragOver=function(c){if(c.dataTransfer.effectAllowed==="all"||c.dataTransfer.effectAllowed==="uninitialized"||c.dataTransfer.effectAllowed.indexOf("copy")>=0)c.dataTransfer.dropEffect="copy";k.stop(c)};d.prototype.drop=function(c){k.stop(c);c=c.dataTransfer.files;if(c.length&&c.length>0)for(var a=
0;a<c.length;a++)this.uploadFile(c[a])};d.prototype.constructor=d;return{ImportDialog:d}});
define("orion/fileCommands","i18n!orion/navigate/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/uiUtils,orion/fileUtils,orion/commands,orion/commandRegistry,orion/extensionCommands,orion/contentTypes,orion/compare/compareUtils,orion/Deferred,orion/webui/dialogs/DirectoryPrompterDialog,orion/webui/dialogs/SFTPConnectionDialog,orion/webui/dialogs/ImportDialog".split(","),function(g,k,j,d,c,a,b,i,h,f,e,n,o,p,m){function q(a){this.registry=a;this.favorites=[];var b=this,a=this.registry.getService("orion.core.favorite");
A||(A=this.registry.getService("orion.page.progress"));A.progress(a.getFavorites(),"Getting favorites").then(function(a){b.cacheFavorites(a.navigator)});a.addEventListener("favoritesChanged",function(a){b.cacheFavorites(a.navigator)})}function r(a,b){var c=a.modelEventDispatcher;c&&typeof c.dispatchEvent==="function"&&c.dispatchEvent(b)}function s(a){A?A.setProgressResult(a):window.console.log(a)}function t(a,b,d,e,f){var g;b.Location===a.treeRoot.Location?a=j.node(d):(b=a.makeNewItemPlaceHolder(b,
d))?(a=b.refNode,g=b.tempNode):a=j.node(d);a?c.getUserText(d+"EditBox",a,!1,e,function(a){a&&(g&&g.parentNode&&g.parentNode.removeChild(g),f(a))}):(d=window.prompt(e))&&f(d)}function l(a){if(!a)return{};Array.isArray(a)&&(a=a.length===1?a[0]:{});return a}function u(b){b=l(b);return b.Location&&a.isAtRoot(b.Location)}function w(b,c,d,e,f,g){A=d;if(e){var h;h=a.isAtRoot(b.treeRoot.ChildrenLocation)?b.treeRoot:A.progress(c.loadWorkspace(""),"Loading workspace");n.when(h,function(a){a=c.createProject(a.ChildrenLocation,
e);g&&(a=d.showWhile(a,g));a.then(function(a){d.progress(c.read(a.ContentLocation,!0),"Reading metadata of newly created project "+e).then(function(a){f&&f(a);b.loadResourceList("",!0)},s)},s)},s)}}var v={},y=null,A=null,G=null;q.prototype={cacheFavorites:function(a){this.favorites=[];for(var b=0;b<a.length;b++)a[b].directory&&this.favorites.push(a[b]);this.favorites.sort(function(a,b){return a<b?-1:a>b?1:0})}};q.prototype.constructor=q;v.uploadFile=function(a,b,c,d,e){this.req=new XMLHttpRequest;
this.req.open("post",e?a.ImportLocation+(a.ImportLocation.indexOf("?")>0?"&force=true":"?force=true"):a.ImportLocation,!0);this.req.setRequestHeader("X-Requested-With","XMLHttpRequest");this.req.setRequestHeader("Slug",b.name);d||this.req.setRequestHeader("X-Xfer-Options","raw");this.req.setRequestHeader("Content-Type",b.type);this.req.onreadystatechange=function(){if(this.req.readyState===4){if(this.req.status===400){var e={};try{e=JSON.parse(this.req.responseText)}catch(f){}if(e.JsonData&&e.JsonData.ExistingFiles&&
(c&&c.serviceRegistry?c.serviceRegistry.getService("orion.page.dialog").confirm:confirm)(e.Message+"\nWould you like to retry the import with force overwriting?")){v.uploadFile(a,b,c,d,!0);return}}r(c,{type:"create",parent:a,newValue:null})}}.bind(this);this.req.send(b)};v.updateNavTools=function(a,b,c,d,e,f,g){function h(a,d){var f=j.node(e);if(f){var i=b._contributionsByScopeId[e],a=a||i&&i.localSelectionService||b.getSelectionService();i&&a&&n.when(a.getSelections(),function(a){b.destroy(f);a=
!a||Array.isArray(a)&&!a.length;g&&a?b.renderCommands(f.id,f,d,c,"button"):b.renderCommands(f.id,f,null,c,"button")})}}var i=j.node(d);if(i)b.destroy(i);else throw Error("could not find toolbar "+d);if(f.Location!==G)b.closeParameterCollector(),G=f.Location;b.renderCommands(i.id,i,f,c,"button");G&&b.processURL(window.location.href);e&&h(null,c.treeRoot);if(!y){y=new q(a);var k=a.getService("orion.page.selection");k.addEventListener("selectionChanged",function(){h(k,c.treeRoot)})}};v.createFileCommands=
function(h,j,k,q){function v(b){var b=a.makeRelative(b),b=b.split("#"),b=b[b.length-1],c=b.indexOf("/?");c>0&&(b=b.substring(0,c+1));return b}function G(a,b,c){for(var a=Array.isArray(a)?a:[a],b=function(a){Array.isArray(a)||(a=[a]);var b=[],d=[],e=this;a.forEach(function(a){b.push((c?q.copyFile:q.moveFile).apply(q,[a.Location,e.path]).then(function(b){d.push({oldValue:a,newValue:b});H({type:c?"copy":"move",oldValue:a,newValue:b})},s))});n.all(b).then(function(){H({type:c?"copyMultiple":"moveMultiple",
items:d})})},e=[],f=0;f<a.length;f++){if(a[f].parent&&a[f].parent.Location)a[f].parent.stripped=a[f].parent.stripped||v(a[f].parent.Location),e.indexOf(a[f].parent.stripped)!==-1||e.push(a[f].parent.stripped);if(a[f].Directory&&!c)a[f].stripped=a[f].stripped||v(a[f].Location),e.push(a[f].stripped)}a=[];if(y){for(var i=y.favorites,f=0;f<i.length;f++){var j=v(i[f].path);e.indexOf(j)!==-1||a.push({name:i[f].name,imageClass:"core-sprite-favorite",path:j,callback:b})}i.length>0&&a.push({})}i=[];j=k.treeRoot.Children;
for(f=0;f<j.length;f++){var l=j[f];l.stripped=l.stripped||(l.Directory?v(l.Location):null);l.stripped&&e.indexOf(l.stripped)===-1&&i.push(l)}i.sort(function(a,b){return a.stripped<b.stripped?-1:a.stripped>b.stripped?1:0});for(f=0;f<i.length;f++){for(var e=i[f],j=e.Name,l=e.stripped.split("/").length+1,m=0;m<l-2;m++)j="  "+j;a.push({name:j,path:e.stripped,callback:b})}i.length>0&&a.push({});a.push({name:g["Choose folder..."],callback:function(a){(new o.DirectoryPrompterDialog({title:g["Choose a Folder"],
serviceRegistry:h,fileClient:q,func:function(b){if(b&&b.Location){Array.isArray(a)||(a=[a]);var e=[],f=[];a.forEach(function(a){var h=b.Location,i=a.Name||null,j=c?q.copyFile:q.moveFile,k=d.formatMessage(c?g["Copying ${0}"]:g["Moving ${0}"],a.Location);c&&a.parent&&a.parent.Location===h&&((i=window.prompt(d.formatMessage(g["Enter a new name for '${0}'"],a.Name),d.formatMessage(g["Copy of ${0}"],a.Name)))||(h=null));h&&(h=j.apply(q,[a.Location,b.Location,i]),e.push(A.showWhile(h,k).then(function(b){f.push({oldValue:a,
newValue:b});H({type:c?"copy":"move",oldValue:a,newValue:b})},s)))});n.all(e).then(function(){H({type:c?"copyMultiple":"moveMultiple",items:f})})}}})).show()}});return a}function U(a){if(a.parent)return{item:a,parent:a.parent};else if(a.Parents&&a.Parents[0])return{item:a,parent:a.Parents[0]};return q.loadWorkspace(q.fileServiceRootURL(a.Location)).then(function(b){return n.when(b.Children||q.fetchChildren(b)).then(function(c){b.Children=c;c=b.Children.some(function(b){return b.Location===a.Location?
(a=b,!0):!1});return{item:a,parent:c?b:null}})})}A=h.getService("orion.page.progress");var H=r.bind(null,k),Q=function(a){var b=Array.isArray(a)?a:[a];if(b.length===0)return!1;for(var c=0;c<b.length;c++)if(a=b[c],!a.Location||a.Projects)return!1;return!0},B=new b.Command({name:g.Rename,tooltip:g["Rename the selected files or folders"],imageClass:"core-sprite-rename",id:"eclipse.renameResource",visibleWhen:function(a){return Array.isArray(a)?a.length===1&&a[0].Name:a.Location&&!a.Projects},parameters:new i.ParametersDescription(null,
{},function(a){var a=Array.isArray(a.items)?a.items:[a.items],b=k.treeRoot;return a.some(function(a){return a===b})?[new i.CommandParameter("name","text",g["Name:"],b.Name)]:null}),callback:function(a){function b(a){var c=e.Location;n.when(U(e),function(b){e=b.item;var f=b.parent;f&&f.Projects&&f.Projects.some(function(a){return a.Id===e.Id?(c=a.Location,!0):!1});b=q.moveFile(c,f.Location,a);A.showWhile(b,d.formatMessage(g["Renaming ${0}"],c)).then(function(a){H({type:"move",oldValue:e,newValue:a,
parent:f})},s)})}var e=l(a.items),f;a.parameters.hasParameters()&&(f=a.parameters.valueFor("name"))!==null?b(f):((f=k.getNameNode(e))||(f=a.domParent||a.domNode),c.getUserText(f.id+"EditBox",f,!0,e.Name,b,null,null,"."))}});j.addCommand(B);var x=new f.ContentTypeService(h),B=new b.Command({name:g["Compare with each other"],tooltip:g["Compare the selected 2 files with each other"],id:"eclipse.compareWithEachOther",visibleWhen:function(a){if(Array.isArray(a))if(a.length===2&&!a[0].Directory&&!a[1].Directory){var b=
x.getFilenameContentType(a[0].Name),a=x.getFilenameContentType(a[1].Name);if(b&&(b["extends"]==="text/plain"||b.id==="text/plain")&&a&&(a["extends"]==="text/plain"||a.id==="text/plain"))return!0}else if(a.length===2&&a[0].Directory&&a[1].Directory)return!0;return!1},hrefCallback:function(a){return a.items[0].Directory&&a.items[1].Directory?e.generateCompareTreeHref(a.items[0].Location,{compareTo:a.items[1].Location,readonly:!0}):e.generateCompareHref(a.items[0].Location,{compareTo:a.items[1].Location,
readonly:!0})}});j.addCommand(B);B=new b.Command({name:g["Compare with..."],tooltip:g["Compare the selected folder with a specified folder"],id:"eclipse.compareWith",visibleWhen:function(a){return Array.isArray(a)&&a.length===1&&a[0].Directory?!0:!1},callback:function(a){(new o.DirectoryPrompterDialog({title:g["Choose a Folder"],serviceRegistry:h,fileClient:q,func:function(b){b&&b.Location&&(b=e.generateCompareTreeHref(a.items[0].Location,{compareTo:b.Location,readonly:!0}),window.open(b))}})).show()}});
j.addCommand(B);B=new b.Command({name:g.Delete,tooltip:g["Delete the selected files or folders"],imageClass:"core-sprite-delete",id:"eclipse.deleteFile",visibleWhen:Q,callback:function(a){var b=Array.isArray(a.items)?a.items:[a.items],a=b.length===1?d.formatMessage(g["Are you sure you want to delete '${0}'?"],b[0].Name):d.formatMessage(g["Are you sure you want to delete these ${0} items?"],b.length);h.getService("orion.page.dialog").confirm(a,function(a){if(a){var c=[],a=b.map(function(a){var b=a.Location;
return n.when(U(a),function(e){a=e.item;var f=e.parent;f&&f.Projects&&(b=null,f.Projects.some(function(c){return c.Id===a.Id?(b=c.Location,!0):!1}));if(!b)return(new n).resolve();e=q.deleteFile(b);return A.showWhile(e,d.formatMessage(g["Deleting ${0}"],b)).then(function(){c.push({oldValue:a,newValue:null,parent:f});H({type:"delete",oldValue:a,newValue:null,parent:f})},s)})});n.all(a).then(function(){H({type:"deleteMultiple",items:c})},s)}})}});j.addCommand(B);B=new b.Command({name:g["Export as zip"],
tooltip:g["Create a zip file of the folder contents and download it"],imageClass:"core-sprite-exportzip",id:"eclipse.downloadFile",visibleWhen:function(a){a=l(a);return a.ExportLocation&&a.Directory},hrefCallback:function(a){return l(a.items).ExportLocation}});j.addCommand(B);B=new i.ParametersDescription([new i.CommandParameter("name","text",g["Name:"],g["New File"])]);B=new b.Command({name:g["New File"],tooltip:g["Create a new file"],imageClass:"core-sprite-new_file",id:"eclipse.newFile",parameters:B,
callback:function(a){k.selection.getSelections(function(b){var c;c=b.length===1&&b[0].Directory?b[0]:l(a.items);b=function(a){if(a){var b=q.createFile(c.Location,a);A.showWhile(b,d.formatMessage(g["Creating ${0}"],a)).then(function(a){H({type:"create",parent:c,newValue:a})},s)}};a.parameters&&a.parameters.valueFor("name")?b(a.parameters.valueFor("name")):t(k,c,a.domNode.id,g["New File"],b)})},visibleWhen:function(b){b=l(b);return b.Directory&&!a.isAtRoot(b.Location)}});j.addCommand(B);var B=new i.ParametersDescription([new i.CommandParameter("name",
"text",g["Folder name:"],g["New Folder"])]),D=new b.Command({name:g["New Folder"],tooltip:g["Create a new folder"],imageClass:"core-sprite-new_folder",id:"eclipse.newFolder",parameters:B,callback:function(a){k.selection.getSelections(function(b){var c;c=b.length===1&&b[0].Directory?b[0]:l(a.items);b=function(a){if(a){var b=q.createFolder(c.Location,a);A.showWhile(b,d.formatMessage(g["Creating ${0}"],a)).then(function(a){H({type:"create",parent:c,newValue:a})},s)}};a.parameters&&a.parameters.valueFor("name")?
b(a.parameters.valueFor("name")):t(k,c,a.domNode.id,g["New Folder"],b)})},visibleWhen:function(b){b=l(b);return b.Directory&&!a.isAtRoot(b.Location)}});j.addCommand(D);var F=new i.ParametersDescription([new i.CommandParameter("url","url",g["File URL:"],"URL"),new i.CommandParameter("unzip","boolean",g["Unzip *.zip files:"],!0)]),F=new b.Command({name:g["Import from HTTP..."],tooltip:g["Copy a file from a URL and optionally unzip it"],id:"orion.importZipURL",parameters:F,callback:function(a){var b=
l(a.items),c=a.parameters&&a.parameters.valueFor("url");if(b&&c){var e=b.ImportLocation+(b.ImportLocation.indexOf("?")===-1?"?":"&")+"source="+c,a=a.parameters&&a.parameters.valueFor("unzip")&&c.indexOf(".zip")===c.length-4?"":"raw",e=q.remoteImport(e,{OptionHeader:a});A.showWhile(e,d.formatMessage(g["Importing from ${0}"],c)).then(function(){H({type:"import",target:b})})}},visibleWhen:function(b){b=l(b);return b.Directory&&!a.isAtRoot(b.Location)}});j.addCommand(F);B=new b.Command({name:g["New Folder"],
parameters:B,imageClass:"core-sprite-new_folder",tooltip:g["Create an empty folder"],description:g["Create an empty folder on the Orion server.  You can import, upload, or create content in the editor."],id:"orion.new.project",callback:function(a){k.selection.getSelections(function(b){b.length===1&&b[0].Directory?D.callback(a):(l(a.items),a.parameters&&a.parameters.valueFor("name")?w(k,q,A,a.parameters.valueFor("name")):t(a.items,a.domNode.id,g["New Folder"],function(a){w(k,q,A,a)}))})},visibleWhen:u});
j.addCommand(B);B=new b.Command({name:g["Link to Server"],tooltip:g["Link to existing content on the server"],description:g["Create a folder that links to an existing folder on the server."],imageClass:"core-sprite-link",id:"orion.new.linkProject",parameters:new i.ParametersDescription([new i.CommandParameter("name","text","Name:","New Folder"),new i.CommandParameter("url","url",g["Server path:"],"")]),callback:function(a){var b=function(a,b){if(a&&b){var c=q.createProject(k.treeRoot.ChildrenLocation,
a,b,!0),e=k;A.showWhile(c,d.formatMessage(g["Linking to ${0}"],b)).then(function(){e.loadResourceList(e.treeRoot.Path,!0)},s)}};a.parameters&&a.parameters.valueFor("name")&&a.parameters.valueFor("url")?b(a.parameters.valueFor("name"),a.parameters.valueFor("url")):s(g["The name and server location were not specified."])},visibleWhen:u});j.addCommand(B);B=new b.Command({name:g["Go Up"],tooltip:g["Move up to the parent folder"],imageClass:"core-sprite-go-up",id:"eclipse.upFolder",callback:function(){typeof k.scopeUp===
"function"&&k.scopeUp()},visibleWhen:function(a){a=l(a);return a.Parents}});j.addCommand(B);B=new b.Command({name:g["Import local file..."],tooltip:g["Copy files and folders from your local file system"],imageClass:"core-sprite-importzip",id:"orion.import",callback:function(a){var b=l(a.items);(new m.ImportDialog({importLocation:b.ImportLocation,func:function(){H({type:"import",target:b})}})).show()},visibleWhen:function(b){b=l(b);return b.Directory&&!a.isAtRoot(b.Location)}});j.addCommand(B);B=new b.Command({name:g["SFTP from..."],
tooltip:g["Copy files and folders from a specified SFTP connection"],imageClass:"core-sprite-transferin",id:"orion.importSFTP",callback:function(a){var b=l(a.items);(new p.SFTPConnectionDialog({func:function(a,c,e,f,h,i){c=q.remoteImport(b.ImportLocation,{OptionHeader:i?"sftp,"+i:"sftp",Host:a,Port:c,Path:e,UserName:f,Passphrase:h});A.showWhile(c,d.formatMessage(g["Importing from ${0}"],a)).then(function(a){H({type:"import",target:b});s(a)},s)}})).show()},visibleWhen:function(b){b=l(b);return b.Directory&&
!a.isAtRoot(b.Location)}});j.addCommand(B);B=new b.Command({name:g["SFTP to..."],tooltip:g["Copy files and folders to a specified SFTP location"],imageClass:"core-sprite-transferout",id:"eclipse.exportSFTPCommand",callback:function(a){var b=l(a.items);(new p.SFTPConnectionDialog({func:function(a,c,e,f,h,i){c=q.remoteExport(b.ExportLocation,{OptionHeader:i?"sftp,"+i:"sftp",Host:a,Port:c,Path:e,UserName:f,Passphrase:h});A.showWhile(c,d.formatMessage(g.Exporting,a)).then(s,s)}})).show()},visibleWhen:function(b){b=
l(b);return b.Directory&&!a.isAtRoot(b.Location)}});j.addCommand(B);B=new b.Command({name:g["Copy to"],tooltip:"Copy files and folders to a specified location",id:"eclipse.copyFile",choiceCallback:function(a,b){return G(a,b,!0)},visibleWhen:Q});j.addCommand(B);Q=new b.Command({name:g["Move to"],tooltip:g["Move files and folders to a new location"],id:"eclipse.moveFile",choiceCallback:function(a,b){return G(a,b,!1)},visibleWhen:Q});j.addCommand(Q);var E=[],Q=new b.Command({name:g["Copy Items"],tooltip:g["Copy the selected items to the copy/paste buffer"],
id:"eclipse.copySelections",callback:function(){k.selection.getSelections(function(a){E=a})}});j.addCommand(Q);Q=new b.Command({name:g["Paste Items"],tooltip:g["Paste items from the copy/paste buffer"],id:"eclipse.pasteSelections",visibleWhen:function(b){b=l(b);return b.Directory&&!a.isAtRoot(b.Location)},callback:function(b){k.selection.getSelections(function(c){var e;e=c.length===1&&c[0].Directory?c[0]:l(b.items);if(E.length>0)if(a.isAtRoot(e.Location))s(g["Cannot paste into the root"]);else{var f=
[],h=[];E.forEach(function(a){var b=a.Location,c=a.Name||null;b&&(a.parent&&a.parent.Location===e.Location&&((c=window.prompt(d.formatMessage(g["Enter a new name for '${0}'"],a.Name),d.formatMessage(g["Copy of ${0}"],a.Name)))||(b=null)),b&&(a=q.copyFile(b,e.Location,c),h.push(A.showWhile(a,d.formatMessage(g["Pasting ${0}"],b)).then(function(a){f.push({oldValue:e,newValue:a});H({type:"copy",oldValue:e,newValue:a})},s))))});n.all(h).then(function(){H({type:"copyMultiple",items:f})})}})}});j.addCommand(Q)};
v.createNewContentCommand=function(a,c,d,e,f,h,j){var e=d?[]:[new i.CommandParameter("folderName","text",g["Folder name:"],c),new i.CommandParameter("url","url",g["Extracted from:"],e),new i.CommandParameter("unzip","boolean",g["Unzip *.zip files:"],!0)],k=null;e.length>0&&(k=new i.ParametersDescription(e));return new b.Command({name:c,parameters:k,id:a,callback:function(a){if(d)window.open(d);else if(a.parameters&&a.parameters.valueFor("folderName")){var b=a.parameters.valueFor("folderName");w(f,
h,j,b,function(b){a.parameters.clientCollect=!0;a.commandRegistry.runCommand("orion.importZipURL",b,f,a.parameters)})}else t(f,a.items,a.domNode.id,c,function(b){w(f,h,j,b,function(b){a.commandRegistry.runCommand("orion.importZipURL",b,f,a.parameters)})})},visibleWhen:u})};return v});
define("orion/widgets/nav/mini-nav","require,i18n!orion/edit/nls/messages,orion/objects,orion/webui/littlelib,orion/explorers/explorer-table,orion/explorers/navigatorRenderer,orion/explorers/explorerNavHandler,orion/i18nUtil,orion/keyBinding,orion/fileCommands,orion/extensionCommands,orion/selection,orion/EventTarget,orion/URITemplate,orion/PageUtil".split(","),function(g,k,j,d,c,a,b,i,h,f,e,n,o,p,m){function q(a){a.setFocus=!1;a.cachePrefix=null;t.apply(this,arguments);this.commandRegistry=a.commandRegistry;
this.editorInputManager=a.editorInputManager;this.progressService=a.progressService;var b=this.sidebarNavInputManager=a.sidebarNavInputManager;this.toolbarNode=a.toolbarNode;this.newActionsScope=this.toolbarNode.id+"New";this.selectionActionsScope=this.toolbarNode.id+"Selection";this.folderNavActionsScope=this.toolbarNode.id+"Folder";this.followEditor=!0;var c={};this.treeRoot=c;var e=this;this.editorInputListener=function(a){var v;v=e.editorInput=a.metadata,a=v;e.treeRoot===c&&e.followEditor?e.loadParentOf(a):
(e.renderer.updateFolderLinks(d.node(e._parentId)),e.reveal(a))};this.editorInputManager.addEventListener("InputChanged",this.editorInputListener);if(b)this.navInputListener=function(a){e.followEditor=!1;e.loadRoot(a.input).then(function(){e.updateCommands()})},b.addEventListener("InputChanged",this.navInputListener),this.addEventListener("rootChanged",function(a){e.sidebarNavInputManager.dispatchEvent(a)});var f=this.modelEventDispatcher,g=this.onFileModelChange.bind(this);["move","delete"].forEach(function(a){f.addEventListener(a,
g)});this.selection=new n.Selection(this.registry,"miniNavFileSelection");this.selection.addEventListener("selectionChanged",function(a){e.updateCommands(a.selections)});this.commandsRegistered=this.registerCommands()}function r(){u.apply(this,arguments)}function s(a){this.commandRegistry=a.commandRegistry;this.contentTypeRegistry=a.contentTypeRegistry;this.fileClient=a.fileClient;this.editorInputManager=a.editorInputManager;this.parentNode=a.parentNode;this.sidebarNavInputManager=a.sidebarNavInputManager;
this.toolbarNode=a.toolbarNode;this.serviceRegistry=a.serviceRegistry;this.explorer=null}var t=c.FileExplorer,l=h.KeyBinding,u=a.NavigatorRenderer;q.prototype=Object.create(t.prototype);j.mixin(q.prototype,{onFileModelChange:function(a){var b=a.oldValue,a=a.newValue,c=this.editorInputManager.getFileMetadata();if(c){var d;[c].concat(c.Parents||[]).some(function(a){return b.Location===a.Location?(d=b,!0):!1});d&&this.sidebarNavInputManager.dispatchEvent({type:"editorInputMoved",parent:this.treeRoot.ChildrenLocation,
newInput:d.Location===c.Location?a&&a.Location||null:null})}},createActionSections:function(){var a=this;[this.newActionsScope,this.selectionActionsScope,this.folderNavActionsScope].forEach(function(b){if(!a[b]){var c=document.createElement("ul");c.id=b;c.classList.add("commandList");c.classList.add("layoutLeft");c.classList.add("pageActions");a.toolbarNode.appendChild(c);a[b]=c}})},destroy:function(){var a=this;[this.newActionsScope,this.selectionActionsScope,this.folderNavActionsScope].forEach(function(b){delete a[b]});
this.sidebarNavInputManager.removeEventListener("InputChanged",this.navInputListener);this.editorInputManager.removeEventListener("InputChanged",this.editorInputListener)},loadParentOf:function(a){if(a){var b=a.Parents&&a.Parents[0];if(b){if(this.treeRoot&&this.treeRoot.ChildrenLocation===b.ChildrenLocation){this.reveal(a);return}}else b=this.fileClient.fileServiceRootURL(a.Location);return this.loadRoot(b).then(this.reveal.bind(this,a))}},loadRoot:function(a){var a=a&&a.ChildrenLocation||a||"",b=
this;return this.commandsRegistered.then(function(){return b.loadResourceList.call(b,a)})},reveal:function(a){if(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0,!1,!1),b.setSelection(a))}},scopeUp:function(){var a=this.treeRoot;if(a=a&&a.Parents){var b=this;(a.length===0?this.loadRoot(this.fileClient.fileServiceRootURL(this.treeRoot.Location)).then(this.reveal.bind(this,this.treeRoot)):this.loadParentOf(this.treeRoot)).then(function(){b.dispatchEvent({type:"rootChanged",root:b.treeRoot,force:!0})})}},
registerCommands:function(){var a=this.commandRegistry,b=this.fileClient,c=this.registry,d=this.newActionsScope,g=this.selectionActionsScope,h=this.folderNavActionsScope;a.addCommandGroup(d,"orion.miniNavNewGroup",1E3,k.New,null,null,"core-sprite-addcontent");a.addCommandGroup(g,"orion.miniNavSelectionGroup",100,k.Actions,null,null,"core-sprite-gear");a.registerSelectionService(g,this.selection);a.registerCommandContribution(d,"eclipse.copySelections",1,null,!0,new l("c",!0));a.registerCommandContribution(d,
"eclipse.pasteSelections",1,null,!0,new l("v",!0));a.registerCommandContribution(d,"eclipse.newFile",1,"orion.miniNavNewGroup");a.registerCommandContribution(d,"eclipse.newFolder",2,"orion.miniNavNewGroup",!1,null);a.registerCommandContribution(d,"orion.new.project",1,"orion.miniNavNewGroup");a.registerCommandContribution(d,"orion.new.linkProject",2,"orion.miniNavNewGroup");a.registerCommandContribution(h,"eclipse.upFolder",1,null,!1,new l(38,!1,!1,!0));d=new l(113);d.domScope="sidebar";d.scopeName=
k.Navigator;h=new l(46);h.domScope="sidebar";h.scopeName=k.Navigator;a.registerCommandContribution(g,"eclipse.renameResource",2,"orion.miniNavSelectionGroup",!1,d);a.registerCommandContribution(g,"eclipse.copyFile",3,"orion.miniNavSelectionGroup");a.registerCommandContribution(g,"eclipse.moveFile",4,"orion.miniNavSelectionGroup");a.registerCommandContribution(g,"eclipse.deleteFile",5,"orion.miniNavSelectionGroup",!1,h);a.registerCommandContribution(g,"eclipse.compareWithEachOther",6,"orion.miniNavSelectionGroup");
a.registerCommandContribution(g,"eclipse.compareWith",7,"orion.miniNavSelectionGroup");a.registerCommandContribution(g,"orion.importZipURL",1,"orion.miniNavSelectionGroup/orion.importExportGroup");a.registerCommandContribution(g,"orion.import",2,"orion.miniNavSelectionGroup/orion.importExportGroup");a.registerCommandContribution(g,"eclipse.downloadFile",3,"orion.miniNavSelectionGroup/orion.importExportGroup");a.registerCommandContribution(g,"orion.importSFTP",4,"orion.miniNavSelectionGroup/orion.importExportGroup");
a.registerCommandContribution(g,"eclipse.exportSFTPCommand",5,"orion.miniNavSelectionGroup/orion.importExportGroup");f.createFileCommands(c,a,this,b);return e.createAndPlaceFileCommandsExtension(c,a,g,0,"orion.miniNavSelectionGroup",!0)},updateCommands:function(){this.createActionSections();var a=this.commandRegistry;f.updateNavTools(this.registry,a,this,this.newActionsScope,this.selectionActionsScope,this.treeRoot,!0);a.destroy(this.folderNavActionsScope);a.renderCommands(this.folderNavActionsScope,
this.folderNavActionsScope,this.treeRoot,this,"tool")}});r.prototype=Object.create(u.prototype);j.mixin(r.prototype,{showFolderLinks:!0,oneColumn:!0,createFolderNode:function(a){var b=u.prototype.createFolderNode.call(this,a);b.tagName==="A"&&(b.classList.add("miniNavFolder"),this.setFolderHref(b,this.explorer.editorInput&&this.explorer.editorInput.Location||"",a.ChildrenLocation));return b},setFolderHref:function(a,b,c){a.href=(new p("#{,resource,params*}")).expand({resource:b,params:{navigate:c}})},
updateFolderLinks:function(a){var b=this.explorer.editorInput&&this.explorer.editorInput.Location,c=this;Array.prototype.slice.call(d.$$("a.miniNavFolder",a)).forEach(function(a){var d=m.matchResourceParameters(a.href).navigate;c.setFolderHref(a,b||"",d)})}});j.mixin(s.prototype,{label:k.Navigator,create:function(){var a=this;this.explorer=new q({commandRegistry:this.commandRegistry,dragAndDrop:f.uploadFile,fileClient:this.fileClient,editorInputManager:this.editorInputManager,sidebarNavInputManager:this.sidebarNavInputManager,
parentId:this.parentNode.id,rendererFactory:function(b){return new r({checkbox:!1,cachePrefix:"MiniNav"},b,a.commandRegistry,a.contentTypeRegistry)},serviceRegistry:this.serviceRegistry,toolbarNode:this.toolbarNode});this.explorer.loadParentOf(this.editorInputManager.getFileMetadata())},destroy:function(){this.explorer&&this.explorer.destroy();this.explorer=null}});return s});
define("orion/sidebar","orion/Deferred,orion/objects,orion/commands,orion/outliner,orion/webui/littlelib,orion/widgets/nav/mini-nav,i18n!orion/edit/nls/messages".split(","),function(g,k,j,d,c,a,b){function i(a){this.params=a;this.commandRegistry=a.commandRegistry;this.contentTypeRegistry=a.contentTypeRegistry;this.editor=a.editor;this.fileClient=a.fileClient;this.editorInputManager=a.editorInputManager;this.outlineService=a.outlineService;this.parentNode=c.node(a.parent);this.toolbarNode=c.node(a.toolbar);
this.selection=a.selection;this.serviceRegistry=a.serviceRegistry;this.sidebarNavInputManager=a.sidebarNavInputManager;this.viewModes={};this.switcherNode=this.modeContributionToolbar=this.activeViewMode=null}k.mixin(i.prototype,{defaultViewMode:"nav",show:function(){if(!this.created){this.created=!0;var c=this.commandRegistry,f=this.contentTypeRegistry,e=this.fileClient,g=this.editorInputManager,i=this.outlineService,k=this.parentNode,m=this.progressService,q=this.selection,r=this.serviceRegistry,
s=this.toolbarNode,t=this.modeContributionToolbar=document.createElement("div");t.id=s.id+"childModes";s.appendChild(t);var l=this.switcherNode=document.createElement("div");l.id=s.id+"viewmodeSwitch";l.classList.add("layoutRight");l.classList.add("pageActions");s.appendChild(l);s=new j.Command({name:b.View,imageClass:"core-sprite-outline",tooltip:b.ViewTooltip,id:"orion.sidebar.viewmode",visibleWhen:function(){return!0},choiceCallback:this.viewModeMenuCallback.bind(this)});c.addCommand(s);c.registerCommandContribution(l.id,
"orion.sidebar.viewmode",1);this.addViewMode("nav",new a({commandRegistry:c,contentTypeRegistry:f,fileClient:e,editorInputManager:g,parentNode:k,sidebarNavInputManager:this.sidebarNavInputManager,serviceRegistry:r,toolbarNode:t}));this.outliner=new d.Outliner({parent:k,toolbar:t,serviceRegistry:r,contentTypeRegistry:f,outlineService:i,commandService:c,selectionService:q,inputManager:g,progressService:m,sidebar:this});this.setViewMode(this.defaultViewMode)}},viewModeMenuCallback:function(){var a=this;
return Object.keys(this.viewModes).map(function(b){return{name:a.getViewMode(b).label||b,callback:a.setViewMode.bind(a,b)}})},getActiveViewModeId:function(){return this.activeViewModeId},addViewMode:function(a,b){if(!a)throw Error("Invalid id: "+a);if(!b||typeof b!=="object")throw Error("Invalid mode: "+b);Object.hasOwnProperty.call(this.viewModes,a)||(this.viewModes[a]=b)},removeViewMode:function(a){var b=this.getViewMode(a);b&&typeof b.destroy==="function"&&b.destroy();delete this.viewModes[a]},
getViewMode:function(a){return Object.hasOwnProperty.call(this.viewModes,a)?this.viewModes[a]:null},setViewMode:function(a){var b=this.activeViewMode;b&&typeof b.destroy==="function"&&b.destroy();this.commandRegistry.destroy(this.modeContributionToolbar);c.empty(this.parentNode);this.activeViewModeId=(b=this.activeViewMode=this.getViewMode(a))?a:null;b&&typeof b.create==="function"&&b.create()},renderViewModeMenu:function(){var a=this.switcherNode;this.commandRegistry.destroy(a);Object.keys(this.viewModes).length>
1&&this.commandRegistry.renderCommands(a.id,a,{},this,"button")}});return i});
define("edit/setup","i18n!orion/edit/nls/messages,require,orion/EventTarget,orion/webui/littlelib,orion/selection,orion/status,orion/progress,orion/dialogs,orion/commandRegistry,orion/favorites,orion/extensionCommands,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/outliner,orion/problems,orion/editor/contentAssist,orion/editorCommands,orion/editor/editorFeatures,orion/editor/editor,orion/syntaxchecker,orion/editor/textView,orion/editor/textModel,orion/editor/projectionTextModel,orion/keyBinding,orion/editor/emacs,orion/editor/vi,orion/searchAndReplace/textSearcher,orion/contentTypes,orion/PageUtil,orion/inputManager,orion/i18nUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/editor/ThemeData,orion/widgets/themes/editor/LocalEditorSettings,edit/editorPreferences,orion/URITemplate,orion/sidebar".split(","),function(g,
k,j,d,c,a,b,i,h,f,e,n,o,p,m,q,r,s,t,l,u,w,v,y,A,G,I,C,z,P,L,S,U,H,Q,B,x,D,F){var E=E||{};E.setUpEditor=function(k,E,G){function W(a){if(a){var b=d.node("pageActions");b&&e.createAndPlaceFileCommandsExtension(k,J,"pageActions",500).then(function(){J.destroy(b);J.renderCommands("pageActions",b,a,M,"button")});var c=d.node("pageNavigationActions");c&&(J.destroy(c),J.renderCommands(c.id,c,a,M,"button"))}}function X(a){$&&a.removeKeyMode($);aa&&a.removeKeyMode(aa);O.keyBindings==="Emacs"?($||($=new I.EmacsMode(a)),
a.addKeyMode($)):O.keyBindings==="vi"&&(aa||(aa=new C.VIMode(a,ia)),a.addKeyMode(aa))}var K,J,ba,ga,ca,da,V,Z;(function(){K=new c.Selection(k);var d=new o.OperationsClient(k);ba=new a.StatusReportingService(k,d,"statusPane","notifications","notificationArea");new i.DialogService(k);J=new h.CommandRegistry({selection:K});da=new b.ProgressService(k,d,J);new r.ProblemService(k);ga=new q.OutlineService({serviceRegistry:k,preferences:E});new f.FavoritesService({serviceRegistry:k});ca=new P.ContentTypeService(k);
V=new n.FileClient(k);Z=new p.Searcher({serviceRegistry:k,commandService:J,fileService:V})})();var ka=d.node("sidebar"),la=d.node("sidebarToolbar"),ha=d.node("editor"),M,N,O,ia=function(a,b,c){b==="progress"?ba.setProgressMessage(a):b==="error"?ba.setErrorMessage(a):ba.setMessage(a,null,c)},$,aa,ea=function(a){O=a;N.setAutoLoadEnabled(a.autoLoadEnabled);N.setAutoSaveTimeout(a.autoSaveEnabled?a.autoSaveTimeout:-1);if(a=M.getTextView())X(a),a.setOptions({tabSize:O.tabSize||4,expandTab:O.expandTab,scrollAnimation:O.scrollAnimationEnabled?
O.scrollAnimation:0});W(N.getFileMetadata())},fa=new x.EditorPreferences(E,function(a){a?ea(a):fa.getPrefs(ea)}),ja=new H.ThemePreferences(E,new Q.ThemeData);ja.apply();var ma=new B(ja,fa);fa.getPrefs(function(a){function b(){j.attach(this)}O=a;var a=G?null:{createContentAssistMode:function(a){var b=k.getService("orion.page.progress"),c=new s.ContentAssist(a.getTextView());c.addEventListener("Activating",function(){for(var d=N.getContentType(),e=a.getTitle(),f=k.getServiceReferences("orion.edit.contentAssist"),
g=[],h=0;h<f.length;h++){var i=f[h],j=i.getProperty("contentType"),l=i.getProperty("pattern");(j&&ca.isSomeExtensionOf(d,j)||l&&RegExp(l).test(e))&&g.push(k.getService(i))}c.setProviders(g);c.setProgress(b)});var d=new s.ContentAssistWidget(c,"contentassist"),d=new s.ContentAssistMode(c,d);c.setMode(d);return d}},c=function(a,b,c){a.href=(new D("#{,resource,params*}")).expand({resource:N.getInput()||"",params:{navigate:c?c.ChildrenLocation:V.fileServiceRootURL(b||"")}})};M=new u.Editor({textViewFactory:function(){return new v.TextView({parent:ha,
model:new A.ProjectionTextModel(new y.TextModel),wrappable:!0,tabSize:O.tabSize||4,expandTab:O.expandTab,scrollAnimation:O.scrollAnimationEnabled?O.scrollAnimation:0,readonly:G})},undoStackFactory:new l.UndoFactory,textDNDFactory:new l.TextDNDFactory,annotationFactory:new l.AnnotationFactory,foldingRulerFactory:new l.FoldingRulerFactory,lineNumberRulerFactory:new l.LineNumberRulerFactory,contentAssistFactory:a,keyBindingFactory:function(a,b,c,d){b=new z.TextSearcher(a,J,c);(new l.KeyBindingsFactory).createKeyBindings(a,
c,d,b);(new t.EditorCommandFactory(k,J,V,N,"pageActions",G,"pageNavigationActions",b,Z,function(){return O})).generateEditorCommands(a);a=a.getTextView();X(a)},statusReporter:ia,domNode:ha});N=new S.InputManager({editor:M,serviceRegistry:k,fileClient:V,progressService:da,selection:K,contentTypeService:ca});N.addEventListener("InputChanged",function(a){if(!(a.input===null||typeof a.input==="undefined")){var b=a.metadata;W(b);m.addSettings(ma);m.setPageTarget({task:"Coding",name:a.name,target:b,makeAlternate:function(){if(b.Parents&&
b.Parents.length>0)return da.progress(V.read(b.Parents[0].Location,!0),U.formatMessage(g["Reading metedata of"],b.Parents[0].Location))},makeBreadcrumbLink:c,serviceRegistry:k,commandService:J,searchService:Z,fileService:V});J.processURL(window.location.href)}});b.prototype.processHash=function(){var a=L.matchResourceParameters(location.hash),b=a.navigate;if(typeof b==="string"||!a.resource)this.dispatchEvent({type:"InputChanged",input:b||""})};var d=new b;(new F({commandRegistry:J,contentTypeRegistry:ca,
editorInputManager:N,editor:M,fileClient:V,outlineService:ga,parent:ka,progressService:da,selection:K,serviceRegistry:k,sidebarNavInputManager:d,toolbar:la})).show();k.getService("orion.core.marker").addEventListener("problemsChanged",function(a){M.showProblems(a.problems)});var e=new w.SyntaxChecker(k,M);M.addEventListener("InputChanged",function(a){e.checkSyntax(N.getContentType(),a.title,a.message,a.contents)});d.addEventListener("rootChanged",function(a){var b=a.root,d=L.matchResourceParameters(location.hash);
if(a.force||Object.hasOwnProperty.call(d,"navigate"))a={},a.resource=d.resource||"",a.params={navigate:b.Path},window.location=(new D("#{,resource,params*}")).expand(a);d.resource||m.setPageTarget({task:"Coding",name:b.Name,target:b,makeBreadcrumbLink:c,serviceRegistry:k,commandService:J,searchService:Z,fileService:V})});d.addEventListener("editorInputMoved",function(a){var b=a.parent,c={};c.resource=a.newInput||"";c.params={navigate:b};window.location=(new D("#{,resource,params*}")).expand(c)});
M.addEventListener("DirtyChanged",function(){N.setDirty(M.isDirty())});K.addEventListener("selectionChanged",function(a){N.setInput(a.selection)});window.addEventListener("hashchange",function(){N.setInput(window.location.hash)});window.addEventListener("hashchange",function(){d.processHash(window.location.hash)});N.setInput(window.location.hash);d.processHash(window.location.hash);m.generateBanner("orion-editor",k,J,E,Z,M,M);ea(O);window.onbeforeunload=function(){if(M.isDirty())return g["There are unsaved changes."]}})};
return E});define('built-edit.js',["orion/browserCompatibility","orion/bootstrap","edit/setup"],function(g,k,j){k.startup().then(function(d){j.setUpEditor(d.serviceRegistry,d.preferences,!1)})});