/**
 * @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). 
 * 
 * Contributors: 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).
 *
 ******************************************************************************/

/*******************************************************************************
 * @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). 
 *
 *******************************************************************************/

/*******************************************************************************
 * @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, 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) 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) 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, 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) 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) 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 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) 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) 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, 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) 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) 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) 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, 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) 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, 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
 *		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) 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
 ******************************************************************************/

/* See jsdiff-license.txt for terms of usage */

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

/*******************************************************************************
 * @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) 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, 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, 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) 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
 ******************************************************************************/

/*******************************************************************************
 * @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) 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) 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) 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) 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, 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). 


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


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

 Contributors: IBM Corporation - initial API and implementation
 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) 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, 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:  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) 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: 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:
 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) 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) 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) 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, 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). 


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

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


 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) 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) 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) 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) 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) 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) 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, 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, 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: 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) 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, 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) 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
 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) 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) 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, 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:
 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) 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
*/
(function(){function f(b,d,a,h,g,e){d[b]&&(a.push(b),(d[b]===!0||d[b]===1)&&h.push(g+b+"/"+e))}function k(b,d,a,h,g){d=h+d+"/"+g;require._fileExists(b.toUrl(d+".js"))&&a.push(d)}function j(b,d,a){for(var h in d)d.hasOwnProperty(h)&&(!b.hasOwnProperty(h)||a)?b[h]=d[h]:typeof d[h]==="object"&&j(b[h],d[h],a)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(b){var i=b.config?b.config():{};return{version:"2.0.1+",load:function(a,h,g,e){e=e||{};if(e.locale)i.locale=e.locale;
var c=d.exec(a),l=c[1],b=c[4],m=c[5],r=b.split("-"),q=[],s={},t,p="";if(c[5])l=c[1],a=l+m;else{m=c[4];b=i.locale;if(!b)b=i.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();r=b.split("-")}if(e.isBuild){q.push(a);k(h,"root",q,l,m);for(t=0;t<r.length;t++)e=r[t],p+=(p?"-":"")+e,k(h,p,q,l,m);h(q,function(){g()})}else h([a],function(c){var e=[],a;f("root",c,e,q,l,m);for(t=0;t<r.length;t++)a=r[t],p+=(p?"-":"")+a,f(p,c,e,q,l,m);h(q,function(){var o,
a,v;for(o=e.length-1;o>-1&&e[o];o--){v=e[o];a=c[v];if(a===!0||a===1)a=h(l+v+"/"+m);j(s,a)}g(s)})})}}})})();
define("orion/i18n",[],function(){return{load:function(f,k,j,d){var d=d||{},b=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,i=b.exec(f);if(i){if(!k.defined||k.defined(f))try{j(k(f));return}catch(a){}if(d.isBuild||d.isTest)j({});else{var h=i[1],g=i[3]?i[2]:"",e=i[3]||i[2];k(["orion/bootstrap"],function(c){c.startup().then(function(c){var a=c.serviceRegistry,c=a.getServiceReferences("orion.i18n.message");if(g)c.some(function(c){return f===c.getProperty("name")?(a.getService(c).getMessageBundle().then(function(c){j(c)},
function(){j({})}),!0):!1})||j({});else{var m={},r;c.forEach(function(c){var a=c.getProperty("name");if((i=b.exec(a))&&h===i[1]&&e===(i[3]||i[2]))if(g=i[3]?i[2]:""){if((c=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&c.toLowerCase().indexOf(g.toLowerCase())===0)m[g]=!0,(!k.specified||!k.specified(a))&&define(a,["orion/i18n!"+a],function(c){return c})}else r=c});!k.specified||!k.specified(f)?r?a.getService(r).getMessageBundle().then(function(c){Object.keys(m).forEach(function(e){typeof c[e]===
"undefined"&&(c[e]=m[e])});define(f,[],c);j(c)},function(){define(f,[],m);j(m)}):(define(f,[],m),j(m)):j(m)}})})}}else j(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"Git Repositories",Repo:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ",
"Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged","Recent commits on":"Recent commits on","Git Status":"Git Status","Go to Git Status":"Go to Git Status","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare",
"Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes",
"Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes","Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Reset:"Reset",
"Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...",
"Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",
". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories","Loading repository":"Loading repository","Loading repositories":"Loading repositories",
"(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!","Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches",
"tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits","Getting current branch":"Getting current branch","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits",
"The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","Getting confituration":"Getting confituration","View all configuration entries":"View all configuration entries","Unstaged addition":"Unstaged addition",
"Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Log (0)":"Log (${0})","Log (0) - 1":"Log (${0}) - ${1}","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch',"Add Remote":"Add Remote","Remote Name:":"Remote Name:","Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Go to the git repository",
"Clone Git Repository":"Clone Git Repository","Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:","Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials",
"Username:":"Username:","Ssh password:":"Password:","Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content","Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...","Looking for the commit":"Looking for the commit",
"New Branch:":"New Branch:",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.","Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout the current tag, creating a local branch based on its contents.",
"Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.","Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...",
"Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository","Are you sure?":"Are you sure?",
"You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Go to Git Remote","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository","Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",
Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Go to Git Log","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository",ShowInEditor:"Show in Editor",ShowInEditorTooltip:"Show the repository folder in the editor","Compare With Each Other":"Compare With Each Other",
"Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","SSH Password:":"Password:","SSH User Name:":"SSH User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content","You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",
Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing":". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing",". Repository state is invalid (i.e. already during rebasing)":". Repository state is invalid (i.e. already during rebasing)",". Repository contains unmerged paths":". Repository contains unmerged paths",". Repository contains pending changes. Please commit or stash them":". Repository contains pending changes. Please commit or stash them",
"Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ","starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch",
"Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Force Push All":"Force Push All","Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.",
"< Previous Page":"< Previous Page","Show previous page of git log":"Show previous page of git log","Show previous page of git tags":"Show previous page of git tags","Next Page >":"Next Page >","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
GitResetIndexConfirm:"The content of your active branch will be replaced with ${0}. All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository","Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick",
"Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch",
"Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository","Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ",
"Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?","Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:",
"Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes","Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",Continue:"Continue",
"Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch","Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch",
"See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:","Filter items":"Filter items","Filter remote branches":"Filter remote branches","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub",
"Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org","Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org","Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name",
"Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:","Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...","The commit can be found in the following repositories":"The commit can be found in the following repositories",
"Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories","You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ",
"To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}","Problem while performing the action":"Problem while performing the action","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.",
"URL:":"URL:","File:":"File:",Submit:"Submit","git url:":"git url: ",Revert:"Revert","Revert changes introduced by the commit into your active branch":"Revert changes introduced by the commit into your active branch",". Could not revert into active branch":". Could not revert into active branch"});define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
(function(){function f(){for(var b=navigator.userAgent,d={browser:!1,version:!1},a=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],h=0;h<a.length;h++){var g=a[h],e=b.match(g.regExp);if(e){d.browser=!0;d.version=e[1]>=g.minVersion;d.name=g.name;break}}return d}function k(){try{return"localStorage"in
window&&window.localStorage!==null}catch(b){return!1}}function j(b){alert(b);throw Error("unsupported browser");}var d=f();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:f,supportsLocalStorage:k,throwBrowserAlert:j}})();define("orion/browserCompatibility",function(){});
(function(f,k){typeof define==="function"&&define.amd?define("orion/Deferred",k):typeof exports==="object"?module.exports=k():(f.orion=f.orion||{},f.orion.Deferred=k())})(this,function(){function f(){for(var a;a=b.shift();)a();i=!1}function k(a){b.push(a);i||(i=!0,setTimeout(f,0))}function j(a){return function(){a.apply(void 0,arguments)}}function d(){function a(){for(var e;e=n.shift();){var a=e.deferred,g=l==="fulfilled"?"resolve":"reject";if(typeof e[g]==="function")try{var h=(0,e[g])(c),d=h&&(typeof h===
"object"||typeof h==="function")&&h.then;if(typeof d==="function")if(h===a.promise)a.reject(new TypeError);else{var i=h.cancel;typeof i==="function"?a._protected(b).parentCancel=i.bind(h):delete a._protected(b).parentCancel;d.call(h,j(a.resolve),j(a.reject),j(a.progress))}else a.resolve(h)}catch(v){a.reject(v)}else a[g](c)}}function h(e){delete f.parentCancel;l="rejected";c=e;n.length&&k(a)}function g(e){function b(c){return function(e){j||(j=!0,c(e))}}var j=!1;delete f.parentCancel;try{var p=e&&
(typeof e==="object"||typeof e==="function")&&e.then;if(typeof p==="function")if(e===i)h(new TypeError);else{l="assumed";var x=e&&e.cancel;if(typeof x!=="function"){var u=new d,e=u.promise;try{p(u.resolve,u.reject,u.progress)}catch(v){u.reject(v)}x=e.cancel;p=e.then}c=e;p.call(e,b(g),b(h));f.parentCancel=x.bind(e)}else l="fulfilled",c=e,n.length&&k(a)}catch(o){b(h)(o)}}function e(){var c=f.parentCancel;if(c)delete f.parentCancel,c();else if(!l)c=Error("Cancel"),c.name="Cancel",h(c)}var c,l,n=[],i=
this,f={};Object.defineProperty(this,"_protected",{value:function(c){if(c!==b)throw Error("protected");return f}});this.resolve=function(c){l||g(c);return i};this.reject=function(c){l||h(c);return i};this.progress=function(c){l||n.forEach(function(e){if(e.progress)try{e.progress(c)}catch(a){}});return i.promise};this.cancel=function(){f.parentCancel?setTimeout(e,0):e();return i};this.then=function(c,e,g){c={resolve:c,reject:e,progress:g,deferred:new d};n.push(c);c.deferred._protected(b).parentCancel=
i.promise.cancel.bind(i);(l==="fulfilled"||l==="rejected")&&k(a);return c.deferred.promise};this.promise={then:i.then,cancel:i.cancel}}var b=[],i=!1;d.all=function(a,h){function g(e,a){b||(l[e]=a,--c===0&&i.resolve(l))}function e(c,e){if(!b){if(h)try{g(c,h(e));return}catch(a){e=a}i.reject(e)}}var c=a.length,l=[],b=!1,i=new d;i.then(void 0,function(){b=!0;a.forEach(function(c){c.cancel&&c.cancel()})});c===0?i.resolve(l):a.forEach(function(c,a){c.then(g.bind(void 0,a),e.bind(void 0,a))});return i.promise};
d.when=function(a,h,g,e){var c;if(!(a&&typeof a.then==="function"))c=new d,c.resolve(a),a=c.promise;return a.then(h,g,e)};return d});
define("orion/EventTarget",[],function(){function f(){this._namedListeners={}}f.prototype={dispatchEvent:function(f){if(!f.type)throw Error("unspecified type");var j=this._namedListeners[f.type];j&&j.forEach(function(d){try{typeof d==="function"?d(f):d.handleEvent(f)}catch(b){typeof console!=="undefined"&&console.log(b)}});return!f.defaultPrevented},addEventListener:function(f,j){if(typeof j==="function"||j.handleEvent)this._namedListeners[f]=this._namedListeners[f]||[],this._namedListeners[f].push(j)},
removeEventListener:function(f,j){var d=this._namedListeners[f];if(d)for(var b=0;b<d.length;b++)if(d[b]===j){d.length===1?delete this._namedListeners[f]:d.splice(b,1);break}}};f.prototype.constructor=f;f.attach=function(k){var j=new f;k.dispatchEvent=j.dispatchEvent.bind(j);k.addEventListener=j.addEventListener.bind(j);k.removeEventListener=j.removeEventListener.bind(j)};return f});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(f,k){function j(a,g,e){this._properties=e||{};this._properties["service.id"]=a;this._properties.objectClass=g;this._properties["service.names"]=g}function d(a,g,e){this._serviceId=a;this._serviceReference=g;this._internalRegistry=e}function b(a,g){function e(c){return function(){var e;try{if(!g())throw Error("Service was unregistered");var b=a[c].apply(a,Array.prototype.slice.call(arguments));if(b&&typeof b.then==="function")return b;
else e=new f,e.resolve(b)}catch(d){e=new f,e.reject(d)}return e.promise}}for(var c in a)typeof a[c]==="function"&&(this[c]=e(c))}function i(a,g){this.type=a;this.serviceReference=g}function a(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new k;var a=this;this._internalRegistry={isRegistered:function(g){return a._entries[g]?!0:!1},unregisterService:function(g){var e=a._entries[g];if(!e)throw Error("Service has already been unregistered: "+g);var c=e.reference;a._serviceEventTarget.dispatchEvent(new i("unregistering",
c));a._entries[g]=null;c.getProperty("objectClass").forEach(function(e){for(var g=a._namedReferences[e],b=0;b<g.length;b++)if(g[b]===c){g.length===1?delete a._namedReferences[e]:g.splice(b,1);break}})},modifyService:function(g){var e=a._entries[g];if(!e)throw Error("Service not found while trying to send modified event: "+g);a._serviceEventTarget.dispatchEvent(new i("modified",e.reference))}}}j.prototype={getPropertyKeys:function(){var a=[],g;for(g in this._properties)this._properties.hasOwnProperty(g)&&
a.push(g);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("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(a){var g=this._serviceReference._properties;this._serviceReference._properties=a||{};a["service.id"]=this._serviceId;
a.objectClass=g.objectClass;a["service.names"]=g["service.names"];this._internalRegistry.modifyService(this._serviceId)}};d.prototype.constructor=d;a.prototype={getService:function(a){var g;if(typeof a==="string")(a=this._namedReferences[a])&&a.some(function(e){g=this._entries[e.getProperty("service.id")].service;return!!g},this);else if(a=this._entries[a.getProperty("service.id")])g=a.service;return g||null},getServiceReferences:function(a){if(a)return this._namedReferences[a]?this._namedReferences[a]:
[];var g=[];this._entries.forEach(function(e){e&&g.push(e.reference)});return g},registerService:function(a,g,e){if(typeof g==="undefined"||g===null)throw Error("invalid service");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var c=this._entries.length,l=new j(c,a,e),n=this._namedReferences;a.forEach(function(c){n[c]=n[c]||[];n[c].push(l)});a=new b(g,this._internalRegistry.isRegistered.bind(null,c));this._entries.push({reference:l,service:a});a=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new i("registered",
l));return new d(c,l,a)},addEventListener:function(a,g){this._serviceEventTarget.addEventListener(a,g)},removeEventListener:function(a,g){this._serviceEventTarget.removeEventListener(a,g)}};a.prototype.constructor=a;return{ServiceRegistry:a}});
define("orion/xhr",["orion/Deferred"],function(f){function k(f,d,b,i){var a=typeof b.response!=="undefined"?b.response:b.responseText,h;try{h=b.status}catch(g){h=0}f={args:d,response:a,responseText:typeof a==="string"?a:null,status:h,url:f,xhr:b};if(typeof i!=="undefined")f.error=i;return f}return function(j,d,b){var b=b||{},i=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,a=new f,h=b.headers||{},g=b.log||!1,e;typeof h["X-Requested-With"]==="undefined"&&(h["X-Requested-With"]="XMLHttpRequest");
if(typeof b.data!=="undefined"&&(j==="POST"||j==="PUT"))e=b.data;var c=!1,l=!1;a.promise.then(void 0,function(e){c=!0;!l&&e instanceof Error&&e.name==="Cancel"&&i.abort()});i.onabort=function(){l=!0;if(!c){var e=Error("Cancel");e.name="Cancel";a.reject(e)}};i.onload=function(){var c=k(d,b,i);200<=i.status&&i.status<400?a.resolve(c):(a.reject(c),g&&typeof console!=="undefined"&&console.log(Error(i.statusText)))};i.onerror=function(){var c=k(d,b,i);a.reject(c);g&&typeof console!=="undefined"&&console.log(Error(i.statusText))};
i.onprogress=function(c){c.xhr=i;a.progress(c)};try{i.open(j,d,!0);if(typeof b.responseType==="string")i.responseType=b.responseType;if(typeof b.timeout==="number")if(typeof i.timeout==="number")i.timeout=b.timeout,i.addEventListener("timeout",function(){a.reject(k(d,b,i,"Timeout exceeded"))});else{var n=setTimeout(function(){a.reject(k(d,b,i,"Timeout exceeded"))},b.timeout);a.promise.then(clearTimeout.bind(null,n),clearTimeout.bind(null,n))}Object.keys(h).forEach(function(c){i.setRequestHeader(c,
h[c])});i.send(e||null)}catch(m){a.reject(k(d,b,i,m))}return a.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(f,k,j){function d(e,c){this._name=e;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function b(e,c){return{get:function(a,g){if(c===0)return null;var h=localStorage.getItem(e+a);if(h===null)return null;h=JSON.parse(h);return g||c===-1||h._expires&&h._expires>(new Date).getTime()?(delete h._expires,h):null},set:function(a,g){if(c!==0){if(c!==-1)g._expires=(new Date).getTime()+
1E3*c;if(Object.keys(g).length===0)localStorage.removeItem(e+a);else{var h=JSON.stringify(g);localStorage.setItem(e+a,h);delete g._expires}}},remove:function(c){localStorage.removeItem(e+c)}}}function i(e){this._currentPromises={};this._cache=new b("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=e.getServiceReferences("orion.core.preference.provider");if(c.length>0)this._service=e.getService(c[0])}return!!this._service}}function a(e){this._location=
e;this._currentPromise=null;this._cache=new b("/orion/preferences/default",3600)}function h(){this._cache=new b("/orion/preferences/local",-1)}function g(e,c){this._userProvider=new i(e);this._localProvider=new h;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=f.toUrl(c));this._defaultsProvider=new a(c);this._serviceRegistration=e.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var e=[],c=0;c<this._stores.length;++c){var a=this._stores[c];this._dirty.indexOf(a)!==-1&&
e.push(this._providers[c].put(this._name,a));if(this._pendingDeletes[c]&&this._pendingDeletes[c].length>0){for(a=0;a<this._pendingDeletes[c].length;a++)e.push(this._providers[c].remove(this._name,this._pendingDeletes[c][a]));delete this._pendingDeletes[c]}}this._dirty=[];return k.all(e)},_scheduleFlush:function(e){e&&this._dirty.indexOf(e)===-1&&this._dirty.push(e);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 e=0;e<this._stores.length;++e){var c=this._stores[e],a;for(a in c)c.hasOwnProperty(a)&&typeof this._cached[a]==="undefined"&&(this._cached[a]=c[a])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(e){return this._getCached()[e]},put:function(e,c){if(this._stores.length!==0){var a=this._stores[0];if(a[e]!==c)a[e]=c,this._cached=null,this._scheduleFlush(a)}},remove:function(e){for(var c=0;c<
this._stores.length;++c){var a=this._stores[c];if(a.hasOwnProperty(e))return delete a[e],this._pendingDeletes[c]||(this._pendingDeletes[c]=[]),this._pendingDeletes[c].push(e),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var e=0;e<this._stores.length;++e)this._stores[e]={},this._scheduleFlush(this._stores[e]);this._cached=null},sync:function(e){if(this._flushPending)return this._flushPending=!1,this._flush();for(var c=this,a=[],g=0;g<this._providers.length;++g)a.push(this._providers[g].get(this._name,
e).then(function(e){return function(a){c._stores[e]=a}}(g)));return k.all(a).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};i.prototype={get:function(e,c){if(this._currentPromises[e])return this._currentPromises[e];var a=new k,g=null;c?this._cache.remove(e):g=this._cache.get(e);if(g!==null)a.resolve(g);else{this._currentPromises[e]=a;var h=this;this._service.get(e).then(function(c){h._cache.set(e,c);delete h._currentPromises[e];a.resolve(c)},function(c){c.status===
404?(c={},h._cache.set(e,c),delete h._currentPromises[e],a.resolve(c)):(delete h._currentPromises[e],a.resolve(h._cache.get(e,!0)||{}))})}return a},put:function(e,c){this._cache.set(e,c);return this._service.put(e,c)},remove:function(e,c){var a=this._cache.get(e);delete a[c];this._cache.set(e,a);return this._service.remove(e,c)}};a.prototype={get:function(e,c){if(this._currentPromise)return this._currentPromise;var a=new k,g=null;c?this._cache.remove(e):g=this._cache.get(e);if(g!==null)a.resolve(g);
else{this._currentPromise=a;var h=this;j("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);h._cache.set(e,c[e]||{});h._currentPromise=null;a.resolve(c[e]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(h._cache.set(e,{}),h._currentPromise=null,a.resolve({})):(h._currentPromise=null,c=h._cache.get(e,!0),c!==null?a.resolve(c[e]||{}):a.resolve({}))})}return a},put:function(){var e=new k;e.resolve();return e},remove:function(e,c){var a=
this._cache.get(e);delete a[c];this.put(e,a)}};h.prototype={get:function(e){var c=new k,e=this._cache.get(e);e!==null?c.resolve(e):c.resolve({});return c},put:function(e,c){var a=new k;this._cache.set(e,c);a.resolve();return a},remove:function(e,c){var a=this._cache.get(e);delete a[c];this.put(e,a)}};g.DEFAULT_SCOPE=1;g.LOCAL_SCOPE=2;g.USER_SCOPE=4;g.prototype={listenForChangedSettings:function(e,c,a){if(!c||typeof c!=="number"||c>7||c<1)a=c,c=g.DEFAULT_SCOPE|g.LOCAL_SCOPE|g.USER_SCOPE;window.addEventListener("storage",
a,!1);if((g.USER_SCOPE&c)!==0)return"/orion/preferences/user"+e;else if((g.LOCAL_SCOPE&c)!==0)return"/orion/preferences/local"+e;return"/orion/preferences/default"+e},getPreferences:function(a,c){if(!c||typeof c!=="number"||c>7||c<1)c=g.DEFAULT_SCOPE|g.LOCAL_SCOPE|g.USER_SCOPE;var h=[];g.USER_SCOPE&c&&this._userProvider.available()&&h.push(this._userProvider);g.LOCAL_SCOPE&c&&h.push(this._localProvider);g.DEFAULT_SCOPE&c&&h.push(this._defaultsProvider);var b=new d(a,h);return b.sync().then(function(){return b})},
getSetting:function(a,c,g){for(var h,b=0;b<a.length;b++)if(a[b].label===c)for(var d=0;d<a[b].data.length;d++)if(a[b].data[d].label===g){h=a[b].data[d].value;break}return h}};return{PreferencesService:g}});
(function(){function f(c){if(typeof c!=="string")throw new TypeError;}function k(c){return c?c.split("&"):[]}function j(c){return c.length===0?"":c.join("&")}function d(c){var a=/([^=]*)(?:=?)(.*)/.exec(c),c=a[1]?decodeURIComponent(a[1]):"",a=a[2]?decodeURIComponent(a[2]):"";return[c,a]}function b(c){var a=encodeURIComponent(c[0]);c[1]&&(a+="="+encodeURIComponent(c[1]));return a}function i(c,a){var e="",o=[],g=0;return{next:function(){if(e!==c.query)e=c.query,o=k(e);if(g<o.length){var h=d(o[g++]);
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 w;}}}function a(c){Object.defineProperty(this,"_url",{get:function(){return c._url}})}function h(c){var a=[];c.split("/").forEach(function(c){c===".."?a.pop():c!=="."&&a.push(c)});return a.join("/")}function g(c){return c.replace(/\s/g,function(c){return"%"+c.charCodeAt(0).toString(16)})}function e(c,a){if(typeof c!=="string")throw new TypeError;var c=g(c),e=m.exec(c);
if(!e)return null;var o={};o.scheme=e[1]||"";if(o.scheme&&!q.test(o.scheme))return null;var v=e[2];if(v&&(v=r.exec(v),o.userinfo=v[1],o.host=v[2],o.port=v[3],o.port&&!s.test(o.port)))return null;o.path=e[3];o.query=e[4];o.fragment=e[5];if(!o.scheme&&a&&(o.scheme=a.scheme,!o.host&&a.host))o.userinfo=a.userinfo,o.host=a.host,o.port=a.port,o.pathRelative=!0;if(o.pathRelative)if(o.path){if(o.path[0]!=="/")e=/^(.*\/)[^\/]*$/.exec(a.path)[1]||"/",o.path=e+o.path}else o.path=a.path;if(o.scheme)o.scheme=
o.scheme.toLowerCase();if(o.port)o.port=/[1-9]\d*$/.exec(o.port)[0];if(o.host&&o.path)o.path=h(o.path);return o}function c(c,o){var g;if(o){o=o.href||o;g=e(o);if(!g||!g.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:g})}g=e(c,g);if(!g)throw new SyntaxError;Object.defineProperty(this,"_input",{value:c,writable:!0});Object.defineProperty(this,"_url",{value:g,writable:!0});var h=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?h:null},enumerable:!0})}
try{var l;if(typeof window.URL==="function"&&window.URL.length!==0&&(l=new window.URL("http://www.w3.org?q")).protocol==="http:"&&l.query)return}catch(n){}var m=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,r=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,q=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,x=/^([^?#\s]*)$/,u=/^([^\s]*)$/,v=/^\S*$/,o=/([^:]*):?(.*)/,w=typeof StopIteration!=="undefined"?
StopIteration:Error("Stop Iteration"),y={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(c){f(c);var a;k(this._url.query).some(function(e){e=d(e);if(e[0]===c)return a=e[1],!0});return a},enumerable:!0},set:{value:function(c,a){f(c);f(a);var e=k(this._url.query);e.some(function(o,g){var h=d(o);if(h[0]===c)return h[1]=a,e[g]=b(h),!0})||e.push(b([c,a]));this._url.query=j(e)},enumerable:!0},has:{value:function(c){f(c);
return k(this._url.query).some(function(a){if(d(a)[0]===c)return!0})},enumerable:!0},"delete":{value:function(c){f(c);var a=k(this._url.query),e=a.filter(function(a){return d(a)[0]!==c});return e.length!==a.length?(this._url.query=j(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(c,a){if(typeof c!=="function")throw new TypeError;var e=i(this._url,"keys+values");try{for(;;){var o=e.next();c.call(a,o[1],o[0],this)}}catch(g){if(g!==w)throw g;
}},enumerable:!0},keys:{value:function(){return i(this._url,"keys")},enumerable:!0},values:{value:function(){return i(this._url,"values")},enumerable:!0},items:{value:function(){return i(this._url,"keys+values")}},size:{get:function(){return k(this._url.query).length},enumerable:!0},getAll:{value:function(c){f(c);var a=[];k(this._url.query).forEach(function(e){e=d(e);e[0]===c&&a.push(e[1])});return a},enumerable:!0},append:{value:function(c,a){f(c);f(a);var e=k(this._url.query);e.push(b([c,a]));this._url.query=
j(e)},enumerable:!0}});Object.defineProperties(c.prototype,{href:{get:function(){var c;if(this._url){c=this._url;var a=c.scheme?c.scheme+":":"";c.host&&(a+="//",c.userinfo&&(a+=c.userinfo+"@"),a+=c.host,c.port&&(a+=":"+c.port));a+=c.path;c.query&&(a+="?"+c.query);c.fragment&&(a+="#"+c.fragment);c=a}else c=this._input;return c},set:function(c){f(c);this._input=c;this._url=e(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(c){f(c);if(this._url&&(c=c.slice(-1)===":"?c.substring(0,c.length-1):c,q.test(c)))this._url.scheme=c.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(c){f(c);if(this._url)this._url.userinfo=c}},username:{get:function(){if(!this._url)return"";var c=o.exec(this._userinfo);return decodeURIComponent(c[1]||"")},set:function(c){f(c);if(this._url){var a=
o.exec(this._userinfo),c=[encodeURIComponent(c||"")];a[2]&&c.push(a[2]);this._userinfo=c.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var c=o.exec(this._userinfo);return decodeURIComponent(c[2]||"")},set:function(c){f(c);if(this._url){var a=[o.exec(this._userinfo)[1]||""];c&&a.push(encodeURIComponent(c));this._userinfo=a.join(":")}},enumerable:!0},host:{get:function(){var c="";this._url&&this._url.host&&(c+=this._url.host,this._url.port&&(c+=":"+this._url.port));return c},
set:function(c){f(c);if(this._url&&(c=p.exec(c)))this._url.host=c[1],this._url.port=/[1-9]\d*$/.exec(c[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(c){f(c);if(this._url&&t.exec(c))this._url.host=c},enumerable:!0},port:{get:function(){var c=this._url?this._url.port||"":"";c&&c===y[this.protocol]&&(c="");return c},set:function(c){f(c);if(this._url&&s.exec(c))this._url.port=/[1-9]\d*$/.exec(c)[0]},enumerable:!0},pathname:{get:function(){return this._url?
this._url.path:""},set:function(c){f(c);if(this._url&&x.exec(c))this._url.host&&c&&c[0]!=="/"&&(c="/"+c),this._url.path=c?h(c):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(c){f(c);if(this._url&&(c&&c[0]==="?"&&(c=c.substring(1)),u.exec(c)))this._url.query=c},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(c){f(c);if(this._url&&(c&&c[0]==="#"&&(c=c.substring(1)),v.exec(c)))this._url.fragment=
c},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(c,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(c,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=c})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(f,k){function j(c,a){var e=Object.keys(c),g=Object.keys(a);if(e.length!==g.length)return!1;e.sort();g.sort();for(var h=0,b=e.length;h<b;h++){var d=e[h];if(d!==g[h])return!1;var i=c[d],d=a[d];if(i!==d&&JSON.stringify(i)!==JSON.stringify(d))return!1}return!0}function d(c){if(c.indexOf("://")===-1)try{return(new URL(c,location.href)).href}catch(a){}return c}function b(c){var a=null,e={key:function(e){return(a=
a||Object.keys(c))[e]},getItem:function(a){return c[a]},setItem:function(e,g){c[e]=g;a=null},removeItem:function(e){delete c[e];a=null},clear:function(){(a=a||Object.keys(c)).forEach(function(a){delete c[a]}.bind(this));a=null}};Object.defineProperty(e,"length",{get:function(){return(a=a||Object.keys(c)).length}});return e}function i(c,a){if(a&&a instanceof XMLHttpRequest){var e,g;try{e=a.status,g=a.statusText}catch(h){e=0,g=""}return{status:e||0,statusText:g}}return a}function a(c){var a=c?JSON.parse(JSON.stringify(c,
i)):c;if(c instanceof Error)a.__isError=!0,a.message=a.message||c.message,a.name=a.name||c.name;return a}function h(c,a){this.type=c;this.plugin=a}function g(c,a){this.__objectId=c;this.__methods=a}function e(c,e,b){function d(c){D&&b.postMessage(c,D)}function i(c){if(!D)return(new f).reject(Error("plugin not connected"));c.id=String(V++);var a=new f;S[c.id]=a;a.then(null,function(a){A==="active"&&a instanceof Error&&a.name==="Cancel"&&d({requestId:c.id,method:"cancel",params:a.message?[a.message]:
[]})});var e=Object.prototype.toString;c.params.forEach(function(o,h){if(e.call(o)==="[object Object]"&&!(o instanceof g)){var b,v;for(b in o)e.call(o[b])==="[object Function]"&&(v=v||[],v.push(b));if(v){var l=T++;O[l]=o;b=function(){delete O[l]};a.then(b,b);c.params[h]=new g(l,v)}}});b.postMessage(c,D);return a.promise}function s(c,a){c||c===0?d({id:c,result:null,error:a}):console.log(a)}function t(c,e,o,g){g.forEach(function(c,a){if(c&&typeof c.__objectId!=="undefined"){var e={};c.__methods.forEach(function(a){e[a]=
function(){return i({objectId:c.__objectId,method:a,params:Array.prototype.slice.call(arguments)})}});g[a]=e}});var h=typeof c===void 0?null:{id:c,result:null,error:null};try{var b=o.apply(e,g);if(h)b&&typeof b.then==="function"?(R[c]=b,b.then(function(a){delete R[c];h.result=a;d(h)},function(e){if(R[c])delete R[c],h.error=a(e),d(h)},function(){d({responseId:c,method:"progress",params:Array.prototype.slice.call(arguments)})})):(h.result=b,d(h))}catch(v){if(h)h.error=a(v),d(h)}}function p(c){try{if(c.method){var a=
c.method,e=c.params||[];if("serviceId"in c){var o=U[c.serviceId];o||s(c.id,"service not found");a in o?t(c.id,o,o[a],e):s(c.id,"method not found")}else if("objectId"in c){var g=O[c.objectId];g||s(c.id,"object not found");a in g?t(c.id,g,g[a],e):s(c.id,"method not found")}else if("requestId"in c){var h=R[c.requestId];h&&a==="cancel"&&h.cancel&&h.cancel.apply(h,e)}else if("responseId"in c){var v=S[c.responseId];v&&a==="progress"&&v.progress&&v.progress.apply(v,e)}else if("plugin"===c.method){var l=
c.params[0];J({headers:l.headers,services:l.services}).then(function(){I.resolve(w)})}else if("timeout"===c.method)I&&I.reject(c.error);else throw Error("Bad method: "+c.method);}else{var d=S[String(c.id)];delete S[String(c.id)];if(c.error){var i=b.handleServiceError(w,c.error);d.reject(i)}else d.resolve(c.result)}}catch(n){console.log("Plugin._messageHandler "+n)}}function x(c){var a={};if(c.methods&&(c.methods.forEach(function(e){a[e]=function(){var a={serviceId:c.serviceId,method:e,params:Array.prototype.slice.call(arguments)};
return A==="active"?i(a):w.start({"transient":!0}).then(function(){return i(a)})}}),a.addEventListener&&a.removeEventListener)){var e=new k,o=T++;O[o]={handleEvent:e.dispatchEvent.bind(e)};var h=new g(o,["handleEvent"]),b=a.addEventListener;a.addEventListener=function(c,a){e._namedListeners[c]||b(c,h);e.addEventListener(c,a)};var v=a.removeEventListener;a.removeEventListener=function(c,a){e.removeEventListener(c,a);e._namedListeners[c]||v(c,h)}}return a}function u(a){var e=JSON.parse(JSON.stringify(a.properties));
e.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);e.objectClass=a;return e}function v(c){var a=x(c),e=u(c),e=b.registerService(c.names||c.type,a,e);K[c.serviceId]={registration:e,proxy:a}}function o(){b.persist(c,{created:y,headers:B,services:H,autostart:G,lastModified:z})}var w=this,e=e||{},y=e.created||(new Date).getTime(),B=e.headers||{},H=e.services||[],G=e.autostart,z=e.lastModified||0,A="installed",C,I,D,K={},V=0,T=0,R={},S={},O={},U={},J;this._persist=o;this._resolve=function(){A=
"resolved";b.dispatchEvent(new h("resolved",w))};this._getAutostart=function(){return G};this._getCreated=function(){return y};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(B))};this.getName=function(){var c=this.getHeaders();return c?c.name||"":null};this.getVersion=function(){var c=this.getHeaders();return c?c.version||"0.0.0":null};this.getLastModified=function(){return z};this.getServiceReferences=function(){var c=[];Object.keys(K).forEach(function(a){c.push(K[a].registration.getReference())});
return c};this.getState=function(){return A};this.start=function(a){if(A==="uninstalled")return(new f).reject(Error("Plugin is uninstalled"));if(C)return C.promise.then(this.start.bind(this,a));if(A==="active")return(new f).resolve();if(!a||!a.transient){var e=a&&a.lazy?"lazy":"started";e!==G&&(G=e,o())}e=b.getState();if(e!=="starting"&&e!=="active")return a.transient?(new f).reject(Error("start transient error")):(new f).resolve();if(A==="installed")try{this._resolve()}catch(g){return(new f).reject(g)}A===
"resolved"&&H.forEach(function(c){v(c)});if(a&&a.lazy)return A!=="starting"&&(A="starting",b.dispatchEvent(new h("lazy activation",w))),(new f).resolve();var d=new f;C=d;A="starting";b.dispatchEvent(new h("starting",w));I=new f;D=b.connect(c,p);I.then(function(){I=null;A="active";b.dispatchEvent(new h("started",w));C=null;d.resolve()},function(){I=null;A="stopping";b.dispatchEvent(new h("stopping",w));Object.keys(K).forEach(function(c){K[c].registration.unregister();delete K[c]});b.disconnect(D);
D=null;A="resolved";C=null;b.dispatchEvent(new h("stopped",w));d.reject(Error("plugin activation error"))});return d.promise};this.stop=function(c){if(A==="uninstalled")return(new f).reject(Error("Plugin is uninstalled"));if(C)return C.promise.then(this.stop.bind(this,c));if((!c||!c.transient)&&"stopped"!==G)G="stopped",o();if(A!=="active"&&A!=="starting")return(new f).resolve();C=c=new f;A="stopping";b.dispatchEvent(new h("stopping",w));Object.keys(K).forEach(function(c){K[c].registration.unregister();
delete K[c]});D&&(b.disconnect(D),D=null);A="resolved";C=null;b.dispatchEvent(new h("stopped",w));c.resolve();return c.promise};J=function(a){if(A==="uninstalled")return(new f).reject(Error("Plugin is uninstalled"));if(!a)return z===0&&(z=(new Date).getTime(),o()),b.loadManifest(c).then(J);var e=B,g=H,d=G;B=a.headers||{};H=a.services||{};G=a.autostart||G;a.lastModified?z=a.lastModified:(z=(new Date).getTime(),o());if(j(B,e)&&j(H,g)&&G===d)return(new f).resolve();if(A==="active"||A==="starting"){var i=
[];Object.keys(H).forEach(function(c){var a=H[c];i.push(c);var e=K[c];if(e){if(j(a.methods,Object.keys(e.proxy))){var c=u(a),o=e.registration.getReference(),g={};o.getPropertyKeys().forEach(function(c){g[c]=o.getProperty(c)});j(c,g)||e.registration.setProperties(c);return}e.registration.unregister();delete K[c]}v(a)});Object.keys(K).forEach(function(c){i.indexOf(c)===-1&&(K[c].registration.unregister(),delete K[c])})}A==="active"&&(b.disconnect(D),I=new f,D=b.connect(c,p),I.then(function(){I=null},
function(){I=null;A="stopping";b.dispatchEvent(new h("stopping"),w);Object.keys(K).forEach(function(c){K[c].registration.unregister();delete K[c]});b.disconnect(D);D=null;A="resolved";b.dispatchEvent(new h("stopped",w))}));return(new f).resolve()};this.update=function(c){return J(c).then(function(){b.dispatchEvent(new h("updated",w))})};this.uninstall=function(){if(A==="uninstalled")return(new f).reject(Error("Plugin is uninstalled"));if(A==="active"||A==="starting"||A==="stopping")return this.stop().then(this.uninstall.bind(this),
this.uninstall.bind(this));b.removePlugin(this);A="uninstalled";b.dispatchEvent(new h("uninstalled",w));return(new f).resolve()}}var c=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(a,g){function i(c){var a=c.source;t.some(function(e){if(a===e.target){try{var g;if(typeof e.useStructuredClone==="undefined"){var h=typeof c.data!=="string";g=h?c.data:JSON.parse(c.data);e.useStructuredClone=h}else g=e.useStructuredClone?c.data:JSON.parse(c.data);e.handler(g)}catch(b){}return!0}})}var g=g||{},j=
g.storage||localStorage;j.getItem||(j=b(j));var q="installed",s=[],t=[],p=new k,x={},u={registerService:a.registerService.bind(a),connect:function(c,a,e){function h(c){c=Error(c);c.name="timeout";a({method:"timeout",error:c})}var b={handler:a,url:c},l=setTimeout(h.bind(null,"Load timeout for: "+c),e||15E3),d=document.createElement("iframe");d.name=c+"_"+(new Date).getTime();if(!g.visible)d.style.display="none",d.style.visibility="hidden";d.src=c;d.onload=function(){clearTimeout(l);setTimeout(h.bind(null,
"Plugin handshake timeout for: "+c),5E3)};d.sandbox="allow-scripts allow-same-origin";document.body.appendChild(d);b.target=d.contentWindow;b.close=function(){d&&(document.body.removeChild(d),d=null)};t.push(b);return b},disconnect:function(c){for(var a=0;a<t.length;a++)if(c===t[a]){t.splice(a,1);try{c.close()}catch(e){}break}},removePlugin:function(c){for(var a=0;a<s.length;a++)if(c===s[a]){s.splice(a,1);break}j.removeItem("plugin."+c.getLocation())},persist:function(c,a){j.setItem("plugin."+c,JSON.stringify(a))},
postMessage:function(c,a){a.target.postMessage(a.useStructuredClone?c:JSON.stringify(c),a.url)},dispatchEvent:function(c){try{p.dispatchEvent(c)}catch(a){console&&console.log("PluginRegistry.dispatchEvent "+a)}},loadManifest:function(c){var a=new f,e=u.connect(c,function(c){e&&c.method&&("manifest"===c.method||"plugin"===c.method?(c=c.params[0],u.disconnect(e),e=null,a.resolve(c)):"timeout"===c.method&&(u.disconnect(e),e=null,a.reject(c.error)))});return a.promise},getState:function(){return q},handleServiceError:function(a,
e){if(e&&e.status===401){var g=a.getHeaders(),h=a.getName()||a.getLocation(),b=document.createElement("span");b.appendChild(document.createTextNode("Authentication required for: "+h+"."));if(g.login)b.appendChild(document.createTextNode(" ")),h=document.createElement("a"),h.target="_blank",h.textContent="Login",h.href=g.login,c.test(h.href)?(b.appendChild(h),b.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+g.login);return{Severity:"Error",HTML:!0,
Message:(new XMLSerializer).serializeToString(b)}}if(e.__isError){var l=e,e=Error(l.message);Object.keys(l).forEach(function(c){e[c]=l[c]});delete e.__isError}return e}};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=u.getState;this.init=function(){if(!(q==="starting"||q==="active"||q==="stopping")){addEventListener("message",i,
!1);for(var c=[],a=0,h=j.length;a<h;a++)c.push(j.key(a));c.forEach(function(c){if(c.indexOf("plugin.")===0){var a=c.substring(7),c=JSON.parse(j.getItem(c));c.created&&s.push(new e(a,c,u))}});s.sort(function(c,a){return c._getCreated()<a._getCreated()?-1:1});g.plugins&&Object.keys(g.plugins).forEach(function(c){c=d(c);if(!this.getPlugin(c)){var a=g.plugins[c],a=typeof a==="object"||{};a.autostart=a.autostart||g.defaultAutostart||"lazy";s.push(new e(c,a,u))}}.bind(this));q="starting"}};this.start=function(){q!==
"starting"&&this.init();if(q!=="starting")return(new f).reject("Cannot start framework. Framework is already "+q+".");var c=[],a=(new Date).getTime();s.forEach(function(e){var g=e._getAutostart();e.getLastModified()===0?c.push(e.update().then(function(){if("started"===g)return e.start({"transient":!0});if("lazy"===g)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===g?c.push(e.start({"transient":!0})):"lazy"===g?(c.push(e.start({lazy:!0,"transient":!0})),a>e.getLastModified()+864E5&&
e.update()):e._resolve()});return f.all(c,function(c){console.log("PluginRegistry.stop "+c)}).then(function(){q="active"})};this.stop=function(){if(q!=="starting"&&q!=="active")return(new f).reject("Cannot stop registry. Registry is already "+q+".");q="stopping";var c=[];s.forEach(function(a){c.push(a.stop({"transient":!0}))});return f.all(c,function(c){console.log("PluginRegistry.stop "+c)}).then(function(){removeEventListener("message",i);q="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};
this.uninstall=function(){return(new f).reject("Cannot uninstall registry")};this.installPlugin=function(c,a){var c=d(c),g=this.getPlugin(c);if(g)return(new f).resolve(g);if(x[c])return x[c];if(a)return g=new e(c,a,u),s.push(g),g._persist(),u.dispatchEvent(new h("installed",g)),(new f).resolve(g);var b=u.loadManifest(c).then(function(a){g=new e(c,a,u);s.push(g);g._persist();delete x[c];u.dispatchEvent(new h("installed",g));return g},function(a){delete x[c];throw a;});return x[c]=b};this.getPlugins=
function(){return s.slice()};this.getPlugin=function(c){var a=null,c=d(c);s.some(function(e){if(c===e.getLocation())return a=e,!0});return a};this.addEventListener=p.addEventListener.bind(p);this.removeEventListener=p.removeEventListener.bind(p);this.resolvePlugins=function(){var c=!0;s.forEach(function(a){c=c&&a._resolve()});return c}}}});
define("orion/serviceTracker",[],function(){function f(d,b){function i(c){var a=c.getProperty("service.id"),e=this.addingService(c);e&&(h[a]=c,g[a]=e)}function a(c){var a=c.getProperty("service.id"),e=g[a];delete h[a];delete g[a];this.removedService(c,e)}this.serviceRegistry=d;var h={},g={},e=k,c,l;this.close=function(){if(e!==j)throw"Already closed";e=k;d.removeEventListener("registered",c);d.removeEventListener("unregistering",l);l=c=null;var g=this;this.getServiceReferences().forEach(function(c){a.call(g,
c)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var c=Object.keys(h);return!c.length?null:c.map(function(c){return h[c]})};this.open=function(){if(e!==k)throw"Already open";e=j;var g=this;c=function(c){if(c.serviceReference.getProperty("objectClass").indexOf(b)!==-1&&(i.call(g,c.serviceReference),typeof g.onServiceAdded==="function"))return g.onServiceAdded(c.serviceReference,g.serviceRegistry.getService(c.serviceReference))};l=function(c){c.serviceReference.getProperty("objectClass").indexOf(b)!==
-1&&a.call(g,c.serviceReference)};d.addEventListener("registered",c);d.addEventListener("unregistering",l);d.getServiceReferences(b).forEach(function(c){i.call(g,c)});if(typeof this.onOpen==="function")this.onOpen()}}var k=0,j=1;f.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return f});
define("orion/objects",[],function(){function f(f){for(var j=1;j<arguments.length;j++){var d=arguments[j],b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&(f[b]=d[b])}return f}return{clone:function(k){if(Array.isArray(k))return Array.prototype.slice.call(k);var j=Object.create(Object.getPrototypeOf(k));f(j,k);return j},mixin:f,toArray:function(f){return Array.isArray(f)?f:[f]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(f,k,j){var d,b,i,a,h,g="pid";d=function(c,a,e){function h(c,e,g){e.forEach(function(h,b){try{var o=c[b].getProperty("__plugin__"),d=o&&a.getPlugin(o);(!o||d&&d.getState()==="active")&&e[b].updated(g)}catch(i){typeof console!=="undefined"&&console.log(i)}})}k.call(this,c,"orion.cm.managedservice");var b={},d={},i=function(a){var h=[];a.plugin.getServiceReferences().forEach(function(a){if(a.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var b=a.getProperty(g),a=c.getService(a);b&&a&&(b=(b=e._find(b))&&b.getProperties(),h.push(a.updated(b)))}});return f.all(h)};this.addingService=function(a){var e=a.getProperty(g),h=c.getService(a);if(!e||!h)return null;b[e]||(b[e]=[]);d[e]||(d[e]=[]);b[e].push(a);d[e].push(h);return h};this.onServiceAdded=function(c,a){var b=c.getProperty(g),b=e._find(b);h([c],[a],b&&b.getProperties())};this.onOpen=function(){a.addEventListener("started",i)};this.onClose=function(){a.removeEventListener("started",
i)};this.notifyUpdated=function(c){var a=c.getPid();h(b[a]||[],d[a]||[],c.getProperties())};this.notifyDeleted=function(c){c=c.getPid();h(b[c]||[],d[c]||[],null)};this.removedService=function(c,a){var e=c.getProperty(g),h=b[e],v=d[e];h.length>1?h.splice(h.indexOf(c),1):delete b[e];v.length>1?v.splice(v.indexOf(a),1):delete d[e]}};b=function(){function c(c,e,g){this.store=new i(this,g);this.configAdmin=new a(this,this.store);this.tracker=new d(c,e,this.store)}c.prototype={getConfigurationAdmin:function(){var c=
this;return this.configAdmin._init().then(function(a){c.tracker.open();return a})},notifyDeleted:function(c){this.tracker.notifyDeleted(c)},notifyUpdated:function(c){this.tracker.notifyUpdated(c)}};return c}();a=function(){function c(c,a){this.factory=c;this.store=a}c.prototype={_init:function(){var c=this;return this.store._init().then(function(){return c})},getConfiguration:function(c){return this.store.get(c)},listConfigurations:function(){return this.store.list()}};return c}();var e="/cm/configurations";
i=function(){function c(c,a){this.factory=c;this.prefsService=a;this.configs=Object.create(null);this.pref=null;var b=this;this.initPromise=this.prefsService.getPreferences(e).then(function(c){b.pref=c;c.keys().forEach(function(a){if(!b.configs[a]){var e=c.get(a);typeof e==="object"&&e!==null&&Object.keys(e).length>0&&(e[g]=a,b.configs[a]=new h(b.factory,b,e))}})})}c.prototype={_init:function(){return this.initPromise},_find:function(c){return this.configs[c]||null},get:function(c){var a=this._find(c);
a||(a=new h(this.factory,this,c),this.configs[c]=a);return a},list:function(){var c=this,a=[];this.pref.keys().forEach(function(e){(e=c._find(e))&&e.getProperties()!==null&&a.push(e)});return a},remove:function(c){this.pref.remove(c);delete this.configs[c]},save:function(c,a){this.pref.put(c,a.getProperties(!0)||{})}};return c}();h=function(){function c(c,a){a=j.clone(a);delete a[g];c.properties=a}function a(e,h,b){this.factory=e;this.store=h;if(b!==null&&typeof b==="object")this.pid=b[g],c(this,
b);else if(typeof b==="string")this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}a.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var a=null;if(this.properties&&(a=j.clone(this.properties),!c))a[g]=this.pid;return a},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();c(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return a}();return{ConfigurationAdminFactory:b}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(f,k,j,d,b,i){var a;return{startup:function(){if(a)return a;a=new k;var h=new j.ServiceRegistry,g=new d.PreferencesService(h);return g.getPreferences("/plugins").then(function(e){var c={plugins:{}};e.keys().forEach(function(a){var g=f.toUrl(a);c.plugins[g]=e[a]});var d=new b.PluginRegistry(h,c);return d.start().then(function(){if(h.getServiceReferences("orion.core.preference.provider").length>
0)return g.getPreferences("/plugins",g.USER_SCOPE).then(function(c){var a=[];c.keys().forEach(function(c){c=f.toUrl(c);d.getPlugin(c)||a.push(d.installPlugin(c,{autostart:"lazy"}).then(function(c){return c.update().then(function(){return c.start({lazy:!0})})}))});return k.all(a,function(c){console.log(c)})})}).then(function(){return(new i.ConfigurationAdminFactory(h,d,g)).getConfigurationAdmin().then(h.registerService.bind(h,"orion.cm.configadmin"))}).then(function(){var c=h.getService("orion.core.auth");
if(c){var a=c.getUser().then(function(a){if(a)localStorage.setItem("lastLogin",(new Date).getTime());else return c.getAuthForm(window.location.href).then(function(c){setTimeout(function(){window.location=c},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return a}}).then(function(){var c={serviceRegistry:h,preferences:g,pluginRegistry:d};a.resolve(c);return c})})}}});
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",
"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 ",Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20131030-1703","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?",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",
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","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.",Raw:"Raw","Open the raw file or folder in the browser":"Open the raw file or folder in the browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred."});
define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/util",[],function(){var f=navigator.userAgent,k=f.indexOf("MSIE")!==-1||f.indexOf("Trident")!==-1?document.documentMode:void 0,j=parseFloat(f.split("Firefox/")[1]||f.split("Minefield/")[1])||void 0,d=f.indexOf("Opera")!==-1,b=parseFloat(f.split("Chrome/")[1])||void 0,i=f.indexOf("Safari")!==-1&&!b,a=parseFloat(f.split("WebKit/")[1])||void 0,h=f.indexOf("Android")!==-1,g=f.indexOf("iPad")!==-1,f=f.indexOf("iPhone")!==-1,e=g||f,c=navigator.platform.indexOf("Mac")!==-1,l=navigator.platform.indexOf("Win")!==
-1,n=navigator.platform.indexOf("Linux")!==-1;return{formatMessage:function(c){var a=arguments;return c.replace(/\$\{([^\}]+)\}/g,function(c,e){return a[(e<<0)+1]})},createElement:function(c,a){return c.createElementNS?c.createElementNS("http://www.w3.org/1999/xhtml",a):c.createElement(a)},isIE:k,isFirefox:j,isOpera:d,isChrome:b,isSafari:i,isWebkit:a,isAndroid:h,isIPad:g,isIPhone:f,isIOS:e,isMac:c,isWindows:l,isLinux:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(f){function k(a,g){g||(g=document);return g.querySelectorAll(a)}function j(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var g=0;g<a.childNodes.length;g++){var e=j(a.childNodes[g]);if(e)return e}return null}function d(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var g=a.childNodes.length-1;g>=0;g--){var e=d(a.childNodes[g]);if(e)return e}return null}function b(a,g){if(a.nodeType===3){var e=i.exec(a.nodeValue);e&&e.length>1&&g(a,
e)}if(a.hasChildNodes())for(e=0;e<a.childNodes.length;e++)b(a.childNodes[e],g)}var i=/\$\{([^\}]+)\}/,a=null;return{$:function(a,g){g||(g=document);return g.querySelector(a)},$$:k,$$array:function(a,g){return Array.prototype.slice.call(k(a,g))},node:function(a){var g=a;typeof a==="string"&&(g=document.getElementById(a));return g},contains:function(a,g){if(!a||!g)return!1;if(a===g)return!0;var e=a.compareDocumentPosition(g);return Boolean(e&16)},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){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,g){b(a,function(a,c){a.parentNode.replaceChild(document.createTextNode(g[c[1]]||c[1]),a)})},processDOMNodes:function(a,g){b(a,function(a,c){var b=g[c[1]];if(b){var h=document.createRange(),
d=c.index;h.setStart(a,d);h.setEnd(a,d+c[0].length);h.deleteContents();h.insertNode(b)}})},addAutoDismiss:function(b,g){function e(c){a.forEach(function(a){var e=!1,g=a.excludeNodes.some(function(a){return document.body.contains(a)?(e=!0,a.contains(c.target)):!1});if(e&&!g)try{a.dismiss()}catch(b){typeof console!=="undefined"&&console&&console.error(b&&b.message)}});a=a.filter(function(c){return c.excludeNodes.some(function(c){return document.body.contains(c)})})}a===null&&(a=[],document.addEventListener("click",
e,!0),f.isIOS&&document.addEventListener("touchend",function(c){function a(){c.target.removeEventListener("click",a)}c.touches.length===0&&c.target.addEventListener("click",a)},!1));a.push({excludeNodes:b,dismiss:g})},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("text",["module"],function(f){var k,j,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],b=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,i=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!=="undefined"&&location.href,h=a&&location.protocol&&location.protocol.replace(/\:/,""),g=a&&location.hostname,e=a&&(location.port||void 0),c=[],l=f.config&&f.config()||{};k={version:"2.0.5",strip:function(c){if(c){var c=c.replace(b,""),a=c.match(i);a&&(c=a[1])}else c="";return c},
jsEscape:function(c){return c.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:l.createXhr||function(){var c,a,e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(a=0;a<3;a+=1){e=d[a];try{c=new ActiveXObject(e)}catch(g){}if(c){d=[e];break}}return c},parseName:function(c){var a,
e,g=!1,b=c.indexOf(".");a=c.indexOf("./")===0||c.indexOf("../")===0;b!==-1&&(!a||b>1)?(a=c.substring(0,b),e=c.substring(b+1,c.length)):a=c;c=e||a;b=c.indexOf("!");b!==-1&&(g=c.substring(b+1)==="strip",c=c.substring(0,b),e?e=c:a=c);return{moduleName:a,ext:e,strip:g}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(c,a,e,g){var b,h;b=k.xdRegExp.exec(c);if(!b)return!0;c=b[2];b=b[3];b=b.split(":");h=b[1];b=b[0];return(!c||c===a)&&(!b||b.toLowerCase()===e.toLowerCase())&&(!h&&!b||h===g)},finishLoad:function(a,
e,g,b){g=e?k.strip(g):g;l.isBuild&&(c[a]=g);b(g)},load:function(c,b,d,i){if(i.isBuild&&!i.inlineText)d();else{l.isBuild=i.isBuild;var f=k.parseName(c),i=f.moduleName+(f.ext?"."+f.ext:""),j=b.toUrl(i),p=l.useXhr||k.useXhr;!a||p(j,h,g,e)?k.get(j,function(a){k.finishLoad(c,f.strip,a,d)},function(c){d.error&&d.error(c)}):b([i],function(c){k.finishLoad(f.moduleName+"."+f.ext,f.strip,c,d)})}},write:function(a,e,g){if(c.hasOwnProperty(e)){var b=k.jsEscape(c[e]);g.asModule(a+"!"+e,"define(function () { return '"+
b+"';});\n")}},writeFile:function(c,a,e,g,b){var a=k.parseName(a),h=a.ext?"."+a.ext:"",d=a.moduleName+h,l=e.toUrl(a.moduleName+h)+".js";k.load(d,e,function(){var a=function(c){return g(l,c)};a.asModule=function(c,a){return g.asModule(c,l,a)};k.write(c,d,a,b)},b)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)j=require.nodeRequire("fs"),k.get=function(c,a){var e=j.readFileSync(c,"utf8");e.indexOf("\ufeff")===0&&(e=e.substring(1));a(e)};else if(l.env===
"xhr"||!l.env&&k.createXhr())k.get=function(c,a,e,g){var b=k.createXhr(),h;b.open("GET",c,!0);if(g)for(h in g)g.hasOwnProperty(h)&&b.setRequestHeader(h.toLowerCase(),g[h]);if(l.onXhr)l.onXhr(b,c);b.onreadystatechange=function(){var g;if(b.readyState===4)g=b.status,g>399&&g<600?(g=Error(c+" HTTP status: "+g),g.xhr=b,e(g)):a(b.responseText)};b.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")k.get=function(c,a){var e,g,b=new java.io.File(c),h=java.lang.System.getProperty("line.separator"),
b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),d="";try{e=new java.lang.StringBuffer;(g=b.readLine())&&g.length()&&g.charAt(0)===65279&&(g=g.substring(1));for(e.append(g);(g=b.readLine())!==null;)e.append(h),e.append(g);d=String(e.toString())}finally{b.close()}a(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(f,k,j){return{slideoutHTMLFragment:function(d){var b=document.createElement("div");b.innerHTML=j;var i=k.$("#slideContainer",b);i.id=d+i.id;i=k.$("#pageCommandParameters",b);i.id=d+i.id;i=k.$("#pageCommandDismiss",b);i.id=d+i.id;return b.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(f){function k(d,b,i,a,h,g){this.type=g||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=b!==void 0&&b!==null?b:!1;this.mod2=i!==void 0&&i!==null?i:!1;this.mod3=a!==void 0&&a!==null?a:!1;this.mod4=h!==void 0&&h!==null?h:!1}function j(d){this.keys=d}k.prototype={getKeys:function(){return[this]},match:function(d,b){if(b!==void 0){if(b!==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(f.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(f.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:f.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,b){var i=this.keys;if(b!==void 0)return b>i.length?!1:i[b].match(d)?b===i.length-1?!0:b+1:!1;else{d instanceof Array||(d=[d]);if(d.length>i.length)return!1;var a;for(a=0;a<d.length;a++)if(!i[a].match(d[a]))return!1;return a===i.length?!0:a}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var b=0;b<d.keys.length;b++)if(!d.keys[b].equals(this.keys[b]))return!1;return!0}};return{KeyBinding:k,KeyStroke:k,
KeySequence:j}});
define("orion/webui/dropdown",["require","orion/webui/littlelib"],function(f,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;this._selectionClass=d.selectionClass;var b=this;this._triggerNode.addEventListener("click",function(d){b.toggle()&&
k.stop(d)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(d){if(d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.SPACE)b.toggle(),k.stop(d)},!1);this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},toggle:function(){return this.isVisible()?this.close():this.open()},isVisible:function(){return this._triggerNode.classList.contains("dropdownTriggerOpen")},open:function(){if(!this.isVisible()){this._populate&&(this.empty(),
this._populate(this._dropdownNode));var d=this.getItems();if(d.length>0){if(!this._hookedAutoDismiss){var b=k.$$(".dropdownSubMenu",this._dropdownNode);k.addAutoDismiss([this._triggerNode].concat(Array.prototype.slice.call(b)),function(){if(this.isVisible()){this.close();for(var b=this._dropdownNode.parentNode;b;)b.dropdown&&typeof b.dropdown.close==="function"&&b.dropdown.close(),b=b.parentNode}}.bind(this));this._hookedAutoDismiss=!0}this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&
this._triggerNode.classList.add(this._selectionClass);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),b=k.bounds(document.body);if(d.left+d.width>b.left+b.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-d.width+"px";else{var b=k.bounds(this._boundingNode(this._triggerNode)),i=k.bounds(this._triggerNode);
this._dropdownNode.style.left=i.left-b.left-d.width+i.width+"px"}},_boundingNode:function(d){var b=window.getComputedStyle(d,null);return b===null?d:b.getPropertyValue("position")==="absolute"||!d.parentNode||d===document.body?d:this._boundingNode(d.parentNode)},close:function(d){if(this.isVisible())return this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),
d&&this._triggerNode.focus(),!0},getItems:function(){var d=[],b=this;k.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(i){i.parentNode.parentNode===b._dropdownNode&&d.push(i)});return d},empty:function(){var d=this;k.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===d._dropdownNode&&b.parentNode.removeChild(b)})},_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 b=this.getItems(),i=document.activeElement;if(b.length&&b.length>0&&i){var a=b.indexOf(i);a<0&&(a=b.indexOf(i.parentNode));a>=0&&(d.keyCode===k.KEY.UP&&a>0?(a--,b[a].focus()):d.keyCode===k.KEY.DOWN&&a<b.length-1?(a++,b[a].focus()):d.keyCode===k.KEY.ENTER||d.keyCode===k.KEY.RIGHT?i.classList.contains("dropdownTrigger")&&i.dropdown&&i.dropdown.open():d.keyCode===k.KEY.LEFT&&i.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 core-sprite-downarrow"></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 core-sprite-closedarrow"></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(f,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 b=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(a){a.target===b._node&&(b.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",this._mouseoverHandler=function(a){k.contains(b._node,a.target)&&(b.show(),k.stop(a))},!1);this._leaveHandler=function(a){k.contains(b._node,a.target)&&b.hide()};for(var i=0;i<d.length;i++)this._node.addEventListener(d[i],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.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(b){k.contains(d._tip,b.target)&&(d.hide(),k.stop(b))},
!1)},!1)}return this._tip},_positionTip:function(d,b){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var i=this._node,a;for(a=k.bounds(i);i&&!a.width&&!a.height;i=i.parentNode)a=k.bounds(i);var i=k.bounds(this._tipInner),h;switch(d){case "above":h=a.top-i.height-this._tailSize-1;a=a.left-this._tailSize;break;case "below":h=a.top+a.height+this._tailSize+1;a=a.left-this._tailSize;break;case "left":h=a.top-this._tailSize/2;a=a.left-i.width-
this._tailSize-1;break;default:h=a.top-this._tailSize/2,a=a.left+a.width+this._tailSize+1}var g=k.bounds(document.documentElement);if(h+i.height>g.height)if(b)h=g.height-i.height-1;else return!1;if(a+i.width>g.width)if(b)a=g.width-i.width-1;else return!1;if(a<0)if(b)a=4;else return!1;if(h<0)if(b)h=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=i.width+"px";this._tip.style.top=h+"px";this._tip.style.left=a+"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 b=!1,i=0;!b&&i<d._position.length;)b=d._positionTip(d._position[i]),i++;b||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 b=this;this._timeout=window.setTimeout(function(){b._tip.classList.remove("tooltipShowing");b._tip.removeAttribute("style");b._afterHiding&&b._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._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",this._mouseoverHandler,!1);for(var d=["mouseout","click"],b=0;b<d.length;b++)this._node.removeEventListener(d[b],this._leaveHandler,!1)}}};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(f,k,j,d,b,i,a,h){function g(c){var a=c.invocation;if(a){var e=c.command;if(e.hrefCallback)return c=e.hrefCallback.call(a.handler||window,a),c.then?c.then(function(c){window.open(c)}):window.open(c),!0;else if(a.commandRegistry)return a.commandRegistry._invoke(a),
!0;else if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(a.handler||window,a)},0),!0}return!1}function e(c,a){for(var e in a)if(a[e]&&a[e].keyBinding&&a[e].command&&a[e].keyBinding.match(c)){var b=a[e],h=b.keyBinding;if((!h.domScope||j.contains(j.node(h.domScope),c.target))&&g(b)){j.stop(c);break}}}function c(c,a,e){a.classList.add("commandImage");var g;c.imageClass?c.addImageClassToElement?a.classList.add(c.imageClass):(g=document.createElement("span"),a.appendChild(g),
g.classList.add(c.spriteClass),g.classList.add(c.imageClass)):(g=new Image,g.alt=c.name,g.name=e,g.id=e,g.src=c.image,a.appendChild(g));return g}function l(c,a,e,g,b){this.commandRegistry=b;this.handler=c;this.items=a;this.userData=e;this.command=g;if(g.parameters)this.parameters=g.parameters.makeCopy();this.id=g.id}function n(c){this._init(c)}var m=null,r={};window.document.addEventListener("keydown",function(c){c=c||window.event;if(function(c){if(k.isMac){if(c.metaKey&&!c.altKey)return!c.shiftKey&&
!c.ctrlKey&&(c.keyCode===65||c.keyCode===67||c.keyCode===86||c.keyCode===88||c.keyCode===90)?!0:!1}else{if(c.ctrlKey&&!c.altKey)return!c.shiftKey&&(c.keyCode===65||c.keyCode===67||c.keyCode===86||c.keyCode===88||c.keyCode===90)?!0:!1;if(c.altKey&&!c.ctrlKey)return!1}if(c["char"])return c["char"].length>0;else if(c.charCode||c.keyCode)switch(c=c.charCode||c.keyCode,c){case 8:case 9:case 13:case 46:return!0;default:return c>=32&&c<112||c>123}return!1}(c)){if(c.target.contentEditable==="true")return;
var a=c.target.nodeName.toLowerCase();if(a==="input")switch(c.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(a==="textarea")return}a={};if(m){var g,b,h;b=Object.keys(r);for(g=0;g<b.length;g++)h=b[g],a[h]=r[h];var d=m();b=Object.keys(d);for(g=0;g<b.length;g++)h=b[g],a[h]=d[h]}else a=r;e(c,a)},!1);l.prototype=
{collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(c){var a=new l(this.handler,this.items,this.userData,this.command,this.commandRegistry);a.domNode=this.domNode;a.domParent=this.domParent;if(c)a.parameters=c.makeCopy();else if(this.parameters)a.parameters=this.parameters.makeCopy();return a}};l.prototype.constructor=l;n.prototype={_init:function(c){this.id=c.id;this.name=c.name;this.tooltip=c.tooltip||c.name;this.callback=c.callback;
this.hrefCallback=c.hrefCallback;this.choiceCallback=c.choiceCallback;this.image=c.image||f.toUrl("images/none.png");this.imageClass=c.imageClass;this.addImageClassToElement=c.addImageClassToElement;this.selectionClass=c.selectionClass;this.spriteClass=c.spriteClass||"commandSprite";this.visibleWhen=c.visibleWhen;this.parameters=c.parameters},populateChoicesMenu:function(c,a,e,g,b){this.getChoices(a,e,g).forEach(function(e){if(e.name){var g=document.createElement("li");c.appendChild(g);var o=document.createElement("span");
o.tabIndex=0;o.role="menuitem";o.classList.add("dropdownMenuItem");var h=document.createTextNode(e.name);o.appendChild(h);g.appendChild(o);o.choice=e;o.addEventListener("click",function(c){c.target.choice&&c.target.choice.callback.call(c.target.choice,a)},!1);o.addEventListener("keydown",function(c){(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)&&c.target.choice&&c.target.choice.callback.call(c.target.choice,a)},!1)}else b._generateMenuSeparator(c)})},getChoices:function(c,a,e){return this.choiceCallback?
this.choiceCallback.call(a,c,e):null},makeChoiceCallback:function(c,a){return function(e){c.callback&&c.callback.call(c,a,e)}},hasImage:function(){return this.imageClass||this.image!==f.toUrl("images/none.png")}};n.prototype.constructor=n;return{Command:n,CommandInvocation:l,createDropdownMenu:function(a,e,g,h,l,i,v){a=j.node(a);if(!a)throw"no parent node was specified";var o=document.createRange();o.selectNode(a);o=o.createContextualFragment(b);j.processTextNodes(o,{ButtonText:e});a.appendChild(o);
a=a.lastChild;o=a.previousSibling;h?o.classList.add(h):(o.classList.add("orionButton"),o.classList.add("commandButton"));if(l){if(!i)o.textContent="",o.setAttribute("aria-label",e);c({spriteClass:"commandSprite",imageClass:l},o,e);o.classList.add("orionButton")}o.dropdown=new d.Dropdown({dropdown:a,populate:g,selectionClass:v});a.dropdown=o.dropdown;return{menuButton:o,menu:a,dropdown:o.dropdown}},createCheckedMenuItem:function(c,e,g,b){c=j.node(c);if(!c)throw"no parent node was specified";var h=
document.createRange();h.selectNode(c);h=h.createContextualFragment(a);j.processTextNodes(h,{ItemText:e});c.appendChild(h);c=j.$(".checkedMenuItem",c.lastChild);c.checked=g;c.addEventListener("change",b,!1);return c},createCommandItem:function(a,e,g,b,d,l,v){var o,l=l||!e.name&&e.hasImage();if(e.hrefCallback)o=document.createElement("a"),o.id=b,l&&e.hasImage()?c(e,o,b):(o.className="commandLink",o.appendChild(document.createTextNode(e.name))),v=e.hrefCallback.call(g.handler,g),v.then?v.then(function(c){o.href=
c}):o.href=v?v:"#";else{o=document.createElement("button");o.className="orionButton";l?e.hasImage()?(c(e,o,b),e.name&&o.setAttribute("aria-label",e.name)):(o.classList.add("commandButton"),o.classList.add("commandMissingImageButton"),o.appendChild(document.createTextNode(e.name))):(o.classList.add("commandButton"),b=document.createTextNode(e.name),o.appendChild(b));var w=v||e.callback;if(w)e.onClick=w,o.addEventListener("click",function(){w.call(g.handler,g)},!1)}a.nodeName.toLowerCase()==="ul"?(v=
document.createElement("li"),a.appendChild(v),a=v):o.classList.add("commandMargins");a.appendChild(o);if(e.tooltip)o.commandTooltip=new h.Tooltip({node:o,text:e.tooltip,position:["above","below","right","left"]});d&&(r[e.id]={keyBinding:d,command:e,invocation:g});return o},createCommandMenuItem:function(c,a,e,g,b){var d,v=c.dropdown;if(a.hrefCallback)d=document.createElement("a"),d.appendChild(document.createTextNode(a.name)),b=a.hrefCallback.call(e.handler,e),b.then?b.then(function(c){d.href=c}):
d.href=b?b:"#",d.addEventListener("keydown",function(c){(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)&&d.click()},!1);else{d=document.createElement("span");d.tabIndex=0;d.appendChild(document.createTextNode(a.name));var o=b||a.callback;if(o)a.onClick=o,d.addEventListener("click",function(){v.close(!0);o.call(e.handler,e)},!1),d.addEventListener("keydown",function(c){if(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)c.preventDefault(),d.click()},!1)}if(a.tooltip)d.commandTooltip=new h.Tooltip({node:d,
text:a.tooltip,position:["right","left","above","below"]});d.className="dropdownMenuItem";d.role="menuitem";b=document.createElement("li");c.appendChild(b);b.appendChild(d);g&&(r[a.id]={keyBinding:g,command:a,invocation:e});return d},executeBinding:g,setKeyBindingProvider:function(c){m=c},localKeyBindings:r,_testMethodProcessKey:e}});
define("orion/explorers/navigationUtils",[],function(){function f(f,d){if(!k&&f)f.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var k=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(j,d,b){j&&(j=j.getGridNavHolder(d,!0))&&f(j,b)},generateNavGrid:f,removeNavGrid:function(f,d){if(f)for(var b=0;b<f.length;b++)if(f[b].domNode===d){f.splice(b,1);break}}}});
define("orion/PageUtil",[],function(){var f=/^http[s]?/i;return{hash:function(){var f=window.location.href.split("#")[1];return f?"#"+f:""},matchResourceParameters:function(f){var f=f||window.location.toString(),j={resource:""},d=f.indexOf("#");if(d!==-1&&(f=f.substring(d+1),f.length!==0)){f=f.split(",");j.resource=decodeURIComponent(f[0]);for(d=1;d<f.length;d++){var b=/([^=]*)(=?)(.*)/.exec(f[d]),i=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");i!==""&&i!=="resource"&&(j[i]=b)}}return j},
validateURLScheme:function(k,j){var d=k;if(k.indexOf("://")===-1){var b=document.createElement("a");b.href=k;d=b.href}b=!1;return(b=j?j.some(function(b){return RegExp("^"+b+":","i").test(d)}):f.test(d))?k:(console.log("Illegal URL Scheme: '"+k+"'"),"")}}});
define("orion/uiUtils",["i18n!orion/nls/messages","orion/webui/littlelib"],function(f,k){function j(b){var d="",a=navigator.platform.indexOf("Mac")!==-1;b.mod1&&(d+=a?"Cmd+":"Ctrl+");b.mod2&&(d+="Shift+");b.mod3&&(d+="Alt+");b.mod4&&a&&(d+="Ctrl+");if(b.alphaKey)return d+b.alphaKey;if(b.type==="keypress")return d+b.keyCode;for(var h in k.KEY)if(typeof(k.KEY[h]==="number")&&k.KEY[h]===b.keyCode)return d+h;var g;switch(b.keyCode){case 59:g=b.mod2?":":";";break;case 61:g=b.mod2?"+":"=";break;case 188:g=
b.mod2?"<":",";break;case 190:g=b.mod2?">":".";break;case 191:g=b.mod2?"?":"/";break;case 192:g=b.mod2?"~":"`";break;case 219:g=b.mod2?"{":"[";break;case 220:g=b.mod2?"|":"\\";break;case 221:g=b.mod2?"}":"]";break;case 222:g=b.mod2?'"':"'"}return g?d+g:b.keyCode>=112&&b.keyCode<=123?d+"F"+(b.keyCode-111):d+String.fromCharCode(b.keyCode)}function d(b){var d=window.navigator.platform.indexOf("Mac")!==-1;return d&&b.metaKey||!d&&b.ctrlKey}return{getUserKeyString:function(b){for(var d="",b=b.getKeys(),
a=0;a<b.length;a++)a!==0&&(d+=" "),d+=j(b[a]);return d},getUserText:function(b,d,a,h,g,e,c,l,n){var f=!1,c=function(c){return function(l){if(!f){var j=k.node(b),r=j.value;if(j)if(c&&l.keyCode===k.KEY.ESCAPE){if(a)d.style.display="inline";f=!0;j.parentNode.removeChild(j);e&&e()}else if(!(c&&l.keyCode!==k.KEY.ENTER)){if(r.length===0||!n&&r===h){if(a)d.style.display="inline"}else if(g(r),a&&d.parentNode)d.style.display="inline";f=!0;j.parentNode&&j.parentNode.removeChild(j);e&&e()}}}},j=document.createElement("input");
j.id=b;j.value=h||"";d.parentNode.insertBefore(j,d.nextSibling);j.classList.add("userEditBoxPrompt");if(a)d.style.display="none";j.addEventListener("keydown",c(!0),!1);j.addEventListener("blur",c(!1),!1);window.setTimeout(function(){j.focus();if(h){var c=k.node(b),a=l?h.indexOf(l):-1;if(a>0)if(c.createTextRange)c=c.createTextRange(),c.collapse(!0),c.moveStart("character",0),c.moveEnd("character",a),c.select();else if(c.setSelectionRange)c.setSelectionRange(0,a);else{if(c.selectionStart!==void 0)c.selectionStart=
0,c.selectionEnd=a}else c.select()}},0)},openInNewWindow:d,followLink:function(b,i){i&&d(i)?window.open(b):window.location=b},createButton:function(b,d){var a=document.createElement("button");a.className="orionButton commandButton commandMargins";a.addEventListener("click",function(a){d();k.stop(a)},!1);b&&a.appendChild(document.createTextNode(b));return a},createDropdownButton:function(){},isFormElement:function(b){switch(b.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","require,orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(f,k,j,d,b,i,a,h,g,e,c){function l(c){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(c);this._parameterCollector=
null}function n(c,a){this.token=c;this.parameterName=a}function m(c,a,e,g,b){this.name=c;this.type=a;this.label=e;this.value=g;this.lines=b||1}function r(c,a,e){this._storeParameters(c);this._hasOptionalParameters=a&&a.hasOptionalParameters;this._options=a;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=a&&a.clientCollect}l.prototype={_init:function(c){this._selectionService=c.selection;var a=this;k.setKeyBindingProvider(function(){return a._activeBindings})},processURL:function(c){for(var a in this._urlBindings)if(this._urlBindings[a]&&
this._urlBindings[a].urlBinding&&this._urlBindings[a].command){var e=this._urlBindings[a].urlBinding.match(c);if(e){var g=this._urlBindings[a],b=g.command,h=g.invocation;if(h&&h.parameters&&b.callback){h.parameters.setValue(e.parameterName,e.parameterValue);var d=this;window.setTimeout(function(){d._invoke(h)},0);break}}}},findCommand:function(c){return this._commandList[c]},runCommand:function(c,a,e,g){a?(c=this._commandList[c])&&(c.visibleWhen?c.visibleWhen(a):1)&&c.callback&&this._invoke(new k.CommandInvocation(e,
a,null,c,this),g):(a=this._urlBindings[c])&&a.command&&a.command.callback&&this._invoke(a.invocation,g)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(c){this._parameterCollector=c},openParameterCollector:function(c,a,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(c,a,e))},confirm:function(c,a,e,g,b,h){var d=!1;if(this._parameterCollector&&!b){var o=this;this._parameterCollector.close();if(this._parameterCollector.open(c,
function(c,b){var h=document.createElement("span");h.classList.add("parameterPrompt");h.textContent=a;c.appendChild(h);h=document.createElement("button");h.addEventListener("click",function(){d=!0;o._parameterCollector.close()},!1);b.appendChild(h);h.appendChild(document.createTextNode(e));h.className="dismissButton";var l=document.createElement("button");l.addEventListener("click",function(){d=!1;o._parameterCollector.close()},!1);b.appendChild(l);l.appendChild(document.createTextNode(g));l.className=
"dismissButton";return h},function(){h(d)}))return}d=window.confirm(a);h(d)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(c,a){return this._collectAndInvoke(c.makeCopy(a),!1)},_collectAndInvoke:function(c,a){if(c)if(this._parameterCollector&&c.parameters&&c.parameters.hasParameters()&&(a||c.parameters.shouldCollectParameters())){var e=!1;c.parameters.updateParameters(c);
if(c.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(c),!e)){var g=new h.Tooltip({node:c.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),e=g.contentContainer();e.classList.add("parameterPopup");var b=window.document.activeElement,d=this._parameterCollector.getFillFunction(c,function(){b&&b.focus();g.destroy()})(e);g.show();window.setTimeout(function(){d.focus();d.select()},0);e=!0}e||c.command.callback.call(c.handler||
window,c)}else c.command.callback.call(c.handler||window,c);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(c){this._collectAndInvoke(c,!0)},showKeyBindings:function(c){function a(c){return function(){k.executeBinding(c)}}var e={},g,h,d=[],v;for(v in this._activeBindings)(h=this._activeBindings[v])&&h.keyBinding&&h.command&&(h.command.name||h.command.tooltip)&&d.push(h);d.sort(function(c,a){return(c.command.name||
c.command.tooltip).localeCompare(a.command.name||a.command.tooltip)});for(v=0;v<d.length;v++)h=d[v],h.keyBinding.scopeName?(e[h.keyBinding.scopeName]||(e[h.keyBinding.scopeName]=[]),e[h.keyBinding.scopeName].push(h)):(g=b.getUserKeyString(h.keyBinding),c.createItem(g,h.command.name||h.command.tooltip,a(h)));for(var o in e)e[o].length&&e[o].length>0&&(c.createHeader(o),e[o].forEach(function(e){g=b.getUserKeyString(e.keyBinding);c.createItem(g,e.command.name||e.command.tooltip,a(e))}))},addCommand:function(c){this._commandList[c.id]=
c;var a=this._pendingBindings[c.id];if(a){var e=this;a.forEach(function(a){e._addBinding(c,a.type,a.binding,a.bindingOnly)});delete this._pendingBindings[c.id]}},addCommandGroup:function(c,a,e,g,b,h,d,o,l){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});c=this._contributionsByScopeId[c];b&&(c=this._createEntryForPath(c,b));if(c[a]){if(g)c[a].title=g;if(e)c[a].position=e;if(d)c[a].imageClass=d;if(o)c[a].tooltip=o;if(l)c[a].selectionClass=l;c[a].emptyGroupMessage=h}else c[a]={title:g,
position:e,emptyGroupMessage:h,imageClass:d,tooltip:o,selectionClass:l,children:{}},c.sortedContributions=null},_createEntryForPath:function(c,a){a&&a.split("/").forEach(function(a){if(a.length>1)c[a]||(c[a]={position:0,children:{}}),c=c[a].children});return c},registerSelectionService:function(c,a){this._contributionsByScopeId[c]||(this._contributionsByScopeId[c]={});this._contributionsByScopeId[c].localSelectionService=a},registerCommandContribution:function(c,a,e,g,b,h,d){this._contributionsByScopeId[c]||
(this._contributionsByScopeId[c]={});c=this._contributionsByScopeId[c];g&&(c=this._createEntryForPath(c,g));c[a]={position:e};h&&((e=this._commandList[a])?this._addBinding(e,"key",h,b):this._addPendingBinding(a,"key",h,b));d&&((e=this._commandList[a])?this._addBinding(e,"url",d,b):this._addPendingBinding(a,"url",d,b));c.sortedContributions=null},_addBinding:function(c,a,e,g){if(!c.id)throw Error("No command id: "+c);a==="key"?this._activeBindings[c.id]={command:c,keyBinding:e,bindingOnly:g}:a==="url"&&
(this._urlBindings[c.id]={command:c,urlBinding:e,bindingOnly:g})},_addPendingBinding:function(c,a,e,g){this._pendingBindings[c]=this._pendingBindings[c]||[];this._pendingBindings[c].push({type:a,binding:e,bindingOnly:g})},_checkForTrailingSeparator:function(c,a,e){var g;if(a==="tool"||a==="button")if((g=c.childNodes.length>0?c.childNodes[c.childNodes.length-1]:null)&&g.classList.contains("commandSeparator"))return e?(c.removeChild(g),!1):!0;if(a==="menu"&&(c=i.$$array("li > *",c),c.length>0&&c[c.length-
1].classList.contains("dropdownSeparator")))if(g=c[c.length-1],e)g.parentNode.parentNode.removeChild(g.parentNode);else return!0;return!1},renderCommands:function(c,a,e,g,b,h,d){if(typeof c!=="string")throw"a scope id for rendering must be specified";a=i.node(a);if(!a)throw"no parent";var o=this._contributionsByScopeId[c];if(!e&&o){var e=o.localSelectionService||this._selectionService,l=this;e&&e.getSelections(function(e){l.renderCommands(c,a,e,g,b,h)})}else o&&(this._render(this._contributionsByScopeId[c],
a,e,g,b||"button",h,d),this._checkForTrailingSeparator(a,b,!0))},destroy:function(c){c=i.node(c);if(!c)throw"no parent";for(;c.hasChildNodes();){var a=c.firstChild;a.commandTooltip&&a.commandTooltip.destroy();a.emptyGroupTooltip&&a.emptyGroupTooltip.destroy();this.destroy(a);c.removeChild(a)}},_render:function(c,a,e,g,b,d,v){var o=c.sortedContributions;if(!o){var o=[],l=!1,i;for(i in c)if(Object.prototype.hasOwnProperty.call(c,i)){var n=c[i];if(n&&typeof n.position==="number")n.id=i,o.push(n),l=!0}if(l)o.sort(function(c,
a){return c.position-a.position}),c.sortedContributions=o}var f=0,m=this;o.forEach(function(c){var o,l;if(!c.imageClass)c.imageClass=null;if(c.children&&Object.getOwnPropertyNames(c.children).length>0){o=c.children;var w;if(b==="tool"||b==="button")if(c.title)w=m._createDropdownMenu(a,c.title,null,null,c.imageClass,c.tooltip,c.selectionClass),v&&j.generateNavGrid(v,w.menuButton),window.setTimeout(function(){m._render(c.children,w.menu,e,g,"menu",d,v);m._checkForTrailingSeparator(w.menu,"menu",!0);
if(w.menu.childNodes.length===0)if(c.emptyGroupMessage){if(!w.menuButton.emptyGroupTooltip)w.menuButton.emptyGroupTooltip=new h.Tooltip({node:w.menuButton,text:c.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})}else v&&j.removeNavGrid(v,w.menuButton),w.menu.parentNode&&w.menu.parentNode.removeChild(w.menu),w.destroyButton&&w.destroyButton.parentNode&&w.destroyButton.parentNode.removeChild(w.destroyButton);else w.menuButton.style.visibility="visible"},0);else{var i;a.childNodes.length>
0&&!m._checkForTrailingSeparator(a,b)&&(i=m.generateSeparatorImage(a));m._render(o,a,e,g,b,d,v);a.childNodes.length>0&&a.childNodes[a.childNodes.length-1]!==i&&(i=m.generateSeparatorImage(a))}else if(c.title){if(i=m._createDropdownMenu(a,c.title,!0,null,null,c.imageClass))m._render(o,i.menu,e,g,"menu",d,v),i.menu.childNodes.length===0&&i.destroyButton&&a.removeChild(i.destroyButton)}else a.childNodes.length>0&&m._generateMenuSeparator(a),m._render(o,a,e,g,b,d,v),m._generateMenuSeparator(a)}else{var n=
m._commandList[c.id];o=n?!0:!1;var y=null,y=null;if(n){l=new k.CommandInvocation(g,e,d,n,m);l.domParent=a;i=o&&(n.visibleWhen?n.visibleWhen(e):!0);if(m._activeBindings[n.id]&&m._activeBindings[n.id].keyBinding)y=m._activeBindings[n.id],y.invocation=i?l:null,y.bindingOnly&&(o=!1);if(m._urlBindings[n.id]&&m._urlBindings[n.id].urlBinding)y=m._urlBindings[n.id],y.invocation=i?l:null,y.bindingOnly&&(o=!1);o=o&&i}if(o)n.choiceCallback?(b==="tool"||b==="button"?(o=a,i=!1,a.nodeName.toLowerCase()==="ul"&&
(o=document.createElement("li"),a.appendChild(o))):(o=a,i=!0),m._createDropdownMenu(o,n.name,i,function(c){n.populateChoicesMenu(c,e,g,d,m)}.bind(n),n.imageClass,n.tooltip||n.title,n.selectionClass)):(l.handler=l.handler||this,l.domParent=a,i=function(){m._invoke(l)},b==="menu"?o=k.createCommandMenuItem(a,n,l,null,i):(o=b+n.id+f,o=k.createCommandItem(a,n,l,o,null,b==="tool",i)),j.generateNavGrid(v,o),l.domNode=o,f++)}})},_createDropdownMenu:function(e,g,b,d,l,n,v){e=i.node(e);if(!e||!i.contains(document.body,
e))return null;var o,w=e;if(b)n=document.createRange(),n.selectNode(e),n=n.createContextualFragment(c),i.processTextNodes(n,{ButtonText:g}),e.appendChild(n),o=e.lastChild,e=o.lastChild,g=e.previousSibling,g.dropdown=new a.Dropdown({dropdown:e,populate:d}),e.dropdown=g.dropdown;else if(e.nodeName.toLowerCase()==="ul"&&(w=document.createElement("li"),e.appendChild(w),o=w),e=null,l&&(e="dropdownButtonWithIcon",n=n||g),n=l?n||g:n,d=k.createDropdownMenu(w,g,d,e,l,!1,v),g=d.menuButton,e=d.menu,n)g.commandTooltip=
new h.Tooltip({node:g,text:n,position:["above","below","right","left"]});return{menuButton:g,menu:e,dropdown:g.dropdown,destroyButton:o}},_generateMenuSeparator:function(c){if(!this._checkForTrailingSeparator(c,"menu")){var a=document.createElement("li");a.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");a.appendChild(e);c.appendChild(a)}},generateSeparatorImage:function(c){var a;a=c.nodeName.toLowerCase()==="ul"?document.createElement("li"):
document.createElement("span");c.appendChild(a);a.classList.add("core-sprite-sep");a.classList.add("imageSprite");a.classList.add("commandSeparator");return a}};l.prototype.constructor=l;n.prototype={match:function(c){c=d.matchResourceParameters(c);return typeof c[this.token]!=="undefined"?(this.parameterValue=c[this.token],this):null}};n.prototype.constructor=n;m.prototype={optionsRequested:function(){return this.optionsRequested}};m.prototype.constructor=m;r.prototype={_storeParameters:function(c){this.parameterTable=
null;if(c){var a=this.parameterTable={};c.forEach(function(c){a[c.name]=c})}},updateParameters:function(c){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(c))},hasParameters:function(){return this.parameterTable!==null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(c){return this.parameterTable[c]},valueFor:function(c){return(c=this.parameterTable[c])?c.value:null},setValue:function(c,a){var e=this.parameterTable[c];
if(e)e.value=a},forEach:function(c){for(var a in this.parameterTable)this.parameterTable[a].type&&this.parameterTable[a].name&&c(this.parameterTable[a])},makeCopy:function(){var c=[];this.forEach(function(a){a=new m(a.name,a.type,a.label,a.value,a.lines);c.push(a)});var a=new r(c,this._options,this.getParameters);a.clientCollect=this.clientCollect;return a},hasOptionalParameters:function(){return this._hasOptionalParameters}};r.prototype.constructor=r;return{CommandRegistry:l,URLBinding:n,ParametersDescription:r,
CommandParameter:m}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(f,k,j){function d(b,d){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=d}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(b,d,a){typeof b==="string"&&(b=j.node(b));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===b)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(b))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=a;var h=d(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!h)return!1;this._activeElements.focusNode=h;b=j.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(b.length===0){d=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("button");b.id="closebox";b.className="imageSprite core-sprite-close dismissButton";b.title=f.Close;d.appendChild(b);var g=this;b.addEventListener("click",function(){g.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(h)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){h.focus();h.select&&h.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,d){j.$$array("input",d).forEach(function(a){a.type==="checkbox"?b.parameters.setValue(a.parameterName,a.checked):a.type!=="button"&&b.parameters.setValue(a.parameterName,a.value.trim())});j.$$array("textArea",d).forEach(function(a){b.parameters.setValue(a.parameterName,a.value.trim())});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b){return b.parameters?
(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b))):!1},getFillFunction:function(b,d){var a=this;return function(h,g){var e=null,c=function(){d&&d();a.close()},l=function(e){e.keyCode===j.KEY.ENTER&&a._collectAndCall(b,h);if(e.keyCode===j.KEY.ESCAPE||e.keyCode===j.KEY.ENTER)c(),j.stop(e)};b.parameters.forEach(function(a){var g=null;if(a.label)g=document.createElement("label"),g.classList.add("parameterInput"),g.setAttribute("for",a.name+
"parameterCollector"),g.textContent=a.label,h.appendChild(g);var b=a.name+"parameterCollector",d=g||h;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)g=document.createElement("textarea"),g.rows=a.lines,g.type="textarea",g.id=b,d.appendChild(g),l=function(a){a.keyCode===j.KEY.ESCAPE&&(c(),j.stop(a))};else if(a.type==="boolean"){if(g=document.createElement("input"),g.type="checkbox",g.id=b,d.appendChild(g),a.value)g.checked=!0}else if(g=document.createElement("input"),g.type=a.type,g.id=b,
d.appendChild(g),a.value)g.value=a.value;g.classList.add("parameterInput");g.setAttribute("speech","speech");g.setAttribute("x-webkit-speech","x-webkit-speech");g.parameterName=a.name;e||(e=g);g.addEventListener("keydown",l,!1)});var n=g;n||(n=document.createElement("span"),n.classList.add("layoutRight"),n.classList.add("parametersDismiss"),h.appendChild(n));var m=function(c,a){var e=document.createElement("button");a.appendChild(e);c&&e.appendChild(document.createTextNode(c));e.classList.add("dismissButton");
return e};if(b.parameters.hasOptionalParameters())b.parameters.optionsRequested=!1,m(f.More,n).addEventListener("click",function(){b.parameters.optionsRequested=!0;a._collectAndCall(b,h);c()},!1);m(f.Submit,n).addEventListener("click",function(){a._collectAndCall(b,h);c()},!1);n=m(null,n);n.id="closebox";n.classList.add("imageSprite");n.classList.add("core-sprite-close");n.title=f.Close;n.addEventListener("click",function(){c()},!1);return e}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/regex",[],function(){return{escape:function(f){return f.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(f){return(f=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(f))?{pattern:f[1],flags:f[2]}:null}}});
define("orion/contentTypes",[],function(){function f(b,a){function h(c,a,e,g){var e=a.filename.indexOf(e)>=0,b;b=g.toLowerCase();b=a.extension.indexOf(b)!==-1;if(e||b){if(!(b=!c))e&&(g=g.toLowerCase(),e=c.extension.indexOf(g)!==-1),b=e;if(b)return a}return c}if(typeof b!=="string")return null;for(var g=b&&b.split(".").pop(),e=null,c=0;c<a.length;c++){var d=a[c];h(e,d,b,g)===d&&(e=d)}return e}function k(i){this.serviceRegistry=i;this.map=function(a){function h(c){return c===null||typeof c==="undefined"?
[]:Array.isArray(c)?c:[c]}function g(c){return h(c).map(function(c){return String.prototype.toLowerCase.call(c)})}for(var a=a.getServiceReferences(d).concat(a.getServiceReferences(b)),e={},c=0;c<a.length;c++)for(var l=h(a[c].getProperty("contentTypes")),i=0;i<l.length;i++){var m=l[i];e[m.id]||(e[m.id]={id:m.id,name:m.name,image:m.image,"extends":m["extends"],extension:g(m.extension),filename:h(m.filename)})}return e}(i);i.registerService(j,this)}var j="orion.core.contentTypeRegistry",d="orion.core.contenttype",
b="orion.file.contenttype";k.prototype={getContentTypes:function(){var b=this.getContentTypesMap(),a=[],h;for(h in b)Object.prototype.hasOwnProperty.call(b,h)&&a.push(b[h]);return a},getContentTypesMap:function(){return this.map},getFileContentType:function(b){return f(b.Name,this.getContentTypes())},getFilenameContentType:function(b){return f(b,this.getContentTypes())},getContentType:function(b){return this.map[b]||null},isExtensionOf:function(b,a){b=typeof b==="string"?this.getContentType(b):b;
a=typeof a==="string"?this.getContentType(a):a;if(!b||!a)return!1;if(b.id===a.id)return!0;else for(var h=b,g={};h&&(h=this.getContentType(h["extends"]));){if(h.id===a.id)return!0;if(g[h.id])throw Error("Cycle: "+h.id);g[h.id]=!0}return!1},isSomeExtensionOf:function(b,a){for(var h=0;h<a.length;h++)if(this.isExtensionOf(b,a[h]))return!0;return!1}};return{ContentTypeRegistry:k,getFilenameContentType:f}});
define("orion/URITemplate",[],function(){function f(c){this._text=c}function k(c){return c.replace("%25","%")}function j(c,a){if(a==="U")return encodeURIComponent(c).replace(/[!'()*]/g,function(c){return"%"+c.charCodeAt(0).toString(16).toUpperCase()});if(a==="U+R")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(e,k);if(a==="U+R-,")return encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+a);}function d(c,a,e){for(var g=
[],b=0;b<c.length;b++)typeof c[b]!=="undefined"&&g.push(j(c[b],a));return g.join(e)}function b(c,a,e,g){for(var b=Object.keys(c),h=[],d=0;d<b.length;d++)typeof c[b[d]]!=="undefined"&&h.push(j(b[d],a)+e+j(c[b[d]],a));return h.join(g)}function i(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=h[c[0]])?c=c.substring(1):this._operator=h.NUL;for(var a=[],e=c.split(","),b=0;b<e.length;b++){var d=e[b].match(g);if(d===null)throw Error("Bad VarSpec: "+c);a.push({name:d[1],
explode:!!d[2],prefix:d[3]?parseInt(d[3],10):-1})}this._varSpecList=a}function a(c){for(var a=[],e=0,g=c.indexOf("{",e);g!==-1;){a.push(new f(c.substring(e,g)));e=c.indexOf("}",g+1);if(e===-1)throw Error("Invalid template: "+c);a.push(new i(c.substring(g+1,e)));e+=1;g=c.indexOf("{",e)}a.push(new f(c.substring(e)));this._templateComponents=a}var h={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-,"}},g=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,e=/%25[0-9A-F][0-9A-F]/g;f.prototype={expand:function(){return encodeURI(this._text)}};
i.prototype={expand:function(c){for(var a=[],e=0;e<this._varSpecList.length;e++){var g=this._varSpecList[e],h=g.name,i=c[h],f=typeof i;if(f!=="undefined"&&i!==null){var k=a.length===0?this._operator.first:this._operator.sep;if(f==="string")this._operator.named&&(k+=j(h,"U+R"),k+=i.length===0?this._operator.ifemp:"="),g.prefix!==-1&&g.prefix<i.length&&(i=i.substring(0,g.prefix)),k+=j(i,this._operator.allow);else if(Array.isArray(i))g.explode?k+=d(i,this._operator.allow,this._operator.sep):(this._operator.named&&
(k+=j(h,"U+R"),k+=i.length===0?this._operator.ifemp:"="),k+=d(i,this._operator.allow,","));else if(f==="object")g.explode?k+=b(i,this._operator.allow,"=",this._operator.sep):(this._operator.named&&(k+=j(h,"U+R"),k+=Object.keys(i).length===0?this._operator.ifemp:"="),k+=b(i,this._operator.allow,",",","));else throw Error("bad param type: "+h+" : "+f);a.push(k)}}return a.join("")}};a.prototype={expand:function(c){for(var a=[],e=0;e<this._templateComponents.length;e++)a.push(this._templateComponents[e].expand(c));
return a.join("")}};return a});
define("orion/i18nUtil",["require","orion/Deferred"],function(f,k){function j(b){if(b=localStorage.getItem("orion/messageBundle/"+b))if(b=JSON.parse(b),b._expires&&b._expires>(new Date).getTime())return delete b._expires,b;return null}var d={};return{getMessageBundle:function(b){function i(){f(["i18n!"+b],function(e){if(e){var c=b;e._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(e));delete e._expires}a.resolve(e)})}if(d[b])return d[b];var a=new k;d[b]=
a;var h=j(b);if(h)return a.resolve(h),a;try{f([b],i)}catch(g){f(["orion/i18n!"+b],i)}return a},formatMessage:function(b){var d=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(a,b){return d[(b<<0)+1]})}}});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/URL-shim".split(","),function(f,k,j,d,b){function i(){return(new URL(f.toUrl("orion/../"),window.location.href)).href.slice(0,-1)}function a(a,g){var e=a.getServiceReferences(g||"orion.page.link"),c=j.matchResourceParameters(window.location.href),l={OrionHome:i(),Location:c.resource},n=[];e.forEach(function(c){var a={};c.getPropertyKeys().forEach(function(e){a[e]=c.getProperty(e)});if(a.uriTemplate&&
a.nls&&(a.name||a.nameKey)){var e=new k;b.getMessageBundle(a.nls).then(function(c){var g=(new d(a.uriTemplate)).expand(l),g=j.validateURLScheme(g);a.href=g;a.textContent=a.nameKey?c[a.nameKey]:a.name;e.resolve(a)});n.push(e)}else if(a.uriTemplate&&a.name){var g=(new d(a.uriTemplate)).expand(l),g=j.validateURLScheme(g);a.href=g;a.textContent=a.name;n.push((new k).resolve(a))}});return k.all(n)}return{createPageLinks:function(b,g){return a(b,g).then(function(a){a.sort(function(c,a){var e=c.textContent&&
c.textContent.toLowerCase(),g=a.textContent&&a.textContent.toLowerCase();return e<g?-1:e>g?1:0});return a.map(function(c){var a=c.href,c=c.textContent,e=document.createElement("a");e.href=a;e.target="_self";e.classList.add("targetSelector");e.textContent=c;return e})})},getPageLinksInfo:a,getOrionHome:i}});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks".split(","),function(f,k,j,d,b,i,a,h,g){var e={},c=g.getOrionHome();e._cloneItemWithoutChildren=function m(c){if(c===null||typeof c!=="object")return c;var a=c.constructor(),e;for(e in c)e!=="children"&&e!=="Children"&&(a[e]=m(c[e]));return a};e._getOpenWithNavCommandExtensions=function(c){function a(c,e){for(var g=c.getServiceReferences("orion.navigate.openWith"),
b=[],h=0;h<g.length;h++){var d=g[h];d.getProperty("editor")===e.id&&(d=d.getProperty("contentType"),d instanceof Array?b=b.concat(d):d!==null&&typeof d!=="undefined"&&b.push(d))}return b}for(var e=function(){for(var a=c.getServiceReferences("orion.edit.editor"),e=[],g=0;g<a.length;g++){var b=a[g],h=b.getProperty("id");e.push({id:h,name:b.getProperty("name"),nameKey:b.getProperty("nameKey"),nls:b.getProperty("nls"),uriTemplate:b.getProperty("orionTemplate")||b.getProperty("uriTemplate"),validationProperties:b.getProperty("validationProperties")||
[]})}return e}(),g=function(c){for(c=c.getServiceReferences("orion.navigate.openWith.default");0<c.length;)return{editor:c[0].getProperty("editor")};return null}(c),b=[],h=0;h<e.length;h++){var d=e[h],l=g&&g.editor===d.id,v=a(c,d);v.length&&b.push({properties:{name:d.name||d.id,nameKey:d.nameKey,id:"eclipse.openWithCommand."+d.id,tooltip:d.name,tooltipKey:d.nameKey,contentType:v,uriTemplate:d.uriTemplate,nls:d.nls,forceSingleItem:!0,isEditor:l?"default":"editor",validationProperties:d.validationProperties},
service:{}})}return b};e._makeValidator=function(a,e,g,h){function d(c,a,e,g){var b=e.match,h;if(a.indexOf("[")===0){if(a.indexOf("]")<0)return!1;if(!Array.isArray(c))return!1;h=a.replace("[","").replace("]","");for(a=0;a<c.length;a++)if(d(c[a],h,e,g))return!0}else if(a.indexOf("|")>=0)return h=a.substring(0,a.indexOf("|")),a=a.substring(a.indexOf("|")+1),d(c,h,e,g)?!0:d(c,a,e,g);else if(a.indexOf(":")>=0)return h=a.substring(0,a.indexOf(":")),a=a.substring(a.indexOf(":")+1),c[h]?d(c[h],a,e,g):!1;
else{a:{h=!1;var l;if(a.charAt(0)==="!")e=typeof c[a.substring(1)]==="undefined";else if(typeof c[a]!=="undefined"){if(typeof b==="undefined")l=c[a],h=!0;else if(typeof b==="string"){if(!typeof(c[a]==="string")){e=!1;break a}if(e.variableName){if(b=RegExp(b).exec(c[a]))h=b[0],l=e.variableMatchPosition==="before"?c[a].substring(0,b.index):e.variableMatchPosition==="after"?c[a].substring(b.index+h.length):e.variableMatchPosition==="only"?h:c[a],h=!0}else{e=RegExp(b).test(c[a]);break a}}else c[a]===
b&&(l=c[a],h=!0);if(h&&e.variableName&&(g[e.variableName]=l,g.itemCached=c,e.replacements))for(c=0;c<e.replacements.length;c++)a=!1,e.replacements[c].pattern?g[e.variableName]=g[e.variableName].replace(RegExp(e.replacements[c].pattern),e.replacements[c].replacement||""):a=!0,a&&window.console.log("Invalid replacements specified in validation property.  "+e.replacements[c]);e=h}else e=!1}return e}}return{info:a,validationFunction:function(c){typeof h==="function"&&(c=h.call(this,c));if(c){if(Array.isArray(c)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&c.length!==1)return!1;if(c.length<1)return!1}else c=[c];for(var e=0;e<c.length;e++){var l;a:{var v=c[e],o=g;if(this.info.validationProperties)for(l=0;l<this.info.validationProperties.length;l++){var w=this.info.validationProperties[l];if(typeof w.source!=="undefined"){if(!d(v,w.source,w,this)){l=!1;break a}}else{window.console.log("Invalid validationProperties in "+a.id+".  No source property specified.");l=!1;break a}}if(this.info.contentType&&o){w=!1;if(v=b.getFilenameContentType(v.Name,
o))for(l=0;l<this.info.contentType.length;l++)if(v.id===this.info.contentType[l]){w=!0;break}l=w}else l=!0}if(!l)return!1}return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var e={},g;for(g in a)Object.prototype.hasOwnProperty.call(a,g)&&(e[g]=a[g]);if(this.info.validationProperties)for(g=0;g<this.info.validationProperties.length;g++){var b=this.info.validationProperties[g];b.source&&b.variableName&&(this.itemCached===a&&this[b.variableName]||
d(a,b.source,b,this),a[b.variableName]?window.console.log("Variable name "+b.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):e[b.variableName]=this[b.variableName])}e.OrionHome=c;return(new i(this.info.uriTemplate)).expand(e)}return null}}};e._createCommandOptions=function(c,g,b,h,d,l){function i(a,o){var w=e._makeValidator(c,b,h,l);a.visibleWhen=w.validationFunction.bind(w);if(d)if(w.generatesURI.bind(w)())a.hrefCallback=function(c){c=
Array.isArray(c.items)?c.items[0]:c.items;return w.getURI.bind(w)(c)};else{var f=c;a.callback=function(c){var o;if(f.forceSingleItem)c=Array.isArray(c.items)?c.items[0]:c.items,o=e._cloneItemWithoutChildren(c);else if(Array.isArray(c.items)){o=[];for(var h=0;h<c.items.length;h++)o.push(e._cloneItemWithoutChildren(c.items[h]))}else o=e._cloneItemWithoutChildren(c.items);if(b)var d=b.getService("orion.page.progress");g.run?d?d.progress(g.run(o),"Running command: "+a.name):g.run(o):b&&(d?d.progress(b.getService(g).run(o),
"Running command: "+a.name):b.getService(g).run(o))}}o.resolve(a)}var f=new k;c.nls?a.getMessageBundle(c.nls).then(function(a){i({name:c.nameKey?a[c.nameKey]:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltipKey?a[c.tooltipKey]:c.tooltip,isEditor:c.isEditor,showGlobally:c.showGlobally},f)}):i({name:c.name,image:c.image,id:c.id||c.name,tooltip:c.tooltip,isEditor:c.isEditor,showGlobally:c.showGlobally},f);return f};e.getOpenWithCommands=function(c){var a=[],e;for(e in c._commandList){var g=c._commandList[e];
g.isEditor&&a.push(g)}return a};var l;e.createAndPlaceFileCommandsExtension=function(c,a,g,b,h,d){var l=!!d;return e.createFileCommands(c,null,d?"all":void 0,l).then(function(c){a._addedOpenWithCommands=l;var e=!1,o=!1;c.forEach(function(c){a.addCommand(c);h&&!e&&(e=!0,a.addCommandGroup(g,"eclipse.fileCommandExtensions",1E3,null,h));h&&!o&&(o=!0,a.addCommandGroup(g,"eclipse.openWith",1E3,"Open With",h+"/eclipse.fileCommandExtensions"));this.isEditor?a.registerCommandContribution(g,c.id,b+this.index,
h?h+"/eclipse.fileCommandExtensions/eclipse.openWith":null):a.registerCommandContribution(g,c.id,b+this.index,h?h+"/eclipse.fileCommandExtensions":null)});return{}})};e.createFileCommands=function(c,a,g,b){var g=g===void 0?"global":g,b=b===void 0?!0:b,h=c.getServiceReferences("orion.navigate.command"),d=[];if(g==="all"||g==="global")for(var i=0;i<h.length;i++)if(h[i].getProperty("id")!=="orion.navigateFromMetadata"){for(var f=c.getService(h[i]),v={},o=h[i].getPropertyKeys(),w=0;w<o.length;w++)v[o[w]]=
h[i].getProperty(o[w]);(g==="all"||v.forceSingleItem&&v.showGlobally)&&d.push({properties:v,service:f})}return k.when(function(){var e=c.getService("orion.core.contentTypeRegistry")||a;return l||k.when(e.getContentTypes(),function(c){return l=c})}(),function(){d=b?d.concat(e._getOpenWithNavCommandExtensions(c,l)):d;var a=d.map(function(a){var g=a.properties;return e._createCommandOptions(g,a.service,c,l,!0).then(function(c){c=new j.Command(c);if(g.isEditor)c.isEditor=g.isEditor;return c})});return k.all(a,
function(c){return{_error:c}}).then(function(c){return c})})};e.createOpenWithCommands=function(c,a,g){return g&&g._addedOpenWithCommands?(new k).resolve(e.getOpenWithCommands(g)):e.createFileCommands(c,a,"none",!0)};return e});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(f,k){function j(d){this._init(d)}j.prototype={_init:function(d){var b=k.node(d.container);if(!b)throw"no parent container";this._container=b;b.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 b=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,b):d.href=f.toUrl("edit/edit.html")+"#"+b}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 b=
document.createElement("a");b.classList.add("breadcrumb");b.appendChild(document.createTextNode(d));return b},addSegmentHref:function(d,b){this._makeHref?this._makeHref(d,b.Location,b):d.href=f.toUrl("edit/edit.html")+"#"+b.ChildrenLocation},buildSegments:function(d,b){if(this._resource.Parents){var i=this._resource.Parents.slice(0),a,h;i&&(i=i.slice(0),b==="reverse"&&(i=i.reverse().slice(0)),i.forEach(function(g){d?(h=d,d=null):h=g.Name;a=this.buildSegment(h);this.path+=g.Name;this.addSegmentHref(a,
g);a.include=!1;this.segments.push(a)}.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,b){var i=b||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(i)),d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,
b){d=document.createElement("span");b?d.appendChild(document.createTextNode(b)):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(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.include=!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=document.getElementById("location");d.style.width="auto";this.MAX_LENGTH=d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility=
"hidden";var d=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;if(b)this.addTitle(d,b);else if(this.finalSegment(d,b),this._resource&&this._resource.Parents&&(this.buildSegments(b,"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(),b=this._rootSegmentName;b?this.addTitle(d,b):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),
this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,b)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};j.prototype.constructor=j;return{BreadCrumbs:j}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(f,k,j){function d(b){k.attach(this);this._init(b)}d.prototype={_init:function(b){this._tracking=null;this._animationDelay=501;this.$node=j.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=j.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=j.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";this._vertical=
b.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(b.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof b.closeByDefault!=="undefined")this._closeByDefault=b.closeByDefault;this._initializeFromStoredSettings();this._closed?
(this._closed=!1,this._thumbDown(!0,!0)):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)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(b){this.addEventListener("resize",function(d){b(d.node)})},_initializeFromStoredSettings:function(){var b=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof b==="string"?b==="closed":this._closeByDefault;if(this._vertical)if(b=localStorage.getItem(this._prefix+"/yPosition"))this._splitTop=parseInt(b,10);else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(b=localStorage.getItem(this._prefix+
"/xPosition"))this._splitLeft=parseInt(b,10);else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var b=j.bounds(this.$node),d=j.bounds(this.$node.parentNode);return this.vertical?b.top-d.top:b.left-d.left},_adjustToSplitPosition:function(b){var d=j.bounds(this.$node),a=j.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(b||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+"/yPosition",
this._splitTop);b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-a.top);this.$sideNode.style.height=b+"px";this.$sideNode.style.display="block";this.$node.style.top=b+"px"}else{this._splitWidth=d.width;if(b||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+"/xPosition",this._splitLeft);b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-a.left);this.$sideNode.style.width=b+"px";this.$sideNode.style.display=
"block";this.$node.style.left=b+"px"}this._resize()},_resize:function(b,d,a){var b=b||0,h=j.bounds(this.$node.parentNode),g=j.bounds(this.$node);if(this._vertical){if(a===void 0)a=g.top,this.$node.parentNode.style.position==="relative"&&(a-=h.top);a+=g.height;this.$mainNode.style.top=a+"px"}else{if(d===void 0)d=g.left,this.$node.parentNode.style.position==="relative"&&(d-=h.left);d+=g.width;this.$mainNode.style.left=d+"px"}var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode);
e._notifyResizeListeners(e.$sideNode)},b)},_notifyResizeListeners:function(b){this.dispatchEvent({type:"resize",node:b})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(b,d){b||this._addAnimation();var a=this._splitTop,h=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")a=h=this._initialSplit}else this._closed=!0,a=h=0;this._vertical?(this.$sideNode.style.height=
a+"px",this.$node.style.top=a+"px"):(this.$sideNode.style.width=h+"px",this.$node.style.left=h+"px");this._resize(this._animationDelay,h,a);b||this._removeAnimation();d||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var g=this;window.setTimeout(function(){g._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var b=this;window.setTimeout(function(){b.$sideNode.classList.remove(b._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");
b.$mainNode.classList.remove(b._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");b.$node.classList.remove(b._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":
"splitLayoutAnimation")},_mouseDown:function(b){if(b.target===this._thumb)return j.stop(b),this._thumbDown();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),j.stop(b)},_mouseMove:function(b){if(this._tracking){var d=j.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=b.clientY;if(this._splitTop<
d.top+5)this._splitTop=d.top+5;else if(this._splitTop>d.top+d.height-5)this._splitTop=d.top+d.height-5;var a=this._splitTop;this.$node.parentNode.style.position==="relative"&&(a=this._splitTop-d.top);this.$node.style.top=a+"px"}else{this._splitLeft=b.clientX;if(this._splitLeft<d.left+5)this._splitLeft=d.left+5;else if(this._splitLeft>d.left+d.width-5)this._splitLeft=d.left+d.width-5;a=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(a=this._splitLeft-d.left);this.$node.style.left=
a+"px"}this._adjustToSplitPosition(!0);j.stop(b)}},_mouseUp:function(b){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"),j.stop(b)}};d.prototype.constructor=d;return{Splitter:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function f(f,j){this._preferences=f;this._themeData=j;var d=j.getThemeStorageInfo(),b=f.listenForChangedSettings(d.storage,2,function(d){d.key===b&&this.apply()}.bind(this))}f.prototype={_initialize:function(f,j,d){var b=d.get(f.styleset);b||(b=j.getStyles(),d.put(f.styleset,JSON.stringify(b)));(j=d.get("selected"))&&(j=JSON.parse(j));if(!j||j[f.selectedKey]===void 0)j=j||{},j[f.selectedKey]=f.defaultTheme,d.put("selected",JSON.stringify(j))},
apply:function(){this.setTheme()},getTheme:function(f){var j=this._themeData,d=j.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,j,b);var i=JSON.parse(b.get("selected")),b=JSON.parse(b.get(d.styleset)),a;if(b)for(var h=0;h<b.length;h++)if(b[h].name===i[d.selectedKey]){a=b[h];break}f({style:a,styles:b})}.bind(this))},setTheme:function(f,j){var d=this._themeData,b=d.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(i){this._initialize(b,
d,i);var a=JSON.parse(i.get("selected"));f||(f=a[b.selectedKey]);a[b.selectedKey]=f;i.put("selected",JSON.stringify(a));j?i.put(b.styleset,JSON.stringify(j)):j=JSON.parse(i.get(b.styleset));for(i=0;i<j.length;i++)if(j[i].name===a[b.selectedKey]){d.processSettings(j[i]);break}}.bind(this))},setFontSize:function(f){var j=this._themeData,d=j.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,j,b);var i=JSON.parse(b.get("selected")),a=JSON.parse(b.get(d.styleset)),
h;if(a)for(var g=0;g<a.length;g++)a[g].fontSize=f,a[g].name===i[d.selectedKey]&&(h=a[g]);b.put(d.styleset,JSON.stringify(a));j.processSettings(h)}.bind(this))}};return{ThemePreferences:f}});
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",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",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",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",
keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",
localSettingsTooltip:"Toggle whether this setting is shown in local editor settings drop down.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame","Editor preferences updated":"Editor preferences updated",
"Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:","Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color",
"Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute","Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute",
"CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/editor/eventTarget",[],function(){function f(){}f.addMixin=function(k){var j=f.prototype,d;for(d in j)j.hasOwnProperty(d)&&(k[d]=j[d])};f.prototype={addEventListener:function(f,j,d){if(!this._eventTypes)this._eventTypes={};var b=this._eventTypes[f];b||(b=this._eventTypes[f]={level:0,listeners:[]});b.listeners.push({listener:j,useCapture:d})},dispatchEvent:function(f){var j=f.type;this._dispatchEvent("pre"+j,f);this._dispatchEvent(j,f);this._dispatchEvent("post"+j,f)},_dispatchEvent:function(f,
j){var d=this._eventTypes?this._eventTypes[f]:null;if(d){var b=d.listeners;try{if(d.level++,b)for(var i=0,a=b.length;i<a;i++)if(b[i]){var h=b[i].listener;typeof h==="function"?h.call(this,j):h.handleEvent&&typeof h.handleEvent==="function"&&h.handleEvent(j)}}finally{if(d.level--,d.compact&&d.level===0){for(i=b.length-1;i>=0;i--)b[i]||b.splice(i,1);b.length===0&&delete this._eventTypes[f];d.compact=!1}}}},isListening:function(f){return!this._eventTypes?!1:this._eventTypes[f]!==void 0},removeEventListener:function(f,
j,d){if(this._eventTypes){var b=this._eventTypes[f];if(b){for(var i=b.listeners,a=0,h=i.length;a<h;a++){var g=i[a];if(g&&g.listener===j&&g.useCapture===d){b.level!==0?(i[a]=null,b.compact=!0):i.splice(a,1);break}}i.length===0&&delete this._eventTypes[f]}}}};return{EventTarget:f}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(f,k,j){function d(b){b=b||{};this._document=b.document||document}var b={};d.getTheme=function(i){var i=i||"default",a=b[i];a||(a=b[i]=new d);return a};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,a){var h=this,g=h._themeClass;h._themeClass=b;this._load(b,a,function(){h.onThemeChanged({type:"ThemeChanged",oldValue:g,newValue:h.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,a){function h(a,c,h){c&&(g.push("."+b+" ."+a+" {"),g.push("\t"+(h?"background-color":"color")+": "+c+";"),g.push("}"))}var g=[];g.push("");g.push("."+b+" {");a.fontFamily&&g.push("\tfont-family: "+a.fontFamily+";");a.fontSize&&g.push("\tfont-size: "+a.fontSize+";");a.fontSize&&g.push("\tcolor: "+a.text+";");g.push("}");g.push("."+b+".textview {");a.background&&g.push("\tbackground-color: "+a.background+";");g.push("}");h("ruler.annotations",a.annotationRuler,!0);h("ruler.lines",
a.annotationRuler,!0);h("ruler.folding",a.annotationRuler,!0);h("ruler.overview",a.overviewRuler,!0);h("rulerLines",a.lineNumber,!1);h("rulerLines.even",a.lineNumberEven,!1);h("rulerLines.odd",a.lineNumberOdd,!1);h("annotationLine.currentLine",a.currentLine,!0);h("entity-name-tag",a.keyword,!1);h("entity-other-attribute-name",a.attribute,!1);h("string-quoted",a.string,!1);h("line_caret",a.currentLine,!0);h("token_keyword",a.keyword,!1);h("token_string",a.string,!1);h("token_singleline_comment",a.comment,
!1);h("token_multiline_comment",a.comment,!1);h("token_doc_comment",a.comment,!1);h("token_doc_html_markup",a.comment,!1);return g.join("\n")},_createStyle:function(b,a,h,g){var e=this._document,b="orion-theme-"+b,c=e.getElementById(b);if(c){if(g||c.firstChild.data===a)return;c.removeChild(c.firstChild);c.appendChild(e.createTextNode(a))}else g?(c=j.createElement(e,"link"),c.rel="stylesheet",c.type="text/css",c.href=a,c.addEventListener("load",function(){h()})):(c=j.createElement(e,"style"),c.appendChild(e.createTextNode(a))),
c.id=b,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(c);g||h()},_load:function(b,a,h){if(b)if(typeof a==="string")this._createStyle(b,a,h);else if(a=a.href,a.substring(a.length-4)!==".css"&&(a+=".css"),/^\//.test(a)||/[a-zA-Z0-9]+:\/\//i.test(a)||!f.toUrl)this._createStyle(b,a,h,!0);else{var g=this;f(["text!"+a],function(a){g._createStyle(b,a,h,!1)})}else h()}};k.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function f(f){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=f;this.classString="."+f+"{ "}f.prototype.className=null;f.prototype.classString=void 0;f.prototype.style=void 0;f.prototype.closeString=" }\n";f.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:f}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(f){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=[],b=new f.ThemeClass("orionPage");
b.style.backgroundColor="#fdfdfd";b.style.width="100%";b.style.height="100%";d.push(b);b=new f.ThemeClass("topRowBanner");b.style.margin="0";b.style.border="0";b.style.backgroundColor=this.navbar;b.style.height="16px";b.style.padding="10px";b.style.paddingLeft="6px";b.style.paddingRight="2px";d.push(b);b=new f.ThemeClass("a");b.style.textDecoration="none";b.style.color=this.content;d.push(b);b=new f.ThemeClass("navlink");b.style.display="inline-block";b.style.padding="2px";b.style.color=this.content;
d.push(b);b=new f.ThemeClass("primaryNav");b.style.color=this.navtext;b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.paddingTop="0";b.style.verticalAlign="baseline";d.push(b);b=new f.ThemeClass("primaryNav a");b.style.fontSize="8pt";b.style.color=this.navtext;b.style.marginRight="6px";b.style.marginLeft="6px";b.style.verticalAlign="baseline";b.style.textDecoration="none";d.push(b);b=new f.ThemeClass("primaryNav a:hover");b.style.color="#bfbfbf";b.style.cursor="hand";b.style.color="white";
b.style.fontWeight="normal";d.push(b);for(var i in d)j+=d[i].toString();return j};k.prototype.writeLocationStyle=function(){var j="",d=[],b=new f.ThemeClass("titleArea");b.style.margin="0";b.style.paddingTop="5px";b.style.border="0";b.style.background=this.location;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.location+"), color-stop(100%,"+this.location+"))";b.style.borderBottom="1px solid "+this.location;b.style.minHeight="20px";d.push(b);b=new f.ThemeClass("breadcrumb");
b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2;";b.style.paddingTop="2px";d.push(b);b=new f.ThemeClass("a.breadcrumb:hover");b.style.textDecoration="none";b.style.borderBottom="1px dotted";b.style.color="#F58B0F";b.style.cursor="pointer";d.push(b);b=new f.ThemeClass("breadcrumbSeparator");b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2";b.style.fontWeight="bold";d.push(b);b=new f.ThemeClass("currentLocation");b.style.fontWeight="bold";b.style.fontSize=
"8pt";b.style.color="#f1f1f2";b.style.textDecoration="none";b.style.textWrap="normal";b.style.lineHeight="10pt";d.push(b);b=new f.ThemeClass("a.currentLocation:hover");b.style.fontWeight="bold";b.style.fontSize="10pt";b.style.color="#666666";b.style.textDecoration="none";b.style.borderBottom="0";d.push(b);b=new f.ThemeClass("navlinkonpage");b.style.color=this.content;d.push(b);b=new f.ThemeClass("progressPane_running");b.style.background="url(../images/progress_running_dark.gif) no-repeat center";
b.style.width="16px";b.style.height="16px";d.push(b);for(var i in d)j+=d[i].toString();return j};k.prototype.writeButtonStyle=function(){var j="",d=[],b=new f.ThemeClass("commandButton");b.style.color="#666";b.style.border="1px solid #dedede";b.style.backgroundColor="#ddd";b.style.textAlign="center";b.style.verticalAlign="baseline";b.style.cursor="pointer";b.style.display="inline-block";b.style.padding="4px 6px";b.style.borderRadius="3px";b.style.lineHeight="12px";b.style.fontSize="8pt";b.style.userSelect=
"none";d.push(b);b=new f.ThemeClass("commandButton:over");b.style.backgroundColor="#e6e6e6";b.style.border="1px solid #808080";d.push(b);b=new f.ThemeClass("commandMenu");b.style.color="#222";b.style.display="inline-block";b.style.verticalAlign="baseline";b.style.margin="0";b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.border="1px solid #dedede";b.style.backgroundColor="#efefef";b.style.cursor="pointer";b.style.borderRadius="1px";d.push(b);b=new f.ThemeClass("commandMenuItem");b.style.border=
"0";b.style.padding="0";b.style.margin="0";d.push(b);for(var i in d)j+=d[i].toString();return j};k.prototype.writeMainStyle=function(){var j="",d=[],b=new f.ThemeClass("searchbox");b.style.backgroundImage="url(../images/core_sprites.png)";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="4px -297px";b.style.width="12px";b.style.height="12px";b.style.backgroundColor=this.search;b.style.border="1px solid "+this.search;b.style.fontSize="11px";b.style.width="15em";b.style.height="16px";
b.style.borderRadius="10px";b.style.color="#999";b.style.padding="0";b.style.paddingLeft="20px";b.style.marginLeft="5px";b.style.marginTop="6px !important";b.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(b);b=new f.ThemeClass("searchbox:focus");b.style.color="white";b.style.outline="none";d.push(b);b=new f.ThemeClass("checkedRow");b.style.cssText="background-color:"+this.selection+" !important;";d.push(b);b=new f.ThemeClass("navbar-item-selected");
b.style.background=this.selection;b.style.color=this.content;d.push(b);b=new f.ThemeClass("auxpane");b.style.border="0";b.style.background=this.sidepanel;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+this.sidepanel+"), color-stop(100%,"+this.sidepanel+"))";b.style.background="-moz-linear-gradient(top, "+this.sidepanel+" 0%, "+this.sidepanel+" 100%)";d.push(b);b=new f.ThemeClass("mainpane");b.style.background=this.mainpanel;b.style.border=0;d.push(b);b=new f.ThemeClass("mainToolbar");
b.style.background=this.toolpanel;b.style.height="32px";b.style.borderBottom="1px solid #ebebeb";b.style.paddingTop="3px";d.push(b);for(var i in d)j+=d[i].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(f){f.navbar.value?(this.navbar=f.navbar.value,this.button=f.button.value,this.location=f.location.value,this.selection=
f.selection.value,this.sidepanel=f.sidepanel.value,this.mainpanel=f.mainpanel.value,this.navtext=f.navtext.value,this.search=f.search.value,this.content=f.content.value,this.toolpanel=f.toolpanel.value):(this.navbar=f.navbar,this.button=f.button,this.location=f.location,this.selection=f.selection,this.sidepanel=f.sidepanel,this.mainpanel=f.mainpanel,this.navtext=f.navtext,this.search=f.search,this.content=f.content,this.toolpanel=f.toolpanel);return this.writeNavigationStyle()+this.writeLocationStyle()+
this.writeMainStyle()+this.writeButtonStyle()};return{ThemeSheetWriter:k}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(f,k,j){function d(){}function b(){this.styles=[];var a=new d;a.name="Orion";a.navbar="#404648";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 d;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 d;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 d;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 d;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 d;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 d;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 i(){return this.styles}d.prototype.name="Orion";d.prototype.navbar="#404648";d.prototype.button="#EFEFEF";d.prototype.location="#333";d.prototype.breadcrumb=
"#3087B3";d.prototype.separator="#333";d.prototype.selection="FEC";d.prototype.sidepanel="#FBFBFB";d.prototype.mainpanel="white";d.prototype.toolpanel="white";d.prototype.navtext="#bfbfbf";d.prototype.content="#3087B3";d.prototype.search="#444";b.prototype.styles=[];b.prototype.getStyles=i;b.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion",selectedKey:"selected"}};b.prototype.getViewData=function(){var a={top:10,left:10,width:350,height:350};
a.shapes=[{type:"RECTANGLE",name:f["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:f["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:f["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:f["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:f["Selection Bar"],
x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:f.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:f["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:f.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:f.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",
order:9},{type:"TEXT",name:f.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:f["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:f.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:f["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:f["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:f["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:f["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:f["Line Color"],x1:20,y1:100,x2:140,
y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:f["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:f["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"}];for(var b=0;b<3;b++)a.shapes.push({type:"TEXT",name:f.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:f.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};b.prototype.processSettings=function(a){var b=new j.ThemeSheetWriter;(new k.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",b.getSheet(a))};return{ThemeData:b,getStyles:i}});
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","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}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(f){function k(j,d,b){this.elements=b;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);d===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),f.addAutoDismiss([this.container],this.destroy.bind(this))):j.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}k.prototype.elementNode=null;k.prototype.switchesContainer=null;k.prototype.switches=null;k.prototype.radioButtons=null;k.prototype.chosenSwitch=null;k.prototype.addElement=
function(f){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='<span class="workingSpan"><img src="'+f.image+'" id="'+f.label+'ImageNode" alt="'+f.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+f.label+'LabelNode" >'+f.label+"</span></span>";d.onmouseover=function(){document.getElementById(f.label+"ImageNode").src=f.secondaryImage;document.getElementById(f.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};
d.onmouseout=function(){document.getElementById(f.label+"ImageNode").src=f.image;document.getElementById(f.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var b=this;d.onclick=function(){b.showMedia(f)};this.elementNode.appendChild(d)};k.prototype.clearElements=function(){this.elementNode.innerHTML=""};k.prototype.showMedia=function(f){this.clearElements();this.addElement(f);var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
f.media+'" alt="'+f.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);f=document.getElementById(f.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=f.parentNode;f.className="chosenCircle"};k.prototype.createSwitch=function(f){var d;d=f?f.label+"switch":"indexSwitch";var b=document.createElement("span");b.className="workingSpan";b.innerHTML='<div class="circle" id ="'+d+'"></div>';var i=this;b.onclick=
f?function(){i.showMedia(f)}:function(){i.initialize();i.chosenSwitch.firstChild.className="circle";i.chosenSwitch=b;i.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(b);return this.radioButtons[this.radioButtons.length]=b};k.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};k.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return k});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(f,k,j,d){function b(){}b.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 b=document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var a=document.createRange();a.selectNode(b);a=a.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(a);this.$frame=b.lastChild;this.title&&j.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=j.$("#closeDialog",this.$frame);var h=this;this.$close.addEventListener("click",function(){h.hide()},!1);this.$parent=j.$(".dialogContent",this.$frame);
a=document.createRange();a.selectNode(this.$parent);b=a.createContextualFragment(this.TEMPLATE);this.messages&&j.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=j.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE?h.hide():a.keyCode===j.KEY.ENTER&&typeof h._defaultCallback==="function"&&h._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 b=this;this.buttons.forEach(function(a){var h=d.createButton(a.text,a.callback);if(a.id)h.id=a.id,b["$"+h.id]=h;if(a.isDefault)b._defaultCallback=a.callback,b._defaultButton=h;b.$buttonContainer.appendChild(h)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(c){b.$lastFocusedElement=c.target},!0);this._modalListener=function(c){var a=!j.contains(b.$frame,
c.target);if(a)for(var e=0;e<b.$$modalExclusions.length;e++)if(j.contains(b.$$modalExclusions[e],c.target)){a=!1;break}a&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),j.stop(c))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var a=this.$frameParent.childNodes,h=!1;this._addedBackdrop=[];for(var g=0;g<a.length;g++){for(var e=0;e<this.$$modalExclusions.length;e++)if(j.contains(this.$$modalExclusions[e],
a[g])){h=!0;break}!h&&a[g]!==b.$frame&&a[g].classList&&!a[g].classList.contains("tooltipContainer")&&(e=a[g],e.classList.contains("modalBackdrop")||(e.classList.add("modalBackdrop"),this._addedBackdrop.push(e)))}(a=j.lastTabbable(this.$buttonContainer)||j.lastTabbable(this.$parent))&&a.addEventListener("keydown",function(c){if(c.keyCode===j.KEY.TAB){var a=b._getFirstFocusField();a&&a!==c.target&&a.focus();j.stop(c)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},
_bindElements:function(b){for(var a=0;a<b.childNodes.length;a++){var h=b.childNodes[a];h.id&&(this["$"+h.id]=h);this._bindElements(h)}},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 b=this;this.keepAlive||
window.setTimeout(function(){b.destroy()},0)},show:function(b){typeof this._beforeShowing==="function"&&this._beforeShowing();var a=j.bounds(this.$frame),h=j.bounds(document.documentElement),g;b?(g=j.bounds(b),b=g.top+g.height+4,g=g.left+4,b+a.height>h.height&&(b=Math.max(0,h.height-a.height-4)),g+a.width>h.width&&(g=Math.max(0,h.width-a.width-4))):(g=Math.max(0,(h.width-a.width)/2),b=Math.max(0,(h.height-a.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=
g+"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(b){b.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}};b.prototype.constructor=b;return{Dialog:b}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(f,k,j,d,b){function i(a){this._displaySignOut=!0;this._init(a)}i.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,g;for(g in a)a.hasOwnProperty(g)&&b++;return b},_makeMenuItem:function(a,
b){var g=document.createElement("span");g.role="menuitem";g.tabIndex=0;var e=document.createTextNode(a);g.appendChild(e);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&g.classList.add(this._dropDownItemClass):g.classList.add("dropdownMenuItem");g.addEventListener("click",b,!1);g.addEventListener("keydown",function(c){(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)&&b()},!1);return g},_renderAuthenticatedService:function(a){var b=this,g=this.authenticatedServices[a].authService;
if(g&&g.logout&&this._displaySignOut){var e=document.createElement("li"),c=this._makeMenuItem(f["Sign Out"],function(){g.logout().then(function(){b.addUserItem(a,g,b.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var c=localStorage.length-1;c>=0;c--){var e=localStorage.key(c);e&&e.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(e)}g.getAuthForm(window.location.href).then(function(c){window.location=c})})});e.appendChild(c);this._dropdownNode.appendChild(e)}},
renderServices:function(){function a(c){g[c]||(g[c]=b.createDocumentFragment());return g[c]}var b=document,g=[],e=this._serviceRegistry;d.getPageLinksInfo(e,"orion.page.link.user").then(function(c){this._dropdown?this._dropdown.empty():this._dropdownNode&&j.empty(this._dropdownNode);c.forEach(function(c){var e=a(typeof c.category==="number"?c.category:1),g=b.createElement("li"),d=b.createElement("a");d.role="menuitem";typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):
d.classList.add("dropdownMenuItem");d.href=c.href;d.textContent=c.textContent;g.appendChild(d);e.appendChild(g);d.addEventListener("keydown",function(c){(c.keyCode===j.KEY.ENTER||c.keyCode===j.KEY.SPACE)&&d.click()},!1)}.bind(this));if(this.keyAssistFunction){var c=document.createElement("li"),d=this._makeMenuItem(f["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass==="string"?this._keyAssistClass!==""&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem");
c.appendChild(d);a(0).appendChild(c)}if(c=e.getServiceReferences("orion.page.getstarted")[0])d=c.getProperty("data"),c=document.createElement("li"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)),c.appendChild(d),a(0).appendChild(c);var i=this;g.sort(function(c,a){return c-a}).forEach(function(c,a){if(a<g.length-1&&!this._noSeparator){var e=document.createElement("li");e.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");
e.appendChild(b);c.appendChild(e)}i._dropdownNode.appendChild(c)}.bind(this));if(this.isSingleService())for(var m in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(m)&&this._renderAuthenticatedService(m,0)}.bind(this))},getStartedDialog:function(a){new b(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,g,e){e?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,
label:g,data:e}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:g,pending:this.unauthenticatedServices[a].pending}:{authService:b,label:g});this.renderServices()}};i.prototype.constructor=i;return{UserMenu:i}});
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?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(f,k,j,d,b,i){function a(a,e,c){var b="";c&&(b="^");if(b=j.parse("/"+b+a.searchStr+"/"))c=b.pattern,b=b.flags,b.indexOf("i")===-1&&!e.caseSensitive&&(b+="i"),a.regExp={pattern:c,flags:b},a.wildCard=!0}var h={ALL_FILE_TYPE:"*.*"};h.doSearch=function(a,e,c,b){if(a){var d=!0;c==="*"&&(c="");c===""&&(d=b&&b.type!==h.ALL_FILE_TYPE);if(d){c!==""&&h.addRecentSearch(e,
c,b?b.regEx:!1);var a=a.createSearchParams(c,!1,!1,b),i=h.generateSearchHref(a);h.getOpenSearchPref(e,function(c){c?window.open(i):window.location=i})}}else window.alert(f["Can't search: no search service is available"])};h.generateSearchHelper=function(g,e){var c=g.keyword,b=c,d={};g.fileType&&g.fileType!==h.ALL_FILE_TYPE&&c===""&&(b="*."+g.fileType);if(g.regEx)d.searchStr=c,a(d,g,e);else{var i=c.indexOf("*")>-1,f=c.indexOf("?")>-1;i&&(c=c.split("*").join(".*"));f&&(c=c.split("?").join("."));!i&&
!f&&!g.nameSearch?(d.searchStr=g.caseSensitive?c.split("\\").join(""):c.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=g.caseSensitive?c:c.toLowerCase(),a(d,g,e),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:g,inFileQuery:d,displayedSearchTerm:b}};h.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"};h.copySearchParams=function(a,e){var c={},b;for(b in a)if(a[b]!==void 0&&a[b]!==null&&(e||b!=="replace"))c[b]=a[b];return c};h.generateSearchHref=function(a){var e=k.toUrl("search/search.html"),a=h.copySearchParams(a,!0),c=a.resource;a.resource=void 0;return typeof a.keyword!=="undefined"?(new i(e+"#{,resource,params*}")).expand({resource:c,params:a}):
(new i(e+"#{,resource}")).expand({resource:c})};h.generateFindURLBinding=function(a,e,c,b,h){a={find:e.searchStr,regEx:e.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof b==="string"?b:void 0,atLine:typeof c==="number"?c:void 0};return h?a:","+(new i("{,params*}")).expand({params:a})};h.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)};h.replaceRegEx=function(a,e,c){return a.replace(RegExp(e.pattern,e.flags),c)};h.replaceStringLiteral=function(a,e,c){e=j.parse("/"+e+"/gim");return h.replaceRegEx(a,e,c)};h.searchOnelineLiteral=function(a,e,c){var b;b=0;for(var h=!1,d=[];;)if(b=e.indexOf(a.searchStr,b),b<0)break;else{d.push({startIndex:b,length:a.searchStrLength});h=!0;if(c)break;b+=a.searchStrLength}return h?d:null};h.findRegExp=function(a,e,c,b){if(!e)return null;
c=c||"";c+=(c.indexOf("g")===-1?"g":"")+(c.indexOf("m")===-1?"m":"");var h=null;return(h=RegExp(e,c).exec(a.substring(b)))&&{startIndex:h.index+b,length:h[0].length}};h.searchOnelineRegEx=function(a,e,c){for(var b=0,d=!1,i=[];;)if(b=h.findRegExp(e,a.regExp.pattern,a.regExp.flags,b)){i.push(b);d=!0;if(c)break;b=b.startIndex+b.length}else break;return d?i:null};h.generateNewContents=function(a,e,c,b,d,i){if(b&&e){if(!a)c.contents=[];for(var f=0;f<e.length;f++){for(var j=e[f],k=!1,t=!1,p=[],x,u=0,v=
0;v<b.children.length;v++)if(b.children[v].lineNumber-1===f){u=v;for(k=0;k<b.children[v].matches.length;k++)b.children[v+k].checked!==!1&&p.push(k);t=p.length>0;x=b.children[v].matches;k=!0;break}if(k){if(t){p=h.replaceCheckedMatches(j,d,x,p,i);j=p.replacedStr;for(k=0;k<b.children[u].matches.length;k++)b.children[u+k].newMatches=p.newMatches}else for(k=0;k<b.children[u].matches.length;k++)b.children[u+k].newMatches=b.children[u+k].matches;a?c.contents[f]=j:c.contents.push(j)}else a||c.contents.push(j)}}};
h.generateMatchContext=function(a,e,c){var b=[],h=a*2+1,d;e.length<=h?(d=0,a=e.length-1):(d=c-a,d<0?(d=0,a=d+h-1):(a=c+a,a>e.length-1&&(a=e.length-1,d=a-h+1)));for(h=d;h<=a;h++)b.push({context:e[h],current:h===c});return b};h.splitFile=function(a){for(var e=0,c=0,b=0,h=0,d=[];;){e!==-1&&e<=b&&(e=a.indexOf("\r",b));c!==-1&&c<=b&&(c=a.indexOf("\n",b));if(c===-1&&e===-1){d.push(a.substring(h));break}var i=1;e!==-1&&c!==-1?e+1===c?(i=2,b=c+1):b=(e<c?e:c)+1:b=e!==-1?e+1:c+1;d.push(a.substring(h,b-i));
h=b}return d};h.searchWithinFile=function(a,e,c,b,d,i){c=h.splitFile(c);if(d)e.contents=c;if(e){e.children=[];for(var f=b=0;f<c.length;f++){var j=c[f];if(j&&j.length>0){var k=i?j:j.toLowerCase();if(k=a.wildCard?h.searchOnelineRegEx(a,k):h.searchOnelineLiteral(a,k)){var t,p=f+1;if(d)for(var x=0;x<k.length;x++)t=x+1,t={parent:e,checked:e.checked,type:"detail",matches:k,lineNumber:p,matchNumber:t,name:j,location:e.location+"-"+p+"-"+t},e.children.push(t);else t={parent:e,context:h.generateMatchContext(2,
c,f),checked:e.checked,type:"detail",matches:k,lineNumber:p,name:j,location:e.location+"-"+p},e.children.push(t);b+=k.length}}}e.totalMatches=b}};h.replaceCheckedMatches=function(a,e,c,b,h){for(var d=0,i="",f=[],j=0;j<c.length;j++){d!==c[j].startIndex&&(i+=a.substring(d,c[j].startIndex));if(c[j].length)h=c[j].length;for(var d=!1,k=0;k<b.length;k++)if(b[k]===j){d=!0;break}d?(f.push({startIndex:i.length,length:e.length}),i+=e):(f.push({startIndex:i.length,length:h}),i+=a.substring(c[j].startIndex,c[j].startIndex+
h));d=c[j].startIndex+h}d<a.length&&(i+=a.substring(d));return{replacedStr:i,newMatches:f}};h.fullPathNameByMeta=function(a){var e=a.length,c="";if(e>0)for(e-=1;e>-1;e--)c=c+(c===""?"":"/")+a[e].Name;return c};h.path2FolderName=function(a,e,c){return a.substring(0,a.length-e.length-(c?0:1))};h._storeRecentSearch=function(a,e,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",e);c&&window.setTimeout(function(){c.dispatchEvent({type:"recentSearchesChanged"})}.bind(this),
20)})};h.addRecentSearch=function(a,e,c){typeof e==="string"&&e&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var d,b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b){for(d in b)if(b[d].name===e)return;b.length>=20&&b.splice(19,b.length-20+1)}else b=[];b.splice(0,0,{name:e,regEx:c});h._storeRecentSearch(a,b)})};h.removeRecentSearch=function(a,e,c){typeof e==="string"&&e&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var d,
b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b)for(d in b)if(b[d].name===e){b.splice(d,1);h._storeRecentSearch(a,b,c);break}})};h.getSearches=function(a,e,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(e);typeof a==="string"&&(a=JSON.parse(a));a&&c&&c(a)})};h.getMixedSearches=function(a,e,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var g=a.get("recentSearch");typeof g===
"string"&&(g=JSON.parse(g));e&&(a=a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var e=h.parseQueryStr(a.query);g.some(function(c){return e.searchStrTitle===c.name})||g.push({name:e.searchStrTitle,label:a.name})}else g.push({name:null,label:a.name,value:a.query})}));g&&b&&b(g)})};h.getOpenSearchPref=function(a,e){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(c){c=c.get("nav.config");e(c&&c["links.newtab"]!=="undefined"?
c["links.newtab"]?!0:!1:!1)})};h.setOpenSearchPref=function(a,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(c){c.put("openSearchPref",{openInNewTab:e})})};return h});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(f,k,j,d,b,i){function a(a,b,e,c){this.registry=a;this.fileClient=b;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(e);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._cancelled=!1;this.registry.getService("orion.page.message").setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}a.prototype.search=function(a){var b=this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=a;this._cancelled=!1;this._deferredArray=[];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))};a.prototype.searchName=function(a,b){if(a)this.searchHelper=d.generateSearchHelper(a,!0);if(b)this.onSearchNameComplete=b;var e=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var c=0;c<this.fileSkeleton.length;c++){var l=
this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,l,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,l,!0))if(e.push(this.fileSkeleton[c]),e.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:e.length,docs:e}})}};a.prototype.buildSkeleton=function(a,b){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=
[];var c=this;a();e.getContentTypes().then(function(a){c.contentTypesCache=a;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;b();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};a.prototype._searchCompleted=function(){console.log("Search Completed.")};a.prototype._searchFiles=function(){var a=[];if(this.fileLocations.length>0)for(var b=0;b<this.fileLocations.length;b++)a.push(this._sniffSearch(this.fileLocations[b]));return i.all(a)};a.prototype._sort=function(a){a.sort(function(a,
e){var c=a.Name&&a.Name.toLowerCase(),b=e.Name&&e.Name.toLowerCase();return c<b?-1:c>b?1:0})};a.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};a.prototype._visitRecursively=function(a){var g=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(a);var c=e.registry.getService("orion.page.progress");return(c?c.progress(e.fileClient.fetchChildren(a),
"Crawling search for children of "+a):e.fileClient.fetchChildren(a)).then(function(c){for(var a=0;a<c.length;a++)if(c[a].Directory!==void 0&&c[a].Directory===!1)if(e._searchOnName)g.push(e._buildSingleSkeleton(c[a]));else if(e._buildSkeletonOnly)g.push(e._buildSingleSkeleton(c[a]));else{if(!e._cancelled){var d=b.getFilenameContentType(c[a].Name,e.contentTypesCache);if(d&&(d["extends"]==="text/plain"||d.id==="text/plain")&&e._onFileType(d))d=e._sniffSearch(c[a]),g.push(d),e._deferredArray.push(d)}}else if(c[a].Location)if(e._cancelled)break;
else d=e._visitRecursively(c[a].ChildrenLocation),g.push(d),e._deferredArray.push(d);return i.all(g)})};a.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)};a.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)};a.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(a){a.cancel()});this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}});console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length);this.registry.getService("orion.page.message").setProgressResult({Message:f["Search cancelled by user"],
Severity:"Warning"})};a.prototype._sniffSearch=function(a){this._totalCounter++;var b=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(a),this.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(f["${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(e){b._hitOnceWithinFile(e)&&
b._reportSingleHit(a);b.registry.getService("orion.page.message").setProgressResult({Message:j.formatMessage(f["${0} files found out of ${1}"],b._hitCounter,b._totalCounter)},f.Cancel)},function(a){a&&a.message&&a.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+a.message)})};a.prototype._buildSingleSkeleton=function(a){this._totalCounter++;this.fileSkeleton.push(a);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();a=new i;a.resolve(this._totalCounter);
return a};a.prototype.constructor=a;return{SearchCrawler:a}});
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(f,k,j,d,b,i,a){function h(a){this._init(a)}h.prototype=new a.Dialog;h.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="results" style="max-height:400px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';h.prototype._init=function(a){this.title=a.title||f["Find File Named"];this.modal=!0;this.messages=f;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new j.ContentTypeRegistry(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(f["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||typeof this._searchRenderer.makeRenderFunction!==
"function")throw Error(f["Missing required argument: searchRenderer"]);this._initialize()};h.prototype._bindToDom=function(a){var e=this;e.$crawlingProgress.style.display="none";this.$fileName.setAttribute("placeholder",f.Search);this.$fileName.addEventListener("input",function(){e._time=+new Date;e._timeoutId&&clearTimeout(e._timeoutId);e._timeoutId=setTimeout(e.checkSearch.bind(e),0)},!1);this.$fileName.addEventListener("keydown",function(c){if(c.keyCode===b.KEY.ENTER){var a=b.$("a",e.$results);
a&&(b.stop(c),window.open(a.href),e.hide())}},!1);a.addEventListener("keydown",function(c){var a,g,d;if(c.keyCode===b.KEY.DOWN||c.keyCode===b.KEY.UP)a=b.$$array("a",e.$results),g=document.activeElement,d=a.indexOf(g),c.keyCode===b.KEY.DOWN?d>=0?(g.classList.remove("treeIterationCursor"),a=d<a.length-1?a[d+1]:a[0],a.focus(),a.classList.add("treeIterationCursor")):a.length>0&&(a=-1<a.length-1?a[0]:a[0],a.focus(),a.classList.add("treeIterationCursor")):d>=0?(g.classList.remove("treeIterationCursor"),
g=e.$fileName,a=d>0?a[d-1]:g,a.focus(),d>0&&a.classList.add("treeIterationCursor")):a.length>0&&(a[a.length-1].focus(),a[a.length-1].classList.add("treeIterationCursor")),b.stop(c)});a.addEventListener("mouseup",function(c){c.target.focus()},!1);setTimeout(function(){if(e._forceUseCrawler||!e._fileService.getService(e._searcher.getSearchLocation()).search){var c=e._searchOnRoot?e._searcher.getSearchRootLocation():e._searcher.getChildrenLocation(),c=new k.SearchCrawler(e._searcher.registry,e._fileService,
"",{searchOnName:!0,location:c});e._searcher.setCrawler(c);c.buildSkeleton(function(){e.$crawlingProgress.style.display="inline";e.$progress.appendChild(document.createTextNode(f["Building file skeleton..."]))},function(){e.$crawlingProgress.style.display="none";e.$progress.removeChild(e.$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()};h.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)};h.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var e=this._searcher.createSearchParams(a,this._nameSearch,this._searchOnRoot),c=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));
this.currentSearch=c;var d=document.createElement("div");d.appendChild(document.createTextNode(this._nameSearch?f["Searching..."]:i.formatMessage(f["Searching for occurrences of"],a)));b.empty(this.$results);this.$results.appendChild(d);this._searcher.search(e,!1,function(){c===this.currentSearch&&c.apply(null,arguments)}.bind(this))}};h.prototype.decorateResult=function(a){for(var e=this,a=b.$$array("a",a),c=0;c<a.length;c++){var d=a[c];d.addEventListener("mouseup",function(c){c.button===0&&!c.ctrlKey&&
!c.metaKey&&e.hide()},!1);d.addEventListener("keyup",function(c){c.keyCode===b.KEY.ENTER&&e.hide()},!1)}};h.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};h.prototype._afterHiding=function(){this._onHide&&this._onHide()};h.prototype.constructor=h;return{OpenResourceDialog:h}});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<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\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=4.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;"></div>\n<div class="layoutRight commandList pageActions" id="settingsActions"></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/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(f,k){function j(d,b,i){if(d=k.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=i=i||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=i.selectionClass;d=document.createElement("div");d.classList.add("dropDownContainer");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=d;if(b=k.node(b))this._triggerNode=
b;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!i.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(a){a.keyCode===k.KEY.ESCAPE&&this.clearPanel()}.bind(this))}f.mixin(j.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){this._dropdownMenu.style.display="";this._positionDropdown();
this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=k.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},addContent:function(d){this._dropdownMenu.innerHTML=
d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,b){b()},_positionDropdown:function(){this._dropdownMenu.style.left="";var d=k.bounds(this._dropdownMenu),b=k.bounds(this._boundingNode(this._parent));if(d.left+d.width>b.left+b.width)this._dropdownMenu.style.right=0},_boundingNode:function(d){return d.style.right!==""||d.style.position==="absolute"||!d.parentNode||!d.parentNode.style?d:this._boundingNode(d.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},
isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)k.empty(this._parent),this._parent=this.select=null}});return j});
define("orion/widgets/input/GroupedContent",["i18n!orion/widgets/nls/messages","orion/objects","orion/webui/littlelib"],function(f,k){function j(){}k.mixin(j.prototype,{templateString:'<div style="float:left;"><section><span style="color:#333;padding:15px;">'+f["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;">'+f["Related Links"]+'</span><nav><ul id="relatedLinks"></ul></nav></section></div>',
getContentPane:function(){return this.templateString}});return j});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","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}'?","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","Go Into":"Go Into","Move into the selected folder":"Move into the selected 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","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(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(f,k,j){function d(a,b,g){if(!a[b])throw b+f[" is not supported in this file system"];return a[b].apply(a,g)}function b(a,h,g,e){if(!a.readBlob)throw f["source file service does not support binary read"];if(!g.writeBlob)throw f["target file service does not support binary write"];if(h[h.length-1]!=="/")return d(a,"readBlob",[h]).then(function(c){return d(g,"writeBlob",[e,c])});var c=e.substring(0,
e.length-1),l=decodeURIComponent(c.substring(c.lastIndexOf("/")+1)),c=c.substring(0,c.lastIndexOf("/")+1);return d(g,"createFolder",[c,l]).then(function(){},function(){}).then(function(){return d(a,"fetchChildren",[h]).then(function(c){for(var d=[],h=0;h<c.length;++h){var l=c[h].Location,i=l;c[h].Directory&&(i=l.substring(0,l.length-1));i=decodeURIComponent(i.substring(i.lastIndexOf("/")+1));i=e+encodeURIComponent(i);c[h].Directory&&(i+="/");d[h]=b(a,l,g,i)}return k.all(d)})})}function i(a,b){function g(c){var a=
new k;a.reject(f["No Matching FileService for location:"]+c);return a}var e=a.getServiceReferences("orion.core.file"),c=e;if(b)for(var c=[],d=0;d<e.length;++d)b(e[d])&&c.push(e[d]);for(var i=[],m=[],r=[],q=[],s={fetchChildren:function(){var c=new k;c.resolve(q);return c},createWorkspace:function(){var c=new k;c.reject(f["no file service"]);return c},loadWorkspaces:function(){var c=new k;c.reject(f["no file service"]);return c},loadWorkspace:function(){var c=new k;window.setTimeout(function(){c.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:f["File Servers"],Location:"/",Children:q,ChildrenLocation:"/"})},100);return c},search:g,createProject:g,createFolder:g,createFile:g,deleteFile:g,moveFile:g,copyFile:g,read:g,write:g},e=0;e<c.length;++e)q[e]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[e].getProperty("top"),ChildrenLocation:c[e].getProperty("top"),Name:c[e].getProperty("Name")},d=c[e].getProperty("pattern")||".*",d[0]!=="^"&&(d="^"+d),i[e]=RegExp(d),m[e]=a.getService(c[e]),r[e]=c[e].getProperty("Name"),
c[e].getProperty("NameKey")&&c[e].getProperty("nls")&&j.getMessageBundle(c[e].getProperty("nls")).then(function(a,e){q[a].Name=e[c[a].getProperty("NameKey")];r[a]=e[c[a].getProperty("NameKey")]}.bind(this,e));this._getServiceIndex=function(c){if(c==="/")return-1;else if(!c||c.length&&c.length===0)return m[0]?0:-1;for(var a=0;a<i.length;++a)if(i[a].test(c))return a;throw f["No Matching FileService for location:"]+c;};this._getService=function(c){c=this._getServiceIndex(c);return c===-1?s:m[c]};this._getServiceName=
function(c){c=this._getServiceIndex(c);return c===-1?s.Name:r[c]};this._getServiceRootURL=function(c){c=this._getServiceIndex(c);return c===-1?s.Location:q[c].Location}}i.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,b,g,e){return d(this._getService(a),"createProject",arguments)},createFolder:function(a,b){return d(this._getService(a),"createFolder",arguments)},createFile:function(a,b){return d(this._getService(a),"createFile",arguments)},deleteFile:function(a){return d(this._getService(a),"deleteFile",arguments)},
moveFile:function(a,h,g){var e=this._getService(a),c=this._getService(h);if(e===c)return d(e,"moveFile",arguments);var i=a[a.length-1]==="/",n=h;n[n.length-1]!=="/"&&(n+="/");if(g)n+=encodeURIComponent(g);else{var f=a;i&&(f=f.substring(0,f.length-1));n+=f.substring(f.lastIndexOf("/")+1)}i&&n[n.length-1]!=="/"&&(n+="/");return b(e,a,c,n).then(function(){return d(e,"deleteFile",[a])})},copyFile:function(a,h,g){var e=this._getService(a),c=this._getService(h);if(e===c)return d(e,"copyFile",arguments);
var i=a[a.length-1]==="/",f=h;f[f.length-1]!=="/"&&(f+="/");if(g)f+=encodeURIComponent(g);else{var m=a;i&&(m=m.substring(0,m.length-1));f+=m.substring(m.lastIndexOf("/")+1)}i&&f[f.length-1]!=="/"&&(f+="/");return b(e,a,c,f)},read:function(a,b){return d(this._getService(a),"read",arguments)},write:function(a,b,g){return d(this._getService(a),"write",arguments)},remoteImport:function(a,b){return d(this._getService(a),"remoteImport",arguments)},remoteExport:function(a,b){return d(this._getService(a),
"remoteExport",arguments)},search:function(a){return d(this._getService(a.resource),"search",arguments)}};i.prototype.constructor=i;return{FileClient:i}});
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/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(f,
k,j,d,b,i,a,h,g,e,c,l,n,m,r,q,s,t,p,x,u,v,o,w,y,B,H,G,z,A,C,I){function D(c,a){if(c.getLabel)return c.getLabel();else{var e=new u;e.resolve(a.properties.name);return e}}function K(c){l.node("progressPane").setAttribute("aria-label",f["Operations - Press spacebar to show current operations"]);(c=c.getService("orion.page.progress"))&&c.init.bind(c)("progressPane")}function V(c,a){var e=c.getServiceReferences("orion.core.auth");F=[];for(var b=E.createMenuGenerator.apply(this,arguments),g=0;g<e.length;g++){var o=
e[g],d=c.getService(o);D(d,o).then(function(c){d.getKey().then(function(a){F.push(a);d.getUser().then(function(e){b.addUserItem(a,d,c,e)},function(e,g){b.addUserItem(a,d,c,g)});window.addEventListener("storage",function(){M[a]!==localStorage.getItem(a)&&(M[a]=localStorage.getItem(a),d.getUser().then(function(e){b.addUserItem(a,d,c,e)},function(){b.addUserItem(a,d,c)}))},!1)})})}}function T(c){return c}function R(c,a,e,b,g){function o(c){if(c)if(!c.visibleWhen||c.visibleWhen(a)){var e=new i.CommandInvocation(a,
a,null,c,b);return(new u).resolve([c,e])}else if(typeof g==="function")return w||(w=g()),u.when(w,function(e){if(e&&a===L&&(!c.visibleWhen||c.visibleWhen(e)))return e=new i.CommandInvocation(e,e,null,c,b),[c,e]});return(new u).resolve()}var d=arguments,v,w,l=c&&c.getServiceReferences("orion.page.link.related");l&&l.length!==0&&u.when(function(){if(v)return v;var a=c.getService("orion.core.contentTypeRegistry");a||(a=new q.ContentTypeRegistry(c),a=c.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(c){return v=
c})}(),function(){if(E.beforeGenerateRelatedLinks.apply(this,d)){for(var a=[],g=0;g<l.length;g++){var w={},f,n=l[g].getPropertyKeys();for(f=0;f<n.length;f++)w[n[f]]=l[g].getProperty(n[f]);if(w.id&&(f=f=null,e.indexOf(w.id)<0))if((w.nls&&w.nameKey||w.name)&&w.uriTemplate)f=h._createCommandOptions(w,l[g],c,v,!0),a.push(f);else if(f=b.findCommand(w.id))a.push((new u).resolve(f));else{var y=c.getServiceReferences("orion.navigate.command");for(f=0;f<y.length;f++)if(y[f].getProperty("id")===w.id){for(var w=
{},n=y[f].getPropertyKeys(),m=0;m<n.length;m++)w[n[m]]=y[f].getProperty(n[m]);f=h._createCommandOptions(w,y[f],c,v,!0);a.push(f);break}}}u.all(a,T).then(function(c){c=c.map(function(c){return c instanceof i.Command?c:new i.Command(c)}).sort(function(c,a){return c.name.localeCompare(a.name)});return u.all(c.map(o),T).then(function(c){c.forEach(function(c){c&&E.addRelatedLinkCommand(c[0],c[1])});E.afterGenerateRelatedLinks.apply(this,d)})})}})}function S(c){var a=l.node("globalActions");a&&(c.destroy(a),
c.renderCommands(a.id,a,{},{},"tool"))}function O(c){var a=window.getComputedStyle(c,null);return a===null?c:a.getPropertyValue("position")==="absolute"||!c.parentNode||c===document.body?c:O(c.parentNode)}function U(c){var a={},e=null;typeof c==="string"&&(c=l.node(c));c||(c=l.node("pageActions"));for(var b=c;b&&b.classList;){if(b.classList.contains("toolComposite")){e=b;break}b=b.parentNode}if(c.classList.contains("commandMarker"))a.commandNode=c;if(e&&(a.slideContainer=l.$(".slideParameters",e),
a.parameterArea=l.$(".parameters",e),a.dismissArea=l.$(".parametersDismiss",e),a.notifications=l.$("#notificationArea",e),e.parentNode&&(a.toolbarTarget=l.$(".toolbarTarget",e.parentNode),a.toolbarTarget)))c=l.bounds(a.toolbarTarget),b=l.bounds(O(a.toolbarTarget.parentNode)),a.toolbarTargetY=c.top-b.top,a.toolbar=e;return a}function J(c){if(c.toolbarTarget&&c.toolbarTargetY){var a=0,e;c.notifications&&c.notifications.classList.contains("slideContainerActive")&&(e=l.bounds(c.notifications),a+=e.height);
c.slideContainer&&c.slideContainer.classList.contains("slideContainerActive")&&(e=l.bounds(c.slideContainer),a+=e.height);a>0&&(a+=8);a?(c.toolbarTarget.style.top=c.toolbarTargetY+a+"px",c.toolbar.style.paddingBottom=a+"px"):c.toolbarTarget.style.top=c.toolbar.style.paddingBottom=""}}var b=function(c){var a=document.createElement("a");a.href=c;return a.href}(k.toUrl("auth/NotifyAuthentication.html")),M={},E={createMenuGenerator:C.createMenuGenerator||function(c,a){if(l.node("userMenu")){var e=l.node("userDropdown"),
b=new m.Dropdown({dropdown:e}),e=new v.UserMenu({dropdownNode:e,dropdown:b,serviceRegistry:c}),b=l.node("userTrigger");new r.Tooltip({node:b,text:f.Options,position:["below","left"]});var b=document.getElementById("userTrigger"),g=b.className;g+=" imageSprite core-sprite-silhouette";b.className=g;e.setKeyAssist(a);return e}},beforeGenerateRelatedLinks:C.beforeGenerateRelatedLinks||function(){var c=l.node("relatedLinks");l.empty(c);return!0},addRelatedLinkCommand:C.addRelatedLinkCommand||function(c,
a){var e=l.node("relatedLinks");i.createCommandMenuItem(e,c,a).classList.remove("dropdownMenuItem")},afterGenerateRelatedLinks:C.afterGenerateRelatedLinks||function(){},afterSetPageTarget:C.afterSetPageTarget||function(){},generateNavigationMenu:C.generateNavigationMenu||function(){var c=document.getElementById("centralNavigation");new r.Tooltip({node:c,text:"Navigation Menu",position:["right"]});var c=new G("primaryNav","centralNavigation"),a=new z;c.addContent(a.getContentPane())},afterGenerateBanner:C.afterGenerateBanner||
function(){}},F=[],L,Q=[],N,P=null;return{generateBanner:function(c,e,b,h,v,m,r,q){function G(){this.create();this._filterString=""}function s(c){c.registerService("orion.cm.managedservice",{updated:function(c){for(var c=c&&c["links.newtab"]!=="undefined"?c["links.newtab"]?"_blank":"_self":"_self",a=l.$$array(".targetSelector"),e=0;e<a.length;e++)a[e].target=c}},{pid:"nav.config"})}(new p.ThemePreferences(h,new x.ThemeData)).apply();var z=l.node(c);if(!z)throw f["could not find banner parent, id was "]+
c;var D=document.createRange();D.selectNode(z);D=D.createContextualFragment(y);l.processTextNodes(D,f);z.firstChild?z.insertBefore(D,z.firstChild):z.appendChild(D);z=l.node("home");z.href=k.toUrl("edit/edit.html");z.setAttribute("aria-label",f["Orion Home"]);l.node("progressPane").src=k.toUrl("images/none.png");if(z=l.node("pageToolbar"))z.classList.add("toolbarLayout"),z.innerHTML=H+j.slideoutHTMLFragment("mainToolbar");(z=l.node("closeNotifications"))&&z.setAttribute("aria-label",f["Close notification"]);
if(A.isFirefox<=17&&(z=l.node("staticBanner")))z.style.width="100%",z.style.MozBoxSizing="border-box";if(z=l.node("footer"))z.innerHTML=B,l.processTextNodes(z,f);b.setParameterCollector(new a.CommandParameterCollector(U,J));document.addEventListener("keydown",function(c){c.keyCode===l.KEY.ESCAPE&&(c=e.getService("orion.page.message"))&&c.setProgressMessage("")},!1);E.generateNavigationMenu.apply(this,arguments);var C=l.node("navigationlinks");C&&o.createPageLinks(e,"orion.page.link").then(function(c){c.forEach(function(c){var a=
document.createElement("li");a.appendChild(c);C.appendChild(a)})});if(z=l.$(".split")){var D=l.$(".sidePanelLayout"),t=l.$(".mainPanelLayout");if(D&&t)P={side:D,main:t},P.splitter=new n.Splitter({node:z,sidePanel:D,mainPanel:t,toggle:!0,closeByDefault:q}),z=new i.Command({name:f["Toggle side panel"],tooltip:f["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){P.splitter.toggleSidePanel()}}),b.addCommand(z),b.registerCommandContribution("pageActions","orion.toggleSidePane",
1,null,!0,new d.KeyBinding("o",!0)),r&&P.splitter.addResizeListener(function(c){r&&c===t&&r.resize()})}var I=!1,u=function(c,a,e){if(!I){var a=a.getService("orion.page.progress"),b=new w.OpenResourceDialog({searcher:c,progress:a,searchRenderer:c.defaultRenderer,onHide:function(){I=!1;e&&e.focus()}});window.setTimeout(function(){I=!0;b.show()},0)}},z=new i.Command({name:f["Find File Named..."],tooltip:f["Choose a file by name and open an editor on it"],id:"eclipse.openResource",callback:function(){u(v,
e,r)}});b.addCommand(z);b.registerCommandContribution("globalActions","eclipse.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));z=new i.Command({name:f["Toggle banner and footer"],tooltip:f["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var c=l.node("banner"),a=l.node("footer"),e=l.$(".content-fixedHeight");c.style.visibility==="hidden"?(c.style.visibility="visible",a.style.visibility="visible",e.classList.remove("content-fixedHeight-maximized")):(c.style.visibility=
"hidden",a.style.visibility="hidden",e.classList.add("content-fixedHeight-maximized"));r&&r.resize();return!0}});b.addCommand(z);b.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));z=new i.Command({name:f["System Configuration Details"],tooltip:f["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return k.toUrl("help/about.html")}});b.addCommand(z);b.registerCommandContribution("globalActions","orion.configDetailsPage",
100,null,!0,new d.KeyBinding(112,!0,!0));z=new i.Command({name:f["Background Operations"],tooltip:f["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return k.toUrl("operations/list.html")}});b.addCommand(z);b.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));G.prototype={create:function(){var c=this._keyAssistDiv=document.createElement("div");c.id="keyAssist";c.style.display="none";c.classList.add("keyAssistFloat");
c.setAttribute("role","menu");var a=this._keyAssistInput=document.createElement("input");a.classList.add("keyAssistInput");a.type="text";a.placeholder=f["Filter bindings"];c.appendChild(a);var e=this._keyAssistContents=document.createElement("div");e.classList.add("keyAssistContents");if(A.isIOS||A.isAndroid)e.style.overflowY="auto";c.appendChild(e);var b=this._keyAssistTable=document.createElement("table");b.tabIndex=0;b.classList.add("keyAssistList");e.appendChild(b);document.body.appendChild(c);
a.addEventListener("keydown",function(c){this._keyDown(c)}.bind(this));b.addEventListener("keydown",function(c){this._keyDown(c)}.bind(this));a.addEventListener("input",function(){this.filterChanged()}.bind(this));e.addEventListener(A.isFirefox?"DOMMouseScroll":"mousewheel",function(c){this._scrollWheel(c)}.bind(this));document.addEventListener("keydown",function(c){c.keyCode===l.KEY.ESCAPE&&this.hide()}.bind(this));l.addAutoDismiss([c],function(){this.hide()}.bind(this))},createContents:function(){l.empty(this._keyAssistTable);
this._selectedIndex=-1;this._selectedRow=null;this._idCount=this._keyAssistContents.scrollTop=0;if(r&&r.getTextView&&r.getTextView()){var c=r.getTextView(),a=c.getActions(!0).filter(function(a){return(a=c.getActionDescription(a))&&a.name});a.sort(function(a,e){return c.getActionDescription(a).name.localeCompare(c.getActionDescription(e).name)});this.createHeader(f.Editor);for(var e=function(a){return function(){c.focus();return c.invokeAction(a)}},o={},d,h=0;h<a.length;h++)for(var v=a[h],w=c.getActionDescription(v),
i=c.getKeyBindings(v),n=0;n<i.length;n++){d=i[n];var y=g.getUserKeyString(d);d.scopeName?(o[d.scopeName]||(o[d.scopeName]=[]),o[d.scopeName].push({bindingString:y,name:w.name,execute:e(v)})):this.createItem(y,w.name,e(v))}for(var m in o)if(o[m].length){this.createHeader(m);for(a=0;a<o[m].length;a++)d=o[m][a],this.createItem(d.bindingString,d.name,d.execute)}}this.createHeader(f.Global);b.showKeyBindings(this)},createItem:function(c,a,e){if(this._filterString){var b=this._filterString.toLowerCase(),
g;b!==this._filterString?(b=this._filterString,g=function(c){return c}):g=function(c){return c.toLowerCase()};if(g(a).indexOf(b)===-1&&g(c).indexOf(b)===-1&&g(this._lastHeader).indexOf(b)===-1)return}var o=this._keyAssistTable.insertRow(-1);o.id="keyAssist-keyBinding-"+this._idCount++;o.setAttribute("role","menuitem");o._execute=e;o.classList.add("keyAssistItem");o.addEventListener("click",function(c){this._selectedRow=o;this.execute();c.preventDefault()}.bind(this));e=o.insertCell(-1);e.classList.add("keyAssistName");
e.appendChild(document.createTextNode(a));e=o.insertCell(-1);e.classList.add("keyAssistAccel");e.appendChild(document.createTextNode(c))},createHeader:function(c){this._lastHeader=c;var a=this._keyAssistTable.insertRow(-1);a.classList.add("keyAssistSection");var a=a.insertCell(-1),e=document.createElement("h2");e.appendChild(document.createTextNode(c));a.appendChild(e)},execute:function(){window.setTimeout(function(){this.hide();var c=this._selectedRow;this._selectedRow=null;c&&c._execute&&c._execute()}.bind(this),
0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var c=this._keyAssistInput.value;if(this._filterString!==c)this._filterString=c,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var c=document.activeElement,a=this._keyAssistDiv,c=a===c||(a.compareDocumentPosition(c)&16)!==0;a.style.display="none";c&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();
this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},select:function(c){var a=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(a.length===0)this._selectedIndex=-1;else{var e=this._selectedIndex;e+=c?1:-1;e%=a.length;e<0&&(e=a.length-1);if(this._selectedIndex!==-1)c=a[this._selectedIndex],c.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=e;if(this._selectedIndex!==-1){this._selectedRow=c=a[this._selectedIndex];
c.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",c.id);this._keyAssistTable.focus();var a=c.getBoundingClientRect(),b=this._keyAssistContents,g=b.getBoundingClientRect();c.offsetTop<b.scrollTop?e===0?b.scrollTop=0:c.scrollIntoView(!0):a.bottom>g.bottom&&c.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())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(c){if(c.keyCode===40)this.select(!0);else if(c.keyCode===38)this.select(!1);else if(c.keyCode===13)this.execute();else return;c.preventDefault()},_scrollWheel:function(c){var a=0,a=A.isIE||A.isOpera?-c.wheelDelta:A.isFirefox?c.detail*40:-c.wheelDeltaY,e=this._keyAssistContents,b=e.scrollTop;e.scrollTop+=a;if(b!==e.scrollTop)return c.preventDefault&&
c.preventDefault(),!1}};var O=new G,M=new i.Command({name:f["Show Keys"],tooltip:f["Show a list of all the keybindings on this page"],id:"eclipse.keyAssist",callback:function(){O.isVisible()?O.hide():O.show();return!0}});b.addCommand(M);b.registerCommandContribution("globalActions","eclipse.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));z=function(){r.getTextView().setKeyBinding(new d.KeyBinding(191,!1,!0,!A.isMac,A.isMac),M.id);r.getTextView().setAction(M.id,M.callback,M)};r&&r.getTextView&&
(r.getTextView()?z():r.addEventListener("TextViewInstalled",z));S(b);V(e,M.callback);K(e);window.addEventListener("hashchange",function(){b.processURL(window.location.href)},!1);window.setTimeout(function(){s(e)},0);E.afterGenerateBanner.apply(this,arguments)},getToolbarElements:U,getMainSplitter:function(){return P},layoutToolbarElements:J,setPageTarget:function(a){var e,b,g=a.breadcrumbRootName,o=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&
!a.breadcrumbTarget&&(b=g?g+" ":"",b+=a.fileService.fileServiceName(a.target.Location),g=null),e=a.name||a.target.Name,L=a.target,R(o,a.target,Q,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(g=g||a.task||a.name),e=a.name,R(o,{NoTarget:""},Q,a.commandService,a.makeAlternate));(N=a.title)||(N=e?e+" - "+a.task:a.task);window.document.title=N;E.afterSetPageTarget.apply(this,arguments);if(e=l.node("location")){l.empty(e);var d=o&&new I.FileClient(o),o=a.breadcrumbTarget||a.target,d=d&&o&&o.Location?
d.fileServiceRootURL(o.Location):null;new c.BreadCrumbs({container:e,resource:o,rootSegmentName:g,workspaceRootSegmentName:b,workspaceRootURL:d,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(c){if(N)N.charAt(0)==="*"&&!c&&(N=N.substring(1)),c&&N.charAt(0)!=="*"&&(N="*"+N),window.document.title=N;var a=l.node("dirty");if(a)a.textContent=c?"*":""},setPageCommandExclusions:function(c){Q=c},notifyAuthenticationSite:b}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(f){return{detectValidURL:function(k){for(var j=/\[([^\]]*)\]\(([^\)]+)\)/g,d=j.exec(k),b=[],i=0;d;){if(d.length===3&&d[2].length>0){var a=new URL(d[2]);a.protocol!==":"&&f.validateURLScheme(a.href)&&(d.index>i&&b.push({segmentStr:k.substring(i,d.index)}),b.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),i=d.index+d[0].length)}d=j.exec(k)}if(i===0)return null;i<k.length-1&&b.push({segmentStr:k.substring(i)});return b},processURLSegments:function(f,
j){j.forEach(function(d){if(d.urlStr){var b=document.createElement("a");b.href=d.urlStr;b.appendChild(document.createTextNode(d.segmentStr))}else b=document.createElement("span"),b.textContent=d.segmentStr;f.appendChild(b)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(f,k,j,d){function b(a,b,g,e,c){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this._operationsClient=b;this.notificationContainerDomId=c;this.domId=g;this.progressDomId=e||g;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var i;b.prototype={_init:function(){var a=k.node("closeNotifications");if(a&&
!this._hookedClose){a.style.cursor="pointer";this._hookedClose=!0;var b=k.node(this.notificationContainerDomId);k.addAutoDismiss([b],function(){this._clickToDisMiss&&this.close()}.bind(this));a.addEventListener("click",function(){this.close()}.bind(this));b.addEventListener("click",function(a){a&&a.target&&a.target.nodeName.toLowerCase()==="a"&&(a=k.$$("a",b))&&a.length&&a.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);this.setProgressMessage("");var a=k.node("closeNotifications");
if(this._cancelMsg&&this._cancelFunc&&a)a.innerHTML="",a.classList.remove("cancelButton"),a.classList.add("dismissButton"),a.classList.add("core-sprite-close"),a.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=j.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(a,b,g){this._init();this.currentMessage=a;var e=k.node(this.domId);if(typeof g==="boolean"){var c=
e.getAttribute("aria-live");e.setAttribute("aria-live",g?"polite":"off");window.setTimeout(function(){a===this.currentMessage&&(k.empty(e),e.appendChild(document.createTextNode(a)),window.setTimeout(function(){e.setAttribute("aria-live",c)},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._clickToDisMiss=
!0;this.currentMessage=a;this._init();var b=a.responseText||a.message||a;if(typeof b==="string")try{b=JSON.parse(b)}catch(g){}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._clickToDisMiss=!1;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 g=k.node(this.progressDomId);k.empty(g);g.appendChild(b);g.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")},setCancelFunction:function(a){this._cancelFunc=a},setProgressResult:function(a,b){this._clickToDisMiss=!1;this._cancelMsg=b;this.currentMessage=a;var g=a.responseText||a;if(typeof g==="string")try{g=JSON.parse(g)}catch(e){}this._init();var c=g.Message||g.toString(),i=f.UnknownError,n="core-sprite-information",m="progressNormal",j=document.createElement("span");j.classList.add("imageSprite");j.classList.add("progressIcon");
var q=[];if(g.Severity)switch(g.Severity){case "Warning":i=f.UnknownWarning;n="core-sprite-warning";m="progressWarning";q.push("progressInfo");q.push("progressError");q.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":n="core-sprite-error";m="progressError";q.push("progressWarning");q.push("progressInfo");q.push("progressNormal");this._clickToDisMiss=!0;break;default:m="progressNormal",q.push("progressWarning"),q.push("progressError"),q.push("progressNormal")}q.push("notificationHide");
j.classList.add(n);var s=k.node(this.progressDomId),n=k.node(this.notificationContainerDomId);k.empty(s);s.appendChild(j);c===Object.prototype.toString()&&(c=i);if(g.HTML)g=document.createElement("span"),g.innerHTML=c,s.appendChild(g);else{if(i=d.detectValidURL(c))c=document.createDocumentFragment(),d.processURLSegments(c,i),Array.prototype.forEach.call(k.$$("a",c),function(c){c.target="_blank"});else{if(g.Severity!=="Warning"&&g.Severity!=="Error"&&!b)this._timer&&window.clearTimeout(this._timer),
this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3);c=document.createTextNode(c)}s.appendChild(c)}if(m&&this.progressDomId!==this.domId){n.classList.add(m);for(m=0;m<q.length;m++)n.classList.remove(q[m])}n.classList.add("notificationShow");if((q=k.node("closeNotifications"))&&this._cancelMsg)q.classList.add("cancelButton"),q.classList.remove("dismissButton"),q.classList.remove("core-sprite-close"),q.classList.remove("imageSprite"),q.innerHTML=this._cancelMsg},
showWhile:function(a,b){var g=this;if(b){g.setProgressMessage(b);var e=function(){b===g.currentMessage&&g.setProgressMessage("")};a.then(e,e)}return a},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(a,b){return new i(this,++this._lastProgressId,a,b)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var a="",b=!0,g;for(g in this._progressMonitors)this._progressMonitors[g].status&&(b||(a+=", "),a+=this._progressMonitors[g].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()}};b.prototype.constructor=b;i=function(a,b,g,e){this.statusService=a;this.progressId=
b;if(g){this.deferred=g;this.begin(e);var c=this;g.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};i.prototype.begin=function(a){this.status=a;this.statusService._beginProgressMonitor(this)};i.prototype.done=function(a){this.status=a;this.statusService._doneProgressMonitor(this)};i.prototype.worked=function(a){this.status=a;this.statusService._workedProgressMonitor(this)};i.prototype.constructor=i;return{StatusReportingService:b,ProgressMonitor:i}});
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(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(f,k,j,d){function b(){}b.prototype={_initialize:function(b,a,h,g,e){this._tooltip=new d.Tooltip({node:b,hideDelay:e||0,afterShowing:this._afterShowingFunction(a).bind(this),afterHiding:h,trigger:g?g:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&j.processTextNodes(b,f);this.$parent.appendChild(b);var c=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===j.KEY.ESCAPE&&c.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var a=0;a<b.childNodes.length;a++){var d=b.childNodes[a];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var a=
j.firstTabbable(this.$parent);a&&a.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};b.prototype.constructor=b;return{PopupDialog:b}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(f,k,j,d){var b={};(function(){var i=!1;b.updateNavTools=function(a,b,g,e,c,d){var n=j.node(e);if(n)b.destroy(n);else throw f["could not find toolbar "]+e;b.renderCommands(e,n,d,g,"button");if(c&&(e=j.node(c)))b.destroy(e),b.renderCommands(c,e,null,g,"button");i||(i=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=j.node(c);
e&&(b.destroy(e),b.renderCommands(c,e,a.selections,g,"button"))}))};b.createOperationsCommands=function(a,b,g){function e(c){return!c.operation||!c.operation.type?!1:c.operation.type==="loadstart"||c.operation.type==="progress"}var c=new d.Command({name:f["Remove Completed"],tooltip:f["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){g.removeCompletedOperations().then(function(){b.loadOperations.bind(b)()})},visibleWhen:function(){return!0}});a.addCommand(c);
c=new d.Command({name:f.Remove,tooltip:f["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=0;a<c.length;a++){var e=c[a];g.removeOperation.bind(g)(e.Location).then(function(){b.loadOperations.bind(b)()},function(){b.loadOperations.bind(b)()})}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return!e(c);for(var a in c)if(e(c[a]))return!1;return!0}});a.addCommand(c);
c=new d.Command({name:f.Cancel,tooltip:f["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(c){for(var c=Array.isArray(c.items)?c.items:[c.items],a=0;a<c.length;a++){var e=c[a];e.deferred&&e.deferred.cancel()}},visibleWhen:function(c){if(!Array.isArray(c)||c.length===0)return e(c)&&(c.operation&&c.operation.cancelable?!0:!1);for(var a in c)if(!e(c[a])||!c[a].operation||!c[a].operation.cancelable)return!1;return!0}});a.addCommand(c)}})();
return b});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(f,k,j,d,b){function i(a){this._options=a}i.prototype=new d.PopupDialog;i.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>';i.prototype._init=
function(a){this._myOperations=[];this._operationsDeferreds=[];this._commandService=a.commandRegistry;b.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(a.triggerNode)};i.prototype._bindToDom=function(){this.$allOperationsLink.href=k.toUrl("operations/list.html");this._setOperationsVisibility()};i.prototype.setOperations=function(a,b){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(a)for(var g in a)this._myOperations.push(a[g]),this._operationsDeferreds.push(b[g]);this._renderOperations()};i.prototype.parseProgressResult=function(a){if(!a)return{};a=a.responseText||a;try{a=JSON.parse(a)}catch(b){}var g={Message:a.Message||a,Severity:a.Severity};if(a.DetailedMessage&&a.DetailedMessage!==g.Message)g.DetailedMessage=a.DetailedMessage;return g};i.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};i.prototype._renderOperationsTable=function(a,b,g){j.empty(a);for(var e=0;e<b.length;e++){var c=b[e],d=document.createElement("tr"),i=document.createElement("td");i.style.paddingLeft="5px";i.style.paddingRight="5px";i.textContent=c.Name;d.appendChild(i);var m=document.createElement("div");i.appendChild(m);i=document.createElement("span");i.style.paddingRight="5px";i.classList.add("imageSprite");switch(c.type){case "Warning":i.classList.add("core-sprite-warning");i.setAttribute("aria-label",
f["Operation resulted in a warning."]);break;case "error":i.classList.add("core-sprite-error");i.setAttribute("aria-label",f["Operation resulted in an error."]);break;case "loadstart":case "progress":i.classList.add("core-sprite-start");i.setAttribute("aria-label",f["Operation is running."]);break;case "abort":i.classList.add("core-sprite-stop");i.setAttribute("aria-label",f["Operation is canceled."]);break;case "load":case "loadend":i.classList.add("core-sprite-ok"),i.setAttribute("aria-label","Operation ok.")}m.appendChild(i);
i=document.createElement("span");i.classList.add("operationStatus");i.textContent=c.Name;m.appendChild(i);if(c.error){var r=c.error.Message||c.error;c.error.DetailedMessage&&c.error.DetailedMessage!==""&&(r+=": "+c.error.DetailedMessage);i.textContent=r;i.classList.remove("operationStatus");i.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",m,{operation:c,deferred:g[e]},this,"tool");a.appendChild(d)}this._setOperationsVisibility()};i.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"};i.prototype.constructor=i;return{OperationsDialog:i}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(f,k,j,d,b){function i(a,g){if(!this._progressPane){this._progressPane=d.node(a);this._operationsDialog=new b.OperationsDialog({triggerNode:this._progressPane,commandRegistry:g});var e=this;this._progressPane.addEventListener("keydown",function(c){(c.charOrCode===" "||c.keyCode===d.KEY.ENTER)&&e._operationsDialog.show()})}}function a(a,b,e,c){this._serviceRegistry=
a;this._serviceRegistration=a.registerService("orion.page.progress",this);this._commandRegistry=e;this._operationsClient=b;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}i.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 e=
{},c;for(c in a)a[c].progressMonitor||(e[c]=a[c]);if(this._isEmpty(e))this._switchIconTo("progressPane_empty"),this._progressPane.title=f.Operations,this._progressPane.alt=f.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var d="";for(c in e){var i=e[c];if(i.type&&(i.type==="loadstart"||i.type==="progress")){d="running";break}}switch(d){case "running":this._progressPane.title=f["Operations running"];this._progressPane.alt=f["Operations running"];
this._progressPane.setAttribute("aria-valuetext",f["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=f["Some operations finished with warning"];this._progressPane.alt=f["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",f["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=f["Some operations finished with error"];this._progressPane.alt=
f["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",f["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=f.Operations,this._progressPane.alt=f.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(e,b)},_isEmpty:function(a){for(var b in a)return!1;return!0}};
i.prototype.constructon=i;a.prototype={init:function(a){if(!this._progressMonitorClass)this._progressMonitorTool=new i(a,this._commandRegistry)},progress:function(a,b,e){var c=this,d=this._operationsIndex++;!e&&this._progressMonitorClass&&(e=new this._progressMonitorClass,e.begin(b));a.then(function(){if(c._operations[d]){var i=c._operations[d];if(b)i.Name=b;c._lastOperation=i;i.type="loadend";if(e)i.progressMonitor=e;c.writeOperation.bind(c)(d,i,a);i.Location||c._removeOperationFromTheList.bind(c)(d)}},
function(i){if(c._operations[d]){var f=c._operations[d];if(b)f.Name=b;if(e)f.progressMonitor=e;c._lastOperation=f;f.type=i.canceled?"abort":"error";f.error=i;c.writeOperation.bind(c)(d,f,a);f.Location||c._removeOperationFromTheList.bind(c)(d)}},function(i){if(b)i.Name=b;if(e)i.progressMonitor=e;c.writeOperation.bind(c)(d,i,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 e=this;a.then(function(){e._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(c){e.setProgressResult.bind(e)(c);
return c});return this.progress(a,b)},writeOperation:function(a,b,e){this._operations[a]=b;this._operationDeferrds[a]=e;b.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(c){c.put(b.Location,{Name:b.Name,expires:b.expires})});b.progressMonitor?b.progressMonitor.progress(b.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};a.prototype.constructor=a;return{ProgressService:a}});
define("orion/dialogs",[],function(){function f(f){this._serviceRegistry=f;this._serviceRegistration=f.registerService("orion.page.dialog",this)}f.prototype={confirm:function(f,j){j(window.confirm(f))},openFiles:function(){}};f.prototype.constructor=f;return{DialogService:f}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(f){function k(j,d){d||(d="orion.page.selection");this._serviceRegistry=j;f.attach(this);this._serviceRegistration=j.registerService(d,this);this._selections=null}k.prototype={getSelection:function(f){var d=this._getSingleSelection();typeof f==="function"&&f(d);return d},getSelections:function(f){var d=Array.isArray(this._selections)?this._selections.slice():[];typeof f==="function"&&f(d);return d},_getSingleSelection:function(){return this._selections&&
this._selections.length>0?this._selections[0]:null},setSelections:function(f){var d=this._selections;this._selections=Array.isArray(f)?f.length>0?f.slice():null:f?[f]:null;d!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};k.prototype.constructor=k;return{Selection:k}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(f,k){function j(a,b,g){return a[b].apply(a,g)}function d(a){this._location=a}function b(){var a=new k;a.reject(f["No Matching OperationService for location:"]+this._location);return a}function i(a){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=a.getService("orion.core.preference");for(var b=a.getServiceReferences("orion.core.operation"),
g=0;g<b.length;g++){var e=a.getService(b[g]);this._services[g]=e;e=b[g].getProperty("pattern")||".*";e[0]!=="^"&&(e="^"+e);this._patterns[g]=RegExp(e)}this._getService=function(c){if(!c)return this._services[0];for(var a=0;a<this._patterns.length;++a)if(this._patterns[a].test(c))return this._services[a];this._operations.remove(c);return new d(c)}}d.prototype={getOperation:b,getOperations:b,removeCompletedOperations:b,removeOperation:b,cancelOperation:b};d.prototype.constructor=d;i.prototype={getOperations:function(){var a=
new k;if(this._operations)return a.resolve(this._operations),a;var b=this;this._preferenceService.getPreferences("/operations").then(function(g){b._operations=g;a.resolve(b._operations)});return a},getOperation:function(a){return j(this._getService(a),"getOperation",arguments)},removeCompletedOperations:function(){for(var a=[],b=this,g=0;g<this._services.length;g++){var e=this._patterns[g],c=new k;a[g]=c.promise;j(this._services[g],"removeCompletedOperations").then(function(c){return function(a){Array.isArray(a)&&
b.getOperations.bind(b)().then(function(b){for(var g=b.keys(),d=0;d<g.length;d++){var h=g[d];e.test(h)&&a.indexOf(h)<0&&b.remove(h)}c.resolve()})}}(c),function(c){return function(a){c.reject(a)}}(c))}return k.all(a)},removeOperation:function(a){var b=this;return j(this._getService(a),"removeOperation",arguments).then(function(){b.getOperations.bind(b)().then(function(b){b.remove(a)})},function(a){return a},function(a){return a})}};i.prototype.constructor=i;return{OperationsClient:i}});
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.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button 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","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(f,k){function j(d){this._init(d)}j.prototype={_init:function(d){var b=d.parent,i=this,b=k.node(b);if(!b)throw f["no parent"];if(!d.model)throw f["no tree model"];if(!d.renderer)throw f["no renderer"];this._parent=b;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(a){i._showRoot?(a._depth=0,i._generate([a],0)):i._treeModel.getChildren(a,function(a){i.destroyed||i._generate(a,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,b){k.empty(this._parent);
var i=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(i);var a=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(a);a.id=this._id;this._tableStyle&&a.classList.add(this._tableStyle);this._renderer.initTable(a,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+"tbody";d.length===
0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,b);a.appendChild(this._bodyElement);i.appendChild(a);this._parent.appendChild(i);this._rowsChanged()},_generateChildren:function(d,b,i){for(var a=0;a<d.length;a++){var h=document.createElement(this._tableRowElement);h.id=this._treeModel.getId(d[a]);this._renderer.rowCallback&&this._renderer.rowCallback(h);h._depth=b;h._item=d[a];this._renderer.render(d[a],h);h.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*b+"px";i?(this._bodyElement.insertBefore(h,i.nextSibling),i&&(i=h)):this._bodyElement.appendChild(h)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,b,i){var a=this._treeModel.getId(d),h;if(a===this._id)this._removeChildRows(a),this._generateChildren(b,0),this._rowsChanged();else{var g=k.node(a);g?(g._item=d,g&&(i||g._expanded)?(this._removeChildRows(a),this._renderer.updateExpandVisuals(g,
!0),b?(g._expanded=!0,this._generateChildren(b,g._depth+1,g),this._rowsChanged()):(h=this,b=this._treeModel.getChildren(g._item,function(a){if(!h.destroyed&&!g._expanded)g._expanded=!0,h._generateChildren(a,g._depth+1,g),h._rowsChanged()}))):this._renderer.updateExpandVisuals(g,!1)):console.log(f["could not find table row "]+a)}},getItem:function(d){var b=k.node(d);return b&&b._item?b._item:d},toggle:function(d){var b=k.node(d);b&&(b._expanded?(this.collapse(d),this._renderer.updateExpandVisuals(b,
!1)):(this.expand(d),this._renderer.updateExpandVisuals(b,!0)))},isExpanded:function(d){d=typeof d==="string"?d:this._treeModel.getId(d);return(d=k.node(d))?d._expanded:!1},expand:function(d,b,i){var d=typeof d==="string"?d:this._treeModel.getId(d),a=k.node(d);if(a&&!a._expanded){var h=this;this._renderer.updateExpandVisuals(a,!0);this._treeModel.getChildren(a._item,function(g){if(!h.destroyed){if(!a._expanded)a._expanded=!0,h._generateChildren(g,a._depth+1,a),h._rowsChanged();b&&b.apply(h,i)}})}},
_removeChildRows:function(d){for(var b=d===this._id,i=!1,a=-1,h=[],g=k.$$array(".treeTableRow",this._parent),e=0;e<g.length;e++){var c=g[e];if(i)break;if(b)c._depth>a?h.push(c):i=!0;else if(c.id===d)b=!0,a=c._depth}for(d=0;d<h.length;d++)b=h[d],b.parentNode.removeChild(b)},collapse:function(d){var d=typeof d==="string"?d:this._treeModel.getId(d),b=k.node(d);if(b){if(!b._expanded)return;b._expanded=!1;this._renderer.updateExpandVisuals(b,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&
this._onCollapse(b._item)}};j.prototype.constructor=j;return{TableTree:j}});
define("orion/treeModelIterator",[],function(){var f={};f.TreeModelIterator=function(){function f(j,d){this.firstLevelChildren=j;this.reset();this._init(d)}f.prototype={_init:function(f){if(f)this.isExpanded=f.isExpanded,this.isExpandable=f.isExpandable,this.forceExpandFunc=f.forceExpandFunc,this.getChildrenFunc=f.getChildrenFunc},topLevel:function(f){return f.parent?f.parent===this.root:!0},_getChildren:function(f){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(f):f?f.children:
null},_expanded:function(f){if(!f)return!0;var d=this._getChildren(f),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(f));return d},_expandable:function(f){return!f?!0:this.isExpandable?this.isExpandable(f):!1},_diveIn:function(f){return this._expanded(f)?(this.setCursor(this._getChildren(f)[0]),this.cursor()):null},_drillToLast:function(f){return this._expanded(f)?(f=this._getChildren(f),this._drillToLast(f[f.length-1])):f},_forward:function(f){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(f&&this._expandable(this._cursor)&&this.forceExpandFunc){var b=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&b.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(f){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(f&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var b=this;return this.forceExpandFunc(d,"last",function(d){d&&
b.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(f,d){for(var b=this.topLevel(f),i=this._getChildren(f.parent),i=b?this.firstLevelChildren:i,a=0;a<i.length;a++)if(i[a]===f)return a===0&&!d?b?null:f.parent:a===i.length-1&&d?b?null:this._findSibling(f.parent,d):d?i[a+1]:i[a-1];return null},_inParentChain:function(f,d){for(var b=f.parent;b;){if(b===d)return!0;b=b.parent}return!1},_getTopLevelParent:function(f){if(this.topLevel(f))return f;for(f=f.parent;f;){if(this.topLevel(f))return f;
f=f.parent}return null},_onCollapse:function(f){return this._expanded(f.parent)?f:this._onCollapse(f.parent)},_scan:function(f,d,b){this.setCursor(d);var i=[];for(i.push(d);;){if(this.iterate(f))i.push(this.cursor());else break;if(b===this.cursor())return i}return null},setCursor:function(f){this._prevCursor=this._cursor;this._cursor=f},setTree:function(f){this.firstLevelChildren=f;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(f,d){var b=this.cursor(),
i=this._scan(!0,f,d);i||(i=this._scan(!1,f,d));this.setCursor(b);return i},iterate:function(f,d){return f?this._forward(d):this._backward(d)},iterateOnTop:function(f,d){var b=this._findSibling(this._getTopLevelParent(this.cursor()),f);b?this.setCursor(b):d&&this.firstLevelChildren.length>0&&this.setCursor(f?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(f){if(!this._cursor)return null;return this._inParentChain(this._cursor,f)?(this.setCursor(f),
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 f}();return f});
define("orion/explorers/explorerNavHandler",["i18n!orion/nls/messages","orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(f,k,j,d){var f={},b=navigator.userAgent.indexOf("iPad")!==-1,i=window.navigator.platform.indexOf("Mac")!==-1;f.ExplorerNavHandler=function(){function a(a,b,e){this.explorer=a;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;a=this._getEventListeningDiv();a.tabIndex=0;a.classList.add("selectionModelContainer");
var c=this;this._modelIterator=new j.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,e,b){return c.explorer.forceExpandFunc(a,e,b)}:void 0});this._init(e);(!e||e.setFocus!==!1)&&a.focus();e=function(a){if(d.isFormElement(a.target))return!0;if(c.explorer.preventDefaultFunc&&
c.explorer.preventDefaultFunc(a,c._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return c.onDownArrow(a);else if(a.keyCode===k.KEY.UP)return c.onUpArrow(a);else if(a.keyCode===k.KEY.RIGHT)return c.onRightArrow(a);else if(a.keyCode===k.KEY.LEFT)return c.onLeftArrow(a);else if(a.keyCode===k.KEY.SPACE)return c.onSpace(a);else if(a.keyCode===k.KEY.ENTER)return c.onEnter(a)};a.addEventListener("keydown",e,!1);this._listeners.push({type:"keydown",listener:e});e=function(){if(c.explorer.onFocus)c.explorer.onFocus(!1);
else c.toggleCursor(null,!1)};a.addEventListener("blur",e,!1);this._listeners.push({type:"blur",listener:e});e=function(){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};a.addEventListener("focus",e,!1);this._listeners.push({type:"focus",listener:e});this._parentDiv=a}a.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_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 i?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 b=this;this.explorer.selection&&this.explorer.selection.getSelections(function(e){b._clearSelection();for(var c=0;c<e.length;c++)b._selections.push(e[c]);b._selections.length>0?b.cursorOn(b._selections[0],
!0,!1,a):b.cursorOn();if(!(b._shiftSelectionAnchor&&b._inSelection(b._shiftSelectionAnchor)>=0))b._shiftSelectionAnchor=null})},refreshModel:function(a,b,e,c){this._currentColumn=0;this.topIterationNodes=[];this.model=b;this._navDict=a;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(e)this.topIterationNodes=e;this._modelIterator.setTree(this.topIterationNodes);!c&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(a){for(var a=this.model.getId(a),b=0;b<this._selections.length;b++)if(a===this.model.getId(this._selections[b]))return b;return-1},_clearSelection:function(a){if(a)for(a=0;a<this._selections.length;a++)this._checkRow(this._selections[a],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(a){if(this._selectionPolicy!==
a)this._selectionPolicy=a,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(a,b,e){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(a,!0);else if(this._isRowSelectable(a)){!b||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(a,!1),this._selections.push(a),this._lastSelection=a):(b=this._inSelection(a),b>=0?(this._checkRow(a,!0),this._selections.splice(b,1)):(this._checkRow(a,
!1),this._selections.push(a),this._lastSelection=a));if(e)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(a,b){a||(a=this.currentModel());var e=this._getGridChildren(a);if(e&&e.length>1||b===0&&e){b!==0&&this.toggleCursor(a,!1);var c=this._currentColumn,d=!0;c+=b;c<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?a=this.currentModel():d=!1),
c=d?e.length-1:this._currentColumn):c>=e.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?a=this.currentModel():d=!1),c=d?0:this._currentColumn);this._currentColumn=c;b!==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 b=
this._parentDiv,e;a&&a!==b&&(e=a.getAttribute("role"))!=="grid"&&e!=="tree"&&e!=="treegrid";)a=a.parentNode;return a===b?null:a},toggleCursor:function(a,b){var e=this.getRowDiv(a),c=this.getCurrentGrid(a);c?(e&&(b?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),c.domNode&&(e=this.getAriaContainerElement(c.domNode),b?(c.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):
e&&(b?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(a,b,e,c){var d,i;if(a||b){if(i===this._modelIterator.cursor())return;d=this._modelIterator.cursor();i=a;this._modelIterator.setCursor(i)}else d=this._modelIterator.prevCursor(),i=this._modelIterator.cursor();if(d!==i||b)if(this.toggleCursor(d,!1),!b||i){this.moveColumn(null,0);this.toggleCursor(i,!0);if((a=this.getRowDiv())&&
!c){for(c=a.parentNode;c;){b=window.getComputedStyle(c,null);if(!b)break;b=b.getPropertyValue("overflow-y");if(b==="hidden"||b==="auto"||b==="scroll")break;c=c.parentNode}if(!c)c=document.body;b=!0;a.offsetTop<=c.scrollTop?(b=!1,e===void 0&&(e=!1)):a.offsetTop+a.offsetHeight>=c.scrollTop+c.clientHeight&&(b=!1,e===void 0&&(e=!0));b||a.scrollIntoView(!e)}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,i)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var a=
[],b=0;b<this._selections.length;b++)a.push(this.model.getId(this._selections[b]));return a},getRowDiv:function(a){a=a?a:this._modelIterator.cursor();if(!a)return null;var a=this.model.getId(a),b=this._navDict.getValue(a);return b&&b.rowDomNode?b.rowDomNode:k.node(a)},iterate:function(a,b,e){this.topIterationNodes.length!==0&&this._modelIterator.iterate(a,b)&&(this.cursorOn(null,!1,a),e&&(a=this._inSelection(this._modelIterator.prevCursor()),b=this._inSelection(this._modelIterator.cursor()),a>=0&&
b>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)))},_checkRow:function(a,b){if(this.explorer.renderer._useCheckboxSelection){var e=this.getRowDiv(a);if(e){var c=k.node(this.explorer.renderer.getCheckBoxId(e.id)),d=b?!c.checked:!0;if(d!==c.checked)this.explorer.renderer.onCheck(e,c,d,!0)}}else this._select(a,b)},_select:function(a){a||(a=this._modelIterator.cursor());var b=this.getRowDiv(a);b&&(this._inSelection(a)<0?b.classList.add("checkedRow"):
b.classList.remove("checkedRow"))},_onModelGrid:function(a,b){var e=this._getGridChildren(a);if(e)for(var c=0;c<e.length;c++)if(b.target===e[c].domNode)return!0;return!1},onClick:function(a,g){var e=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(a)));if(g.target!==e&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(a,g)))if(this.cursorOn(a,!0,!1,!0),b)this.setSelection(a,!0);else if(this._ctrlKeyOn(g))this.setSelection(a,!0,!0);else if(g.shiftKey&&this._shiftSelectionAnchor){if(e=
this._modelIterator.scan(this._shiftSelectionAnchor,a)){this._clearSelection(!0);for(var c=0;c<e.length;c++)this.setSelection(e[c],!0)}}else this.setSelection(a,!1,!0)},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,!0);a.preventDefault();return!1},onDownArrow:function(a){this.iterate(!0,!1,a.shiftKey);!this._ctrlKeyOn(a)&&!a.shiftKey&&this.setSelection(this.currentModel(),
!1,!0);a.preventDefault();return!1},_shouldMoveColumn:function(a){var b=this.currentModel(),e=this._getGridChildren(b);return e&&e.length>1?this.isExpandable(b)?this._ctrlKeyOn(a):!0:!1},onLeftArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,-1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),a.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&
typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(b.parent),this.setSelection(b.parent,!1,!0))},onRightArrow:function(a){if(this._shouldMoveColumn(a))return this.moveColumn(null,1),a.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),a.preventDefault(),!1},_isRowSelectable:function(a){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(a):!0},onSpace:function(a){this.setSelection(this.currentModel(),
!0,!0);a.preventDefault()},onEnter:function(a){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if(typeof b.onClick==="function")b.onClick();else typeof b.widget.focus==="function"&&b.widget.focus();else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(a),!1,!1,!1,0,null);b.domNode.dispatchEvent(e)}else if(this.explorer.renderer.getRowActionElement&&(b=this._modelIterator.cursor()))if(b=this.explorer.renderer.getRowActionElement(this.model.getId(b)),
b.href)this._ctrlKeyOn(a)?window.open(b.href):window.location.href=b.href}};return a}();f.ExplorerNavDict=function(){function a(a){this._dict={};this._model=a}a.prototype={addRow:function(a,b){this._dict[this._model.getId(a)]={model:a,rowDomNode:b}},getValue:function(a){return this._dict[a]},getGridNavHolder:function(a,b){if(!a)return null;var e=this._model.getId(a);if(this._dict[e]){if(!this._dict[e].gridChildren&&b)this._dict[e].gridChildren=[];return this._dict[e].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 f});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands,orion/commandRegistry".split(","),function(f,k,j,d,b,i){var a={};a.Explorer=function(){function a(b,e,c,d){this.registry=b;this.renderer=c;this.selection=e;this.commandService=d;this.myTree=null}a.prototype={destroy:function(){this.model&&this.model.destroy();this.myTree&&this.myTree.destroy();this.destroyed=!0},changedItem:function(a,e){this.myTree&&
this.myTree.refresh.bind(this.myTree)(a,e,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceHolder:function(a,e,c){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),c=document.createElement("span"),c.id=e+"placeHolderRow",a.appendChild(c),{tempNode:c,refNode:c};if(a){c=document.createElement("tr");c.id=e+"placeHolderRow";var b=document.createElement("td");b.id=e+"placeHolderCol";
c.appendChild(b);a.appendChild(c);c=j.node(e+"placeHolderRow");a=j.node(e+"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(),e=0;e<a.length;e++)this.myTree.collapse(a[e])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler)for(var a=this._navHandler.getTopLevelNodes(),e=0;e<a.length;e++)this._expandRecursively(a[e])},_expandRecursively:function(a){if(this._navHandler&&
this._navHandler.isExpandable(a)){var e=this;this.myTree.expand(a,function(){e.model.getChildren(a,function(a){if(!(a===void 0||a===null))for(var b=a.length,d=0;d<b;d++)e._expandRecursively(a[d])})})}},createTree:function(a,e,c){a=typeof a==="string"?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var h=a+"innerTree",i=j.node(h);i&&j.empty(i);if(e)e.rootId=h;this.model=e;this._parentId=a;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=
c?c.selectionPolicy:"",this._navDict=new b.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:h,model:e,parent:a,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.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(),e=[];if(a&&this.getNavDict())for(var c=a.getSelection(),b=0;b<c.length;b++){var d=a.getRowDiv(c[b]);d&&d.parentNode&&(d=this.getNavDict().getValue(this.model.getId(c[b])),d.model&&e.push(d.model))}this.selection.setSelections(e)}},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 b.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var e=this;this.model.getRoot(function(c){c instanceof Array?e.getNavHandler().refreshModel(e.getNavDict(),
e.model,c):c.children&&c.children instanceof Array&&e.getNavHandler().refreshModel(e.getNavDict(),e.model,c.children);a&&a.setFocus&&e.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return a}();a.createExplorerCommands=function(a,b){function e(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?b?b(a):!0:!1:!1}var c=new i.Command({tooltip:f["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},
callback:function(a){a.items.expandAll()}}),d=new i.Command({tooltip:f["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.collapseAll()}});a.addCommand(c);a.addCommand(d)};a.ExplorerModel=function(){function a(b,e,c){this.rootPath=b;this.fetchItems=e;this.idPrefix=c||""}a.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var e=this;this.fetchItems(this.rootPath).then(function(c){e.root=
c;a(c)})},getChildren:function(a,e){a.Children?e(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;e(c)}):e([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),e=this.idPrefix,c=0;c<a.length;c++)e+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return e}};return a}();a.ExplorerFlatModel=function(){function b(a,e,c){this.rootPath=a;this.fetchItems=e;this.root=c}b.prototype=new a.ExplorerModel;
b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var e=this;this.fetchItems(this.rootPath).then(function(c){e.root=c;a(c)})}};b.prototype.getChildren=function(a,e){a===this.root?e(this.root):e([])};return b}();a.ExplorerRenderer=function(){function a(b,e){this.explorer=e;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,e){this.tableTree=e;j.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,e,c,b,d){var c=c||"tool",h=document.createElement("td");h.id=e.id+"actionswrapper";b&&h.classList.add(b);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,h,a,this.explorer,c,null,d&&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 h},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 h=this;d.addEventListener("click",function(a){h.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,h){(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()&&h&&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){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&b&&c.getSelectionPolicy()!=="cursorOnly"&&(a=window.sessionStorage[a+"selection"],typeof a==="string"&&(a=a.length>0?JSON.parse(a):null),a)){for(var d=[],c=0;c<
a.length;c++){var h=b.getValue(a[c]);if(h&&h.rowDomNode&&h.model&&(d.push(h.model),this._highlightSelection&&h.rowDomNode.classList.add("checkedRow"),h=j.node(this.getCheckBoxId(h.rowDomNode.id))))h.checked=!0,h.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),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 h=this;this.tableTree.expand(c[d],function(){h._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 h=document.createElement("span");h.id=this.expandCollapseImageId(a.id);b.appendChild(h);h.classList.add(this._twistieSpriteClass);h.classList.add(this._collapseImageClass);if(c){var i=document.createElement("span");b.appendChild(i);
i.classList.add(d||"imageSprite");i.classList.add(c)}var f=this;h.onclick=function(){f.tableTree.toggle(a.id);if(f.tableTree.isExpanded(a.id))f._expanded.push(a.id);else for(var c in f._expanded)if(f._expanded[c]===a.id){f._expanded.splice(c,1);break}(c=f._getUIStatePreferencePath())&&window.sessionStorage&&f._storeExpansions(c)};return h},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}();
a.SelectionRenderer=function(){function b(a,e){this._init(a);this.explorer=e}b.prototype=new a.ExplorerRenderer;b.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,h=this.getCellHeaderElement(d);h;)h.innerHTML.length>0&&h.classList.add("navColumn"),c.appendChild(h),h=this.getCellHeaderElement(++d);b.appendChild(c);d>0&&a.appendChild(b)};
b.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(c){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,c)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,h=this.getCellElement(c,a,b);h;)b.appendChild(h),c===0?this.getPrimColumnStyle?h.classList.add(this.getPrimColumnStyle()):h.classList.add("navColumn"):
this.getSecondaryColumnStyle?h.classList.add(this.getSecondaryColumnStyle()):h.classList.add("secondaryColumn"),h=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();a.SimpleFlatModel=function(){function b(a,e,c){this.items=a;this.getKey=c;this.idPrefix=e;this.root={children:a}}b.prototype=new a.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.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};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return a});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/objects,orion/URITemplate,orion/webui/littlelib".split(","),function(f,k,j,d,b,i,a,h){function g(e,d,g,h,f,j,t,p,x){var d=i.clone(d),u;if(d.Directory)u=document.createElement("a"),u.className="navlinkonpage",u.href=!e?c:(new a(e+"#{,resource,params*}")).expand({resource:d.ChildrenLocation}),d.Name&&u.appendChild(document.createTextNode(d.Name));
else{f||(f=b.getOpenWithCommands(g));if(!j)for(e=0;e<f.length;e++)f[e].isEditor==="default"&&(j=f[e]);u=document.createElement("a");u.className="navlink targetSelector";t&&typeof t==="object"&&Object.keys(t).forEach(function(a){u[a]=t[a]});var v=null,o=null;if(v=x?x.holderDom:u)o=document.createElement("span"),o.className="core-sprite-file modelDecorationSprite",v.appendChild(o);d.Name&&u.appendChild(document.createTextNode(d.Name));var w=!1,y=d.Location;if(p&&typeof p==="object")d.params={},i.mixin(d.params,
p);for(e=0;e<f.length;e++)if(p=f[e],p.visibleWhen(d)){y=p.hrefCallback({items:d});w=!0;break}k.when(h.getFileContentType(d),function(a){var c;if(c=!w)if(c=j){a:{switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":c=!0;break a}c=!1}c=!c}c&&(y=j.hrefCallback({items:d}));if(v){c=v;var b=d.Location,e=o,g;switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":g=document.createElement("img");
g.src=b;g.classList.add("thumbnail");break;default:if(a&&a.image)g=document.createElement("img"),g.src=a.image,g.classList.add("thumbnail")}g&&c.replaceChild(g,e)}u.href=y})}return u}function e(a,c,b,e){this.explorer=c;this.commandService=b;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var c=new a("#{,resource,params*}");e.prototype=new j.SelectionRenderer;e.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};
e.prototype.tableCallback=function(a){a.setAttribute("aria-label",f.Navigator);a.setAttribute("role","presentation")};e.prototype.rowCallback=function(a){a.setAttribute("role","treeitem")};e.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=f.NoFile;var d=document.createElement("span");d.classList.add("core-sprite-addcontent");d.classList.add("icon-inline");
d.classList.add("imageSprite");h.processDOMNodes(e,[d]);b.appendChild(e);c.appendChild(b);a.appendChild(c)};e.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"}};e.prototype.setTarget=function(a){this.target=a};e.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};e.prototype.createFolderNode=
function(a){var c;this.showFolderLinks?(c=g(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&c.insertBefore(a,c.firstChild)):(c=document.createElement("span"),c.textContent=a.Name);return c};e.prototype.showFolderLinks=!0;e.prototype.getCellElement=function(a,c,e){switch(a){case 0:var a=document.createElement("td"),h=document.createElement("span");h.id=e.id+"MainCol";h.setAttribute("role","presentation");a.appendChild(h);a.setAttribute("role","presentation");
h.className="mainNavColumn";var i;if(c.Directory)this.getExpandImage(e,h),i=this.createFolderNode(c),h.appendChild(i),this.explorer._makeDropTarget(c,i),this.explorer._makeDropTarget(c,e);else{if(!this.openWithCommands){this.openWithCommands=b.getOpenWithCommands(this.commandService);for(i=0;i<this.openWithCommands.length;i++)if(this.openWithCommands[i].isEditor==="default")this.defaultEditor=this.openWithCommands[i]}i=g("",c,this.commandService,this.contentTypeService,this.openWithCommands,this.defaultEditor,
{target:this.target});h.appendChild(i)}if(i)i.id=e.id+"NameLink",i.nodeType===1&&(d.addNavGrid(this.explorer.getNavDict(),c,i),i.setAttribute("role","link"),i.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,h,c,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;e=document.createElement("td");if(c.LocalTimeStamp)e.textContent=(new Date(c.LocalTimeStamp)).toLocaleString();return e;case 2:if(this.oneColumn)return null;
e=document.createElement("td");if(!c.Directory&&typeof c.Length==="number")c=parseInt(c.Length,10)/1024,e.textContent=Math.ceil(c).toLocaleString()+" KB";e.style.textAlign="right";return e}};e.prototype.constructor=e;return{NavigatorRenderer:e,createLink:g}});
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(f,k,j,d,b,i,a,h,g){function e(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function c(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new e(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}e.prototype.makeRenderFunction=function(c,e,i,r,q){var s=this.serviceRegistry,t=this.commandRegistry;this.openWithCommands=this.openWithCommands||h.createOpenWithCommands(s,c,t);var p=this;return function(h,s,v,o){g.when(p.openWithCommands,function(g){if(v)j.empty(e),g=document.createElement("div"),g.appendChild(document.createTextNode(f["Search failed."])),e.appendChild(g),typeof r==="function"&&r(e);else{var y=
function(){function a(c,b){var e=b.folderName?b.folderName:b.path,d=document.createElement("span");d.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");d.appendChild(document.createTextNode(" - "+e+" "));c.appendChild(d)}var c={};return function(b,e){var d=e.name;if(c.hasOwnProperty(d)){a(b,e);var o=c[d];typeof o==="function"&&(c[d]=null,o())}else c[d]=function(){a(b,e)}}}(),B=!1;j.empty(e);if(h&&h.length>0){var H=document.createElement("table");H.setAttribute("role","presentation");for(var G=0;G<h.length;G++){var z=
h[G],A;if(!B&&(B=!0,i))A=H.insertRow(0).insertCell(0),A.textContent=i;A=H.insertRow(-1).insertCell(0);A.colspan=2;q&&q(A);var C={Name:z.name,Directory:z.directory,Location:z.path||z.location},p=null;if(typeof z.LineNumber==="number")p={},p.line=z.LineNumber;if(o&&o.keyword&&!o.nameSearch){var D=b.generateSearchHelper(o),p=p||{};p.find=D.inFileQuery.searchStr;p.regEx=D.inFileQuery.wildCard?!0:void 0}C=a.createLink(k.toUrl("edit/edit.html"),C,t,c,g,null,{"aria-describedby":(z.folderName?z.folderName:
z.path).replace(/[^a-zA-Z0-9_\.:\-]/g,""),style:{verticalAlign:"middle"}},p);z.LineNumber&&C.appendChild(document.createTextNode(" (Line "+z.LineNumber+")"));A.appendChild(C);y(A,z)}e.appendChild(H);typeof r==="function"&&r(e)}!B&&s&&(g=d.formatMessage(f["No matches found for ${0}"],s),j.empty(e),e.appendChild(document.createTextNode(g)),typeof r==="function"&&r(e))}})}};c.prototype={search:function(a,c,e){var d=function(a){for(var c=[],e=0;e<a.response.docs.length;e++){var d=a.response.docs[e];c.push({name:d.Name,
path:d.Location,folderName:b.path2FolderName(d.Path?d.Path:d.Location,d.Name),directory:d.Directory,lineNumber:d.LineNumber})}return c};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(c){e(d(c),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var b=a.keyword,b=b.substring(b.indexOf("}")+1),b=b.substring(b.indexOf(":")+1);e(d(c),b,null,a)},function(a){e(null,null,a,null)})}catch(g){typeof g===
"string"&&g.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(c){e(d(c),null,null,a)}):typeof g==="string"&&g.indexOf("search")>-1&&!a.nameSearch?(new i.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(c){e(d(c),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(g)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=a},handleError:function(a,c){console.error(a);
j.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&a.Parents.length>0?e=c.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),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),b=this._fileService.fileServiceName(a.Location),
this._childrenLocation=a.ChildrenLocation;e=j.node("search");b||(b="");if(e&&e.placeholder){e.value="";var g=d.formatMessage(f["Search ${0}"],b);e.placeholder=g.length>30?g.substring(0,27)+"...":d.formatMessage(f["Search ${0}"],b)}if(e&&e.title)e.title=f["Type a keyword or wild card to search in "]+b},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,c,b,e){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,
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}}};c.prototype.constructor=c;return{Searcher:c}});
define("orion/section",["orion/webui/littlelib","orion/selection","orion/commandRegistry","orion/commonHTMLFragments"],function(f,k,j,d){function b(a,b){var g=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");var e=b.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:
["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var c=0;c<e.length;c++)this.domNode.classList.add(e[c]);this.domNode.id=b.id;if(b.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===g.titleNode||a.target===g.twistie)&&g._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===f.KEY.ENTER&&(a.target===g.domNode||a.target===g.titleNode||a.target===g.twistie)&&g._changeExpandedState()},!1);if(b.iconClass){var i=document.createElement("span");i.classList.add("sectionIcon");this.domNode.appendChild(i);(Array.isArray(b.iconClass)?b.iconClass:[b.iconClass]).forEach(function(a){i.classList.add(a)})}this.titleNode=document.createElement("div");
this.titleNode.id=b.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=b.title;if(typeof b.getItemCount==="function")e=document.createElement("div"),e.classList.add("layoutLeft"),e.classList.add("sectionItemCount"),this.domNode.appendChild(e),e.textContent=b.getItemCount(this);this._progressNode=document.createElement("div");this._progressNode.id=
b.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);e=document.createElement("div");e.id=b.id+"FilterSearchBox";this.domNode.appendChild(e);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.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=b.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=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("sectionActions");
this.domNode.appendChild(this.selectionNode);b.slideout&&(e=d.slideoutHTMLFragment(b.id),c=document.createRange(),c.selectNode(this.domNode),e=c.createContextualFragment(e),this.domNode.appendChild(e));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);b.content&&this.setContent(b.content);
this.hidden=b.hidden;if(typeof b.onExpandCollapse==="function")this._onExpandCollapse=b.onExpandCollapse;this._preferenceService=b.preferenceService;this._contentParent.style.display="none";if(this._preferenceService){var n=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(n.id);if(a!==void 0)n.hidden=!a;if(!n.hidden)n._contentParent.style.display="block";n._updateExpandedState(!n.hidden,!1)})}else{if(!this.hidden)this._contentParent.style.display="block";this._updateExpandedState(!this.hidden,
!1)}this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function i(a){this._section=a;this._id=++a._lastMonitor}b.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 i(this)},_setMonitorMessage:function(a,b){this._progressNode.style.visibility=
"visible";this._loading[a]=b;var d="",e;for(e in this._loading)d!==""&&(d+="\n"),d+=this._loading[e];this._progressNode.title=d},_monitorDone:function(a){delete this._loading[a];var a="",b;for(b in this._loading)a!==""&&(a+="\n"),a+=this._loading[b];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,b){var d=this.twistie,e=this.id;d&&(d.classList.add(a?this._expandImageClass:this._collapseImageClass),d.classList.remove(a?this._collapseImageClass:this._expandImageClass));this._preferenceService&&b&&this._preferenceService.getPreferences("/window/views").then(function(c){c.put(e,a)});this._onExpandCollapse&&this._onExpandCollapse(a,this)}};b.prototype.constructor=b;i.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)}};i.prototype.constructor=i;return{Section:b}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(f,k,j,d){var b={};b.CompareCommandFactory=function(){function b(a){this.setOptions(a,!0)}b.prototype={setOptions:function(a,b){if(b)this.options={};if(!this.options)this.options={};a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},getOptions:function(){return this.options},initCommands:function(a){var b=this.options.commandSpanId,d=
this.options.commandService;if(d&&b){var e=new k.Command({name:f["Copy current change from right to left"],tooltip:f["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&a.options.newFile&&!a.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),c=new k.Command({name:f["Copy current change from left to right"],tooltip:f["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(){return a.type==="twoWay"&&a.options.oldFile&&!a.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),i=new k.Command({tooltip:f["Switch to unified diff"],name:f.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.getWidget().type==="twoWay"},callback:function(a){a.items.options.toggler.toggle()}}),
n=new k.Command({tooltip:f["Switch to side by side diff"],name:f["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&a.options.toggler.getWidget().type==="inline"},callback:function(a){a.items.options.toggler.toggle()}}),m=new k.Command({name:f["Next diff block"],tooltip:f["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(a){a.items.nextDiff()}}),
r=new k.Command({name:f["Previous diff block"],tooltip:f["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(a){a.items.prevDiff()}}),q=new k.Command({name:f["Next diff change"],tooltip:f["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",callback:function(a){a.items.nextChange()}}),s=new k.Command({name:f["Previous diff change"],tooltip:f["Previous diff change"],
imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",callback:function(a){a.items.prevChange(a)}});d.addCommand(e);d.addCommand(c);d.addCommand(n);d.addCommand(i);d.addCommand(m);d.addCommand(r);d.addCommand(q);d.addCommand(s);d.registerCommandContribution(b,"orion.compare.toggle2Inline",108);d.registerCommandContribution(b,"orion.compare.toggle2TwoWay",109);d.registerCommandContribution(b,"orion.compare.copyToLeft",110,null,!1,new j.KeyBinding(37,!0,!1,!0));
d.registerCommandContribution(b,"orion.compare.copyToRight",111,null,!1,new j.KeyBinding(39,!0,!1,!0));d.registerCommandContribution(b,"orion.compare.nextDiff",112,null,!1,new j.KeyBinding(40,!0));d.registerCommandContribution(b,"orion.compare.prevDiff",113,null,!1,new j.KeyBinding(38,!0));a.options.wordLevelNav?(d.registerCommandContribution(b,"orion.compare.nextChange",114,null,!1,new j.KeyBinding(40,!0,!0)),d.registerCommandContribution(b,"orion.compare.prevChange",115,null,!1,new j.KeyBinding(38,
!0,!0))):(d.registerCommandContribution(b,"orion.compare.nextChange",114,null,!0,new j.KeyBinding(40,!0,!0)),d.registerCommandContribution(b,"orion.compare.prevChange",115,null,!0,new j.KeyBinding(38,!0,!0)))}},renderCommands:function(a){var b=this.options.commandSpanId,g=this.options.commandService;g&&b&&(d.empty(d.node(b)),this.options.gridRenderer&&this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?
this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),g.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):(g.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):g.renderCommands(b,b,a,a,"tool",null,this.options.gridRenderer.navGridHolder)):g.renderCommands(b,b,a,a,"tool",null))}};return b}();return b});
define("orion/compare/compareUtils",["orion/URITemplate"],function(f){var k=k||{};k.compareUtils=k.compareUtils||{};k.compareUtils.lookUpMapper=function(f,d,b){for(var i=0,a=0;a<f.length;a++){var h=f[a][d];h===0&&(h=1);if(b>=i&&b<i+h)return{mapperIndex:a,startFrom:i};if(a===f.length-1)break;i+=f[a][d]}return{mapperIndex:f.length-1,startFrom:i}};k.compareUtils.lookUpLineIndex=function(f,d,b){if(b===0)return 0;for(var i=0,a=0;a<b;a++)i+=f[a][d];return i};k.compareUtils.updateMapper=function(f,d,b,i,
a){if(i!==a&&(i>0||a>0)){var h=k.compareUtils.lookUpMapper(f,d,b);if(!(h.mapperIndex<0)){if(i>0)for(var g=b-h.startFrom,b=h.mapperIndex;b<f.length;b++){g=f[b][d]-g;if(i<=g){f[b][d]-=i;break}f[b][d]-=g;i-=g;g=0}a>0&&(f[h.mapperIndex][d]+=a)}}};k.compareUtils.overlapMapper=function(f,d,b,i,a){f=b+f[d]-1;f<b&&(f=b);a<i&&(a=i);return f<i||a<b?!1:!0};k.compareUtils.findFirstDiff=function(f,d,b,i){for(var a=0,h=null,g=0;g<f.length;g++){if(a>i)break;if(k.compareUtils.overlapMapper(f[g],d,a,b,i)&&(h={mapperIndex:g,
startFrom:a},f[g][2]!==0))break;a+=f[g][d]}return h};k.compareUtils.matchMapper=function(f,d,b,i){if(f.length===0)return b;var a=b+Math.round((i-b)/3),h=k.compareUtils.findFirstDiff(f,d,b,i),g=f[h.mapperIndex][d]===0?h.startFrom:h.startFrom+f[h.mapperIndex][d]-1,e=k.compareUtils.lookUpLineIndex(f,1-d,h.mapperIndex),c=h.startFrom-b;return f[h.mapperIndex][2]===0?e-c:a>=h.startFrom&&a<=g?e-Math.round((i-b)/3):a<h.startFrom?e-c:(f[h.mapperIndex][1-d]===0?e:e+f[h.mapperIndex][1-d]-1)-(g-b)};k.compareUtils.getMapperLineCount=
function(f){for(var d=0,b=0;b<f.length;b++)d+=Math.max(f[b][0],f[b][1]);return d};k.compareUtils.getAnnotationIndex=function(f,d){for(var b=0;b<f.length;b++)if(f[b][0]===d)return b;return-1};k.compareUtils.getAnnotationMapperIndex=function(f,d){return f[d][1]};k.compareUtils.getAnnotationIndexByMapper=function(f,d){for(var b=0;b<f.length;b++)if(f[b][1]===d)return{current:b,prev:b-1,next:b+1};return{current:-1,prev:-1,next:-1}};k.compareUtils.isMapperConflict=function(f,d){return d<0?!1:!f[d][3]?!1:
f[d][3]===1};k.compareUtils.mergeDiffBlocks=function(f,d,b,i,a,h){for(var g=0;g<d.length;g++){var e=d[g][0],c=b[d[g][1]];if(c[0]>0){for(var l="",n=0;n<c[0];n++)l=l+i[c[2]-1+n].substring(a)+h;c=f.getLineCount();e>=c&&(e=c-1);e=f.getLineStart(e);f.setText(l,e,e)}}};k.compareUtils.generateCompareHref=function(j,d){var b=require.toUrl("compare/compare.html");if(!d.conflict)d.conflict=void 0;if(!d.readonly)d.readonly=void 0;return(new f(b+"#{,resource,params*}")).expand({resource:j,params:d})};k.compareUtils.generateCompareTreeHref=
function(j,d){var b=require.toUrl("compare-tree/compare-tree.html");return(new f(b+"#{,resource,params*}")).expand({resource:j,params:d})};return k.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(f,k){function j(b,d,a){var h=new k;b[d].apply(b,a).then(function(a){h.resolve(a)},function(a){h.reject(a)});return h}function d(b,d){var a=b.getServiceReferences("orion.core.diff"),h,g=a;if(d){g=[];for(h=0;h<a.length;++h)d(a[h])&&g.push(a[h])}var e=[],c=[];for(h=0;h<g.length;++h)e[h]=RegExp(g[h].getProperty("pattern")||".*"),c[h]=b.getService(g[h]);this._getService=function(a){if(a.indexOf("://")===-1){var b=
document.createElement("a");b.href=a;a=b.href}for(b=0;b<e.length;++b)if(e[b].test(a))return c[b];throw f["No Matching DiffService for location:"]+a;}}d.prototype={getDiffContent:function(b){return j(this._getService(b),"getDiffContent",arguments)},getDiffFileURI:function(b){return j(this._getService(b),"getDiffFileURI",arguments)}};return{DiffProvider:d}});
define("orion/compare/diffParser",[],function(){var f=f||{};f.DiffParser=function(){function f(d,b){this._lineDelimiter=d?d:j?"\r\n":"\n";this._diffLineDelimiter=b?b:this._lineDelimiter;this._DEBUG=!1}var j=window.navigator.platform.indexOf("Win")!==-1;f.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(d){this._diffLineDelimiter=this._lineDelimiter=d},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(d,b,i,a){this._init();if(b==="")return{outPutFile:d,mapper:[]};this._oFileContents=d===""?[]:d.split(this._lineDelimiter);this._diffContents=b.split(this._diffLineDelimiter);b=this._diffContents.length;this._hunkRanges=[];for(var h=0;h<b;h++){var g=this._parseHunkRange(h);g&&this._hunkRanges.push(g)}if(0===this._hunkRanges.length)return{outPutFile:d,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(d=0;d<this._hunkRanges.length;d++)this._parseHunkBlock(d);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(i);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));a||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var d=0;d<this._deltaMap.length;d++)if(console.log(JSON.stringify(this._deltaMap[d])),
this._deltaMap[d][2]>0){console.log("    **Diff content on change/add: \n");for(var b=0;b<this._deltaMap[d][0];b++)console.log("    "+this._diffContents[this._deltaMap[d][2]+b-1])}},_logNewFile:function(){for(var d=0;d<this._nFileContents.length;d++)console.log(this._nFileContents[d])},_createBlock:function(d,b,i,a){a===i&&d===" "||(i=[i,a-i,"s"],d==="-"?i[2]="r":d==="+"?i[2]="a":d==="c"&&(i[2]="c"),b.push(i))},_createMinusBlock:function(d,b,i){var a=this._oBlocks.length;a===0||d!==this._oBlocks[a-
1][0]?(this._oBlocks.push([d===0?1:d,i]),this._nBlocks.push([b,0,-2])):this._oBlocks[a-1][1]+=i},_createPlusBlock:function(d,b,i,a){var h=this._nBlocks.length;h===0||b!==this._nBlocks[h-1][0]?(this._oBlocks.push([d===0?1:d,0]),this._nBlocks.push([b,i,a])):(this._nBlocks[h-1][1]+=i,this._nBlocks[h-1][2]=a)},_parseHunkBlock:function(d){for(var b=" ",i=this._hunkRanges[d][0]+1,a=d===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[d+1][0],h=0,g=0,e=this._hunkRanges[d][1],c=this._hunkRanges[d][3],
f=i,n=i;n<a;n++)if(0!==this._diffContents[n].length){var m=this._diffContents[n][0];if(m==="\\"&&("\\ No newline at end of file"===this._diffContents[n].substring(0,this._diffContents[n].length-1)||"\\ No newline at end of file"===this._diffContents[n]))b==="-"?this._oNewLineAtEnd=!1:b===" "?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,n>i&&this._diffContents[n-1][this._diffContents[n-1].length-1]==="\r"&&(this._diffContents[n-1]=this._diffContents[n-1].substring(0,this._diffContents[n-
1].length-1));else{switch(m){case "-":case "+":case " ":break;default:continue}if(b!==m){m==="+"&&(f=n);switch(b){case " ":e=this._hunkRanges[d][1]+h;c=this._hunkRanges[d][3]+g;break;case "-":this._createMinusBlock(e,c,this._hunkRanges[d][1]+h-e);break;case "+":this._createPlusBlock(e,c,this._hunkRanges[d][3]+g-c,f)}b=m}switch(m){case "-":h++;break;case "+":g++;break;case " ":h++,g++}}}switch(b){case "-":this._createMinusBlock(e,c,this._hunkRanges[d][1]+h-e);break;case "+":this._createPlusBlock(e,
c,this._hunkRanges[d][3]+g-c,f)}},_detectConflictes:function(d,b){if(d<0)return!1;for(var i=d+b,a=d;a<i;a++){var h=this._diffContents[a];if(h.indexOf("<<<<<")>-1||h.indexOf(">>>>>")>-1)return!0}return!1},_buildMap:function(d){var b=this._oBlocks.length,i=this._oFileContents.length,a=0,h;h=1;for(var g=0;g<b;g++)h=this._oBlocks[g][0]-h,h>0&&(this._deltaMap.push([h,h,0]),a+=h),d&&this._detectConflictes(this._nBlocks[g][2],this._nBlocks[g][1])?this._deltaMap.push([this._nBlocks[g][1],this._oBlocks[g][1],
this._nBlocks[g][2]+1,1]):this._deltaMap.push([this._nBlocks[g][1],this._oBlocks[g][1],this._nBlocks[g][2]+1]),a+=this._oBlocks[g][1],h=this._oBlocks[g][0]+this._oBlocks[g][1];0<i-h&&(this._deltaMap.push([i-h+1,i-h+1,0]),a+=i-h+1);a<i&&(h=i-a,d=this._deltaMap[this._deltaMap.length-1],d[2]===0?(d[0]+=h,d[1]+=h):d[2]===-1?this._deltaMap.push([h,h,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([h,h,0]):(this._nNewLineAtEnd&&(d[0]+=h),this._oNewLineAtEnd&&(d[1]+=h)))},_buildNewFile:function(){var d=
1,b=!1,i=this._deltaMap.length,a,h;for(a=0;a<i;a++){b=!1;if(this._deltaMap[a][2]===0){for(h=0;h<this._deltaMap[a][0];h++)this._nFileContents.push(this._oFileContents[d+h-1]);b=!0}else if(this._deltaMap[a][2]>0)for(h=0;h<this._deltaMap[a][0];h++)this._nFileContents.push(this._diffContents[this._deltaMap[a][2]+h-1].substring(1));d+=this._deltaMap[a][1]}this._nNewLineAtEnd&&!b&&this._nFileContents.push("")},_parseHRangeBody:function(d,b){if(0<d.indexOf(",")){var i=d.split(","),a=parseInt(i[0],10),i=
parseInt(i[1],10);b.push(a>=0?a:1);b.push(i>=0?i:1)}else a=parseInt(d,10),b.push(a>=0?a:1),b.push(1)},_parseHunkRange:function(d){var b=this._diffContents[d];if(8>b.length)return null;if("@@"!==b.substring(0,2))return null;var b=b.substring(2),i=b.indexOf("@@");if(i<0)return null;var b=b.substring(0,i),i=b.indexOf("-"),a=b.indexOf("+");if(i<0||a<0)return null;d=[d];i<a?(b=b.substring(i+1).split("+"),this._parseHRangeBody(b[0],d),this._parseHRangeBody(b[1],d)):(b=b.substring(a+1).split("-"),this._parseHRangeBody(b[1],
d),this._parseHRangeBody(b[0],d));return d}};return f}();return f});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(f){var k=k||{};k.CompareRuler=function(){function f(d,b,i){this._location=d||"left";this._overview=b||"page";this._rulerStyle=i;this._editor=null;var a=this;this._listener={onModelChanged:function(b){a._onModelChanged(b)}}}f.prototype={setView:function(d){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=d;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return!1},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(d,b){for(var i=[],a=d;a<b;a++){var h=this.getStyle(a);h&&(i[a]={html:this.getHTML(a),style:h})}return i},getWidestAnnotation:function(){return{html:this.getHTML(-1),style:this.getStyle(-1)}},
getRulerStyle:function(){return this.getStyle(void 0)}};return f}();k.LineNumberCompareRuler=function(){function f(d,b,i,a,h,g){k.CompareRuler.call(this,i,"page",a);this._diffNavigator=d;this._oddStyle=h||{style:{backgroundColor:"white"}};this._evenStyle=g||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=b}f.prototype=new k.CompareRuler;f.prototype.getStyle=function(d){return d===void 0?this._rulerStyle:this._evenStyle};f.prototype.getHTML=function(d){var b=this._editor.getModel(),
i=this._diffNavigator.getFeeder(this._mapperColumnIndex===0);return!i?"":d===-1?b.getLineCount():i.getLineNumber?(d=i.getLineNumber(d),d===-1?"":d+1):d+1};f.prototype._onModelChanged=function(d){var d=d.start,b=this._editor.getModel(),i=b.getLineCount(),a=(i+"").length;if(this._numOfDigits!==a)this._numOfDigits=a,this._editor.redrawLines(b.getLineAtOffset(d),i,this)};return f}();k.CompareOverviewRuler=function(){function j(d,b,i,a){this._diffNavigator=i;this._onClick=a;k.CompareRuler.call(this,d,
"document",b)}j.prototype=new k.CompareRuler;j.prototype.getStyle=function(d){var b,i;if(d===void 0)b=this._rulerStyle||{},i=b.style||(b.style={}),i.lineHeight="1px",i.fontSize="1px",i.width="14px";else if(b=d!==-1?{styleClass:"annotationOverview breakpoint"}:{},i=b.style||(b.style={}),i.cursor="pointer",i.width="8px",i.left="2px",d>=0){var a;if(this._diffNavigator&&this._diffNavigator.getFeeder())a=this._diffNavigator.getFeeder().getDiffBlocks();else return null;d=f.getAnnotationIndex(a,d);if(d===
-1)return null;a=f.getAnnotationMapperIndex(a,d);var h;h=this._diffNavigator.getMapper();if(a=f.isMapperConflict(h,a))i.border="1px #FF0000 solid";if(d===this._diffNavigator.getCurrentBlockIndex())i.backgroundColor=a?"red":"blue";d=this._diffNavigator.getFeeder().getDiffBlockH(d);a=this._diffNavigator.getFeeder().getOverviewLineCount();if(d<0)return null;h=this._editor.getClientArea();d=Math.floor(h.height*d/a);d<2&&(d=2);i.height=d+"px"}else return null;return b};j.prototype.setDiffNavigator=function(d){this._diffNavigator=
d};j.prototype.getHTML=function(){return"&nbsp;"};j.prototype.onClick=function(d){d!==void 0&&this._onClick(d,this)};j.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return j}();k.CompareCurveRuler=function(){function j(d){this._canvasDiv=d;this._mapper=void 0}j.prototype={init:function(d,b,i,a){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=d;this._leftEditor=b;this._rightEditor=i;this._leftTextView=b.getTextView();
this._rightTextView=i.getTextView();this._diffNavigator=a;this.render()},matchPositionFrom:function(d){var b=d?this._leftTextView:this._rightTextView,i=d?this._rightTextView:this._leftTextView,a=b.getTopIndex(),b=b.getBottomIndex(),d=f.matchMapper(this._mapper,d?0:1,a,b);i.setTopIndex(d)},copyTo:function(d){if(this._diffNavigator.iterator){var b=this._diffNavigator.iterator.cursor();if(b&&(b.type==="word"?!b.copied&&!b.parent.copied:!b.copied)){var i=d?this._rightTextView.getText(b.oldA.start,b.oldA.end):
this._leftTextView.getText(b.newA.start,b.newA.end),a=d?b.newA:b.oldA;(d?this._leftTextView:this._rightTextView).setText(i,a.start,a.end);b.copied=!0}}},render:function(){if(this._mapper){var d=this._canvasDiv.getContext("2d");d.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);d.strokeStyle="#AAAAAA";d.lineWidth=1;d.beginPath();var b=this._leftTextView.getTopIndex(),i=this._leftTextView.getBottomIndex(),a=this._rightTextView.getTopIndex(),h=this._rightTextView.getBottomIndex();this._leftLineH=
this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var g=0,e=0,c=!1,l=0;l<this._mapper.length;l++){if(this._mapper[l][2]!==0)if(f.overlapMapper(this._mapper[l],0,g,b,i)||f.overlapMapper(this._mapper[l],1,e,a,h))this._renderCurve(l,g,e,this._canvasDiv,d,b,i,a,h),c=!0;else if(c)break;g+=this._mapper[l][0];e+=this._mapper[l][1]}d.stroke()}},_renderCurve:function(d,b,i,a,h){var g=this._mapper[d],b=this._leftTextView.getLinePixel(b+g[0]/2)+g[0]%2*this._leftLineH/
3-this._leftTextView.getTopPixel(),i=this._rightTextView.getLinePixel(i+g[1]/2)+g[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel(),a=a.parentNode.clientWidth;d===this._diffNavigator.getCurrentMapperIndex()?(h.stroke(),h.strokeStyle="#000",h.lineWidth=1,h.beginPath(),h.moveTo(0,b),h.bezierCurveTo(a/3,b,a*0.666,i,a,i),h.stroke(),h.strokeStyle="#AAAAAA",h.lineWidth=1,h.beginPath()):(h.moveTo(0,b),h.bezierCurveTo(a/3,b,a*0.666,i,a,i),h.stroke())},onChanged:function(d,b){var i=b?this._rightIniting:
this._leftIniting;if(d.removedLineCount!==d.addedLineCount){var a=b?this._rightTextView:this._leftTextView;i||f.updateMapper(this._mapper,b?1:0,a.getModel().getLineAtOffset(d.start),d.removedLineCount,d.addedLineCount);(d.removedLineCount>0||d.addedLineCount>0)&&this.render()}b?this._rightIniting=!1:this._leftIniting=!1;return i}};return j}();return k});define("orion/editor/i18n",{load:function(f,k,j){k.specified&&k.specified("orion/bootstrap")?k(["orion/i18n!"+f],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",committerOnTime:"${0} on ${1}",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",trimTrailingWhitespaces:"Trim Trailing Whitespaces",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",viStar:"Search Word Under Cursor",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(f,k){var j={root:k},d;for(d in f)f.hasOwnProperty(d)&&typeof j[d]==="undefined"&&(j[d]=f[d]);return j});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/util"],function(f,k){function j(d,b){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(d);this.setLineDelimiter(b)}j.prototype={find:function(d){if(this._text.length>1)this._text=[this._text.join("")];var b=d.string,i=b,a=d.caseInsensitive;!d.regex&&b&&(i=b.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&"),a&&(i=i.replace(/[iI\u0130\u0131]/g,"[Ii\u0130\u0131]")));var h=null,g;if(i){var b=d.reverse,e=d.wrap,c=d.wholeWord,
f=d.start||0,d=d.end,n=d!==null&&d!==void 0,m="";m.indexOf("g")===-1&&(m+="g");a&&m.indexOf("i")===-1&&(m+="i");c&&(i="\\b"+i+"\\b");var j=this._text[0],k,s,t=0;n&&(a=f<d?f:d,j=j.substring(a,f<d?d:f),t=a);var p=RegExp(i,m);if(b)g=function(){var a=null;for(p.lastIndex=0;;){s=p.lastIndex;k=p.exec(j);if(s===p.lastIndex)return null;if(k){if(!(k.index+t<f)){if(!e||a)break;f=j.length+t}a={start:k.index+t,end:p.lastIndex+t}}else break}if(a)f=a.start;return a};else{if(!n)p.lastIndex=f;g=function(){for(;;){s=
p.lastIndex;k=p.exec(j);if(s===p.lastIndex)break;if(k)return{start:k.index+t,end:p.lastIndex+t};if(!(s!==0&&e))break}return null}}h=g()}return{next:function(){var a=h;a&&(h=g());return a},hasNext:function(){return h!==null}}},getCharCount:function(){for(var d=0,b=0;b<this._text.length;b++)d+=this._text[b].length;return d},getLine:function(d,b){var i=this.getLineCount();if(!(0<=d&&d<i))return null;var a=this._lineOffsets[d];if(d+1<i){i=this.getText(a,this._lineOffsets[d+1]);if(b)return i;for(var a=
i.length,h;(h=i.charCodeAt(a-1))===10||h===13;)a--;return i.substring(0,a)}else return this.getText(a)},getLineAtOffset:function(d){var b=this.getCharCount();if(!(0<=d&&d<=b))return-1;var i=this.getLineCount();if(d===b)return i-1;var a,h,g=this._lastLineIndex;if(0<=g&&g<i&&(a=this._lineOffsets[g],h=g+1<i?this._lineOffsets[g+1]:b,a<=d&&d<h))return g;for(var e=i,c=-1;e-c>1;)if(g=Math.floor((e+c)/2),a=this._lineOffsets[g],h=g+1<i?this._lineOffsets[g+1]:b,d<=a)e=g;else if(d<h){e=g;break}else c=g;return this._lastLineIndex=
e},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(d,b){var i=this.getLineCount();if(!(0<=d&&d<i))return-1;if(d+1<i){i=this._lineOffsets[d+1];if(b)return i;for(var a=this.getText(Math.max(this._lineOffsets[d],i-2),i),h=a.length,g;(g=a.charCodeAt(h-1))===10||g===13;)h--;return i-(a.length-h)}else return this.getCharCount()},getLineStart:function(d){return!(0<=d&&d<this.getLineCount())?-1:this._lineOffsets[d]},getText:function(d,
b){d===void 0&&(d=0);b===void 0&&(b=this.getCharCount());if(d===b)return"";for(var i=0,a=0,h;a<this._text.length;){h=this._text[a].length;if(d<=i+h)break;i+=h;a++}for(var g=i,e=a;a<this._text.length;){h=this._text[a].length;if(b<=i+h)break;i+=h;a++}if(e===a)return this._text[e].substring(d-g,b-i);g=this._text[e].substring(d-g);i=this._text[a].substring(0,b-i);return g+this._text.slice(e+1,a).join("")+i},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){return this.dispatchEvent(d)},
setLineDelimiter:function(d,b){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(b){var i=this.getLineCount();if(i>1){for(var a=Array(i),h=0;h<i;h++)a[h]=this.getLine(h);this.setText(a.join(this._lineDelimiter))}}},setText:function(d,b,i){d===void 0&&(d="");b===void 0&&(b=0);i===void 0&&(i=this.getCharCount());if(!(b===i&&d==="")){for(var a=this.getLineAtOffset(b),h=this.getLineAtOffset(i),g=b,e=
i-b,c=h-a,f=d.length,n=0,m=this.getLineCount(),j=0,k=0,s=0,t=[];;){j!==-1&&j<=s&&(j=d.indexOf("\r",s));k!==-1&&k<=s&&(k=d.indexOf("\n",s));if(k===-1&&j===-1)break;s=j!==-1&&k!==-1?j+1===k?k+1:(j<k?j:k)+1:j!==-1?j+1:k+1;t.push(b+s);n++}this.onChanging({type:"Changing",text:d,start:g,removedCharCount:e,addedCharCount:f,removedLineCount:c,addedLineCount:n});t.length===0&&(s=this.getLineStart(a),h=h+1<m?this.getLineStart(h+1):this.getCharCount(),b!==s&&(d=this.getText(s,b)+d,b=s),i!==h&&(d+=this.getText(i,
h),i=h));s=f-e;for(h=a+c+1;h<m;h++)this._lineOffsets[h]+=s;if(t.length<5E4)a=[a+1,c].concat(t),Array.prototype.splice.apply(this._lineOffsets,a);else{s=a+1;this._lineOffsets.splice(s,c);for(m=0;m<t.length;m+=5E4)a=[s,0].concat(t.slice(m,Math.min(t.length,m+5E4))),Array.prototype.splice.apply(this._lineOffsets,a),s+=5E4}for(s=m=0;s<this._text.length;){h=this._text[s].length;if(b<=m+h)break;m+=h;s++}a=m;for(t=s;s<this._text.length;){h=this._text[s].length;if(i<=m+h)break;m+=h;s++}h=this._text[s];b=
this._text[t].substring(0,b-a);i=h.substring(i-m);t=[t,s-t+1];b&&t.push(b);d&&t.push(d);i&&t.push(i);Array.prototype.splice.apply(this._text,t);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:g,removedCharCount:e,addedCharCount:f,removedLineCount:c,addedLineCount:n})}}};f.EventTarget.addMixin(j.prototype);return{TextModel:j}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(f,k){function j(b){if(b)this._view=b,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0}function d(b){j.call(this,b)}j.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(b){for(var d=[],a=this._keyBindings,h=0;h<a.length;h++)a[h].actionID===b&&d.push(a[h].keyBinding);return d},getView:function(){return this._view},isActive:function(){return this._view.getKeyModes().indexOf(this)!==-1},
match:function(b){if(b.type==="keydown")switch(b.keyCode){case 16:case 17:case 18:case 91:return}for(var d=this._keyBindingIndex,a=this._matchingKeyBindings||this._keyBindings,h=[],g=0;g<a.length;g++){var e=a[g],c=e.keyBinding.match(b,d);if(c===!0)return this._keyBindingIndex=0,this._matchingKeyBindings=null,e.actionID;else typeof c==="number"&&h.push(e)}if(h.length===0)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=h,"noop"},setKeyBinding:function(b,
d){for(var a=this._keyBindings,h=0;h<a.length;h++){var g=a[h];if(g.keyBinding.equals(b)){d?g.actionID=d:g.predefined?g.actionID="noop":a.splice(h,1);return}}d&&a.push({keyBinding:b,actionID:d})},setView:function(b){this._view=b}};d.prototype=new j;d.prototype.createKeyBindings=function(){var b=f.KeyBinding,d=[];d.push({actionID:"lineUp",keyBinding:new b(38),predefined:!0});d.push({actionID:"lineDown",keyBinding:new b(40),predefined:!0});d.push({actionID:"charPrevious",keyBinding:new b(37),predefined:!0});
d.push({actionID:"charNext",keyBinding:new b(39),predefined:!0});k.isMac?(d.push({actionID:"scrollPageUp",keyBinding:new b(33),predefined:!0}),d.push({actionID:"scrollPageDown",keyBinding:new b(34),predefined:!0}),d.push({actionID:"pageUp",keyBinding:new b(33,null,null,!0),predefined:!0}),d.push({actionID:"pageDown",keyBinding:new b(34,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(37,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(39,!0),predefined:!0}),
d.push({actionID:"wordPrevious",keyBinding:new b(37,null,null,!0),predefined:!0}),d.push({actionID:"wordNext",keyBinding:new b(39,null,null,!0),predefined:!0}),d.push({actionID:"scrollTextStart",keyBinding:new b(36),predefined:!0}),d.push({actionID:"scrollTextEnd",keyBinding:new b(35),predefined:!0}),d.push({actionID:"textStart",keyBinding:new b(38,!0),predefined:!0}),d.push({actionID:"textEnd",keyBinding:new b(40,!0),predefined:!0}),d.push({actionID:"scrollPageUp",keyBinding:new b(38,null,null,null,
!0),predefined:!0}),d.push({actionID:"scrollPageDown",keyBinding:new b(40,null,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(37,null,null,null,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(39,null,null,null,!0),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(38,null,null,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(40,null,null,!0),predefined:!0})):(d.push({actionID:"pageUp",keyBinding:new b(33),predefined:!0}),d.push({actionID:"pageDown",
keyBinding:new b(34),predefined:!0}),d.push({actionID:"lineStart",keyBinding:new b(36),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b(35),predefined:!0}),d.push({actionID:"wordPrevious",keyBinding:new b(37,!0),predefined:!0}),d.push({actionID:"wordNext",keyBinding:new b(39,!0),predefined:!0}),d.push({actionID:"textStart",keyBinding:new b(36,!0),predefined:!0}),d.push({actionID:"textEnd",keyBinding:new b(35,!0),predefined:!0}));k.isFirefox&&k.isLinux&&(d.push({actionID:"lineUp",keyBinding:new b(38,
!0),predefined:!0}),d.push({actionID:"lineDown",keyBinding:new b(40,!0),predefined:!0}));k.isWindows&&(d.push({actionID:"scrollLineUp",keyBinding:new b(38,!0),predefined:!0}),d.push({actionID:"scrollLineDown",keyBinding:new b(40,!0),predefined:!0}));d.push({actionID:"selectLineUp",keyBinding:new b(38,null,!0),predefined:!0});d.push({actionID:"selectLineDown",keyBinding:new b(40,null,!0),predefined:!0});d.push({actionID:"selectCharPrevious",keyBinding:new b(37,null,!0),predefined:!0});d.push({actionID:"selectCharNext",
keyBinding:new b(39,null,!0),predefined:!0});d.push({actionID:"selectPageUp",keyBinding:new b(33,null,!0),predefined:!0});d.push({actionID:"selectPageDown",keyBinding:new b(34,null,!0),predefined:!0});k.isMac?(d.push({actionID:"selectLineStart",keyBinding:new b(37,!0,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(39,!0,!0),predefined:!0}),d.push({actionID:"selectWordPrevious",keyBinding:new b(37,null,!0,!0),predefined:!0}),d.push({actionID:"selectWordNext",keyBinding:new b(39,
null,!0,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new b(36,null,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new b(35,null,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new b(38,!0,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new b(40,!0,!0),predefined:!0}),d.push({actionID:"selectLineStart",keyBinding:new b(37,null,!0,null,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(39,null,!0,null,!0),predefined:!0}),
d.push({actionID:"selectLineStart",keyBinding:new b(38,null,!0,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(40,null,!0,!0),predefined:!0})):(k.isLinux&&(d.push({actionID:"selectWholeLineUp",keyBinding:new b(38,!0,!0),predefined:!0}),d.push({actionID:"selectWholeLineDown",keyBinding:new b(40,!0,!0),predefined:!0})),d.push({actionID:"selectLineStart",keyBinding:new b(36,null,!0),predefined:!0}),d.push({actionID:"selectLineEnd",keyBinding:new b(35,null,!0),predefined:!0}),d.push({actionID:"selectWordPrevious",
keyBinding:new b(37,!0,!0),predefined:!0}),d.push({actionID:"selectWordNext",keyBinding:new b(39,!0,!0),predefined:!0}),d.push({actionID:"selectTextStart",keyBinding:new b(36,!0,!0),predefined:!0}),d.push({actionID:"selectTextEnd",keyBinding:new b(35,!0,!0),predefined:!0}));d.push({actionID:"undo",keyBinding:new f.KeyBinding("z",!0),predefined:!0});k.isMac?d.push({actionID:"redo",keyBinding:new f.KeyBinding("z",!0,!0),predefined:!0}):d.push({actionID:"redo",keyBinding:new f.KeyBinding("y",!0),predefined:!0});
d.push({actionID:"deletePrevious",keyBinding:new b(8),predefined:!0});d.push({actionID:"deletePrevious",keyBinding:new b(8,null,!0),predefined:!0});d.push({actionID:"deleteNext",keyBinding:new b(46),predefined:!0});d.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0),predefined:!0});d.push({actionID:"deleteWordPrevious",keyBinding:new b(8,!0,!0),predefined:!0});d.push({actionID:"deleteWordNext",keyBinding:new b(46,!0),predefined:!0});d.push({actionID:"tab",keyBinding:new b(9),predefined:!0});
d.push({actionID:"shiftTab",keyBinding:new b(9,null,!0),predefined:!0});d.push({actionID:"enter",keyBinding:new b(13),predefined:!0});d.push({actionID:"enter",keyBinding:new b(13,null,!0),predefined:!0});d.push({actionID:"selectAll",keyBinding:new b("a",!0),predefined:!0});d.push({actionID:"toggleTabMode",keyBinding:new b("m",!0),predefined:!0});k.isMac&&(d.push({actionID:"deleteNext",keyBinding:new b(46,null,!0),predefined:!0}),d.push({actionID:"deleteWordPrevious",keyBinding:new b(8,null,null,!0),
predefined:!0}),d.push({actionID:"deleteWordNext",keyBinding:new b(46,null,null,!0),predefined:!0}));d.push({actionID:"toggleWrapMode",keyBinding:new f.KeyBinding("w",!0,!1,!0)});d.push({actionID:"toggleOverwriteMode",keyBinding:new f.KeyBinding(45)});if(!k.isFirefox){var a=k.isMac&&k.isChrome;d.push({actionID:"noop",keyBinding:new b("u",!a,!1,!1,a),predefined:!0});d.push({actionID:"noop",keyBinding:new b("i",!a,!1,!1,a),predefined:!0});d.push({actionID:"noop",keyBinding:new b("b",!a,!1,!1,a),predefined:!0})}k.isFirefox&&
(d.push({actionID:"copy",keyBinding:new b(45,!0),predefined:!0}),d.push({actionID:"paste",keyBinding:new b(45,null,!0),predefined:!0}),d.push({actionID:"cut",keyBinding:new b(46,null,!0),predefined:!0}));k.isMac&&(d.push({actionID:"lineStart",keyBinding:new b("a",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineEnd",keyBinding:new b("e",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineUp",keyBinding:new b("p",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"lineDown",keyBinding:new b("n",!1,!1,
!1,!0),predefined:!0}),d.push({actionID:"charPrevious",keyBinding:new b("b",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"charNext",keyBinding:new b("f",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deletePrevious",keyBinding:new b("h",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteNext",keyBinding:new b("d",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteLineEnd",keyBinding:new b("k",!1,!1,!1,!0),predefined:!0}),k.isFirefox?(d.push({actionID:"scrollPageDown",keyBinding:new b("v",!1,
!1,!1,!0),predefined:!0}),d.push({actionID:"deleteLineStart",keyBinding:new b("u",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"deleteWordPrevious",keyBinding:new b("w",!1,!1,!1,!0),predefined:!0})):(d.push({actionID:"pageDown",keyBinding:new b("v",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"centerLine",keyBinding:new b("l",!1,!1,!1,!0),predefined:!0}),d.push({actionID:"enterNoCursor",keyBinding:new b("o",!1,!1,!1,!0),predefined:!0})));return d};return{KeyMode:j,DefaultKeyMode:d}});
define("orion/editor/util",[],function(){return{contains:function(f,k){if(!k)return!1;if(!f.compareDocumentPosition){for(var j=k;j;){if(f===j)return!0;j=j.parentNode}return!1}return f===k||(f.compareDocumentPosition(k)&16)!==0},addEventListener:function(f,k,j,d){typeof f.addEventListener==="function"?f.addEventListener(k,j,d===!0):f.attachEvent("on"+k,j)},removeEventListener:function(f,k,j,d){typeof f.removeEventListener==="function"?f.removeEventListener(k,j,d===!0):f.detachEvent("on"+k,j)}}});
define("orion/editor/textView","i18n!orion/editor/nls/messages,orion/editor/textModel,orion/editor/keyModes,orion/editor/eventTarget,orion/editor/textTheme,orion/editor/util,orion/util".split(","),function(f,k,j,d,b,i,a){function h(c,b,e){if(e){b.className="";for(var e=b.attributes,d=e.length;d-- >0;)(!a.isIE||a.isIE>=9||a.isIE<9&&e[d].specified)&&b.removeAttribute(e[d].name)}if(c){if(c.styleClass)b.className=c.styleClass;if(e=c.style)for(var g in e)e.hasOwnProperty(g)&&(b.style[g]=e[g]);if(c=c.attributes)for(var h in c)c.hasOwnProperty(h)&&
b.setAttribute(h,c[h])}}function g(a){return a instanceof Array?a.slice(0):a}function e(a,c){if(!a)return c;if(!c)return a;for(var b in c)c.hasOwnProperty(b)&&(a.hasOwnProperty(b)||(a[b]=c[b]));return a}function c(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 e=0;e<a.length;e++)if(!c(a[e],b[e]))return!1;
return!0}if(!(a instanceof Object)||!(b instanceof Object))return!1;for(e in a)if(a.hasOwnProperty(e)){if(!b.hasOwnProperty(e))return!1;if(!c(a[e],b[e]))return!1}for(e in b)if(!a.hasOwnProperty(e))return!1;return!0}function l(a,c,b){for(var e=0,d=0,g=0,h=a.length;g<h;){e!==-1&&e<=g&&(e=a.indexOf("\r",g));d!==-1&&d<=g&&(d=a.indexOf("\n",g));var f=g,i;if(d===-1&&e===-1){c(a.substring(g));break}e!==-1&&d!==-1?e+1===d?(i=e,g=d+1):(i=e<d?e:d,g=(e<d?e:d)+1):e!==-1?(i=e,g=e+1):(i=d,g=d+1);c(a.substring(f,
i));b()}}function n(a){var c,b,e,d,g=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(g.getComputedStyle)a=g.getComputedStyle(a,null),c=a.getPropertyValue("padding-left"),b=a.getPropertyValue("padding-top"),e=a.getPropertyValue("padding-right"),d=a.getPropertyValue("padding-bottom");else if(a.currentStyle)c=a.currentStyle.paddingLeft,b=a.currentStyle.paddingTop,e=a.currentStyle.paddingRight,d=a.currentStyle.paddingBottom;return{left:parseInt(c,10)||0,top:parseInt(b,10)||0,right:parseInt(e,
10)||0,bottom:parseInt(d,10)||0}}function m(a){var c,b,e,d,g=a._trim;if(!g){var g=n(a),h=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;if(h.getComputedStyle)d=h.getComputedStyle(a,null),c=d.getPropertyValue("border-left-width"),b=d.getPropertyValue("border-top-width"),e=d.getPropertyValue("border-right-width"),d=d.getPropertyValue("border-bottom-width");else if(a.currentStyle)c=a.currentStyle.borderLeftWidth,b=a.currentStyle.borderTopWidth,e=a.currentStyle.borderRightWidth,d=a.currentStyle.borderBottomWidth;
c=parseInt(c,10)||0;b=parseInt(b,10)||0;e=parseInt(e,10)||0;d=parseInt(d,10)||0;g.left+=c;g.top+=b;g.right+=e;g.bottom+=d;a._trim=g}return g}function r(a,c,b){this.start=a;this.end=c;this.caret=b}function q(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function s(a,c,b){this.view=a;this.lineIndex=c;this._lineDiv=b}function t(a){this._init(a||{})}var p=i.addEventListener,x=i.removeEventListener,u=function(){function a(c){this.options=c}a.prototype.play=function(){var a=
typeof this.options.duration==="number"?this.options.duration:350,c=this.options.easing||this.defaultEasing,b=this.options.onAnimate||function(){},e=this.options.curve[0],d=this.options.curve[1],g=d-e,h=-1,v,f=this;this.interval=this.options.window.setInterval(function(){h=h===-1?(new Date).getTime():h;var i=((new Date).getTime()-h)/a;i<1?(i=c(i),v=e+i*g,b(v)):(b(d),f.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}();r.prototype={clone:function(){return new r(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+"}"}};s.prototype={create:function(a,c){if(!this._lineDiv){var b=this._lineDiv=this._createLine(a,c,this.lineIndex);b._line=
this;return b}},_createLine:function(b,e,d){var g=this.view,f=g._model,i=f.getLine(d),l=f.getLineStart(d),n={type:"LineStyle",textView:g,lineIndex:d,lineText:i,lineStart:l};if(i.length<2E3)g.onLineStyle(n);f=e||a.createElement(b.ownerDocument,"div");if(!e||!c(e.viewStyle,n.style)){h(n.style,f,e);if(e)e._trim=null;f.viewStyle=n.style;f.setAttribute("role","presentation")}f.lineIndex=d;d=[];this._createRanges(n.ranges,i,0,i.length,l,{tabOffset:0,ranges:d});i=" ";!g._fullSelection&&a.isIE<9&&(i="\ufeff");
a.isWebkit&&(i="\u200c");n={text:i,style:g._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 m,j,k,r,q,i=g=0,s,p;if(e){if(j=e.modelChangedEvent)j.removedLineCount===0&&j.addedLineCount===0?(p=j.start-l,s=j.addedCharCount-j.removedCharCount):p=-1,e.modelChangedEvent=void 0;j=e.firstChild}for(l=0;l<d.length;l++){n=d[l];r=n.text;g+=r.length;m=n.style;if(j)if(q=j.firstChild.data,k=j.viewStyle,q===r&&
c(m,k)){i+=q.length;j._rectsCache=void 0;m=j=j.nextSibling;continue}else for(;j;){if(p!==-1){k=g;k>=p&&(k-=s);q=(q=j.firstChild.data)?q.length:0;if(i+q>k)break;i+=q}k=j.nextSibling;f.removeChild(j);j=k}m=this._createSpan(f,r,m,n.ignoreChars);j?f.insertBefore(m,j):f.appendChild(m);if(e)e.lineWidth=void 0}if(e)for(b=m?m.nextSibling:null;b;)k=b.nextSibling,e.removeChild(b),b=k;else b.appendChild(f);return f},_createRanges:function(a,b,e,d,g,h){if(!(e>d)){if(a)for(var f=0;f<a.length;f++){var i=a[f];if(!(i.end<
g+e)){var l=Math.max(g+e,i.start)-g;if(l>d)break;var n=Math.min(g+d,i.end)-g;if(l<=n){l=Math.max(e,l);n=Math.min(d,n);e<l&&this._createRange(b,e,l,null,h);if(!i.style||!i.style.unmergeable)for(;f+1<a.length&&a[f+1].start-g===n&&c(i.style,a[f+1].style);)i=a[f+1],n=Math.min(g+d,i.end)-g,f++;this._createRange(b,l,n,i.style,h);e=n}}}e<d&&this._createRange(b,e,d,null,h)}},_createRange:function(a,c,b,e,d){if(!(c>b)){var g=this.view._customTabSize;if(g&&g!==8)for(var h=a.indexOf("\t",c);h!==-1&&h<b;){c<
h&&(c={text:a.substring(c,h),style:e},d.ranges.push(c),d.tabOffset+=c.text.length);c=g-d.tabOffset%g;if(c>0){for(var f="\u00a0",i=1;i<c;i++)f+=" ";c={text:f,style:e,ignoreChars:c-1};d.ranges.push(c);d.tabOffset+=c.text.length}c=h+1;if(c===b)return;h=a.indexOf("\t",c)}c<=b&&(c={text:a.substring(c,b),style:e},d.ranges.push(c),d.tabOffset+=c.text.length)}},_createSpan:function(c,b,e,d){var g=this.view,f="span";e&&e.tagName&&(f=e.tagName.toLowerCase());var i=f==="a";if(i)c.hasLink=!0;i&&!g._linksVisible&&
(f="span");i=c.ownerDocument;c=a.createElement(c.ownerDocument,f);e&&e.html?(c.innerHTML=e.html,c.ignore=!0):e&&e.node?(c.appendChild(e.node),c.ignore=!0):c.appendChild(i.createTextNode(e&&e.text?e.text:b));h(e,c);if(f==="a"){var l=g._getWindow();p(c,"click",function(a){return g._handleLinkClick(a?a:l.event)},!1)}c.viewStyle=e;if(d)c.ignoreChars=d;return c},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(c,
b){var e=this._ensureCreated(),d=this.view;if(c===void 0)return this._getLineBoundingClientRect(e,!0);var g=d._model,h=e.ownerDocument,f=this.lineIndex,i=null;if(c<g.getLineEnd(f)){f=g.getLineStart(f);for(g=e.firstChild;g;){if(!g.ignore){var l=g.firstChild,n=l.length;g.ignoreChars&&(n-=g.ignoreChars);if(f+n>c){i=c-f;if(l.length===1)i=new q(g.getBoundingClientRect());else if(d._isRangeRects)h=h.createRange(),h.setStart(l,i),h.setEnd(l,i+1),i=new q(h.getBoundingClientRect());else if(a.isIE){if(h=h.body.createTextRange(),
h.moveToElementText(g),h.collapse(),(f=i===0&&a.isIE===8)&&(i=1),h.moveEnd("character",i+1),h.moveStart("character",i),i=new q(h.getBoundingClientRect()),f)i.left=g.getClientRects()[0].left}else{var m=l.data;g.removeChild(l);g.appendChild(h.createTextNode(m.substring(0,i)));var j=a.createElement(h,"span");j.appendChild(h.createTextNode(m.substring(i,i+1)));g.appendChild(j);g.appendChild(h.createTextNode(m.substring(i+1)));i=new q(j.getBoundingClientRect());g.innerHTML="";g.appendChild(l);this._createdDiv||
(h=d._getSelection(),(f<=h.start&&h.start<f+n||f<=h.end&&h.end<f+n)&&d._updateDOMSelection())}a.isIE&&(h=e.ownerDocument.defaultView||e.ownerDocument.parentWindow,e=h.screen.logicalXDPI/h.screen.deviceXDPI,h=h.screen.logicalYDPI/h.screen.deviceYDPI,i.left*=e,i.right*=e,i.top*=h,i.bottom*=h);break}f+=n}g=g.nextSibling}}e=this.getBoundingClientRect();if(!i)d._wrapMode?(d=this.getClientRects(),i=d[d.length-1],i.left=i.right,i.left+=e.left,i.top+=e.top,i.right+=e.left,i.bottom+=e.top):(i=new q(e),i.left=
i.right);if(b||b===void 0)i.left-=e.left,i.top-=e.top,i.right-=e.left,i.bottom-=e.top;return i},_getClientRects:function(a,c){var b,e,d,g;if(!a._rectsCache){b=a.getClientRects();e=Array(b.length);for(g=0;g<b.length;g++)d=e[g]=new q(b[g]),d.left-=c.left,d.top-=c.top,d.right-=c.left,d.bottom-=c.top;a._rectsCache=e}b=a._rectsCache;e=[b.length];for(g=0;g<b.length;g++)e[g]=new q(b[g]);return e},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];for(var c=this._ensureCreated(),
b=[],e=c.firstChild,d,g=c.getBoundingClientRect();e;){if(!e.ignore)for(var h=this._getClientRects(e,g),c=0;c<h.length;c++){var f=h[c],i;if(f.top!==f.bottom){var l=f.top+(f.bottom-f.top)/2;for(i=0;i<b.length;i++)if(d=b[i],d.top<=l&&l<d.bottom)break;if(i===b.length)b.push(f);else{if(f.left<d.left)d.left=f.left;if(f.top<d.top)d.top=f.top;if(f.right>d.right)d.right=f.right;if(f.bottom>d.bottom)d.bottom=f.bottom}}}e=e.nextSibling}return a!==void 0?b[a]:b},_getLineBoundingClientRect:function(a,c){var b=
new q(a.getBoundingClientRect());if(!this.view._wrapMode){b.right=b.left;for(var e=a.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;if(e)e=e.getBoundingClientRect(),b.right=e.right+m(a).right}c&&(e=m(a),b.left+=e.left,b.right-=e.right);return b},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;for(var c=this.getClientRects(),a=this.getBoundingClientRect(a),a=a.top+(a.bottom-a.top)/2,
b=0;b<c.length;b++)if(c[b].top<=a&&a<c[b].bottom)return b;return c.length-1},getLineStart:function(a){if(!this.view._wrapMode||a===0)return this.view._model.getLineStart(a);var c=this.getClientRects();return this.getOffset(c[a].left+1,c[a].top+1)},getOffset:function(c,b){var e=this.view,d=e._model,g=this.lineIndex,h=d.getLineStart(g),f=d.getLineEnd(g);if(h===f)return h;var i=this._ensureCreated(),l=this.getBoundingClientRect(),n,m;if(e._wrapMode){n=this.getClientRects();if(b<n[0].top)b=n[0].top;for(var j=
0;j<n.length;j++)if(m=n[j],m.top<=b&&b<m.bottom)break;if(c<m.left)c=m.left;c>m.right&&(c=m.right-1)}else c<0&&(c=0),c>l.right-l.left&&(c=l.right-l.left);var k=i.ownerDocument,j=k.defaultView||k.parentWindow,r=a.isIE?j.screen.logicalXDPI/j.screen.deviceXDPI:1,q=a.isIE?j.screen.logicalYDPI/j.screen.deviceYDPI:1,j=h,s=i.firstChild;a:for(;s;){if(!s.ignore){var p=s.firstChild,i=p.length;s.ignoreChars&&(i-=s.ignoreChars);var t,x,J;n=this._getClientRects(s,l);for(var u=0;u<n.length;u++)if(m=n[u],m.left<=
c&&c<m.right&&(!e._wrapMode||m.top<=b&&b<m.bottom)){var u=m.left+l.left,E;if(a.isIE||e._isRangeRects){for(var k=e._isRangeRects?k.createRange():k.body.createTextRange(),F=i,L=-1;F-L>1;){var Q=Math.floor((F+L)/2);n=L+1;m=Q===i-1&&s.ignoreChars?p.length:Q+1;E=n===0&&a.isIE===8;e._isRangeRects?(k.setStart(p,n),k.setEnd(p,m)):(E&&(n=1),k.moveToElementText(s),k.move("character",n),k.moveEnd("character",m-n));n=k.getClientRects();for(var N=!1,P=0;P<n.length;P++)if(m=n[P],t=(E?u:m.left)*r-l.left,J=m.right*
r-l.left,x=m.top*q-l.top,m=m.bottom*q-l.top,t<=c&&c<J&&(!e._wrapMode||x<=b&&b<m)){N=!0;break}N?F=Q:L=Q}j+=F;n=F;m=F===i-1&&s.ignoreChars?p.length:Math.min(F+1,p.length);e._isRangeRects?(k.setStart(p,n),k.setEnd(p,m)):(k.moveToElementText(s),k.move("character",n),k.moveEnd("character",m-n));n=k.getClientRects();e=!1;n.length>0&&(m=n[0],t=(E?u:m.left)*r-l.left,J=m.right*r-l.left,e=c>t+(J-t)/2);l=j-h;d=d.getLine(g);g=d.charCodeAt(l);55296<=g&&g<=56319&&e?l<d.length&&(g=d.charCodeAt(l+1),56320<=g&&g<=
57343&&(j+=1)):56320<=g&&g<=57343&&!e&&l>0&&(g=d.charCodeAt(l-1),55296<=g&&g<=56319&&(j-=1));e&&j++}else{d=[];for(g=0;g<i;g++)d.push("<span>"),g===i-1?d.push(p.data.substring(g)):d.push(p.data.substring(g,g+1)),d.push("</span>");s.innerHTML=d.join("");for(d=s.firstChild;d;){m=d.getBoundingClientRect();t=m.left-l.left;J=m.right-l.left;if(t<=c&&c<J){c>t+(J-t)/2&&j++;break}j++;d=d.nextSibling}if(!this._createdDiv)s.innerHTML="",s.appendChild(p),l=e._getSelection(),(j<=l.start&&l.start<j+i||j<=l.end&&
l.end<j+i)&&e._updateDOMSelection()}break a}j+=i}s=s.nextSibling}return Math.min(f,Math.max(h,j))},getNextOffset:function(c,b){if(b.unit==="line"){var e=this.view._model,d=e.getLineAtOffset(c);if(b.count>0)return b.count--,e.getLineEnd(d);b.count++;return e.getLineStart(d)}return b.unit==="wordend"||b.unit==="wordWS"||b.unit==="wordendWS"?this._getNextOffset_W3C(c,b):a.isIE?this._getNextOffset_IE(c,b):this._getNextOffset_W3C(c,b)},_getNextOffset_W3C:function(a,c){function b(a){return 33<=a&&a<=47||
58<=a&&a<=64||91<=a&&a<=94||a===96||123<=a&&a<=126}function e(a){return a===32||a===9}var d=this.view._model,g=d.getLineAtOffset(a),h=d.getLine(g),f=d.getLineStart(g),d=d.getLineEnd(g),g=h.length,i=a-f,l,n=c.count<0?-1:1;if(c.unit==="word"||c.unit==="wordend"||c.unit==="wordWS"||c.unit==="wordendWS")for(var m,j,k;c.count!==0;){if(c.count>0){if(i===g)return d;l=h.charCodeAt(i);m=b(l);j=!m&&!e(l);for(i++;i<g;){l=h.charCodeAt(i);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){k=b(l);if(c.unit==="wordend"){if(!k&&
m)break}else if(k&&!m)break;l=!k&&!e(l)}else l=!e(l);if(c.unit==="wordend"||c.unit==="wordendWS"){if(!l&&j)break}else if(l&&!j)break;j=l;m=k;i++}}else{if(i===0)return f;i--;l=h.charCodeAt(i);m=b(l);for(j=!m&&!e(l);0<i;){l=h.charCodeAt(i-1);if(c.unit!=="wordWS"&&c.unit!=="wordendWS"){k=b(l);if(c.unit==="wordend"){if(k&&!m)break}else if(!k&&m)break;l=!k&&!e(l)}else l=!e(l);if(c.unit==="wordend"||c.unit==="wordendWS"){if(l&&!j)break}else if(!l&&j)break;j=l;m=k;i--}}c.count-=n}else for(;c.count!==0&&
0<=i+n&&i+n<=g;)i+=n,l=h.charCodeAt(i),56320<=l&&l<=57343&&i>0&&(l=h.charCodeAt(i-1),55296<=l&&l<=56319&&(i+=n)),c.count-=n;return f+i},_getNextOffset_IE:function(a,c){var b=this._ensureCreated(),e=this.view._model,d=this.lineIndex,g=0,h;h=e.getLineStart(d);var i=b.ownerDocument,f=c.count<0?-1:1;if(a===e.getLineEnd(d)){for(b=b.lastChild;b&&b.ignoreChars===b.firstChild.length;)b=b.previousSibling;if(!b)return h;g=i.body.createTextRange();g.moveToElementText(b);h=g.text.length;g.moveEnd(c.unit,f);g=
a+g.text.length-h}else if(a===h&&c.count<0)g=h;else for(b=b.firstChild;b;){e=b.firstChild.length;b.ignoreChars&&(e-=b.ignoreChars);if(h+e>a){g=i.body.createTextRange();a===h&&c.count<0?g.moveToElementText(b.previousSibling):(g.moveToElementText(b),g.collapse(),g.moveEnd("character",a-h));h=g.text.length;g.moveEnd(c.unit,f);g=a+g.text.length-h;break}h=e+h;b=b.nextSibling}c.count-=f;return g},destroy:function(){var a=this._createdDiv;if(a)a.parentNode.removeChild(a),this._createdDiv=null}};t.prototype=
{addKeyMode:function(a,c){var b=this._keyModes;c!==void 0?b.splice(c,0,a):b.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,c){a.setView(this);var b=this._rulers;if(c!==void 0){var e,d;for(e=0,d=0;e<b.length&&d<c;e++)a.getLocation()===b[e].getLocation()&&d++;b.splice(d,0,a);c=d}else b.push(a);this._createRuler(a,c);this._update()},computeSize:function(){var c=0,b=0,e=this._model,d=this._clientDiv;if(!d)return{width:c,height:b};var g=d.style.width;if(a.isWebkit)d.style.width="0x7fffffffpx";
for(var e=e.getLineCount(),h=0;h<e;h++){var i=this._getLine(h),f=i.getBoundingClientRect(),c=Math.max(c,f.right-f.left);b+=f.bottom-f.top;i.destroy()}if(a.isWebkit)d.style.width=g;d=this._getViewPadding();c+=d.right+d.left+this._metrics.scrollWidth;b+=d.bottom+d.top+this._metrics.scrollWidth;return{width:c,height:b}},convert:function(a,c,b){if(this._clientDiv){var e=this._getScroll(),d=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect();c==="document"&&(a.x!==void 0&&(a.x+=-e.x+g.left+
d.left),a.y!==void 0&&(a.y+=-e.y+g.top+d.top));b==="document"&&(a.x!==void 0&&(a.x+=e.x-g.left-d.left),a.y!==void 0&&(a.y+=e.y-g.top-d.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(),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 c=[],b=this._actions,e;for(e in b)b.hasOwnProperty(e)&&(a||!b[e].defaultHandler)&&c.push(e);return c},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 c=[],b=this._keyModes,e=0;e<b.length;e++)c=c.concat(b[e].getKeyBindings(a));return c},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 c=this._model,a=Math.min(Math.max(0,a),c.getCharCount()),c=c.getLineAtOffset(a),b=this._getLine(c),a=b.getBoundingClientRect(a);b.destroy();b=a.left;c=this._getLinePixel(c)+a.top;return{x:b,y:c}},getNextOffset:function(a,c){var b=new r(a,a,!1);this._doMove(c,b);return b.getCaret()},
getOptions:function(){var a;if(arguments.length===0)a=this._defaultOptions();else if(arguments.length===1){if(a=arguments[0],typeof a==="string")return g(this["_"+a])}else{a={};for(var c in arguments)arguments.hasOwnProperty(c)&&(a[arguments[c]]=void 0)}for(var b in a)a.hasOwnProperty(b)&&(a[b]=g(this["_"+b]));return a},getModel:function(){return this._model},getOffsetAtLocation:function(a,c){if(!this._clientDiv)return 0;var b=this._getLineIndex(c),e=this._getLine(b),b=e.getOffset(a,c-this._getLinePixel(b));
e.destroy();return b},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,c){return this._model.getText(a,c)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,c,b){if(this._clientDiv){if(a=this._actions[a]){if(!c&&a.handler&&a.handler(b))return!0;if(a.defaultHandler)return typeof a.defaultHandler(b)===
"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,
c){if(!(this._redrawCount>0))for(var b=this.getRulers(),e=0;e<b.length;e++)this.redrawLines(a,c,b[e])},redrawLines:function(a,c,b){if(!(this._redrawCount>0)&&(a===void 0&&(a=0),c===void 0&&(c=this._model.getLineCount()),a!==c)){var e=this._clientDiv;if(e){if(b)for(e=this._getRulerParent(b).firstChild;e;){if(e._ruler===b)break;e=e.nextSibling}b?e.rulerChanged=!0:this._lineHeight&&this._resetLineHeight(a,c);if(!b||b.getOverview()==="page")for(e=e.firstChild;e;){var d=e.lineIndex;if(a<=d&&d<c)e.lineChanged=
!0;e=e.nextSibling}if(!b&&!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<c)this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0;this._queueUpdate()}}},redrawRange:function(a,c){if(!(this._redrawCount>0)){var b=this._model;a===void 0&&(a=0);c===void 0&&(c=b.getCharCount());var e=b.getLineAtOffset(a),b=b.getLineAtOffset(Math.max(a,c-1))+1;this.redrawLines(e,b)}},removeKeyMode:function(a){for(var c=this._keyModes,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,
1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var c=this._rulers,b=0;b<c.length;b++)if(c[b]===a){c.splice(b,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,c,b){if(a){var e=this._actions,d=e[a];d||(d=e[a]={});d.handler=c;if(b!==void 0)d.actionDescription=b}},setKeyBinding:function(a,c){this._keyModes[0].setKeyBinding(a,c)},setCaretOffset:function(a,c,b){var e=this._model.getCharCount(),
a=Math.max(0,Math.min(a,e));this._setSelection(new r(a,a,!1),c===void 0||c,!0,b)},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 c=this._model.getLineCount(),
b=this._model.getCharCount(),e=a.getLineCount(),d=a.getCharCount(),g={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:b,addedCharCount:d,removedLineCount:c,addedLineCount:e};this.onModelChanging(g);this._model=a;g={type:"ModelChanged",start:0,removedCharCount:b,addedCharCount:d,removedLineCount:c,addedLineCount:e};this.onModelChanged(g);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(),e;for(e in a)if(a.hasOwnProperty(e)){var d=a[e];if(!c(this["_"+e],d)){var h=b[e]?b[e].update:null;h?h.call(this,d):this["_"+e]=g(d)}}},setSelection:function(a,c,b,e){var d=a>c;if(d)var g=a,a=c,c=g;g=this._model.getCharCount();a=Math.max(0,Math.min(a,g));c=Math.max(0,Math.min(c,g));this._setSelection(new r(a,c,d),b===void 0||b,!0,e)},setText:function(c,b,e){var d=b===void 0&&e===void 0;b===void 0&&(b=0);e===void 0&&
(e=this._model.getCharCount());if(d)this._variableLineHeight=!1;this._modifyContent({text:c,start:b,end:e,_code:!0},!d);if(d)this._columnX=-1,this._setSelection(new r(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,c){this._clientDiv&&
(a&&this._updateStyle(),c===void 0||c?this._update():this._queueUpdate())},_handleRootMouseDown:function(c){if(!this._ignoreEvent(c)){if(a.isFirefox&&c.which===1)this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0;var b=this._overlayDiv||this._clientDiv;if(a.isIE<9)b=this._viewDiv;for(var e=c.target?c.target:c.srcElement;e;){if(b===e)return;e=e.parentNode}c.preventDefault&&c.preventDefault();c.stopPropagation&&c.stopPropagation();if(!this._isW3CEvents){var d=
this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(c){if(!this._ignoreEvent(c)&&a.isFirefox&&c.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 c=this._rootDiv,b=a.createElement(c.ownerDocument,"div");c.appendChild(b);c.removeChild(b)}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",c=this._getWindow(),b=this._selDiv1.ownerDocument,c.getSelection){b=c.getSelection();for(c=b.anchorNode;c;){if(c===this._clientDiv){b.rangeCount>0&&b.removeAllRanges();break}c=c.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(c=b.selection.createRange().parentElement();c;){if(c===this._clientDiv){b.selection.empty();break}c=c.parentNode}this._ignoreSelect=
!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleContextMenu:function(c){if(!this._ignoreEvent(c)){a.isIE&&this._lastMouseButton===3&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",c),b.screenX=c.screenX,b.screenY=c.screenY,this.onContextMenu(b),b=b.defaultPrevented):a.isMac&&a.isFirefox&&c.button===0&&(b=!0);if(b)return c.preventDefault&&c.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(c){if(!this._ignoreEvent(c)){if(a.isFirefox){var b=
this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",c)),this._dragOffset=-1;else return c.preventDefault&&c.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(c){if(!this._ignoreEvent(c)){this._dropTarget=
!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",c));a.isFirefox&&(this._fixCaret(),c.dataTransfer.dropEffect==="none"&&!c.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(c){if(!this._ignoreEvent(c)){var b=!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",c)));if(a.isWebkit||b)return c.preventDefault&&c.preventDefault(),!1}},_handleDragOver:function(c){if(!this._ignoreEvent(c)){var b=
!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",c)));if(a.isWebkit||b){if(b)c.dataTransfer.dropEffect="none";c.preventDefault&&c.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 c=this._highlightRGB;this._selDiv1.style.background=c;this._selDiv2.style.background=c;this._selDiv3.style.background=c}if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(c){if(!this._ignoreEvent(c)){if(this.isListening("KeyDown")){var b=
this._createKeyEvent("KeyDown",c);this.onKeyDown(b);if(b.defaultPrevented){if(a.isFirefox)this._keyDownPrevented=!0;c.preventDefault();return}}b=!1;switch(c.keyCode){case 16:case 17:case 18:case 91:b=!0;break;default:this._setLinksVisible(!1)}if(c.keyCode===229){if(this._readonly)return c.preventDefault&&c.preventDefault(),!1;b=!0;if(a.isSafari&&a.isMac&&c.ctrlKey)b=!1,c.keyCode=129;b&&this._startIME()}else b||this._commitIME();if((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)return this._keyDownEvent=
c,!0;if(this._doAction(c))return c.preventDefault?(c.preventDefault(),c.stopPropagation()):(c.cancelBubble=!0,c.returnValue=!1,c.keyCode=0),!1}},_handleKeyPress:function(c){if(!this._ignoreEvent(c))if(this._keyDownPrevented)c.preventDefault&&(c.preventDefault(),c.stopPropagation()),this._keyDownPrevented=void 0;else{if(a.isMac&&a.isWebkit&&(63232<=c.keyCode&&c.keyCode<=63487||c.keyCode===13||c.keyCode===8))return c.preventDefault&&c.preventDefault(),!1;if(((a.isMac||a.isLinux)&&a.isFirefox<4||a.isOpera)&&
this._doAction(this._keyDownEvent))return c.preventDefault&&c.preventDefault(),!1;var b=a.isMac?c.metaKey:c.ctrlKey;if(c.charCode!==void 0&&b)switch(c.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",c),this.onKeyPress(b),b.defaultPrevented)){c.preventDefault();return}if(this._doAction(c))return c.preventDefault?(c.preventDefault(),c.stopPropagation()):(c.cancelBubble=!0,c.returnValue=!1,c.keyCode=0),!1;b=!1;if(a.isMac){if(c.ctrlKey||
c.metaKey)b=!0}else if(a.isFirefox){if(c.ctrlKey||c.altKey)b=!0}else c.ctrlKey^c.altKey&&(b=!0);if(!b&&(b=a.isOpera?c.which:c.charCode!==void 0?c.charCode:c.keyCode,b>31))return this._doContent(String.fromCharCode(b)),c.preventDefault&&c.preventDefault(),!1}},_handleDocKeyUp:function(c){(a.isMac?c.metaKey:c.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var c=this._createKeyEvent("KeyUp",a);this.onKeyUp(c);if(c.defaultPrevented){a.preventDefault();
return}}this._handleDocKeyUp(a);a.keyCode===13&&this._commitIME()}},_handleLinkClick:function(c){if(!(a.isMac?c.metaKey:c.ctrlKey))return c.preventDefault&&c.preventDefault(),!1},_handleMouse:function(c){var b=this._getWindow(),e=!0,d=b;if(a.isIE||a.isFirefox&&!this._overlayDiv)d=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=!0;var g=this;b.setTimeout(function(){g.focus();g._ignoreFocus=!1},0)}this._clickCount===1?(e=this._setSelectionTo(c.clientX,c.clientY,c.shiftKey,!a.isOpera&&
this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(c.clientX,c.clientY,c.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(c){if(!this._ignoreEvent(c)){if(this._linksVisible)if((c.target||c.srcElement).tagName!=="A")this._setLinksVisible(!1);else return;this._commitIME();var b=c.which;b||(c.button===4&&(b=2),c.button===2&&(b=3),c.button===1&&(b=1));
var e=b!==2&&c.timeStamp?c.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,g=Math.abs(this._lastMouseX-c.clientX),h=Math.abs(this._lastMouseY-c.clientY),i=this._lastMouseButton===b;this._lastMouseX=c.clientX;this._lastMouseY=c.clientY;this._lastMouseTime=e;this._lastMouseButton=b;if(b===1)this._isMouseDown=!0,i&&d<=this._clickTime&&g<=this._clickDist&&h<=this._clickDist?this._clickCount++:this._clickCount=1;if(this.isListening("MouseDown")&&(e=this._createMouseEvent("MouseDown",c),this.onMouseDown(e),
e.defaultPrevented)){c.preventDefault();return}if(b===1&&this._handleMouse(c)&&(a.isIE>=9||a.isOpera||a.isChrome||a.isSafari||a.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),c.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(c){if(!this._animation){var b=this._isClientDiv(c);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",c));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==c.clientX||this._lastMouseMoveY!==c.clientY;this._lastMouseMoveX=c.clientX;this._lastMouseMoveY=c.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(a.isMac?c.metaKey:c.ctrlKey));
if(!this._isW3CEvents){if(c.button===0)return this._setGrab(null),!0;if(!this._isMouseDown&&c.button===1&&(this._clickCount&1)!==0&&b)return this._clickCount=2,this._handleMouse(c,this._clickCount)}if(this._isMouseDown&&this._dragOffset===-1){var b=c.clientX,c=c.clientY,d=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect(),h=this._getClientWidth(),i=this._getClientHeight(),e=g.left+d.left,f=g.top+d.top,h=g.left+d.left+h,d=g.top+d.top+i;c<f?this._doAutoScroll("up",b,c-f):c>d?this._doAutoScroll("down",
b,c-d):b<e&&!this._wrapMode?this._doAutoScroll("left",b-e,c):b>h&&!this._wrapMode?this._doAutoScroll("right",b-h,c):(this._endAutoScroll(),this._setSelectionTo(b,c,!0))}}}},_isClientDiv:function(a){for(var c=this._overlayDiv||this._clientDiv,a=a.target?a.target:a.srcElement;a;){if(c===a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,c){return{type:a,event:c,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,c){var b=this.convert({x:c.clientX,y:c.clientY},
"page","document");return{type:a,event:c,clickCount:this._clickCount,x:b.x,y:b.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(c){var b=c.which?c.button===0:c.button===1;if(this.isListening("MouseUp")&&(this._isClientDiv(c)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",c));if(!this._linksVisible&&b&&this._isMouseDown){if(this._dragOffset!==-1)b=this._getSelection(),b.extend(this._dragOffset),b.collapse(),this._setSelection(b,!0,!0),this._dragOffset=
-1;this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null);a.isFirefox&&c.preventDefault()}},_handleMouseWheel:function(c){var b=this._getLineHeight(),e=0,d=0;a.isIE||a.isOpera?d=-c.wheelDelta/40*b:a.isFirefox?(b=a.isMac?c.detail*3:Math.max(-256,Math.min(256,c.detail))*b,c.axis===c.HORIZONTAL_AXIS?e=b:d=b):a.isMac?(d=c.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=c.timeStamp,e=c.wheelDeltaX%120!==0?1:d<40?40/(40-d):40,d=c.wheelDeltaY%120!==0?1:d<40?40/(40-d):40,e=
Math.ceil(-c.wheelDeltaX/e),-1<e&&e<0&&(e=-1),0<e&&e<1&&(e=1),d=Math.ceil(-c.wheelDeltaY/d),-1<d&&d<0&&(d=-1),0<d&&d<1&&(d=1)):(e=-c.wheelDeltaX,d=-c.wheelDeltaY/120*8*b);if(a.isSafari){for(b=c.target;b&&b.lineIndex===void 0;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(b.x!==e.x||b.y!==e.y)return c.preventDefault&&c.preventDefault(),!1},_handlePaste:function(c){if(!this._ignoreEvent(c)&&!this._ignorePaste&&this._doPaste(c)){if(a.isIE){var b=
this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();b._ignoreFocus=!1},0)}c.preventDefault&&c.preventDefault();return!1}},_handleResize:function(){var b=this._parent.clientWidth,e=this._parent.clientHeight;if(this._parentWidth!==b||this._parentHeight!==e){this._parentWidth!==b&&this._wrapMode&&this._resetLineHeight();this._parentWidth=b;this._parentHeight=e;b=a.isIE<9;e=this._calculateMetrics();if(!c(e,this._metrics)){if(this._variableLineHeight)this._variableLineHeight=
!1,this._resetLineHeight();this._metrics=e;b=!0}b?this._queueUpdate():this._update()}},_handleRulerEvent:function(a){for(var c=a.target?a.target:a.srcElement,b=c.lineIndex;c&&!c._ruler;){if(b===void 0&&c.lineIndex!==void 0)b=c.lineIndex;c=c.parentNode}var e=c?c._ruler:null;if(b===void 0&&e&&e.getOverview()==="document"){var b=this._getClientHeight(),d=this._model.getLineCount(),g=this._getViewPadding(),h=this._viewDiv.getBoundingClientRect(),b=Math.floor((a.clientY-h.top-this._metrics.scrollWidth)*
d/(b+g.top+g.bottom-2*this._metrics.scrollWidth));0<=b&&b<d||(b=void 0)}if(e)switch(a.type){case "click":if(e.onClick)e.onClick(b,a);break;case "dblclick":if(e.onDblClick)e.onDblClick(b,a);break;case "mousemove":if(e.onMouseMove)e.onMouseMove(b,a);break;case "mouseover":if(e.onMouseOver)e.onMouseOver(b,a);break;case "mouseout":if(e.onMouseOut){for(d=a.relatedTarget;d&&d!==this._rootDiv;){if(d===c)return;d=d.parentNode}e.onMouseOut(b,a)}}},_handleScroll:function(){var a=this._getScroll(!1),c=this._hScroll,
b=this._vScroll;if(c!==a.x||b!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),this._update(b===a.y),this.onScroll({type:"Scroll",oldValue:{x:c,y:b},newValue:a})},_handleSelectStart:function(a){if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,c){if(a){var b;b=a.tagName==="DIV"?a:a.parentNode.parentNode;var e=0,d=b.lineIndex;if(a.tagName!=="DIV")for(b=b.firstChild;b;){var g=b.firstChild;if(g===a){b.ignoreChars&&(e-=b.ignoreChars);e+=c;break}b.ignoreChars&&
(e-=b.ignoreChars);e+=g.data.length;b=b.nextSibling}return Math.max(0,e)+this._model.getLineStart(d)}},_updateSelectionFromDOM:function(){var a=this._getWindow().getSelection(),c=this._getModelOffset(a.anchorNode,a.anchorOffset),a=this._getModelOffset(a.focusNode,a.focusOffset);c===void 0||a===void 0||this._setSelection(new r(c,a),!1,!1)},_handleSelectionChange:function(){if(this._imeOffset===-1)if(a.isAndroid){var c=this._getWindow();this._selTimer&&c.clearTimeout(this._selTimer);var b=this;this._selTimer=
c.setTimeout(function(){if(b._clientDiv)b._selTimer=null,b._updateSelectionFromDOM()},250)}else this._updateSelectionFromDOM()},_handleTextInput:function(c){if(!this._ignoreEvent(c)){this._imeOffset=-1;if(a.isAndroid){for(var b=this._getWindow().getSelection(),e=b.anchorNode;e;){if(e.lineIndex!==void 0)break;e=e.parentNode}if(e){var d=this._model,g=e.lineIndex,h=d.getLine(g),i=h,f=0,d=d.getLineStart(g);if(b.rangeCount>0)b.getRangeAt(0).deleteContents(),g=e.ownerDocument.createTextNode(c.data),b.getRangeAt(0).insertNode(g),
f=this._getDOMText(e,g),i=f.text,f=f.offset,g.parentNode.removeChild(g);e.lineRemoved=!0;for(e=0;h.charCodeAt(e)===i.charCodeAt(e)&&e<f;)e++;b=h.length-1;for(g=i.length-h.length;h.charCodeAt(b)===i.charCodeAt(b+g)&&b+g>=f+c.data.length;)b--;b++;h=i.substring(e,b+g);e+=d;b+=d;this._modifyContent({text:h,start:e,end:b,_ignoreDOMSelection:!0},!0)}}else this._doContent(c.data);c.preventDefault()}},_handleTouchStart:function(c){this._commitIME();var b=this._getWindow();if(this._touchScrollTimer)this._vScrollDiv.style.display=
"none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),this._touchScrollTimer=null;var e=c.touches;if(e.length===1){var e=e[0],d=e.clientX,g=e.clientY;this._touchStartX=d;this._touchStartY=g;if(a.isAndroid&&(g<e.pageY-b.pageYOffset||d<e.pageX-b.pageXOffset))d=e.pageX-b.pageXOffset,g=e.pageY-b.pageYOffset;b=this.convert({x:d,y:g},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=c.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var c=
a.touches;if(c.length===1){c=c[0];this._touchCurrentX=c.clientX;this._touchCurrentY=c.clientY;if(!this._touchScrollTimer&&a.timeStamp-this._touchStartTime<200){this._vScrollDiv.style.display="block";if(!this._wrapMode)this._hScrollDiv.style.display="block";var b=this,e=this._getWindow();this._touchScrollTimer=e.setInterval(function(){var a=0,c=0;if(b._touching)a=b._touchStartX-b._touchCurrentX,c=b._touchStartY-b._touchCurrentY,b._touchSpeedX=a/10,b._touchSpeedY=c/10,b._touchStartX=b._touchCurrentX,
b._touchStartY=b._touchCurrentY;else if(Math.abs(b._touchSpeedX)<0.1&&Math.abs(b._touchSpeedY)<0.1){b._vScrollDiv.style.display="none";b._hScrollDiv.style.display="none";e.clearInterval(b._touchScrollTimer);b._touchScrollTimer=null;return}else a=b._touchSpeedX*10,c=b._touchSpeedY*10,b._touchSpeedX*=0.95,b._touchSpeedY*=0.95;b._scrollView(a,c)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){if(a.touches.length===0)this._touching=!1},_doAction:function(a){var c,b,e=this._keyModes;
for(b=e.length-1;b>=0;b--)if(c=e[b],typeof c.match==="function"&&(c=c.match(a),c!==void 0))return this.invokeAction(c);return!1},_doMove:function(a,c){var b=this._model,e=c.getCaret(),d=b.getLineAtOffset(e);if(!a.count)a.count=1;for(;a.count!==0;){var g=b.getLineStart(d);if(a.count<0&&e===g)if(d>0)a.unit==="character"&&a.count++,d--,c.extend(b.getLineEnd(d));else break;else if(a.count>0&&e===b.getLineEnd(d))if(d+1<b.getLineCount())a.unit==="character"&&a.count--,d++,c.extend(b.getLineStart(d));else break;
else{var h=!1;a.expandTab&&a.unit==="character"&&(e-g)%this._tabSize===0&&(h=!/[^ ]/.test(b.getText(g,e)));h?(c.extend(e-this._tabSize),a.count+=a.count<0?1:-1):(g=this._getLine(d),c.extend(g.getNextOffset(e,a)),g.destroy())}e=c.getCaret()}return c},_doBackspace:function(a){var c=this._getSelection();if(c.isEmpty()){if(!a.count)a.count=1;a.count*=-1;a.expandTab=this._expandTab;this._doMove(a,c)}this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doCase:function(a){var c=this._getSelection();
this._doMove(a,c);var b=this.getText(c.start,c.end);this._setSelection(c,!0);switch(a.type){case "lower":b=b.toLowerCase();break;case "capitalize":b=b.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(c=0;c<b.length;c++){var e=b[c],d=e.toLowerCase(),e=d!==e?d:e.toUpperCase();a+=e}b=a;break;default:b=b.toUpperCase()}this._doContent(b);return!0},_doContent:function(a){var c=this._getSelection();if(this._overwriteMode&&c.isEmpty()){var b=this._model,e=b.getLineAtOffset(c.end);
c.end<b.getLineEnd(e)&&(b=this._getLine(e),c.extend(b.getNextOffset(c.getCaret(),{unit:"character",count:1})),b.destroy())}this._modifyContent({text:a,start:c.start,end:c.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var c=this._getSelection();return!c.isEmpty()?this._setClipboardText(this._getBaseText(c.start,c.end),a):!0},_doCursorNext:function(a){var c=this._getSelection();!c.isEmpty()&&!a.select?c.start=c.end:this._doMove(a,c);a.select||c.collapse();this._setSelection(c,!0);return!0},_doCursorPrevious:function(a){var c=
this._getSelection();if(!c.isEmpty()&&!a.select)c.end=c.start;else{if(!a.count)a.count=1;a.count*=-1;this._doMove(a,c)}a.select||c.collapse();this._setSelection(c,!0);return!0},_doCut:function(a){var c=this._getSelection();return!c.isEmpty()?(c=this._getBaseText(c.start,c.end),this._doContent(""),this._setClipboardText(c,a)):!0},_doDelete:function(a){var c=this._getSelection();c.isEmpty()&&this._doMove(a,c);this._modifyContent({text:"",start:c.start,end:c.end},!0);return!0},_doEnd:function(a){var c=
this._getSelection(),b=this._model,e;if(a.ctrl)c.extend(b.getCharCount()),e=function(){};else{var d=c.getCaret(),g=b.getLineAtOffset(d);if(this._wrapMode){var h=this._getLine(g),d=h.getLineIndex(d),d=d===h.getLineCount()-1?b.getLineEnd(g):h.getLineStart(d+1)-1;h.destroy()}else a.count&&a.count>0&&(g=Math.min(g+a.count-1,b.getLineCount()-1)),d=b.getLineEnd(g);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0,!0,e);return!0},_doEnter:function(a){var c=this._model,b=this._getSelection();this._doContent(c.getLineDelimiter());
if(a&&a.noCursor)b.end=b.start,this._setSelection(b,!0);return!0},_doHome:function(a){var c=this._getSelection(),b=this._model,e;if(a.ctrl)c.extend(0),e=function(){};else{var d=c.getCaret(),g=b.getLineAtOffset(d);this._wrapMode?(b=this._getLine(g),d=b.getLineIndex(d),d=b.getLineStart(d),b.destroy()):d=b.getLineStart(g);c.extend(d)}a.select||c.collapse();this._setSelection(c,!0,!0,e);return!0},_doLineDown:function(c){var b=this._model,e=this._getSelection(),d=e.getCaret(),g=b.getLineAtOffset(d),h=
this._getLine(g),i=this._columnX,f=1,l=!1;if(i===-1||c.wholeLine||c.select&&a.isIE)i=c.wholeLine?b.getLineEnd(g+1):d,i=h.getBoundingClientRect(i).left;(d=h.getLineIndex(d))<h.getLineCount()-1?f=h.getClientRects(d+1).top+1:(d=b.getLineCount()-1,l=g===d,c.count&&c.count>0?g=Math.min(g+c.count,d):g++);d=!1;if(l){if(c.select||a.isMac||a.isLinux)e.extend(b.getCharCount()),d=!0}else h.lineIndex!==g&&(h.destroy(),h=this._getLine(g)),e.extend(h.getOffset(i,f)),d=!0;d&&(c.select||e.collapse(),this._setSelection(e,
!0,!0));this._columnX=i;h.destroy();return!0},_doLineUp:function(c){var b=this._model,e=this._getSelection(),d=e.getCaret(),g=b.getLineAtOffset(d),h=this._getLine(g),i=this._columnX,f=!1,l;if(i===-1||c.wholeLine||c.select&&a.isIE)i=c.wholeLine?b.getLineStart(g-1):d,i=h.getBoundingClientRect(i).left;(d=h.getLineIndex(d))>0?l=h.getClientRects(d-1).top+1:(f=g===0,f||(c.count&&c.count>0?g=Math.max(g-c.count,0):g--,l=this._getLineHeight(g)-1));d=!1;if(f){if(c.select||a.isMac||a.isLinux)e.extend(0),d=!0}else h.lineIndex!==
g&&(h.destroy(),h=this._getLine(g)),e.extend(h.getOffset(i,l)),d=!0;d&&(c.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=i;h.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(c){var b=this,e=this._model,d=this._getSelection(),g=d.getCaret(),h=e.getLineAtOffset(g),i=e.getLineCount(),f=this._getScroll(),e=this._getClientHeight(),l,n;if(this._lineHeight){l=this._columnX;f=this._getBoundsAtOffset(g);if(l===-1||c.select&&a.isIE)l=f.left;g=this._getLineIndex(f.top+e);
n=this._getLine(g);h=this._getLinePixel(g);g=n.getOffset(l,f.top+e-h);e=n.getBoundingClientRect(g);n.destroy();d.extend(g);c.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=l},e.top+h-f.top);return!0}if(h<i-1){var m=this._getLineHeight(),j=Math.min(i-h-1,Math.floor(e/m)),j=Math.max(1,j);l=this._columnX;if(l===-1||c.select&&a.isIE)n=this._getLine(h),l=n.getBoundingClientRect(g).left,n.destroy();n=this._getLine(h+j);d.extend(n.getOffset(l,0));n.destroy();c.select||d.collapse();
c=i*m;g=f.y+j*m;g+e>c&&(g=c-e);this._setSelection(d,!0,!0,function(){b._columnX=l},g-f.y)}return!0},_doPageUp:function(c){var b=this,e=this._model,d=this._getSelection(),g=d.getCaret(),h=e.getLineAtOffset(g),i=this._getScroll(),f=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;i=this._getBoundsAtOffset(g);if(l===-1||c.select&&a.isIE)l=i.left;g=this._getLineIndex(i.bottom-f);e=this._getLine(g);h=this._getLinePixel(g);g=e.getOffset(l,i.bottom-f-h);f=e.getBoundingClientRect(g);e.destroy();
d.extend(g);c.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=l},f.top+h-i.top);return!0}if(h>0){var n=this._getLineHeight(),f=Math.max(1,Math.min(h,Math.floor(f/n)));l=this._columnX;if(l===-1||c.select&&a.isIE)e=this._getLine(h),l=e.getBoundingClientRect(g).left,e.destroy();e=this._getLine(h-f);d.extend(e.getOffset(l,this._getLineHeight(h-f)-1));e.destroy();c.select||d.collapse();c=Math.max(0,i.y-f*n);this._setSelection(d,!0,!0,function(){b._columnX=l},c-i.y)}return!0},_doPaste:function(c){var b=
this;return this._getClipboardText(c,function(c){c&&(a.isLinux&&b._lastMouseButton===2&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(c))})!==null},_doScroll:function(a){var c=a.type,b=this._model,e=b.getLineCount(),a=this._getClientHeight(),d=this._getLineHeight();e*=d;var g=this._getScroll().y,h;switch(c){case "textStart":h=0;break;case "textEnd":h=e-a;break;case "pageDown":h=g+a;break;case "pageUp":h=g-a;break;case "lineDown":h=
g+d;break;case "lineUp":h=g-d;break;case "centerLine":c=this._getSelection(),h=b.getLineAtOffset(c.start),b=(b.getLineAtOffset(c.end)-h+1)*d,h=h*d-a/2+b/2}h!==void 0&&(h=Math.min(Math.max(0,h),e-a),this._scrollViewAnimated(0,h-g,function(){}));return!0},_doSelectAll:function(){var a=this._model,c=this._getSelection();c.setCaret(0);c.extend(a.getCharCount());this._setSelection(c,!1);return!0},_doTab:function(){if(this._tabMode&&!this._readonly){var a="\t";if(this._expandTab)var c=this._model,a=this._getSelection().getCaret(),
b=c.getLineAtOffset(a),c=c.getLineStart(b),a=Array(this._tabSize-(a-c)%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 c=
this._model,b=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=b.getCaret(),g=c.getLineCount(),h=c.getLineAtOffset(d),i;if(this._autoScrollDir==="up"||this._autoScrollDir==="down")d=this._autoScrollY/this._getLineHeight(),d=d<0?Math.floor(d):Math.ceil(d),i=Math.max(0,Math.min(g-1,h+d));else if(this._autoScrollDir==="left"||this._autoScrollDir==="right")i=this._getLineIndex(e.y),h=this._getLine(h),e.x+=h.getBoundingClientRect(d,!1).left,h.destroy();
i===0&&(a.isMac||a.isLinux)?b.extend(0):i===g-1&&(a.isMac||a.isLinux)?b.extend(c.getCharCount()):(h=this._getLine(i),b.extend(h.getOffset(e.x,e.y-this._getLinePixel(i))),h.destroy());this._setSelection(b,!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 c=this._model.getLineCount(),b=0;if(a){for(var a=
0,e=(new Date).getTime(),d=0;b<c;)if(this._lineHeight[b]||(a++,d||(d=b),this._lineHeight[b]=this._calculateLineHeight(b)),b++,(new Date).getTime()-e>100)break;this.redrawRulers(0,c);this._queueUpdate()}a=this._getWindow();if(b!==c){var g=this;this._calculateLHTimer=a.setTimeout(function(){g._calculateLHTimer=null;g._calculateLineHeightTimer(!0)},0)}else if(this._calculateLHTimer)a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0}},_calculateLineHeight:function(a){var a=this._getLine(a),
c=a.getBoundingClientRect();a.destroy();return Math.max(1,c.bottom-c.top)},_calculateMetrics:function(){var c=this._clientDiv,b=c.ownerDocument,e=a.createElement(b,"div");e.style.lineHeight="normal";var d={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(d);h(d.style,e);e.style.position="fixed";e.style.left="-1000px";var g=a.createElement(b,"span");g.appendChild(b.createTextNode(" "));e.appendChild(g);var i=a.createElement(b,"span");i.style.fontStyle=
"italic";i.appendChild(b.createTextNode(" "));e.appendChild(i);var f=a.createElement(b,"span");f.style.fontWeight="bold";f.appendChild(b.createTextNode(" "));e.appendChild(f);d=a.createElement(b,"span");d.style.fontWeight="bold";d.style.fontStyle="italic";d.appendChild(b.createTextNode(" "));e.appendChild(d);c.appendChild(e);var l=e.getBoundingClientRect(),g=g.getBoundingClientRect(),i=i.getBoundingClientRect(),f=f.getBoundingClientRect(),d=d.getBoundingClientRect(),g=g.bottom-g.top,i=i.bottom-i.top,
f=f.bottom-f.top,j=d.bottom-d.top,k=0,d=l.bottom-l.top<=0,l=Math.max(1,l.bottom-l.top);i>g&&(k=1);f>i&&(k=2);j>f&&(k=3);var r;if(k!==0){r={style:{}};if((k&1)!==0)r.style.fontStyle="italic";if((k&2)!==0)r.style.fontWeight="bold"}g=m(e);c.removeChild(e);j=n(this._viewDiv);e=a.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=j.left+"px";e.style.paddingTop=j.top+"px";e.style.paddingRight=j.right+"px";e.style.paddingBottom=j.bottom+"px";e.style.width="100px";e.style.height=
"100px";j=a.createElement(b,"div");j.style.width="100%";j.style.height="100%";e.appendChild(j);c.appendChild(e);k=e.getBoundingClientRect();i=j.getBoundingClientRect();f=0;if(!this._singleMode)e.style.overflow="hidden",j.style.height="200px",f=e.clientWidth,e.style.overflow="scroll",f-=e.clientWidth;c.removeChild(e);j={left:i.left-k.left,top:i.top-k.top,right:k.right-i.right,bottom:k.bottom-i.bottom};i=k=0;if(!d&&(this._wrapOffset||this._marginOffset))e=a.createElement(b,"div"),e.style.position="fixed",
e.style.left="-1000px",e.innerHTML=Array(this._wrapOffset+1).join(" "),c.appendChild(e),k=e.getBoundingClientRect(),k=Math.ceil(k.right-k.left),e.innerHTML=Array(this._marginOffset+1).join(" "),i=e.getBoundingClientRect(),i=Math.ceil(i.right-i.left),c.removeChild(e);return{lineHeight:l,largestFontStyle:r,lineTrim:g,viewPadding:j,scrollWidth:f,wrapWidth:k,marginWidth:i,invalid:d}},_cancelAnimation:function(){if(this._animation)this._animation.stop(),this._animation=null},_clearSelection:function(a){var c=
this._getSelection();if(c.isEmpty())return!1;a==="next"?c.start=c.end:c.end=c.start;this._setSelection(c,!0);return!0},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var a=this._model,c=a.getLineAtOffset(this._imeOffset),b=a.getLineStart(c),e=this._getDOMText(this._getLineNode(c)).text,a=a.getLine(c),b=this._imeOffset-b,a=b+e.length-a.length;b!==a&&this._doContent(e.substring(b,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(c){return a._doLineUp(e(c,{select:!1}))},actionDescription:{name:f.lineUp}},lineDown:{defaultHandler:function(c){return a._doLineDown(e(c,{select:!1}))},actionDescription:{name:f.lineDown}},lineStart:{defaultHandler:function(c){return a._doHome(e(c,{select:!1,ctrl:!1}))},actionDescription:{name:f.lineStart}},lineEnd:{defaultHandler:function(c){return a._doEnd(e(c,{select:!1,ctrl:!1}))},actionDescription:{name:f.lineEnd}},
charPrevious:{defaultHandler:function(c){return a._doCursorPrevious(e(c,{select:!1,unit:"character"}))},actionDescription:{name:f.charPrevious}},charNext:{defaultHandler:function(c){return a._doCursorNext(e(c,{select:!1,unit:"character"}))},actionDescription:{name:f.charNext}},pageUp:{defaultHandler:function(c){return a._doPageUp(e(c,{select:!1}))},actionDescription:{name:f.pageUp}},pageDown:{defaultHandler:function(c){return a._doPageDown(e(c,{select:!1}))},actionDescription:{name:f.pageDown}},scrollPageUp:{defaultHandler:function(c){return a._doScroll(e(c,
{type:"pageUp"}))},actionDescription:{name:f.scrollPageUp}},scrollPageDown:{defaultHandler:function(c){return a._doScroll(e(c,{type:"pageDown"}))},actionDescription:{name:f.scrollPageDown}},scrollLineUp:{defaultHandler:function(c){return a._doScroll(e(c,{type:"lineUp"}))},actionDescription:{name:f.scrollLineUp}},scrollLineDown:{defaultHandler:function(c){return a._doScroll(e(c,{type:"lineDown"}))},actionDescription:{name:f.scrollLineDown}},wordPrevious:{defaultHandler:function(c){return a._doCursorPrevious(e(c,
{select:!1,unit:"word"}))},actionDescription:{name:f.wordPrevious}},wordNext:{defaultHandler:function(c){return a._doCursorNext(e(c,{select:!1,unit:"word"}))},actionDescription:{name:f.wordNext}},textStart:{defaultHandler:function(c){return a._doHome(e(c,{select:!1,ctrl:!0}))},actionDescription:{name:f.textStart}},textEnd:{defaultHandler:function(c){return a._doEnd(e(c,{select:!1,ctrl:!0}))},actionDescription:{name:f.textEnd}},scrollTextStart:{defaultHandler:function(c){return a._doScroll(e(c,{type:"textStart"}))},
actionDescription:{name:f.scrollTextStart}},scrollTextEnd:{defaultHandler:function(c){return a._doScroll(e(c,{type:"textEnd"}))},actionDescription:{name:f.scrollTextEnd}},centerLine:{defaultHandler:function(c){return a._doScroll(e(c,{type:"centerLine"}))},actionDescription:{name:f.centerLine}},selectLineUp:{defaultHandler:function(c){return a._doLineUp(e(c,{select:!0}))},actionDescription:{name:f.selectLineUp}},selectLineDown:{defaultHandler:function(c){return a._doLineDown(e(c,{select:!0}))},actionDescription:{name:f.selectLineDown}},
selectWholeLineUp:{defaultHandler:function(c){return a._doLineUp(e(c,{select:!0,wholeLine:!0}))},actionDescription:{name:f.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(c){return a._doLineDown(e(c,{select:!0,wholeLine:!0}))},actionDescription:{name:f.selectWholeLineDown}},selectLineStart:{defaultHandler:function(c){return a._doHome(e(c,{select:!0,ctrl:!1}))},actionDescription:{name:f.selectLineStart}},selectLineEnd:{defaultHandler:function(c){return a._doEnd(e(c,{select:!0,ctrl:!1}))},
actionDescription:{name:f.selectLineEnd}},selectCharPrevious:{defaultHandler:function(c){return a._doCursorPrevious(e(c,{select:!0,unit:"character"}))},actionDescription:{name:f.selectCharPrevious}},selectCharNext:{defaultHandler:function(c){return a._doCursorNext(e(c,{select:!0,unit:"character"}))},actionDescription:{name:f.selectCharNext}},selectPageUp:{defaultHandler:function(c){return a._doPageUp(e(c,{select:!0}))},actionDescription:{name:f.selectPageUp}},selectPageDown:{defaultHandler:function(c){return a._doPageDown(e(c,
{select:!0}))},actionDescription:{name:f.selectPageDown}},selectWordPrevious:{defaultHandler:function(c){return a._doCursorPrevious(e(c,{select:!0,unit:"word"}))},actionDescription:{name:f.selectWordPrevious}},selectWordNext:{defaultHandler:function(c){return a._doCursorNext(e(c,{select:!0,unit:"word"}))},actionDescription:{name:f.selectWordNext}},selectTextStart:{defaultHandler:function(c){return a._doHome(e(c,{select:!0,ctrl:!0}))},actionDescription:{name:f.selectTextStart}},selectTextEnd:{defaultHandler:function(c){return a._doEnd(e(c,
{select:!0,ctrl:!0}))},actionDescription:{name:f.selectTextEnd}},deletePrevious:{defaultHandler:function(c){return a._doBackspace(e(c,{unit:"character"}))},actionDescription:{name:f.deletePrevious}},deleteNext:{defaultHandler:function(c){return a._doDelete(e(c,{unit:"character"}))},actionDescription:{name:f.deleteNext}},deleteWordPrevious:{defaultHandler:function(c){return a._doBackspace(e(c,{unit:"word"}))},actionDescription:{name:f.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(c){return a._doDelete(e(c,
{unit:"word"}))},actionDescription:{name:f.deleteWordNext}},deleteLineStart:{defaultHandler:function(c){return a._doBackspace(e(c,{unit:"line"}))},actionDescription:{name:f.deleteLineStart}},deleteLineEnd:{defaultHandler:function(c){return a._doDelete(e(c,{unit:"line"}))},actionDescription:{name:f.deleteLineEnd}},tab:{defaultHandler:function(){return a._doTab()},actionDescription:{name:f.tab}},shiftTab:{defaultHandler:function(){return a._doShiftTab()},actionDescription:{name:f.shiftTab}},enter:{defaultHandler:function(){return a._doEnter()},
actionDescription:{name:f.enter}},enterNoCursor:{defaultHandler:function(c){return a._doEnter(e(c,{noCursor:!0}))},actionDescription:{name:f.enterNoCursor}},selectAll:{defaultHandler:function(){return a._doSelectAll()},actionDescription:{name:f.selectAll}},copy:{defaultHandler:function(){return a._doCopy()},actionDescription:{name:f.copy}},cut:{defaultHandler:function(){return a._doCut()},actionDescription:{name:f.cut}},paste:{defaultHandler:function(){return a._doPaste()},actionDescription:{name:f.paste}},
uppercase:{defaultHandler:function(c){return a._doCase(e(c,{type:"upper"}))},actionDescription:{name:f.uppercase}},lowercase:{defaultHandler:function(c){return a._doCase(e(c,{type:"lower"}))},actionDescription:{name:f.lowercase}},capitalize:{defaultHandler:function(c){return a._doCase(e(c,{unit:"word",type:"capitalize"}))},actionDescription:{name:f.capitalize}},reversecase:{defaultHandler:function(c){return a._doCase(e(c,{type:"reverse"}))},actionDescription:{name:f.reversecase}},toggleOverwriteMode:{defaultHandler:function(){return a._doOverwriteMode()},
actionDescription:{name:f.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(){return a._doTabMode()},actionDescription:{name:f.toggleTabMode}},toggleWrapMode:{defaultHandler:function(){return a._doWrapMode()},actionDescription:{name:f.toggleWrapMode}}}},_createRulerParent:function(c){var b=a.createElement(document,"div");b.className=c;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");this._rootDiv.appendChild(b);return b},_createRuler:function(c,b){if(this._clientDiv){var e=this._getRulerParent(c);if(e){if(e!==this._marginDiv||this._marginOffset)e.style.display="block";var d=a.createElement(e.ownerDocument,"div");d._ruler=c;d.rulerChanged=!0;d.style.position="relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(b===void 0||b<0||b>=e.children.length)e.appendChild(d);
else{for(var g=e.firstChild;g&&b-- >0;)g=g.nextSibling;e.insertBefore(d,g)}}}},_createView:function(){if(!this._clientDiv){for(var c=this._parent;c.hasChildNodes();)c.removeChild(c.lastChild);var b=c.ownerDocument,e=a.createElement(b,"div");this._rootDiv=e;e.tabIndex=-1;e.style.position="relative";e.style.overflow="hidden";e.style.width="100%";e.style.height="100%";e.style.overflow="hidden";e.style.WebkitTextSizeAdjust="100%";e.setAttribute("role","application");c.appendChild(e);this._leftDiv=this._createRulerParent("textviewLeftRuler");
c=a.createElement(b,"div");c.className="textviewScroll";this._viewDiv=c;c.tabIndex=-1;c.style.position="absolute";c.style.top="0px";c.style.bottom="0px";c.style.borderWidth="0px";c.style.margin="0px";c.style.outline="none";c.style.background="transparent";if(a.isMac&&a.isWebkit)c.style.pointerEvents="none",c.style.zIndex="2";e.appendChild(c);(this._rightDiv=this._createRulerParent("textviewRightRuler")).style.right="0px";var d=a.createElement(b,"div");this._scrollDiv=d;d.style.margin="0px";d.style.borderWidth=
"0px";d.style.padding="0px";c.appendChild(d);(this._marginDiv=this._createRulerParent("textviewMarginRuler")).style.zIndex="4";if(!a.isIE&&!a.isIOS)this._clipDiv=c=a.createElement(b,"div"),c.style.position="absolute",c.style.overflow="hidden",c.style.margin="0px",c.style.borderWidth="0px",c.style.padding="0px",c.style.background="transparent",e.appendChild(c),this._clipScrollDiv=d=a.createElement(b,"div"),d.style.position="absolute",d.style.height="1px",d.style.top="-1000px",d.style.background="transparent",
c.appendChild(d);this._setFullSelection(this._fullSelection,!0);c=a.createElement(b,"div");c.className="textviewContent";this._clientDiv=c;c.tabIndex=0;c.style.position="absolute";c.style.borderWidth="0px";c.style.margin="0px";c.style.padding="0px";c.style.outline="none";c.style.zIndex="1";c.style.WebkitUserSelect="text";c.setAttribute("spellcheck","false");if(a.isIOS||a.isAndroid)c.style.WebkitTapHighlightColor="transparent";(this._clipDiv||e).appendChild(c);if(a.isIOS||a.isAndroid)this._vScrollDiv=
d=a.createElement(b,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle="solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.width="8px",d.style.display="none",e.appendChild(d),this._hScrollDiv=d=a.createElement(b,"div"),d.style.position="absolute",d.style.borderWidth="1px",d.style.borderColor="white",d.style.borderStyle=
"solid",d.style.borderRadius="4px",d.style.backgroundColor="black",d.style.opacity="0.5",d.style.margin="0px",d.style.padding="0px",d.style.outline="none",d.style.zIndex="3",d.style.height="8px",d.style.display="none",e.appendChild(d);if(a.isFirefox&&!c.setCapture)this._overlayDiv=b=a.createElement(b,"div"),b.style.position=c.style.position,b.style.borderWidth=c.style.borderWidth,b.style.margin=c.style.margin,b.style.padding=c.style.padding,b.style.cursor="text",b.style.zIndex="2",(this._clipDiv||
e).appendChild(b);c.contentEditable="true";c.setAttribute("role","textbox");c.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,!0);this._hookEvents();e=this._rulers;for(b=0;b<e.length;b++)this._createRuler(e[b]);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},singleMode:{value:!1,update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},
wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:b.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var c=this._getRulerParent(a);if(c)for(var b=c.firstChild;b;){if(b._ruler===a){b._ruler=void 0;c.removeChild(b);if(c.children.length===0&&(c!==this._marginDiv||!this._marginOffset))c.style.display="none";break}b=b.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._cursorDiv=this._marginDiv=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,c,b){this._autoScrollDir=a;this._autoScrollX=c;this._autoScrollY=b;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 c=this._hasFocus;this._ignoreFocus=!0;c&&a.blur();a.contentEditable=!1;a.contentEditable=!0;c&&a.focus();this._ignoreFocus=
!1}},_getBaseText:function(a,c){var b=this._model;b.getBaseModel&&(a=b.mapOffset(a),c=b.mapOffset(c),b=b.getBaseModel());return b.getText(a,c)},_getBottomIndex:function(a){var c=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._clientDiv.getBoundingClientRect();a.bottom>b.bottom&&(c=this._getLinePrevious(c)||c)}return c.lineIndex},_getBoundsAtOffset:function(a){var c=this._getLine(this._model.getLineAtOffset(a)),a=c.getBoundingClientRect(a),
b=this._getLinePixel(c.lineIndex);a.top+=b;a.bottom+=b;c.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(c,b){var e=this._model.getLineDelimiter(),d,g,h=this._getWindow(),i=h.clipboardData;if(!i&&c)i=c.clipboardData;if(i)return d=[],g=i.getData(a.isIE?"Text":"text/plain"),
l(g,function(a){d.push(a)},function(){d.push(e)}),g=d.join(""),b&&b(g),g;if(a.isFirefox){this._ignoreFocus=!0;var f=this._clipboardDiv,i=this._rootDiv.ownerDocument;if(!f)this._clipboardDiv=f=a.createElement(i,"div"),f.style.position="fixed",f.style.whiteSpace="pre",f.style.left="-1000px",this._rootDiv.appendChild(f);f.innerHTML="<pre contenteditable=''></pre>";f.firstChild.focus();var n=this,m=function(){var a=n._getTextFromElement(f);f.innerHTML="";d=[];l(a,function(a){d.push(a)},function(){d.push(e)});
return d.join("")},j=!1;this._ignorePaste=!0;if(!a.isLinux||this._lastMouseButton!==2)try{j=i.execCommand("paste",!1,null)}catch(k){j=f.childNodes.length>1||f.firstChild&&f.firstChild.childNodes.length>0}this._ignorePaste=!1;if(!j)return c?(h.setTimeout(function(){n.focus();(g=m())&&b&&b(g);n._ignoreFocus=!1},0),null):(this.focus(),this._ignoreFocus=!1,"");this.focus();this._ignoreFocus=!1;(g=m())&&b&&b(g);return g}return""},_getDOMText:function(a,c){for(var b=a.firstChild,e="",d=0;b;){var g;if(!b.ignore)if(b.ignoreChars){g=
b.lastChild;for(var h=0,i=[],f=-1;g;){for(var l=g.data,n=l.length-1;n>=0;n--){var m=l.substring(n,n+1);h<b.ignoreChars&&(m===" "||m==="\u200c"||m==="\ufeff")?h++:i.push(m==="\u00a0"?"\t":m)}if(c===g)f=i.length;g=g.previousSibling}i=i.reverse().join("");f!==-1&&(d=e.length+i.length-f);e+=i}else for(g=b.firstChild;g;){if(c===g)d=e.length;e+=g.data;g=g.nextSibling}b=b.nextSibling}return{text:e,offset:d}},_getTextFromElement:function(a){var c=a.ownerDocument,b=c.defaultView;if(!b.getSelection)return a.innerText||
a.textContent;c=c.createRange();c.selectNode(a);var a=b.getSelection(),b=[],e;for(e=0;e<a.rangeCount;e++)b.push(a.getRangeAt(e));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(c);c=a.toString();a.removeAllRanges();for(e=0;e<b.length;e++)a.addRange(b[e]);this._ignoreSelect=!1;return c},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var c=this._getLineNode(a);return c&&!c.lineChanged&&!c.lineRemoved?c._line:new s(this,a)},_getLineHeight:function(a,c){if(a!==
void 0&&this._lineHeight){var b=this._lineHeight[a];if(b)return b;if(c||c===void 0)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var c=this._clientDiv.firstChild;c;){if(a===c.lineIndex)return c;c=c.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 c=this._getTopIndex(),b=-this._topIndexY+this._getScroll().y;if(a>c)for(;c<a;c++)b+=this._getLineHeight(c);else for(c-=1;c>=a;c--)b-=this._getLineHeight(c);return b}return this._getLineHeight()*a},_getLineIndex:function(a){var c,b=0,e=this._model.getLineCount();if(this._lineHeight){var b=this._getTopIndex(),d=-this._topIndexY+this._getScroll().y;if(a!==d)if(a<d)for(;a<
d&&b>0;)a+=this._getLineHeight(--b);else for(c=this._getLineHeight(b);a-c>=d&&b<e-1;)a-=c,c=this._getLineHeight(++b)}else c=this._getLineHeight(),b=Math.floor(a/c);return Math.max(0,Math.min(e-1,b))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_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 c=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){var a=c.getBoundingClientRect(),b=this._getViewPadding(),e=this._viewDiv.getBoundingClientRect();a.top<e.top+b.top&&(c=this._getLineNext(c)||c)}return c.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 b=this._handlers=[],e=this._clientDiv,d=this._viewDiv,g=this._rootDiv,h=this._overlayDiv||e,i=e.ownerDocument,f=this._getWindow(),l=a.isIE?i:f;b.push({target:f,type:"resize",handler:function(a){return c._handleResize(a?a:f.event)}});b.push({target:e,type:"blur",handler:function(a){return c._handleBlur(a?a:f.event)}});
b.push({target:e,type:"focus",handler:function(a){return c._handleFocus(a?a:f.event)}});b.push({target:d,type:"focus",handler:function(){e.focus()}});b.push({target:d,type:"scroll",handler:function(a){return c._handleScroll(a?a:f.event)}});b.push({target:e,type:"textInput",handler:function(a){return c._handleTextInput(a?a:f.event)}});b.push({target:e,type:"keydown",handler:function(a){return c._handleKeyDown(a?a:f.event)}});b.push({target:e,type:"keypress",handler:function(a){return c._handleKeyPress(a?
a:f.event)}});b.push({target:e,type:"keyup",handler:function(a){return c._handleKeyUp(a?a:f.event)}});a.isIE&&b.push({target:i,type:"keyup",handler:function(a){return c._handleDocKeyUp(a?a:f.event)}});b.push({target:e,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:f.event)}});b.push({target:e,type:"copy",handler:function(a){return c._handleCopy(a?a:f.event)}});b.push({target:e,type:"cut",handler:function(a){return c._handleCut(a?a:f.event)}});b.push({target:e,type:"paste",
handler:function(a){return c._handlePaste(a?a:f.event)}});if(a.isIOS||a.isAndroid)b.push({target:i,type:"selectionchange",handler:function(a){return c._handleSelectionChange(a?a:f.event)}}),b.push({target:e,type:"touchstart",handler:function(a){return c._handleTouchStart(a?a:f.event)}}),b.push({target:e,type:"touchmove",handler:function(a){return c._handleTouchMove(a?a:f.event)}}),b.push({target:e,type:"touchend",handler:function(a){return c._handleTouchEnd(a?a:f.event)}});else{b.push({target:e,type:"selectstart",
handler:function(a){return c._handleSelectStart(a?a:f.event)}});b.push({target:e,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:f.event)}});b.push({target:e,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:f.event)}});b.push({target:e,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:f.event)}});b.push({target:l,type:"mouseup",handler:function(a){return c._handleMouseUp(a?a:f.event)}});b.push({target:l,type:"mousemove",handler:function(a){return c._handleMouseMove(a?
a:f.event)}});b.push({target:g,type:"mousedown",handler:function(a){return c._handleRootMouseDown(a?a:f.event)}});b.push({target:g,type:"mouseup",handler:function(a){return c._handleRootMouseUp(a?a:f.event)}});b.push({target:h,type:"dragstart",handler:function(a){return c._handleDragStart(a?a:f.event)}});b.push({target:h,type:"drag",handler:function(a){return c._handleDrag(a?a:f.event)}});b.push({target:h,type:"dragend",handler:function(a){return c._handleDragEnd(a?a:f.event)}});b.push({target:h,
type:"dragenter",handler:function(a){return c._handleDragEnter(a?a:f.event)}});b.push({target:h,type:"dragover",handler:function(a){return c._handleDragOver(a?a:f.event)}});b.push({target:h,type:"dragleave",handler:function(a){return c._handleDragLeave(a?a:f.event)}});b.push({target:h,type:"drop",handler:function(a){return c._handleDrop(a?a:f.event)}});b.push({target:this._clientDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:f.event)}});this._clipDiv&&
b.push({target:this._clipDiv,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return c._handleMouseWheel(a?a:f.event)}});if(a.isFirefox&&(!a.isWindows||a.isFirefox>=15))(d=f.MutationObserver||f.MozMutationObserver)?(this._mutationObserver=new d(function(a){c._handleDataModified(a)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(a){return c._handleDataModified(a?a:f.event)}});this._overlayDiv&&
(b.push({target:this._overlayDiv,type:"mousedown",handler:function(a){return c._handleMouseDown(a?a:f.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(a){return c._handleMouseOver(a?a:f.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(a){return c._handleMouseOut(a?a:f.event)}}),b.push({target:this._overlayDiv,type:"contextmenu",handler:function(a){return c._handleContextMenu(a?a:f.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",
handler:function(a){return c._handleDblclick(a?a:f.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(d=0;d<b.length;d++)g=b[d],p(g.target,g.type,g.handler,g.capture)},_hookRulerEvents:function(c,b){if(c){var e=this,d=this._getWindow();a.isIE&&b.push({target:c,type:"selectstart",handler:function(){return!1}});b.push({target:c,type:a.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return e._handleMouseWheel(a?
a:d.event)}});b.push({target:c,type:"click",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:c,type:"dblclick",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:c,type:"mousemove",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:c,type:"mouseover",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:c,type:"mouseout",handler:function(a){e._handleRulerEvent(a?a:d.event)}})}},_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(c){var b=c.parent;typeof b==="string"&&(b=(c.document||document).getElementById(b));if(!b)throw"no parent";c.parent=b;c.model=c.model||new k.TextModel;var e=this._defaultOptions(),d;for(d in e)e.hasOwnProperty(d)&&(this["_"+d]=c[d]!==void 0?c[d]:e[d].value);this._keyModes=[];this._rulers=[];this._selection=new r(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 b.ownerDocument.createRange().getBoundingClientRect==="function";this._isW3CEvents=b.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,c){if(!this._readonly||a._code)if(a.type="Verify",this.onVerify(a),!(a.text===null||a.text===void 0)){var b=this._model;try{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!0;b.setText(a.text,a.start,a.end)}finally{if(a._ignoreDOMSelection)this._ignoreDOMSelection=!1}c&&(b=
this._getSelection(),b.setCaret(a.start+a.text.length),this._setSelection(b,!0));this.onModify({type:"Modify"})}},_onModelChanged:function(a){a.type="ModelChanged";this.onModelChanged(a);a.type="Changed";var c=a.start,b=a.addedCharCount,e=a.removedCharCount,d=a.addedLineCount,g=a.removedLineCount,h=this._getSelection();h.end>c&&(h.end>c&&h.start<c+e?h.setCaret(c+b):(h.start+=b-e,h.end+=b-e),this._setSelection(h,!1,!1));c=this._model.getLineAtOffset(c);for(b=this._getLineNext();b;){e=b.lineIndex;if(c<=
e&&e<=c+g)c===e&&!b.modelChangedEvent&&!b.lineRemoved?(b.modelChangedEvent=a,b.lineChanged=!0):(b.lineRemoved=!0,b.lineChanged=!1,b.modelChangedEvent=null);if(e>c+g)b.lineIndex=e+d-g,b._line.lineIndex=b.lineIndex;b=this._getLineNext(b)}this._lineHeight&&(a=[c,g].concat(Array(d)),Array.prototype.splice.apply(this._lineHeight,a));if(!this._wrapMode&&c<=this._maxLineIndex&&this._maxLineIndex<=c+g)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,c){if(this._wrapMode||this._variableLineHeight){if(a!==void 0&&c!==void 0)for(var b=a;b<c;b++)this._lineHeight[b]=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 r(0,0,!1),!1,!1);if(this._viewDiv)this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0;var c=this._clientDiv;if(c){for(var b=c.firstChild;b;)b.lineRemoved=!0,b=b.nextSibling;if(a.isFirefox)this._ignoreFocus=
!1,(b=this._hasFocus)&&c.blur(),c.contentEditable=!1,c.contentEditable=!0,b&&c.focus(),this._ignoreFocus=!1}},_scrollViewAnimated:function(a,c,b){var e=this._getWindow();if(b&&this._scrollAnimation){var d=this;this._animation=new u({window:e,duration:this._scrollAnimation,curve:[c,0],onAnimate:function(a){a=c-Math.floor(a);d._scrollView(0,a);c-=a},onEnd:function(){d._animation=null;d._scrollView(a,c);b&&e.setTimeout(b,0)}});this._animation.play()}else this._scrollView(a,c),b&&e.setTimeout(b,0)},_scrollView:function(a,
c){this._ensureCaretVisible=!1;var b=this._viewDiv;a&&(b.scrollLeft+=a);c&&(b.scrollTop+=c)},_setClipboardText:function(c,b){var e,d=this._getWindow(),g=d.clipboardData;if(!g&&b)g=b.clipboardData;if(g&&(e=[],l(c,function(a){e.push(a)},function(){e.push(a.platformDelimiter)}),g.setData(a.isIE?"Text":"text/plain",e.join(""))))return!0;var h=this._parent.ownerDocument,f=a.createElement(h,"pre");f.style.position="fixed";f.style.left="-1000px";l(c,function(a){f.appendChild(h.createTextNode(a))},function(){f.appendChild(a.createElement(h,
"br"))});f.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(f);g=h.createRange();g.setStart(f.firstChild,0);g.setEndBefore(f.lastChild);var i=d.getSelection();i.rangeCount>0&&i.removeAllRanges();i.addRange(g);var n=this,g=function(){f&&f.parentNode===n._clientDiv&&n._clientDiv.removeChild(f);n._updateDOMSelection()},i=!1;this._ignoreCopy=!0;try{i=h.execCommand("copy",!1,null)}catch(m){}this._ignoreCopy=!1;if(!i&&b)return d.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(c,
b,e,d,g){for(var h,f,i,l,n=0,m=c.firstChild,j,k,r=this._model.getLine(c.lineIndex).length;m;){if(!m.ignore){j=m.firstChild;k=j.length;m.ignoreChars&&(k-=m.ignoreChars);if(n+k>b||n+k>=r){h=j;f=b-n;m.ignoreChars&&k>0&&f===k&&(f+=m.ignoreChars);break}n+=k}m=m.nextSibling}for(var n=0,m=e.firstChild,q=this._model.getLine(e.lineIndex).length;m;){if(!m.ignore){j=m.firstChild;k=j.length;m.ignoreChars&&(k-=m.ignoreChars);if(k+n>d||n+k>=q){i=j;l=d-n;m.ignoreChars&&k>0&&l===k&&(l+=m.ignoreChars);break}n+=k}m=
m.nextSibling}this._setDOMFullSelection(c,b,r,e,d,q);c=this._getWindow();b=this._parent.ownerDocument;if(c.getSelection){e=c.getSelection();c=b.createRange();c.setStart(h,f);c.setEnd(i,l);if(this._hasFocus&&(e.anchorNode!==h||e.anchorOffset!==f||e.focusNode!==i||e.focusOffset!==l||e.anchorNode!==i||e.anchorOffset!==l||e.focusNode!==h||e.focusOffset!==f))this._ignoreSelect=!1,e.rangeCount>0&&e.removeAllRanges(),e.addRange(c),this._ignoreSelect=!0;if(this._cursorDiv&&(c=b.createRange(),g?(c.setStart(h,
f),c.setEnd(h,f)):(c.setStart(i,l),c.setEnd(i,l)),i=c.getClientRects()[0],l=this._cursorDiv.parentNode,h=l.getBoundingClientRect(),i&&h))this._cursorDiv.style.top=i.top-h.top+l.scrollTop+"px",this._cursorDiv.style.left=i.left-h.left+l.scrollLeft+"px"}else if(b.selection&&this._hasFocus)g=b.body,c=a.createElement(b,"div"),g.appendChild(c),g.removeChild(c),c=g.createTextRange(),c.moveToElementText(h.parentNode),c.moveStart("character",f),h=g.createTextRange(),h.moveToElementText(i.parentNode),h.moveStart("character",
l),c.setEndPoint("EndToStart",h),this._ignoreSelect=!1,c.select(),this._ignoreSelect=!0},_setDOMFullSelection:function(a,c,b,e,d){if(this._selDiv1&&(b=this._selDiv1,b.style.width="0px",b.style.height="0px",b=this._selDiv2,b.style.width="0px",b.style.height="0px",b=this._selDiv3,b.style.width="0px",b.style.height="0px",!(a===e&&c===d))){var g=this._model,h=this._getViewPadding(),f=this._clientDiv.getBoundingClientRect(),i=this._viewDiv.getBoundingClientRect(),b=i.left+h.left,l=f.right,h=i.top+h.top,
n=f.bottom,i=f=0;this._clipDiv?(i=this._clipDiv.getBoundingClientRect(),f=i.left-this._clipDiv.scrollLeft):(i=this._rootDiv.getBoundingClientRect(),f=i.left);i=i.top;this._ignoreDOMSelection=!0;var m=(new s(this,a.lineIndex,a)).getBoundingClientRect(g.getLineStart(a.lineIndex)+c,!1),j=m.left,c=(new s(this,e.lineIndex,e)).getBoundingClientRect(g.getLineStart(e.lineIndex)+d,!1),g=c.left;this._ignoreDOMSelection=!1;var k=this._selDiv1,j=Math.min(l,Math.max(b,j)),r=Math.min(n,Math.max(h,m.top)),q=l,d=
Math.min(n,Math.max(h,m.bottom));k.style.left=j-f+"px";k.style.top=r-i+"px";k.style.width=Math.max(0,q-j)+"px";k.style.height=Math.max(0,d-r)+"px";if(a.lineIndex===e.lineIndex)q=Math.min(g,l),k.style.width=Math.max(0,q-j)+"px";else if(m=Math.min(n,Math.max(h,c.top)),g=Math.min(l,Math.max(b,g)),h=Math.min(n,Math.max(h,c.bottom)),n=this._selDiv3,n.style.left=b-f+"px",n.style.top=m-i+"px",n.style.width=Math.max(0,g-b)+"px",n.style.height=Math.max(0,h-m)+"px",Math.abs(a.lineIndex-e.lineIndex)>1)a=this._selDiv2,
a.style.left=b-f+"px",a.style.top=d-i+"px",a.style.width=Math.max(0,l-b)+"px",a.style.height=Math.max(0,m-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(c){if(this._linksVisible!==c){this._linksVisible=c;if(a.isIE&&c)this._hadFocus=this._hasFocus;var b=this._clientDiv;b.contentEditable=!c;this._hadFocus&&!c&&b.focus();
if(this._overlayDiv)this._overlayDiv.style.zIndex=c?"-1":"1";for(c=this._getLineNext();c;){if(c.hasLink)for(b=c.firstChild;b;)if(b.ignore)b=b.nextSibling;else{var e=b.nextSibling,d=b.viewStyle;d&&d.tagName&&d.tagName.toLowerCase()==="a"&&c.replaceChild(c._line._createSpan(c,b.firstChild.data,d),b);b=e}c=this._getLineNext(c)}this._updateDOMSelection()}},_setSelection:function(a,c,b,e,d){if(a){this._columnX=-1;b===void 0&&(b=!0);var g=this._selection;this._selection=a;c!==!1&&this._showCaret(!1,e,c,
d);b&&this._updateDOMSelection();if(!g.equals(a))this.onSelection({type:"Selection",oldValue:{start:g.start,end:g.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,c,b,e){var d=this._model,g=this._getSelection(),c=this.convert({x:a,y:c},"page","document"),a=this._getLineIndex(c.y);if(this._clickCount===1){d=this._getLine(a);a=d.getOffset(c.x,c.y-this._getLinePixel(a));d.destroy();if(e&&!b&&g.start<=a&&a<g.end)return this._dragOffset=a,!1;g.extend(a);b||g.collapse()}else(this._clickCount&
1)===0?(d=this._getLine(a),a=d.getOffset(c.x,c.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(b=this._doubleClickSelection.start,e=d.getNextOffset(a,{unit:"wordend",count:1})):(b=d.getNextOffset(a,{unit:"word",count:-1}),e=this._doubleClickSelection.end):(b=d.getNextOffset(a,{unit:"word",count:-1}),e=d.getNextOffset(b,{unit:"wordend",count:1})),d.destroy()):this._doubleClickSelection?(e=d.getLineAtOffset(this._doubleClickSelection.start),a>=e?(b=d.getLineStart(e),
e=d.getLineEnd(a)):(b=d.getLineStart(a),e=d.getLineEnd(e))):(b=d.getLineStart(a),e=d.getLineEnd(a)),g.setCaret(b),g.extend(e);this._setSelection(g,!0,!0);return!0},_setFullSelection:function(c,b){this._fullSelection=c;if(a.isWebkit)this._fullSelection=!0;var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!a.isIOS){var d=e.ownerDocument;this._highlightRGB=a.isWebkit?"transparent":"Highlight";var g=a.createElement(d,"div");this._selDiv1=g;g.style.position=
"absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding="0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width="0px";g.style.height="0px";g.style.zIndex="0";e.appendChild(g);var h=a.createElement(d,"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";e.appendChild(h);this._selDiv3=
d=a.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";e.appendChild(d);if(a.isFirefox&&a.isMac){e=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e=
"rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;g.style.background=e;h.style.background=e;d.style.background=e}b||this._updateDOMSelection()}}else{if(this._selDiv1)e.removeChild(this._selDiv1),this._selDiv1=null;if(this._selDiv2)e.removeChild(this._selDiv2),
this._selDiv2=null;if(this._selDiv3)e.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 c=a.createElement(document,"div");c.className="textviewBlockCursor";this._cursorDiv=c;c.tabIndex=-1;c.style.zIndex="2";c.style.color=
"transparent";c.style.position="absolute";c.style.pointerEvents="none";c.innerHTML="&nbsp;";this._viewDiv.appendChild(c);this._updateDOMSelection()}}else if(this._cursorDiv)this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null},_setMarginOffset:function(a,c){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";if(!c)this._metrics=this._calculateMetrics(),this._queueUpdate()},_setWrapOffset:function(a,c){this._wrapOffset=a;if(!c)this._metrics=this._calculateMetrics(),
this._queueUpdate()},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":"false")},_setSingleMode:function(a,c){this._singleMode=a;this._updateOverflow();this._updateStyle(c)},_setTabSize:function(c,b){this._tabSize=c;this._customTabSize=void 0;var e=this._clientDiv;if(a.isOpera){if(e)e.style.OTabSize=this._tabSize+""}else if(a.isWebkit>=537.1){if(e)e.style.tabSize=this._tabSize+""}else if(a.isFirefox>=4){if(e)e.style.MozTabSize=this._tabSize+""}else if(this._tabSize!==
8)this._customTabSize=this._tabSize;b||(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,c){this._themeClass=a;var b="textview",e=this._theme.getThemeClass();e&&(b+=" "+e);this._themeClass&&e!==this._themeClass&&(b+=" "+this._themeClass);
this._rootDiv.className=b;this._updateStyle(c)},_setWrapMode:function(a,c){this._wrapMode=a&&this._wrappable;var b=this._clientDiv;this._wrapMode?(b.style.whiteSpace="pre-wrap",b.style.wordWrap="break-word"):(b.style.whiteSpace="pre",b.style.wordWrap="normal");this._updateOverflow();c||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,c,b,e){if(this._clientDiv){var d=this._model,g=this._getSelection(),h=this._getScroll(),f=g.getCaret(),i=g.start,l=g.end,n=d.getLineAtOffset(l),
m=Math.max(Math.max(i,d.getLineStart(n)),l-1),d=this._getClientWidth(),n=this._getClientHeight(),j=d/4,k=this._getBoundsAtOffset(f===i?i:m),r=k.left,q=k.right,s=k.top,p=k.bottom;a&&!g.isEmpty()&&(k=this._getBoundsAtOffset(f===l?i:m),k.top===s?f===i?q=r+Math.min(k.right-r,d):r=q-Math.min(q-k.left,d):f===i?p=s+Math.min(k.bottom-s,n):s=p-Math.min(p-k.top,n));a=0;r<h.x&&(a=Math.min(r-h.x,-j));q>h.x+d&&(a=Math.max(q-h.x-d,j));g=0;s<h.y?g=s-h.y:p>h.y+n&&(g=p-h.y-n);e&&(e>0?g>0&&(g=Math.max(g,e)):g<0&&(g=
Math.min(g,e)));if(a!==0||g!==0)return g!==0&&typeof b==="number"&&(b<0&&(b=0),b>1&&(b=1),g+=Math.floor(g>0?b*n:-b*n)),this._scrollViewAnimated(a,g,c),n!==this._getClientHeight()||d!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;else c&&c();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 c=this._handlers[a];x(c.target,c.type,c.handler)}this._handlers=null;if(this._mutationObserver)this._mutationObserver.disconnect(),this._mutationObserver=null},_updateDOMSelection:function(){if(!(this._redrawCount>0)&&!this._ignoreDOMSelection&&
this._clientDiv){var a=this._getSelection(),c=this._model,b=c.getLineAtOffset(a.start),e=c.getLineAtOffset(a.end),d=this._getLineNext();if(d){var g=this._getLinePrevious(),h;b<d.lineIndex?(h=d,b=0):b>g.lineIndex?(h=g,b=0):(h=this._getLineNode(b),b=a.start-c.getLineStart(b));e<d.lineIndex?c=0:e>g.lineIndex?(d=g,c=0):(d=this._getLineNode(e),c=a.end-c.getLineStart(e));this._setDOMSelection(h,b,d,c,a.caret)}}},_update:function(c){if(!(this._redrawCount>0)){if(this._updateTimer)this._getWindow().clearTimeout(this._updateTimer),
this._updateTimer=null,c=!1;var b=this._clientDiv,e=this._viewDiv;if(b){if(this._metrics.invalid)this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1;var d=this._model,g=this._getScroll(!1),h=this._getViewPadding(),f=d.getLineCount(),i=this._getLineHeight(),l=!1,n=!1,m=!1,j=this._metrics.scrollWidth;if(this._wrapMode)b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px";var k,r,q,p,t=0,x=0,u;if(this._lineHeight){for(;x<f;){u=this._getLineHeight(x);if(t+u>g.y)break;
t+=u;x++}k=x;r=Math.max(0,k-1);q=d=g.y-t;k>0&&(d+=this._getLineHeight(k-1))}else p=Math.max(0,g.y)/i,k=Math.floor(p),r=Math.max(0,k-1),d=Math.round((p-r)*i),q=Math.round((p-k)*i);this._topIndexY=q;p=this._parent;var J=p.clientWidth,M=p.clientHeight;if(c){i=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),i=k.right-k.left);k=this._getClientWidth();p=this._getClientHeight();n=k;if(this._wrapMode){if(this._metrics.wrapWidth)n=this._metrics.wrapWidth}else n=Math.max(this._maxLineWidth,n);for(;x<
f;)u=this._getLineHeight(x,!1),t+=u,x++;f=t}else{p=this._getClientHeight();q=Math.min(k+Math.floor((p+q)/i),f-1);var g=Math.min(q+1,f-1),E;for(u=b.firstChild;u;){E=u.lineIndex;var F=u.nextSibling;if(!(r<=E&&E<=g)||u.lineRemoved||u.lineIndex===-1)this._mouseWheelLine===u?(u.style.display="none",u.lineIndex=-1):b.removeChild(u);u=F}u=this._getLineNext();var F=e.ownerDocument,L=F.createDocumentFragment();for(E=r;E<=g;E++)if(!u||u.lineIndex>E)(new s(this,E)).create(L,null);else{L.firstChild&&(b.insertBefore(L,
u),L=F.createDocumentFragment());if(u&&u.lineChanged)u=(new s(this,E)).create(L,u),u.lineChanged=!1;u=this._getLineNext(u)}L.firstChild&&b.insertBefore(L,u);if(a.isWebkit&&!this._wrapMode)b.style.width="0x7fffffffpx";u=this._getLineNext();E=p+d;for(L=!1;u;){r=u.lineWidth;if(r===void 0)if(F=u._line.getBoundingClientRect(),r=u.lineWidth=Math.ceil(F.right-F.left),F=F.bottom-F.top,this._lineHeight)this._lineHeight[u.lineIndex]=F;else if(i!==0&&F!==0&&Math.ceil(i)!==Math.ceil(F))this._variableLineHeight=
!0,this._lineHeight=[],this._lineHeight[u.lineIndex]=F;if(this._lineHeight&&!L&&(E-=this._lineHeight[u.lineIndex],E<0))q=u.lineIndex,L=!0;if(!this._wrapMode){if(r>=this._maxLineWidth)this._maxLineWidth=r,this._maxLineIndex=u.lineIndex;if(this._checkMaxLineIndex===u.lineIndex)this._checkMaxLineIndex=-1}if(u.lineIndex===k)this._topChild=u;if(u.lineIndex===q)this._bottomChild=u;u=this._getLineNext(u)}if(this._checkMaxLineIndex!==-1&&(E=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=E&&E<f)){i=
new s(this,E);F=i.getBoundingClientRect();r=F.right-F.left;if(r>=this._maxLineWidth)this._maxLineWidth=r,this._maxLineIndex=E;i.destroy()}for(;x<f;)u=this._getLineHeight(x,x<=q),t+=u,x++;f=t;this._updateRuler(this._leftDiv,k,g,M);this._updateRuler(this._rightDiv,k,g,M);this._updateRuler(this._marginDiv,k,g,M);i=0;this._leftDiv&&(k=this._leftDiv.getBoundingClientRect(),i=k.right-k.left);g=0;this._rightDiv&&(g=this._rightDiv.getBoundingClientRect(),g=g.right-g.left);e.style.left=i+"px";e.style.right=
g+"px";g=this._scrollDiv;g.style.height=f+"px";k=this._getClientWidth();if(!this._singleMode&&!this._wrapMode){t=l=p;(x=e.style.overflowX==="scroll")?l+=j:t-=j;u=q=k;(r=e.style.overflowY==="scroll")?q+=j:u-=j;p=l;k=q;f>p&&(m=!0,k=u);this._maxLineWidth>k&&(n=!0,p=t,f>p&&(m=!0,k=u));if(x!==n)e.style.overflowX=n?"scroll":"hidden";if(r!==m)e.style.overflowY=m?"scroll":"hidden";l=x!==n||r!==m}m=k;if(this._wrapMode){if(this._metrics.wrapWidth)m=this._metrics.wrapWidth}else m=Math.max(this._maxLineWidth,
m);n=m;if((!a.isIE||a.isIE>=9)&&this._maxLineWidth>k)m+=h.right+h.left;g.style.width=m+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=m+"px";g=this._getScroll(!1)}if(this._vScrollDiv)m=p-8,t=Math.max(15,Math.ceil(Math.min(1,m/(f+h.top+h.bottom))*m)),this._vScrollDiv.style.left=i+k-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,g.y*m/f))+"px",this._vScrollDiv.style.height=t+"px";if(!this._wrapMode&&this._hScrollDiv)m=k-8,t=Math.max(15,Math.ceil(Math.min(1,m/(this._maxLineWidth+
h.left+h.right))*m)),this._hScrollDiv.style.left=i+Math.floor(Math.max(0,Math.floor(g.x*m/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=p-9+"px",this._hScrollDiv.style.width=t+"px";x=g.x;t=this._clipDiv;m=this._overlayDiv;if(q=this._marginDiv)q.style.left=-x+i+this._metrics.marginWidth+h.left+"px",q.style.bottom=(e.style.overflowX==="scroll"?j:0)+"px";if(t){t.scrollLeft=x;t.scrollTop=0;e=i+h.left;j=h.top;c=k;i=p;x=0;q=-d;if(g.x===0)e-=h.left,c+=h.left,x=h.left;g.x+k===n&&(c+=h.right);g.y===
0&&(j-=h.top,i+=h.top,q+=h.top);g.y+p===f&&(i+=h.bottom);t.style.left=e+"px";t.style.top=j+"px";t.style.right=J-c-e+"px";t.style.bottom=M-i-j+"px";b.style.left=x+"px";b.style.top=q+"px";b.style.width=n+"px";b.style.height=p+d+"px";if(m)m.style.left=b.style.left,m.style.top=b.style.top,m.style.width=b.style.width,m.style.height=b.style.height}else{e=x;j=d;J=x+k;M=d+p;e===0&&(e-=h.left);j===0&&(j-=h.top);J===n&&(J+=h.right);g.y+p===f&&(M+=h.bottom);b.style.clip="rect("+j+"px,"+J+"px,"+M+"px,"+e+"px)";
b.style.left=-x+i+h.left+"px";b.style.width=(this._wrapMode||a.isWebkit?n:k+x)+"px";if(!c)b.style.top=-d+h.top+"px",b.style.height=p+d+"px";if(m&&(m.style.clip=b.style.clip,m.style.left=b.style.left,m.style.width=b.style.width,!c))m.style.top=b.style.top,m.style.height=b.style.height}this._updateDOMSelection();if(l)b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate()}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",
a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(c,b,e,d){if(c)for(var g=this._parent.ownerDocument,f=this._getLineHeight(),i=this._getViewPadding(),c=c.firstChild;c;){var l=c._ruler,n=f,m=l.getOverview();m==="page"&&(n+=this._topIndexY);c.style.top=-n+"px";c.style.height=d+n+"px";c.rulerChanged&&h(l.getRulerStyle(),c);var j,k=c.firstChild;k?(j=k,k=k.nextSibling):(j=a.createElement(g,"div"),j.style.visibility="hidden",c.appendChild(j));var r;if(c.rulerChanged&&j){n=-1;
if(r=l.getWidestAnnotation())if(h(r.style,j),r.html)j.innerHTML=r.html;j.lineIndex=n;j.style.height=f+i.top+"px"}var q;if(m==="page"){for(l=l.getAnnotations(b,e+1);k;)n=k.lineIndex,r=k.nextSibling,(!(b<=n&&n<=e)||k.lineChanged)&&c.removeChild(k),k=r;k=c.firstChild.nextSibling;q=g.createDocumentFragment();for(n=b;n<=e;n++)if(!k||k.lineIndex>n){j=a.createElement(g,"div");if(r=l[n]){h(r.style,j);if(r.html)j.innerHTML=r.html;j.annotation=r}j.lineIndex=n;j.style.height=this._getLineHeight(n)+"px";q.appendChild(j)}else if(q.firstChild&&
(c.insertBefore(q,k),q=g.createDocumentFragment()),k)k=k.nextSibling;q.firstChild&&c.insertBefore(q,k)}else{r=this._getClientHeight();n=this._model.getLineCount();k=r+i.top+i.bottom-2*this._metrics.scrollWidth;m=f*n<k?f:k/n;if(c.rulerChanged){for(r=c.childNodes.length;r>1;)c.removeChild(c.lastChild),r--;l=l.getAnnotations(0,n);q=g.createDocumentFragment();for(var s in l)if(n=s>>>0,!(n<0)){j=a.createElement(g,"div");r=l[s];h(r.style,j);j.style.position="absolute";j.style.top=this._metrics.scrollWidth+
f+Math.floor(n*m)+"px";if(r.html)j.innerHTML=r.html;j.annotation=r;j.lineIndex=n;q.appendChild(j)}c.appendChild(q)}else if(c._oldTrackHeight!==k)for(j=c.firstChild?c.firstChild.nextSibling:null;j;)j.style.top=this._metrics.scrollWidth+f+Math.floor(j.lineIndex*m)+"px",j=j.nextSibling;c._oldTrackHeight=k}c.rulerChanged=!1;c=c.nextSibling}},_updateStyleSheet:function(){var c="";a.isWebkit&&this._metrics.scrollWidth>0&&(c+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");a.isFirefox&&
a.isMac&&this._highlightRGB&&this._highlightRGB!=="Highlight"&&(c+="\n.textview ::-moz-selection {background: "+this._highlightRGB+";}");if(c){var b=document.getElementById("_textviewStyle");if(b)b.removeChild(b.firstChild),b.appendChild(document.createTextNode(c));else{b=a.createElement(document,"style");b.id="_textviewStyle";var e=document.getElementsByTagName("head")[0]||document.documentElement;b.appendChild(document.createTextNode(c));e.insertBefore(b,e.firstChild)}}},_updateStyle:function(c){if(!c&&
a.isIE)this._rootDiv.style.lineHeight="normal";var b=this._metrics=this._calculateMetrics();this._rootDiv.style.lineHeight=a.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();c||(this.redraw(),this._resetLineWidth())}};d.EventTarget.addMixin(t.prototype);return{TextView:t}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(f,k){function j(d){this._model=d;this._projections=[]}j.prototype={addProjection:function(d){if(d){var b=this._model,i=this._projections;d._lineIndex=b.getLineAtOffset(d.start);d._lineCount=b.getLineAtOffset(d.end)-d._lineIndex;var a=d.text;a||(a="");d._model=typeof a==="string"?new f.TextModel(a,b.getLineDelimiter()):a;var b=this.mapOffset(d.start,!0),a=d.end-d.start,h=d._lineCount,g=d._model.getCharCount(),
e=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:d._model.getText(),start:b,removedCharCount:a,addedCharCount:g,removedLineCount:h,addedLineCount:e});var c=this._binarySearch(i,d.start);i.splice(c,0,d);this.onChanged({type:"Changed",start:b,removedCharCount:a,addedCharCount:g,removedLineCount:h,addedLineCount:e})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(d,b){var f=this._projections,a=0,h,g;if(b){for(h=
0;h<f.length;h++){g=f[h];if(g.start>d)break;if(g.end>d)return-1;a+=g._model.getCharCount()-(g.end-g.start)}return d+a}for(h=0;h<f.length;h++){g=f[h];if(g.start>d-a)break;var e=g._model.getCharCount();if(g.start+e>d-a)return-1;a+=e-(g.end-g.start)}return d-a},removeProjection:function(d){var b,f=0;for(b=0;b<this._projections.length;b++){var a=this._projections[b];if(a===d){d=a;break}f+=a._model.getCharCount()-(a.end-a.start)}if(b<this._projections.length){var a=this._model,f=d.start+f,h=d.end-d.start,
g=d._lineCount,e=d._model.getCharCount(),c=d._model.getLineCount()-1;this.onChanging({type:"Changing",text:a.getText(d.start,d.end),start:f,removedCharCount:e,addedCharCount:h,removedLineCount:c,addedLineCount:g});this._projections.splice(b,1);this.onChanged({type:"Changed",start:f,removedCharCount:e,addedCharCount:h,removedLineCount:c,addedLineCount:g})}},_binarySearch:function(d,b){for(var f=d.length,a=-1,h;f-a>1;)h=Math.floor((f+a)/2),b<=d[h].start?f=h:a=h;return f},getCharCount:function(){for(var d=
this._model.getCharCount(),b=this._projections,f=0;f<b.length;f++){var a=b[f];d+=a._model.getCharCount()-(a.end-a.start)}return d},getLine:function(d,b){if(d<0)return null;var f=this._model,a=this._projections,h=0,g=[],e=0,c,l,n;for(c=0;c<a.length;c++){n=a[c];if(n._lineIndex>=d-h)break;l=n._model.getLineCount()-1;if(n._lineIndex+l>=d-h)if(e=d-(n._lineIndex+h),e<l)return n._model.getLine(e,b);else g.push(n._model.getLine(l));e=n.end;h+=l-n._lineCount}for(e=Math.max(e,f.getLineStart(d-h));c<a.length;c++){n=
a[c];if(n._lineIndex>d-h)break;g.push(f.getText(e,n.start));l=n._model.getLineCount()-1;if(n._lineIndex+l>d-h)return g.push(n._model.getLine(0,b)),g.join("");g.push(n._model.getText());e=n.end;h+=l-n._lineCount}a=f.getLineEnd(d-h,b);e<a&&g.push(f.getText(e,a));return g.join("")},getLineAtOffset:function(d){for(var b=this._model,f=this._projections,a=0,h=0,g=0;g<f.length;g++){var e=f[g];if(e.start>d-a)break;var c=e._model.getCharCount();if(e.start+c>d-a){f=d-(e.start+a);h+=e._model.getLineAtOffset(f);
a+=f;break}h+=e._model.getLineCount()-1-e._lineCount;a+=c-(e.end-e.start)}return b.getLineAtOffset(d-a)+h},getLineCount:function(){for(var d=this._projections,b=this._model.getLineCount(),f=0;f<d.length;f++){var a=d[f];b+=a._model.getLineCount()-1-a._lineCount}return b},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,b){if(d<0)return-1;for(var f=this._model,a=this._projections,h=0,g=0,e=0;e<a.length;e++){var c=a[e];if(c._lineIndex>d-h)break;var l=c._model.getLineCount()-
1;if(c._lineIndex+l>d-h)return c._model.getLineEnd(d-(c._lineIndex+h),b)+c.start+g;g+=c._model.getCharCount()-(c.end-c.start);h+=l-c._lineCount}return f.getLineEnd(d-h,b)+g},getLineStart:function(d){if(d<0)return-1;for(var b=this._model,f=this._projections,a=0,h=0,g=0;g<f.length;g++){var e=f[g];if(e._lineIndex>=d-a)break;var c=e._model.getLineCount()-1;if(e._lineIndex+c>=d-a)return e._model.getLineStart(d-(e._lineIndex+a))+e.start+h;h+=e._model.getCharCount()-(e.end-e.start);a+=c-e._lineCount}return b.getLineStart(d-
a)+h},getText:function(d,b){d===void 0&&(d=0);var f=this._model,a=this._projections,h=0,g=[],e,c,l;for(e=0;e<a.length;e++){c=a[e];if(c.start>d-h)break;l=c._model.getCharCount();if(c.start+l>d-h)if(b!==void 0&&c.start+l>b-h)return c._model.getText(d-(c.start+h),b-(c.start+h));else g.push(c._model.getText(d-(c.start+h))),d=c.end+h+l-(c.end-c.start);h+=l-(c.end-c.start)}var n=d-h;if(b!==void 0){for(;e<a.length;e++){c=a[e];if(c.start>b-h)break;g.push(f.getText(n,c.start));l=c._model.getCharCount();if(c.start+
l>b-h)return g.push(c._model.getText(0,b-(c.start+h))),g.join("");g.push(c._model.getText());n=c.end;h+=l-(c.end-c.start)}g.push(f.getText(n,b-h))}else{for(;e<a.length;e++)c=a[e],g.push(f.getText(n,c.start)),g.push(c._model.getText()),n=c.end;g.push(f.getText(n))}return g.join("")},_onChanging:function(d,b,f,a,h,g){for(var e=this._model,c=this._projections,l,n=0,m,j=b+f;l<c.length;l++){f=c[l];if(f.start>b)break;n+=f._model.getCharCount()-(f.end-f.start)}b+=n;for(var k=l;l<c.length;l++){f=c[l];if(f.start>
j)break;n+=f._model.getCharCount()-(f.end-f.start);m+=f._model.getLineCount()-1-f._lineCount}f=j+n;n=l;this.onChanging(b,f-b,a,h+m,g);c.splice(c,n-k);for(d=d.length-(f-b);l<c.length;l++)f=c[l],f.start+=d,f.end+=d,f._lineIndex=e.getLineAtOffset(f.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,b,f){d===void 0&&(d="");b===void 0&&(b=0);var a=b,h=f,g=this._model,
e=this._projections,c=0,l=0,n,m,j,k,s,t=0;for(n=0;n<e.length;n++){m=e[n];if(m.start>b-c)break;j=m._model.getCharCount();if(m.start+j>b-c)if(f!==void 0&&m.start+j>f-c){m._model.setText(d,b-(m.start+c),f-(m.start+c));return}else t=m._model.getLineCount()-1-m._model.getLineAtOffset(b-(m.start+c)),k={projection:m,start:b-(m.start+c)},b=m.end+c+j-(m.end-m.start);l+=m._model.getLineCount()-1-m._lineCount;c+=j-(m.end-m.start)}b-=c;var p=n,t=g.getLineAtOffset(b)+l-t;if(f!==void 0)for(;n<e.length;n++){m=e[n];
if(m.start>f-c)break;j=m._model.getCharCount();if(m.start+j>f-c){l+=m._model.getLineAtOffset(f-(m.start+c));j=f-(m.start+c);f=m.end+c;s={projection:m,end:j};break}l+=m._model.getLineCount()-1-m._lineCount;c+=j-(m.end-m.start)}else{for(;n<e.length;n++)m=e[n],l+=m._model.getLineCount()-1-m._lineCount,c+=m._model.getCharCount()-(m.end-m.start);f=h=g.getCharCount()+c}f-=c;m=g.getLineAtOffset(f)+l;h-=a;for(var l=m-t,t=d.length,x=j=m=c=0;;){m!==-1&&m<=x&&(m=d.indexOf("\r",x));j!==-1&&j<=x&&(j=d.indexOf("\n",
x));if(j===-1&&m===-1)break;x=m!==-1&&j!==-1?m+1===j?j+1:(m<j?m:j)+1:m!==-1?m+1:j+1;c++}this.onChanging({type:"Changing",text:d,start:a,removedCharCount:h,addedCharCount:t,removedLineCount:l,addedLineCount:c});g.setText(d,b,f);if(k)m=k.projection,m._model.setText("",k.start);if(s)m=s.projection,m._model.setText("",0,s.end),m.start=m.end,m._lineCount=0;e.splice(p,n-p);for(d=d.length-(f-b);n<e.length;n++)m=e[n],m.start+=d,m.end+=d,m._lineIndex=g.getLineAtOffset(m.start);this.onChanged({type:"Changed",
start:a,removedCharCount:h,addedCharCount:t,removedLineCount:l,addedLineCount:c})}};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/editor/util,orion/util".split(","),function(f,k,j,d,b,i){function a(a){this._view=a;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(a.getOptions("parent").ownerDocument)}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=i.createElement(a,"div");d.tabIndex=0;d.className="textviewTooltip";d.setAttribute("aria-live","assertive");d.setAttribute("aria-atomic","true");var e=this._tooltipContents=i.createElement(a,"div");d.appendChild(e);a.body.appendChild(d);var c=this;b.addEventListener(d,"mouseover",function(){if(c._hideDelay){var a=c._getWindow();if(c._delayedHideTimeout)a.clearTimeout(c._delayedHideTimeout),c._delayedHideTimeout=null;if(c._hideTimeout)a.clearTimeout(c._hideTimeout),c._hideTimeout=
null;c._nextTarget=null}},!1);b.addEventListener(d,"mouseout",function(a){a=a.relatedTarget||a.toElement;a===d||c._hasFocus()||(!a||!b.contains(d,a))&&c._hide()},!1);b.addEventListener(d,"keydown",function(a){a.keyCode===27&&c._hide()},!1);b.addEventListener(a,"mousedown",this._mouseDownHandler=function(a){c.isVisible()&&(b.contains(d,a.target||a.srcElement)||c._hide())},!0);this._view.addEventListener("Destroy",function(){c.destroy()});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);b.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var a=this._tooltipDiv;return!a?!1:b.contains(a,a.ownerDocument.activeElement)},hide:function(a){if(a===void 0)a=this._hideDelay;var b=this._getWindow();if(this._delayedHideTimeout)b.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null;var e=this;a?e._delayedHideTimeout=b.setTimeout(function(){e._delayedHideTimeout=null;e._hide();e.setTarget(e._nextTarget,0)},a):(e._hide(),e.setTarget(e._nextTarget,0))},_hide:function(){var a=this._tooltipDiv;if(a){this._hasFocus()&&this._view.focus();if(this._contentsView)this._contentsView.destroy(),this._contentsView=null;if(this._tooltipContents)this._tooltipContents.innerHTML="";a.style.visibility="hidden";a=this._getWindow();if(this._showTimeout)a.clearTimeout(this._showTimeout),
this._showTimeout=null;if(this._delayedHideTimeout)a.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=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,b,e){if(this.isVisible()){if(!this._hasFocus())this._nextTarget=a,this.hide(e)}else if(this._target=a){var c=
this,a=c._getWindow();if(c._showTimeout)a.clearTimeout(c._showTimeout),c._showTimeout=null;b===0?c.show(!0):c._showTimeout=a.setTimeout(function(){c._showTimeout=null;c.show(!0)},b?b:c._showDelay)}},show:function(a){if(this._target){var b=this._target.getTooltipInfo();if(b){var e=this._tooltipDiv,c=this._tooltipContents;e.style.left=e.style.right=e.style.width=e.style.height=c.style.width=c.style.height="auto";var f=b.contents;f instanceof Array&&(f=this._getAnnotationContents(f));if(typeof f==="string")c.innerHTML=
f;else if(this._isNode(f))c.appendChild(f);else if(f instanceof d.ProjectionTextModel){var i=this._view,m=i.getOptions();m.wrapMode=!1;m.parent=c;var j=m.themeClass;j?((j=j.replace("tooltipTheme",""))&&(j=" "+j),j="tooltipTheme"+j):j="tooltipTheme";m.themeClass=j;m=this._contentsView=new k.TextView(m);m.addEventListener("LineStyle",function(a){i.onLineStyle(a)});m.setModel(f);f=m.computeSize();c.style.width=f.width+"px";c.style.height=f.height+"px";m.resize()}else return;c=e.ownerDocument.documentElement;
b.anchor==="right"?(f=c.clientWidth-b.x,e.style.right=f+"px"):(f=parseInt(this._getNodeStyle(e,"padding-left","0"),10),f+=parseInt(this._getNodeStyle(e,"border-left-width","0"),10),f=b.x-f,e.style.left=f+"px");e.style.maxWidth=c.clientWidth-f-10+"px";f=parseInt(this._getNodeStyle(e,"padding-top","0"),10);f+=parseInt(this._getNodeStyle(e,"border-top-width","0"),10);f=b.y-f;e.style.top=f+"px";e.style.maxHeight=c.clientHeight-f-10+"px";e.style.opacity="1";e.style.visibility="visible";if(a){var q=this,
s=this._getWindow();q._hideTimeout=s.setTimeout(function(){q._hideTimeout=null;var a=parseFloat(q._getNodeStyle(e,"opacity","1"));q._fadeTimeout=s.setInterval(function(){e.style.visibility==="visible"&&a>0?(a-=0.1,e.style.opacity=a):q._hide()},q._fadeDelay/10)},q._autoHideDelay)}}}},_getAnnotationContents:function(a){function g(a,c){var b=t.getLineStart(t.getLineAtOffset(a)),e=t.getLineEnd(t.getLineAtOffset(c),!0);return t.getText(b,e)}function e(a){var c=a.title,e=i.createElement(j,"div");e.className=
"tooltipRow";if(a.html)e.innerHTML=a.html,e.lastChild&&b.addEventListener(e.lastChild,"click",function(){var c=a.start,b=a.end;s.getBaseModel&&(c=s.mapOffset(c,!0),b=s.mapOffset(b,!0));k.setSelection(c,b,1/3,function(){m._hide()})},!1),e.appendChild(j.createTextNode("\u00a0"));c||(c=g(a.start,a.end));typeof c==="function"&&(c=a.title());if(typeof c==="string"){var d=i.createElement(j,"span");d.appendChild(j.createTextNode(c));c=d}e.appendChild(c);return e}for(var c,l=[],n=0;n<a.length;n++)c=a[n],
c.title!==""&&!c.groupAnnotation&&l.push(c);a=l;if(a.length===0)return null;var m=this,j=this._tooltipDiv.ownerDocument,k=this._view,s=k.getModel(),t=s.getBaseModel?s.getBaseModel():s;if(a.length===1)if(c=a[0],c.title!==void 0){c=e(c);if(c.firstChild)(a=c.firstChild.className)&&(a+=" "),a+="single",c.firstChild.className=a;return c}else return a=new d.ProjectionTextModel(t),l=t.getLineStart(t.getLineAtOffset(c.start)),n=t.getCharCount(),c.end!==n&&a.addProjection({start:c.end,end:n}),l>0&&a.addProjection({start:0,
end:l}),a;else{l=i.createElement(j,"div");c=i.createElement(j,"em");c.appendChild(j.createTextNode(f.multipleAnnotations));l.appendChild(c);for(n=0;n<a.length;n++)c=a[n],(c=e(c))&&l.appendChild(c);return l}},_getNodeStyle:function(a,b,e){var c;if(a&&(c=a.style[b],!c))if(a.currentStyle){for(c=0;(c=b.indexOf("-",c))!==-1;)b=b.substring(0,c)+b.substring(c+1,c+2).toUpperCase()+b.substring(c+2);c=a.currentStyle[b]}else c=(a=a.ownerDocument.defaultView.getComputedStyle(a,null))?a.getPropertyValue(b):null;
return c||e},_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/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(f,k){function j(a,c,b){this.start=a;this.end=c;this._projectionModel=b;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function d(){}function b(a,c){var b=a.lastIndexOf("."),b=a.substring(b+1),g={title:f[b],style:{styleClass:"annotation "+b},html:"<div class='annotationHTML "+b+"'></div>",overviewStyle:{styleClass:"annotationOverview "+b}};c?g.lineStyle={styleClass:"annotationLine "+
b}:g.rangeStyle={styleClass:"annotationRange "+b};d.registerType(a,g)}function i(){}function a(a){this._annotations=[];var c=this;this._listener={onChanged:function(a){c._onChanged(a)}};this.setTextModel(a)}function h(a,c){this._view=a;this._annotationModel=c;var b=this;this._listener={onDestroy:function(a){b._onDestroy(a)},onLineStyle:function(a){b._onLineStyle(a)},onChanged:function(a){b._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",
this._listener.onLineStyle);c.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,c=a.getBaseModel();this._projection=
{start:c.getLineStart(c.getLineAtOffset(this.start)+1),end:c.getLineEnd(c.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";d.ANNOTATION_BLAME="orion.annotation.blame";d.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var g={};d.registerType=function(a,c){var b=c;if(typeof b!=="function")b=function(a,c,b){this.start=a;this.end=c;if(b!==void 0)this.title=b},b.prototype=c;b.prototype.type=a;g[a]=b;return a};d.createAnnotation=
function(a,c,b,d){return new (this.getType(a))(c,b,d)};d.getType=function(a){return g[a]};b(d.ANNOTATION_ERROR);b(d.ANNOTATION_WARNING);b(d.ANNOTATION_TASK);b(d.ANNOTATION_BREAKPOINT);b(d.ANNOTATION_BOOKMARK);b(d.ANNOTATION_CURRENT_BRACKET);b(d.ANNOTATION_MATCHING_BRACKET);b(d.ANNOTATION_CURRENT_SEARCH);b(d.ANNOTATION_MATCHING_SEARCH);b(d.ANNOTATION_READ_OCCURRENCE);b(d.ANNOTATION_WRITE_OCCURRENCE);b(d.ANNOTATION_SELECTED_LINKED_GROUP);b(d.ANNOTATION_CURRENT_LINKED_GROUP);b(d.ANNOTATION_LINKED_GROUP);
b(d.ANNOTATION_CURRENT_LINE,!0);b(d.ANNOTATION_BLAME,!0);b(d.ANNOTATION_CURRENT_BLAME,!0);d.registerType(d.ANNOTATION_FOLDING,j);i.addMixin=function(a){var c=i.prototype,b;for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};i.prototype={addAnnotationType:function(a){if(!this._annotationTypes)this._annotationTypes=[];this._annotationTypes.push(a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===a)return c+1;return 0},
getAnnotationsByType:function(a,c,b){a=a.getAnnotations(c,b);for(b=[];a.hasNext();)c=a.next(),this.getAnnotationTypePriority(c.type)!==0&&b.push(c);var d=this;b.sort(function(a,c){return d.getAnnotationTypePriority(a.type)-d.getAnnotationTypePriority(c.type)});return b},isAnnotationTypeVisible:function(a){return this.getAnnotationTypePriority(a)!==0},removeAnnotationType:function(a){if(this._annotationTypes)for(var c=0;c<this._annotationTypes.length;c++)if(this._annotationTypes[c]===a){this._annotationTypes.splice(c,
1);break}}};a.prototype={addAnnotation:function(a){if(a){var c=this._annotations,b=this._binarySearch(c,a.start);c.splice(b,0,a);this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,c){var b=this._annotations,d,g=0,f=function(){for(;g<b.length;){var d=b[g++];if(a===d.start||(a>d.start?a<d.end:d.start<c))return d;if(d.start>=c)break}return null};d=f();return{next:function(){var a=d;a&&(d=f());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 c=this._annotations,b,d;if(a){b=[];for(d=c.length-1;d>=0;d--){var g=c[d];g.type===a&&(c.splice(d,1),b.splice(0,0,g))}}else b=c;this.onChanged({type:"Changed",removed:b,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,c){var b=this._annotations,d,g,f,h=[];if(a)for(d=a.length-1;d>=0;d--)f=a[d],g=this._getAnnotationIndex(f),g<0||(b.splice(g,1),h.splice(0,0,f));c||(c=[]);for(d=0;d<c.length;d++)f=c[d],g=this._binarySearch(b,f.start),b.splice(g,0,f);this.onChanged({type:"Changed",removed:h,added:c,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,c){for(var b=a.length,d=-1,g;b-d>1;)g=Math.floor((b+d)/2),c<=a[g].start?b=g:d=g;return b},_getAnnotationIndex:function(a){for(var c=this._annotations,b=this._binarySearch(c,a.start);b<c.length&&c[b].start===a.start;){if(c[b]===a)return b;b++}return-1},_onChanged:function(a){var c=a.start,b=a.removedCharCount,d=this._annotations,g=c+b;if(0<d.length){for(var f={type:"Changed",added:[],removed:[],changed:[],
textModelChangedEvent:a},a=a.addedCharCount-b,b=0;b<d.length;b++){var h=d[b];h.start>=g?(h.start+=a,h.end+=a,f.changed.push(h)):h.end<=c||(h.start<c&&g<h.end?(h.end+=a,f.changed.push(h)):(d.splice(b,1),f.removed.push(h),b--))}if(f.added.length>0||f.removed.length>0||f.changed.length>0)this.onChanged(f)}}};k.EventTarget.addMixin(a.prototype);h.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,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.tagName&&!a.tagName)a.tagName=c.tagName;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]||(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]||(a.attributes[b]=
c.attributes[b])}}return a},_mergeStyleRanges:function(a,c){a||(a=[]);var b,d;for(d=0;d<a.length&&c;d++){var g=a[d];if(c.end<=g.start)break;if(!(c.start>=g.end)){b=this._mergeStyle({},g.style);b=this._mergeStyle(b,c.style);var f=[];f.push(d,1);c.start<g.start&&f.push({start:c.start,end:g.start,style:c.style});c.start>g.start&&f.push({start:g.start,end:c.start,style:g.style});f.push({start:Math.max(g.start,c.start),end:Math.min(g.end,c.end),style:b});c.end<g.end&&f.push({start:c.end,end:g.end,style:g.style});
c=c.end>g.end?{start:g.end,end:c.end,style:c.style}:null;Array.prototype.splice.apply(a,f)}}c&&(b=this._mergeStyle({},c.style),a.splice(d,0,{start:c.start,end:c.end,style:b}));return a},_onAnnotationModelChanged:function(a){function c(a){for(var c=0;c<a.length;c++)if(d.isAnnotationTypeVisible(a[c].type)){var e=a[c].start,f=a[c].end;g.getBaseModel&&(e=g.mapOffset(e,!0),f=g.mapOffset(f,!0));e!==-1&&f!==-1&&b.redrawRange(e,f)}}if(!a.textModelChangedEvent){var b=this._view;if(b){var d=this,g=b.getModel();
c(a.added);c(a.removed);c(a.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(a){var c=this._annotationModel,b=a.textView.getModel(),d=c.getTextModel(),g=a.lineStart,f=a.lineStart+a.lineText.length;d!==b&&(g=b.mapOffset(g),f=b.mapOffset(f));for(c=c.getAnnotations(g,f);c.hasNext();)if(g=c.next(),this.isAnnotationTypeVisible(g.type)){if(g.rangeStyle){var f=g.start,h=g.end;d!==b&&(f=b.mapOffset(f,!0),h=b.mapOffset(h,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:f,end:h,style:g.rangeStyle})}if(g.lineStyle)a.style=
this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,g.lineStyle)}}};i.addMixin(h.prototype);return{FoldingAnnotation:j,AnnotationType:d,AnnotationTypeList:i,AnnotationModel:a,AnnotationStyler:h}});
define("orion/editor/editor","i18n!orion/editor/nls/messages,orion/editor/eventTarget,orion/editor/tooltip,orion/editor/annotations,orion/objects,orion/util".split(","),function(f,k,j,d,b,i){function a(a){a=a||{};this._domNode=a.domNode;this._statusReporter=a.statusReporter;this._dirty=!1;this._title=null}function h(b){b=b||{};a.call(this,b);this._textViewFactory=b.textViewFactory;this._undoStackFactory=b.undoStackFactory;this._textDNDFactory=b.textDNDFactory;this._annotationFactory=b.annotationFactory;
this._foldingRulerFactory=b.foldingRulerFactory;this._lineNumberRulerFactory=b.lineNumberRulerFactory;this._contentAssistFactory=b.contentAssistFactory;this._keyBindingFactory=b.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=this._annotationStyler=null}var g=d.AnnotationType;a.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null},focus:function(){},getModel:function(){return this._model},
getText:function(a,c){return this.getModel().getText(a,c)},getTitle:function(){return this._title},install:function(){},isDirty:function(){return this._dirty},markClean:function(){this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},reportStatus:function(a,c,b){this._statusReporter&&this._statusReporter(a,c,b)},resize:function(){},setDirty:function(a){if(this._dirty!==a)this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"})},
setInput:function(a,c,b,d){this._title=a;this.onInputChanged({type:"InputChanged",title:a,message:c,contents:b,contentsSaved:d})},uninstall:function(){}};k.EventTarget.addMixin(a.prototype);h.prototype=new a;b.mixin(h.prototype,{destroy:function(){a.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},
getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},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},getUndoStack:function(){return this._undoStack},
getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},markClean:function(){this.getUndoStack().markClean()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,c){if(this._annotationRulerVisible!==a||c)if(this._annotationRulerVisible=
a,this._annotationRuler){var b=this._textView;a?b.addRuler(this._annotationRuler,0):b.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,c){if(this._foldingRulerVisible!==a||c)if(this._foldingRulerVisible=a,this._foldingRuler){var b=this._textView;b.getModel().getBaseModel&&(a?b.addRuler(this._foldingRuler):b.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,c){if(this._lineNumberRulerVisible!==a||c)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var b=
this._textView;a?b.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):b.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,c){if(this._overviewRulerVisible!==a||c)if(this._overviewRulerVisible=a,this._overviewRuler){var b=this._textView;a?b.addRuler(this._overviewRuler):b.removeRuler(this._overviewRuler)}},mapOffset:function(a,c){var b=this._textView.getModel();b.getBaseModel&&(a=b.mapOffset(a,c));return a},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var a=this._textView,c=a.getSelection(),a=a.getModel();if(a.getBaseModel)c.start=a.mapOffset(c.start),c.end=a.mapOffset(c.end);return c},_expandOffset:function(a){var c=this._textView.getModel(),b=this._annotationModel;if(b&&c.getBaseModel)for(a=b.getAnnotations(a,a+1);a.hasNext();)c=a.next(),c.type===g.ANNOTATION_FOLDING&&c.expand&&(c.expand(),b.modifyAnnotation(c))},setCaretOffset:function(a,c,b){var d=this._textView,g=d.getModel();g.getBaseModel&&(this._expandOffset(a),
a=g.mapOffset(a,!0));d.setCaretOffset(a,c,b)},setText:function(a,c,b){var d=this._textView,g=d.getModel();g.getBaseModel&&(c!==void 0&&(this._expandOffset(c),c=g.mapOffset(c,!0)),b!==void 0&&(this._expandOffset(b),b=g.mapOffset(b,!0)));d.setText(a,c,b)},setSelection:function(a,c,b,d){var g=this._textView,f=g.getModel();f.getBaseModel&&(this._expandOffset(a),this._expandOffset(c),a=f.mapOffset(a,!0),c=f.mapOffset(c,!0));g.setSelection(a,c,b,d)},moveSelection:function(a,c,b,d){var g=this._textView;
this.setSelection(a,c||a,1/3,function(){(d===void 0||d)&&g.focus();b&&b()})},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(a,c){var b=this._textView,d=this.getAnnotationModel();if(!d)return null;var g=this._annotationStyler;if(!g)return null;var f=b.getOffsetAtLocation(a,c);if(f===-1)return null;f=this.mapOffset(f);g=g.getAnnotationsByType(d,f,f+1);d=[];for(f=0;f<g.length;f++)g[f].rangeStyle&&d.push(g[f]);if(d.length===0)return null;b=b.convert({x:a,y:c},
"document","page");return{contents:d,anchor:"left",x:b.x+10,y:b.y+20}},_highlightCurrentLine:function(a,c){var b=this._annotationModel;if(b){var d=this._textView;if(!d.getOptions("singleMode")){var f=d.getModel(),h=c?f.getLineAtOffset(c.start):-1,i=f.getLineAtOffset(a.start),d=a.start===a.end,j=!c||c.start===c.end,k=f.getLineStart(i),p=f.getLineEnd(i);f.getBaseModel&&(k=f.mapOffset(k),p=f.mapOffset(p));f=this._currentLineAnnotation;if(!(h===i&&j&&d&&f&&f.start===k&&f.end===p)){var h=f?[f]:null,x;
d&&(f=g.createAnnotation(g.ANNOTATION_CURRENT_LINE,k,p),x=[f]);this._currentLineAnnotation=f;b.replaceAnnotations(h,x)}}}},install:function(){this.installTextView()},installTextView:function(){if(!this._textView){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,c=this._textView,b=this;this._listener={onModelChanged:function(){b.checkDirty()},onMouseOver:function(a){b._listener.onMouseMove(a)},onMouseMove:function(a){var e=j.Tooltip.getTooltip(c);if(e&&!(b._listener.lastMouseX===a.event.clientX&&b._listener.lastMouseY===a.event.clientY))b._listener.lastMouseX=a.event.clientX,b._listener.lastMouseY=a.event.clientY,e.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return b._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(a){var e=j.Tooltip.getTooltip(c);
if(e&&!(b._listener.lastMouseX===a.event.clientX&&b._listener.lastMouseY===a.event.clientY))b._listener.lastMouseX=a.event.clientX,b._listener.lastMouseY=a.event.clientY,e.setTarget(null)},onScroll:function(){var a=j.Tooltip.getTooltip(c);a&&a.setTarget(null,0,0)},onSelection:function(a){b._updateCursorStatus();b._highlightCurrentLine(a.newValue,a.oldValue)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Selection",this._listener.onSelection);c.addEventListener("MouseOver",
this._listener.onMouseOver);c.addEventListener("MouseOut",this._listener.onMouseOut);c.addEventListener("MouseMove",this._listener.onMouseMove);c.addEventListener("Scroll",this._listener.onScroll);if(this._keyBindingFactory){var d;if(d=typeof this._keyBindingFactory==="function"?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(a,this._undoStack,this._contentAssist))this._textActions=d.textActions,this._linkedMode=d.linkedMode,
this._sourceCodeActions=d.sourceCodeActions}d=function(c){if(c!==void 0&&c!==-1){for(var b=this.getView().getModel(),d=this.getAnnotationModel(),f=a.mapOffset(b.getLineStart(c)),c=a.mapOffset(b.getLineEnd(c)),b=d.getAnnotations(f,c),h=null;b.hasNext();){var i=b.next();if(i.type===g.ANNOTATION_BOOKMARK){h=i;break}}h?d.removeAnnotation(h):(h=g.createAnnotation(g.ANNOTATION_BOOKMARK,f,c),h.title=void 0,d.addAnnotation(h))}};if(this._annotationFactory){var f=c.getModel();f.getBaseModel&&(f=f.getBaseModel());
if(this._annotationModel=this._annotationFactory.createAnnotationModel(f))if(f=this._annotationStyler=this._annotationFactory.createAnnotationStyler(c,this._annotationModel))f.addAnnotationType(g.ANNOTATION_CURRENT_SEARCH),f.addAnnotationType(g.ANNOTATION_MATCHING_SEARCH),f.addAnnotationType(g.ANNOTATION_ERROR),f.addAnnotationType(g.ANNOTATION_WARNING),f.addAnnotationType(g.ANNOTATION_MATCHING_BRACKET),f.addAnnotationType(g.ANNOTATION_CURRENT_BRACKET),f.addAnnotationType(g.ANNOTATION_CURRENT_LINE),
f.addAnnotationType(g.ANNOTATION_READ_OCCURRENCE),f.addAnnotationType(g.ANNOTATION_WRITE_OCCURRENCE),f.addAnnotationType(g.ANNOTATION_SELECTED_LINKED_GROUP),f.addAnnotationType(g.ANNOTATION_CURRENT_LINKED_GROUP),f.addAnnotationType(g.ANNOTATION_LINKED_GROUP),f.addAnnotationType("orion.annotation.highlightError");c.annotationModel=this._annotationModel;var f=this._annotationFactory.createAnnotationRulers(this._annotationModel),h=this._annotationRuler=f.annotationRuler;if(h)h.onDblClick=d,h.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"}),
h.addAnnotationType(g.ANNOTATION_ERROR),h.addAnnotationType(g.ANNOTATION_WARNING),h.addAnnotationType(g.ANNOTATION_TASK),h.addAnnotationType(g.ANNOTATION_BOOKMARK);this.setAnnotationRulerVisible(this._annotationRulerVisible||this._annotationRulerVisible===void 0,!0);if(h=this._overviewRuler=f.overviewRuler)h.addAnnotationType(g.ANNOTATION_CURRENT_SEARCH),h.addAnnotationType(g.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(g.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(g.ANNOTATION_WRITE_OCCURRENCE),
h.addAnnotationType(g.ANNOTATION_CURRENT_BLAME),h.addAnnotationType(g.ANNOTATION_ERROR),h.addAnnotationType(g.ANNOTATION_WARNING),h.addAnnotationType(g.ANNOTATION_TASK),h.addAnnotationType(g.ANNOTATION_BOOKMARK),h.addAnnotationType(g.ANNOTATION_MATCHING_BRACKET),h.addAnnotationType(g.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(g.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||this._overviewRulerVisible===void 0,!0)}if(this._lineNumberRulerFactory)this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(g.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(g.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=d,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||this._lineNumberRulerVisible===void 0,!0);if(this._foldingRulerFactory)this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(g.ANNOTATION_FOLDING),
this.setFoldingRulerVisible(this._foldingRulerVisible||this._foldingRulerVisible===void 0,!0);this.dispatchEvent({type:"TextViewInstalled",textView:c})}},uninstall:function(){this.uninstallTextView()},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._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a})},_updateCursorStatus:function(){var a=this.getModel(),c=this.getCaretOffset(),b=a.getLineAtOffset(c),a=a.getLineStart(b);c-=a;for(var a=this.getKeyModes(),d=0;d<a.length;d++){var g=a[d];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(i.formatMessage(f.lineColumn,
b+1,c+1))},showAnnotations:function(a,c,b,d){var f=this._annotationModel;if(f){for(var h=[],i=[],j=f.getTextModel(),k=f.getAnnotations(0,j.getCharCount()),p;k.hasNext();)p=k.next(),c.indexOf(p.type)!==-1&&p.creatorID===this&&h.push(p);if(a)for(c=0;c<a.length;c++)if(p=a[c]){if(b)p=b(p);else{var x;typeof p.line==="number"?(x=j.getLineStart(p.line-1),k=x+p.start-1,x+=p.end):(k=p.start,x=p.end);var u=d(p);if(!u)continue;p=g.createAnnotation(u,k,x,p.description)}p.creatorID=this;i.push(p)}f.replaceAnnotations(h,
i)}},showProblems:function(a){this.showAnnotations(a,[g.ANNOTATION_ERROR,g.ANNOTATION_WARNING,g.ANNOTATION_TASK],null,function(a){switch(a.severity){case "error":return g.ANNOTATION_ERROR;case "warning":return g.ANNOTATION_WARNING;case "task":return g.ANNOTATION_TASK}return null})},showOccurrences:function(a){this.showAnnotations(a,[g.ANNOTATION_READ_OCCURRENCE,g.ANNOTATION_WRITE_OCCURRENCE],null,function(a){return a.readAccess?g.ANNOTATION_READ_OCCURRENCE:g.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(a){var c=
this._blameRGB,h=this.getTextView().getOptions("parent").ownerDocument;if(!c){var n=i.createElement(h,"div");n.className="annotation blame";h.body.appendChild(n);var j=(h.defaultView||h.parentWindow).getComputedStyle(n).getPropertyValue("background-color");n.parentNode.removeChild(n);var n=j.indexOf("("),k=j.indexOf(")"),j=j.substring(n+1,k);this._blameRGB=c=j.split(",").slice(0,3)}var q=function(){var a=d.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=b.mixin({},
a.style);a.style.style=b.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},s=function(){var a=i.createElement(h,"div");a.className="tooltipTitle";var c=this.blame.Message.indexOf("\n");if(c===-1)c=this.blame.Message.length;var b=i.createElement(h,"a");b.href=this.blame.CommitLink;b.appendChild(h.createTextNode(this.blame.Message.substring(0,c)));a.appendChild(b);a.appendChild(i.createElement(h,"br"));
a.appendChild(h.createTextNode(i.formatMessage(f.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},t=this.getModel();this.showAnnotations(a,[g.ANNOTATION_BLAME,g.ANNOTATION_CURRENT_BLAME],function(a){var e=t.getLineStart(a.Start-1),f=t.getLineEnd(a.End-1,!0),e=d.AnnotationType.createAnnotation(g.ANNOTATION_BLAME,e,f,s),f=c.slice(0);f.push(a.Shade);e.style=b.mixin({},e.style);e.style.style=b.mixin({},e.style.style);e.style.style.backgroundColor="rgba("+f.join()+")";e.groupId=a.Name;
e.groupType=g.ANNOTATION_CURRENT_BLAME;e.createGroupAnnotation=q;e.html='<img class="annotationHTML blame" src="'+a.AuthorImage+'"/>';e.blame=a;return e})},showSelection:function(a,c,b,d,g){typeof a==="number"?(typeof c!=="number"&&(c=a),this.moveSelection(a,c)):typeof b==="number"&&(a=this.getModel().getLineStart(b-1),typeof d==="number"&&(a+=d),typeof g!=="number"&&(g=0),this.moveSelection(a,a+g))},setInput:function(b,c,d,g){this._textView&&(g||(c?this._textView.setText(c):d!==null&&d!==void 0&&
(this._textView.setText(d),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection())),this._undoStack.reset(),this._textView.focus()),this.checkDirty());a.prototype.setInput.call(this,b,c,d,g)},onGotoLine:function(a,c,b,d){if(this._textView){var g=this.getModel(),a=Math.max(0,Math.min(a,g.getLineCount()-1)),f=g.getLineStart(a),h=0;b===void 0&&(b=0);typeof c==="string"?(a=g.getLine(a).indexOf(c),a!==-1&&(h=a,b=h+c.length)):(h=c,c=g.getLineEnd(a)-f,
h=Math.min(h,c),b=Math.min(b,c));this.moveSelection(f+h,f+b,d)}}});return{BaseEditor:a,Editor:h}});
define("orion/editor/find","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/keyModes,orion/editor/annotations,orion/regex,orion/objects,orion/util".split(","),function(f,k,j,d,b,i,a){function h(a){var e=a.getTextView();j.KeyMode.call(this,e);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";e.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));e.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var c=d.editor,e=c.getModel(),g=c.mapOffset(a.start),c=c.mapOffset(a.end),e=e.getText(g,c);if((e=d._prefix.match(RegExp("^"+b.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 g(a,b,e){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(e)}}var e={};h.prototype=new j.KeyMode;i.mixin(h.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 e=this._prefix;if(e.length===0)return!1;var d=this.editor,g=d.getModel(),g=a?this._success?b?this._start:d.getCaretOffset()+
1:0:this._success?b?this._start:d.getCaretOffset():g.getCharCount()-1;if(e=d.getModel().find({string:e,start:g,reverse:!a,caseInsensitive:e.toLowerCase()===e}).next()){if(!b)this._start=g;this._ignoreSelection=this._success=!0;d.moveSelection(a?e.start:e.end,a?e.end:e.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 c;c=this._forward?this._success?f.incrementalFindStr:f.incrementalFindStrNotFound:this._success?f.incrementalFindReverseStr:f.incrementalFindReverseStrNotFound;c=a.formatMessage(c,this._prefix);this.editor.reportStatus(c,this._success?"":"error")}else this.editor.reportStatus("")}});
e.IncrementalFind=h;g.prototype={find:function(a,b,e){this.setOptions({reverse:!a});var d=this.getFindString(),g;if(b)d=b.findString||d,g=b.count;a=this.getOptions();this.setOptions(b);b=e?this._startOffset:this.getStartOffset();if((g=this._doFind(d,b,g))&&!e)this._startOffset=g.start;this.setOptions(a);this._hideAfterFind&&this.hide();return g},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(),a=this._editor.getText(a.start,a.end);this._regex&&(a=b.escape(a));return a||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();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var b=a;if(this._regex){for(var b="",e=!1,d=this._editor.getModel().getLineDelimiter(),g=0;g<a.length;g++){var f=a.substring(g,g+1);if(e){switch(f){case "R":b+=d;break;case "r":b+=
"\r";break;case "n":b+="\n";break;case "t":b+="\t";break;case "\\":b+="\\";break;default:b+="\\"+f}e=!1}else f==="\\"?e=!0:b+=f}e&&(b+="\\")}return b},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var b=this._editor,e=this._processReplaceString(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,e),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var c=this.getFindString();if(c){this._replacingAll=!0;var b=this._editor,e=b.getTextView();b.reportStatus(f.replaceAll);var d=this._processReplaceString(this.getReplaceString()),g=this;window.setTimeout(function(){for(var h=0,i=0;;){var j=g._doFind(c,h,null,!0);if(!j)break;i++;i===1&&(e.setRedraw(!1),g.startUndo());g._doReplace(j.start,j.end,c,d);h=g.getStartOffset()}i>
0&&(g.endUndo(),e.setRedraw(!0));h>0?b.reportStatus(a.formatMessage(f.replacedMatches,i)):b.reportStatus(f.nothingReplaced,"error");g._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()},_find:function(a,b,e){return this._editor.getModel().find({string:a,start:b,end:this._end,reverse:this._reverse,wrap:e?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,b,e,g){var e=e||1,h=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var i,j;if(this._regex)try{j=this._find(a,b,g)}catch(k){h.reportStatus(k.message,
"error");return}else j=this._find(a,b,g);for(a=0;a<e&&j.hasNext();a++)i=j.next();if(!this._replacingAll){i?this._editor.reportStatus(""):this._editor.reportStatus(f.notFound,"error");if(this.isVisible()){e=d.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(j=h.getAnnotationModel())j.removeAnnotations(e),i&&j.addAnnotation(d.AnnotationType.createAnnotation(e,i.start,i.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var p=this;this._timer=window.setTimeout(function(){p._markAllOccurrences();
p._timer=null},500)}}this._findCallback?this._findCallback(i):i&&h.moveSelection(i.start,i.end,null,!1)}return i},_doReplace:function(a,b,e,d){var g=this._editor;if(this._regex&&(d=g.getText(a,b).replace(RegExp(e,this._caseInsensitive?"i":""),d),!d))return;g.setText(d,a,b);g.setSelection(a,a+d.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var b=d.AnnotationType.ANNOTATION_MATCHING_SEARCH,e=a.getAnnotations(0,a.getTextModel().getCharCount()),g=[],f;e.hasNext();){var h=
e.next();h.type===b&&g.push(h)}if(this.isVisible()){e=this.getFindString();e=this._editor.getModel().find({string:e,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(f=[];e.hasNext();)h=e.next(),f.push(d.AnnotationType.createAnnotation(b,h.start,h.end))}a.replaceAnnotations(g,f)}},_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)}};e.Find=g;return e});
define("orion/editor/actions","i18n!orion/editor/nls/messages,orion/keyBinding,orion/editor/annotations,orion/editor/tooltip,orion/editor/find,orion/util".split(","),function(f,k,j,d,b,i){function a(a,e,d){this.editor=a;this.undoStack=e;this._incrementalFind=new b.IncrementalFind(a);this._find=d?d:new b.Find(a,e);this._lastEditLocation=null;this.init()}function h(a,b,e,d){this.editor=a;this.undoStack=b;this.contentAssist=e;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var g=j.AnnotationType,e={};a.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){if(this.editor.isDirty())this._lastEditLocation=a.start+a.addedCharCount}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(){return this.undoStack?(this.undoStack.undo(),!0):!1}.bind(this),{name:f.undo});a.setAction("redo",function(){return this.undoStack?
(this.undoStack.redo(),!0):!1}.bind(this),{name:f.redo});a.setKeyBinding(new k.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();(a=prompt(f.find,this.editor.getText(a.start,a.end)))&&this._find.find(!0,{findString:a})}}.bind(this),{name:f.find});a.setKeyBinding(new k.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?(this._find.find(!0,a),!0):!1}.bind(this),{name:f.findNext});a.setKeyBinding(new k.KeyBinding("k",
!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:f.findPrevious});a.setKeyBinding(new k.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:f.incrementalFind});a.setKeyBinding(new k.KeyBinding("j",!0,!0),"incrementalFindReverse");a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);
return!0}.bind(this),{name:f.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:f.unindentLines});a.setKeyBinding(new k.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:f.moveLinesUp});a.setKeyBinding(new k.KeyBinding(40,!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),
{name:f.moveLinesDown});a.setKeyBinding(new k.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:f.copyLinesUp});a.setKeyBinding(new k.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:f.copyLinesDown});a.setKeyBinding(new k.KeyBinding("d",!0,!1,!1),"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:f.deleteLines});
a.setKeyBinding(new k.KeyBinding("l",!i.isMac,!1,!1,i.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:f.gotoLine});a.setKeyBinding(new k.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:f.nextAnnotation});a.setKeyBinding(new k.KeyBinding(188,!0),"previousAnnotation");a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:f.prevAnnotation});
a.setKeyBinding(new k.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:f.expand});a.setKeyBinding(new k.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:f.collapse});a.setKeyBinding(new k.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",function(){return this.expandAnnotations(!0)}.bind(this),{name:f.expandAll});a.setKeyBinding(new k.KeyBinding("c",
!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:f.collapseAll});a.setKeyBinding(new k.KeyBinding("q",!i.isMac,!1,!1,i.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:f.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-1:
e.end),g=b.getLineStart(d),d=b.getLineEnd(e,!0),f=b.getLineCount(),h="",g=b.getText(g,d);e===f-1&&(g=(h=b.getLineDelimiter())+g);a.setText(g,d,d);a.setSelection(d+h.length,d+g.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),d=b.getLineStart(d),g=b.getLineEnd(e,!0),f=b.getLineCount(),h="",g=b.getText(d,g);e===f-1&&(g+=h=b.getLineDelimiter());
a.setText(g,d,d);a.setSelection(d,d+g.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=1;if(a&&a.count)e=a.count;var d=b.getSelection(),g=b.getModel(),f=g.getLineAtOffset(d.start),a=g.getLineStart(f),e=d.start!==d.end||e===1?g.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(f+e-1,g.getLineCount()-1),e=g.getLineEnd(e,!0);b.setText("",a,e);return!0},expandAnnotation:function(a){var b=this.editor,e=b.getAnnotationModel();
if(!e)return!0;var d=b.getModel(),g=b.getCaretOffset(),f=d.getLineAtOffset(g),g=d.getLineStart(f),f=d.getLineEnd(f,!0);d.getBaseModel&&(g=d.mapOffset(g),f=d.mapOffset(f),d.getBaseModel());for(var h,d=e.getAnnotations(g,f);!h&&d.hasNext();)g=d.next(),g.type===j.AnnotationType.ANNOTATION_FOLDING&&(h=g);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()),e.modifyAnnotation(h));return!0},expandAnnotations:function(a){var b=this.editor,e=b.getTextView(),d=b.getAnnotationModel();if(!d)return!0;
var b=b.getModel(),g=d.getAnnotations(0,b.getCharCount());for(e.setRedraw(!1);g.hasNext();)b=g.next(),b.type===j.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse(),d.modifyAnnotation(b));e.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var e=a.getModel(),d=a.getSelection(),g=e.getLineAtOffset(d.start),f=e.getLineAtOffset(d.end>d.start?d.end-1:d.end);if(g!==f){var h=[];h.push("");
for(var i=g;i<=f;i++)h.push(e.getLine(i,!0));i=e.getLineStart(g);e=e.getLineEnd(f,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),i,e);a.setSelection(i===d.start?d.start:d.start+b.length,d.end+(f-g+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(f.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(),e=a.getSelection(),d=b.getLineAtOffset(e.start),g=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=b.getLineCount();if(g===f-1)return!0;var d=b.getLineStart(d),e=b.getLineEnd(g,!0),h=b.getLineEnd(g+1,!0)-(e-d),i=0;g!==f-2?b=b.getText(d,e):(g=b.getLineEnd(g),b=b.getText(g,e)+b.getText(d,g),i+=e-g);this.startUndo();
a.setText("",d,e);a.setText(b,h,h);a.setSelection(h+i,h+i+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start);if(d===0)return!0;var g=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=b.getLineCount(),e=b.getLineStart(d-1),h=b.getLineStart(d),i=b.getLineEnd(g,!0),j=b.getText(h,i),k=0;g===f-1&&(g=b.getLineEnd(d-1),d=b.getLineEnd(d-1,!0),j+=b.getText(g,d),h=g,
k=d-g);this.startUndo();a.setText("",h,i);a.setText(j,e,e);a.setSelection(e,e+j.length-k);this.endUndo();return!0},nextAnnotation:function(a){var b=this.editor,e=b.getAnnotationModel();if(!e)return!0;var f=b.getOverviewRuler()||b.getAnnotationStyler();if(!f)return!0;for(var h=b.getModel(),i=b.getCaretOffset(),e=e.getAnnotations(a?i:0,a?h.getCharCount():i),j=null;e.hasNext();){var k=e.next();if(a){if(k.start<=i)continue}else if(k.start>=i)continue;if(!k.lineStyle&&!(k.type===g.ANNOTATION_MATCHING_BRACKET||
k.type===g.ANNOTATION_CURRENT_BRACKET||!f.isAnnotationTypeVisible(k.type)))if(j=k,a)break}if(j){var p=b.getTextView(),x=h.getLineAtOffset(j.start),u=d.Tooltip.getTooltip(p);if(!u)return b.moveSelection(j.start),!0;b.moveSelection(j.start,j.start,function(){u.setTarget({getTooltipInfo:function(){var a=p.convert({x:p.getLocationAtOffset(j.start).x,y:p.getLocationAtOffset(h.getLineStart(x)).y},"document","page");return{contents:[j],x:a.x,y:a.y+Math.floor(p.getLineHeight(x)*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 e=a.getModel(),d=a.getSelection(),g=e.getLineAtOffset(d.start),f=e.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getOptions("tabSize"),i=Array(h+1).join(" "),j=[],k=b=0,u=g;u<=f;u++){var v=e.getLine(u,!0);if(e.getLineStart(u)!==e.getLineEnd(u))if(v.indexOf("\t")===0)v=v.substring(1),b++;else if(v.indexOf(i)===0)v=v.substring(h),b+=h;else return!0;u===g&&(k=b);j.push(v)}g=e.getLineStart(g);h=e.getLineEnd(f,
!0);e=e.getLineStart(f);a.setText(j.join(""),g,h);f=g===d.start?d.start:d.start-k;d=Math.max(f,d.end-b+(d.end===e+1&&d.start!==d.end?1:0));a.setSelection(f,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};e.TextActions=a;h.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));
a.setKeyBinding(new k.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:f.trimTrailingWhitespaces});a.setKeyBinding(new k.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",function(){return this.toggleLineComment()}.bind(this),{name:f.toggleLineComment});a.setKeyBinding(new k.KeyBinding(191,!0,!i.isMac,!1,i.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),
{name:f.addBlockComment});a.setKeyBinding(new k.KeyBinding(220,!0,!i.isMac,!1,i.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:f.removeBlockComment});a.setKeyBinding(new k.KeyBinding("[",!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new k.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",
function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new k.KeyBinding("<",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("<",">")}.bind(this));a.setKeyBinding(new k.KeyBinding(">",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket(">")}.bind(this));a.setKeyBinding(new k.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");
a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new k.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new k.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new k.KeyBinding("}",!1,!1,!1,!1,"keypress"),
"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new k.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new k.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",
function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var e=a.getSelection();if(e.start===e.end){for(var d=a.getModel(),g=d.getLineAtOffset(e.start),f=d.getLine(g,!1),h=d.getLineStart(g),i=0,j=e.start-h,k;i<j&&((k=f.charCodeAt(i))===32||k===9);)i++;var h=f.substring(0,i),b=b.getOptions("tabSize","expandTab"),u=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),v=/^[\s]*\/\*[\*]*[\s]*$/,
o=/^[\s]*\*/,w=/\*\/[\s]*$/,y=f.substring(0,j),B=f.substring(j),H;if(this.smartIndentation&&f.charCodeAt(H=y.trimRight().length-1)===123)return d=j-H-1,B=B.length-B.trimLeft().length,f=f.charCodeAt(j+B)===125?b+h+u+b+h:b+h+u,a.setText(f,e.start-d,e.end+B),a.setCaretOffset(e.start+b.length+h.length+u.length-d),!0;else if(this.autoCompleteComments&&!w.test(y)&&(v.test(y)||o.test(y))){if(i=v.exec(y)){f=b+h+" * ";f+=w.test(B)?B.substring(0,B.length-2).trim():B.trim();if(d.getLineCount()===g+1||!o.test(d.getLine(g+
1)))f+=b+h+" */";a.setText(f,e.start,e.end+B.length);a.setCaretOffset(e.start+b.length+h.length+3);return!0}if(i=o.exec(y))for(g-=1;g>=0;g--)if(i=d.getLine(g,!1),v.test(i))return w.test(B)||f.charCodeAt(j)===47?(f=b+h+"*"+B,h=e.start+b.length+h.length+1):(f=b+h+"* "+B,h=e.start+b.length+h.length+2),a.setText(f,e.start,e.end+B.length),a.setCaretOffset(h),!0;else if(!o.test(i))break}else if(w.test(y))return f=f.substring(e.start)+b+h.substring(0,h.length-1),a.setText(f,e.start,e.end),a.setCaretOffset(e.start+
f.length),!0;else if(i>0){for(i=j;i<f.length&&((k=f.charCodeAt(i++))===32||k===9);)e.end++;a.setText(d.getLineDelimiter()+h,e.start,e.end);return!0}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=this._findEnclosingComment(b,e.start,e.end);if(d.commentStart!==void 0&&d.commentEnd!==void 0)return!0;b=b.getText(e.start,e.end);if(b.length===0)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),g=b.length;
a.setText("/*"+b+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(g-d));return!0},autoPairBrackets:function(a,b){if(a==="["&&!this.autoPairSquareBrackets)return!1;else if(a==="{"&&!this.autoPairBraces)return!1;else if(a==="("&&!this.autoPairParentheses)return!1;else if(a==="<"&&!this.autoPairAngleBrackets)return!1;var e=this.editor;if(e.getTextView().getOptions("readonly"))return!1;var d=e.getSelection(),g=e.getModel(),f=e.getCaretOffset()===g.getCharCount()?"":g.getText(d.start,d.start+1).trim(),
h=/^$|[)}\]>]/;if(d.start===d.end&&h.test(f))return e.setText(a+b,d.start,d.start),e.setCaretOffset(d.start+1),!0;else if(d.start!==d.end)return g=g.getText(d.start,d.end),e.setText(a+g+b,d.start,d.end),e.setSelection(d.start+1,d.end+1),!0;return!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel(),g=b.getCaretOffset(),f=g===0?"":d.getText(e.start-1,e.start).trim(),h=g===d.getCharCount()?
"":d.getText(e.start,e.start+1).trim(),g=/^"$|^'$/,i=/\w/,j=/^$|[)}\]>]/;if(e.start!==e.end){d=d.getText(e.start,e.end);if(g.test(d))return!1;b.setText(a+d+a,e.start,e.end);b.setSelection(e.start+1,e.end+1)}else if(h===a)b.setCaretOffset(e.start+1);else if(f===a||g.test(h)||i.test(f)||!j.test(h))return!1;else b.setText(a+a,e.start,e.start),b.setCaretOffset(e.start+1);return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&a.positions.length>0&&this.linkedMode){for(var b=
[],e=0;e<a.positions.length;++e)b[e]={positions:[{offset:a.positions[e].offset,length:a.positions[e].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},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getSelection(),e=a.getModel(),d=a.getCaretOffset(),g=d===0?"":e.getText(b.start-1,b.start),e=d===e.getCharCount()?"":e.getText(b.start,b.start+1);(g==="("&&e===")"||g==="["&&e==="]"||g==="{"&&e==="}"||g==="<"&&e===">"||g==='"'&&e==='"'||g==="'"&&e==="'")&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,e){var d=a.getLineAtOffset(b),g=a.getLineAtOffset(e),f,h,i,j,k,u;for(f=d;f>=0;f--)if(h=a.getLine(f),i=f===d?b-a.getLineStart(d):h.length,j=h.lastIndexOf("/*",i),
h=h.lastIndexOf("*/",i),h>j)break;else if(j!==-1){k=a.getLineStart(f)+j;break}for(f=g;f<a.getLineCount();f++)if(h=a.getLine(f),i=f===g?e-a.getLineStart(g):0,j=h.indexOf("/*",i),h=h.indexOf("*/",i),j!==-1&&j<h)break;else if(h!==-1){u=a.getLineStart(f)+h;break}return{commentStart:k,commentEnd:u}},lineStart:function(){for(var a=this.editor,b=a.getModel(),e=a.getCaretOffset(),d=b.getLineAtOffset(e),g=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var f=b.charCodeAt(d);if(!(f===32||f===9))break}d+=
g;return e!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getText(e.start,e.end),g,f,h;for(h=0;h<d.length;h++)if(d.substring(h,h+2)==="/*"){g=e.start+h;break}for(;h<d.length;h++)if(d.substring(h,h+2)==="*/"){f=e.start+h;break}if(g!==void 0&&f!==void 0)a.setText(b.getText(g+2,f),g,f+2),a.setSelection(g,f);else{d=this._findEnclosingComment(b,e.start,e.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(e.start-2,e.end-2)}return!0},toggleLineComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;for(var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),g=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=!0,h=[],i,j,k=d;k<=g;k++)if(i=b.getLine(k,!0),h.push(i),!f||(j=i.indexOf("//"))===-1)f=!1;else if(j!==0){var u;for(u=
0;u<j;u++)if(f=i.charCodeAt(u),!(f===32||f===9))break;f=u===j}k=b.getLineStart(d);u=b.getLineEnd(g,!0);if(f){for(f=0;f<h.length;f++)i=h[f],j=i.indexOf("//"),h[f]=i.substring(0,j)+i.substring(j+2);h=h.join("");i=b.getLineStart(g);b=k===e.start?e.start:e.start-2;e=e.end-2*(g-d+1)+(e.end===i+1?2:0)}else h.splice(0,0,""),h=h.join("//"),b=k===e.start?e.start:e.start+2,e=e.end+2*(g-d+1);a.setText(h,k,u);a.setSelection(b,e);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),e=
a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,g=b.getLineCount(),f=0;f<g;f++){var h=b.getLine(f),i=d.exec(h);if(i){var j=b.getLineStart(f),h=i[0].length,i=j+i.index;b.setText("",i,i+h);if(e.start>i)e.start=Math.max(i,e.start-h);if(e.start!==e.end&&e.end>i)e.end=Math.max(i,e.end-h)}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(e.start,e.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},
skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(e.start,e.start+1))===a?(b.setCaretOffset(e.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=
a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setSmartIndentation:function(a){this.smartIndentation=a}};e.SourceCodeActions=h;if(!String.prototype.trimLeft)String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")};if(!String.prototype.trimRight)String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")};return e});
define("orion/editor/undoStack",[],function(){function f(d,b,f,a){this.offset=d;this.text=b;this.previousText=f;this.type=a}function k(d){this.owner=d;this.changes=[]}function j(d,b){this.view=d;this.size=b!==void 0?b:100;this.reset();var f=d.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;var a=this;this._listener={onChanging:function(b){a._onChanging(b)},onDestroy:function(b){a._onDestroy(b)}};f.addEventListener("Changing",this._listener.onChanging);d.addEventListener("Destroy",this._listener.onDestroy)}
f.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(d,b){this._doUndoRedo(this.offset,this.previousText,this.text,d,b);return!0},redo:function(d,b){this._doUndoRedo(this.offset,this.text,this.previousText,d,b);return!0},merge:function(d,b,f,a,h){if(a===this.type)if(a===1&&d===this.offset+this.text.length)return this.text+=
b,!0;else if(a===-1&&h===this.offset)return this.offset=d,this.previousText=f+this.previousText,!0;else if(a===-1&&d===this.offset)return this.previousText+=f,!0;return!1},_doUndoRedo:function(d,b,f,a,h){var g=a.getModel();if(g.mapOffset&&a.annotationModel){var e=g.mapOffset(d,!0);if(e<0)for(var c=a.annotationModel.getAnnotations(d,d+1);c.hasNext();){var j=c.next();if(j.type==="orion.annotation.folding"){j.expand();e=g.mapOffset(d,!0);break}}if(e<0)return;d=e}g.setText(b,d,d+f.length);h&&a.setSelection(d,
d+b.length)}};k.prototype={getRedoChanges:function(){for(var d=[],b=0;b<this.changes.length;b++)d=d.concat(this.changes[b].getRedoChanges());return d},getUndoChanges:function(){for(var d=[],b=this.changes.length-1;b>=0;b--)d=d.concat(this.changes[b].getUndoChanges());return d},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,b){this.changes.length>1&&d.setRedraw(!1);for(var f=this.changes.length-
1;f>=0;f--)this.changes[f].undo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(b){var f=this.startSelection.start,a=this.startSelection.end;d.setSelection(this.startCaret?f:a,this.startCaret?a:f)}(f=this.owner)&&f.undo&&f.undo();return this.changes.length>0},redo:function(d,b){this.changes.length>1&&d.setRedraw(!1);for(var f=0;f<this.changes.length;f++)this.changes[f].redo(d,!1);this.changes.length>1&&d.setRedraw(!0);if(b){var f=this.endSelection.start,a=this.endSelection.end;d.setSelection(this.endCaret?
f:a,this.endCaret?a:f)}(f=this.owner)&&f.redo&&f.redo();return this.changes.length>0},merge:function(d,b,f,a,h){var g=this.changes.length;return g>0?this.changes[g-1].merge(d,b,f,a,h):!1},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--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return this.index>0},canRedo:function(){return this.stack.length-this.index>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();
for(var d=[],b=this.index;b<this.stack.length;b++)d=d.concat(this.stack[b].getRedoChanges());return d},getUndoChanges:function(){this._commitUndo();for(var d=[],b=this.index;b>=0;b--)d=d.concat(this.stack[b].getUndoChanges());return 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=0;this.cleanChange=void 0;this.stack=[];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(){this.endCompoundChange()},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);
this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(d){if(!this._ignoreUndo){var b=d.text,i=d.start,a=d.addedCharCount,h=d.removedCharCount,d=i+h,g=0;a===0&&h===1?g=-1:a===1&&h===0&&(g=1);a=this.stack.length;h=this.model.getText(i,d);(!(a>0&&this.index===a)||!this.stack[a-1].merge(i,b,h,g,d))&&this.add(new f(i,b,h,g))}}};return{UndoStack:j}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(f,k,j,d){function b(a,c,b,d){this._location=c||"left";this._overview=b||"page";this._rulerStyle=d;this._view=null;var g=this;this._listener={onTextModelChanged:function(a){g._onTextModelChanged(a)},onAnnotationModelChanged:function(a){g._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function i(a,c,d,g,f){b.call(this,a,c,"page",d);this._oddStyle=g||{style:{backgroundColor:"white"}};
this._evenStyle=f||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function a(a,c,d){b.call(this,a,c,"page",d)}function h(a,c,d){b.call(this,a,c,"document",d)}function g(b,c,d){a.call(this,b,c,d)}b.prototype={getAnnotations:function(a,c){var b=this._annotationModel;if(!b)return[];var d=this._view.getModel(),g=d.getLineStart(a),f=d.getLineEnd(c-1),h=d;d.getBaseModel&&(h=d.getBaseModel(),g=d.mapOffset(g),f=d.mapOffset(f));for(var i=[],b=this.getAnnotationsByType(b,g,f),g=0;g<
b.length;g++)for(var f=b[g],j=h.getLineAtOffset(f.start),k=h.getLineAtOffset(Math.max(f.start,f.end-1)),x=j;x<=k;x++){var u=x;if(d!==h){u=h.getLineStart(x);u=d.mapOffset(u,!0);if(u===-1)continue;u=d.getLineAtOffset(u)}if(a<=u&&u<c){var v=this._mergeAnnotation(i[u],f,x-j,k-j+1);v&&(i[u]=v)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var o in i)i[o]._multiple&&(i[o].html+=this._multiAnnotationOverlay.html);return i},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 c=this._view,b=c.getModel(),d=b,g=b.getLineStart(a),f=g,h=g,i=this._annotationModel;if(i){c=c.getSelection();h=b.getLineEnd(a,!0);if(g<=c.start&&c.start<h)g=c.start;b.getBaseModel&&(g=b.mapOffset(g),
h=b.mapOffset(h),d=b.getBaseModel());for(var k,h=i.getAnnotations(g,h),i=null;!k&&h.hasNext();)c=h.next(),this.isAnnotationTypeVisible(c.type)&&(i=c,c.start<=g||(k=c));if(i&&i.groupId!==void 0)this._currentClickGroup=this._currentClickGroup===i.groupId?null:i.groupId,this._setCurrentGroup(a);k&&d.getLineAtOffset(k.start)===d.getLineAtOffset(g)?(g=k.start,h=k.end):h=g=f;b.getBaseModel&&(g=b.mapOffset(g,!0),h=b.mapOffset(h,!0))}(a=j.Tooltip.getTooltip(this._view))&&a.setTarget(null);this._view.setSelection(h,
g,1/3,function(){})}},onDblClick:function(){},onMouseMove:function(a,c){var b=j.Tooltip.getTooltip(this._view);if(b&&!(b.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var d=this;b.setTarget({y:c.clientY,getTooltipInfo:function(){return d._getTooltipInfo(d._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,c){this.onMouseMove(a,c);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(){this._currentClickGroup||this._setCurrentGroup(-1);var a=j.Tooltip.getTooltip(this._view);
a&&a.setTarget(null)},_getTooltipInfo:function(a,c){if(a!==void 0){var b=this._view,d=b.getModel(),g=this._annotationModel,f=[];if(g){var f=d.getLineStart(a),h=d.getLineEnd(a);d.getBaseModel&&(f=d.mapOffset(f),h=d.mapOffset(h));f=this.getAnnotationsByType(g,f,h)}g=this._getTooltipContents(a,f);if(!g)return null;g={contents:g,anchor:this.getLocation()};f=b.getClientArea();f.y=this.getOverview()==="document"?b.convert({y:c},"view","document").y:b.getLocationAtOffset(d.getLineStart(a)).y;b.convert(f,
"document","page");g.x=f.x;g.y=f.y;g.anchor==="right"&&(g.x+=f.width);return g}},_getTooltipContents:function(a,c){return c},_onAnnotationModelChanged:function(a){function c(a){for(var c=0;c<a.length;c++)if(g.isAnnotationTypeVisible(a[c].type)){var e=a[c].start,f=a[c].end;d.getBaseModel&&(e=d.mapOffset(e,!0),f=d.mapOffset(f,!0));e!==-1&&f!==-1&&b.redrawLines(d.getLineAtOffset(e),d.getLineAtOffset(Math.max(e,f-1))+1,g)}}var b=this._view;if(b){var d=b.getModel(),g=this,f=d.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,d.getBaseModel&&(a=d.mapOffset(a,!0)),a=d.getLineAtOffset(a),b.redrawLines(a,f,g)):(c(a.added),c(a.removed),c(a.changed))}},_mergeAnnotation:function(a,c,b){a||(a={});if(b===0)if(a.html&&c.html){if(c.html!==a.html&&!a._multiple&&this._multiAnnotation)a.html=this._multiAnnotation.html;a._multiple=!0}else a.html=c.html;a.style=this._mergeStyle(a.style,c.style);return a},_mergeStyle:function(a,c){if(c){a||(a={});a.styleClass&&c.styleClass&&a.styleClass!==c.styleClass?
a.styleClass+=" "+c.styleClass:a.styleClass=c.styleClass;var b;if(c.style){if(!a.style)a.style={};for(b in c.style)a.style[b]===void 0&&(a.style[b]=c.style[b])}if(c.attributes){if(!a.attributes)a.attributes={};for(b in c.attributes)a.attributes[b]===void 0&&(a.attributes[b]=c.attributes[b])}}return a},_setCurrentGroup:function(a){var c=this._annotationModel,b=null,d=c.getTextModel(),g,f,h=this._currentGroupAnnotation;if(a!==-1){var i=d.getLineStart(a),j=d.getLineEnd(a);d.getBaseModel&&(i=d.mapOffset(i),
j=d.mapOffset(j));for(f=c.getAnnotations(i,j);f.hasNext();)if(g=f.next(),this.isAnnotationTypeVisible(g.type)&&g.start<=i&&g.end>=j&&g.groupId!==void 0){b=g;break}if(h&&b&&h.groupId===b.groupId)return}this._currentGroupAnnotation=null;h&&c.removeAnnotations(h.groupType);if(b&&a!==-1){this._currentGroupAnnotation=b;f=c.getAnnotations(0,d.getCharCount());for(a=[];f.hasNext();)g=f.next(),delete g.groupAnnotation,g.groupId===b.groupId&&(g=g.createGroupAnnotation(),a.push(g));c.replaceAnnotations(null,
a)}}};k.AnnotationTypeList.addMixin(b.prototype);i.prototype=new b;i.prototype.getAnnotations=function(a,c){for(var d=b.prototype.getAnnotations.call(this,a,c),g=this._view.getModel(),f=a;f<c;f++){var h=f&1?this._oddStyle:this._evenStyle,i=f;g.getBaseModel&&(i=g.getLineStart(i),i=g.getBaseModel().getLineAtOffset(g.mapOffset(i)));d[f]||(d[f]={});d[f].html=this._firstLine+i+"";if(!d[f].style)d[f].style=h}return d};i.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();
return this.getAnnotations(a-1,a)[a-1]};i.prototype.setFirstLine=function(a){this._firstLine=a!==void 0?a:1};i.prototype._onTextModelChanged=function(a){var a=a.start,c=this._view.getModel(),b=(this._firstLine+(c.getBaseModel?c.getBaseModel().getLineCount():c.getLineCount())-1+"").length;if(this._numOfDigits!==b)this._numOfDigits=b,this._view.redrawLines(c.getLineAtOffset(a),c.getLineCount(),this)};a.prototype=new b;h.prototype=new b;h.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",
fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};h.prototype._getTooltipContents=function(a,c){if(c.length===0){var g=this._view.getModel(),h=a;g.getBaseModel&&(h=g.getLineStart(h),h=g.getBaseModel().getLineAtOffset(g.mapOffset(h)));return d.formatMessage(f.line,h+1)}return b.prototype._getTooltipContents.call(this,a,c)};h.prototype._mergeAnnotation=function(a,c,b,d){if(b===0){if(!a)a={html:"&nbsp;",style:{style:{height:3*d+"px"}}},a.style=this._mergeStyle(a.style,c.overviewStyle);
return a}};g.prototype=new a;g.prototype.onClick=function(a){if(a!==void 0){var c=this._annotationModel;if(c){var b=this._view.getModel(),d=b.getLineStart(a),a=b.getLineEnd(a,!0);b.getBaseModel&&(d=b.mapOffset(d),a=b.mapOffset(a),b=b.getBaseModel());for(var g,c=c.getAnnotations(d,a);!g&&c.hasNext();)a=c.next(),this.isAnnotationTypeVisible(a.type)&&(g=a);g&&b.getLineAtOffset(g.start)===b.getLineAtOffset(d)&&((b=j.Tooltip.getTooltip(this._view))&&b.setTarget(null),g.expanded?g.collapse():g.expand(),
this._annotationModel.modifyAnnotation(g))}}};g.prototype._getTooltipContents=function(b,c){return c.length===1&&c[0].expanded?null:a.prototype._getTooltipContents.call(this,b,c)};g.prototype._onAnnotationModelChanged=function(b){function c(a){for(h=0;h<a.length;h++)if(f.isAnnotationTypeVisible(a[h].type)){var c=a[h].start;g.getBaseModel&&(c=g.mapOffset(c,!0));c!==-1&&(j=Math.min(j,g.getLineAtOffset(c)))}}if(b.textModelChangedEvent)a.prototype._onAnnotationModelChanged.call(this,b);else{var d=this._view;
if(d){var g=d.getModel(),f=this,h,i=g.getLineCount(),j=i;c(b.added);c(b.removed);c(b.changed);b=d.getRulers();for(h=0;h<b.length;h++)d.redrawLines(j,i,b[h])}}};return{Ruler:b,AnnotationRuler:a,LineNumberRuler:i,OverviewRuler:h,FoldingRuler:g}});
define("orion/editor/textDND",["orion/util"],function(f){function k(f,d){this._view=f;this._undoStack=d;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var b=this;this._listener={onDragStart:function(d){b._onDragStart(d)},onDragEnd:function(d){b._onDragEnd(d)},onDragEnter:function(d){b._onDragEnter(d)},onDragOver:function(d){b._onDragOver(d)},onDrop:function(d){b._onDrop(d)},onDestroy:function(d){b._onDestroy(d)}};f.addEventListener("DragStart",this._listener.onDragStart);f.addEventListener("DragEnd",
this._listener.onDragEnd);f.addEventListener("DragEnter",this._listener.onDragEnter);f.addEventListener("DragOver",this._listener.onDragOver);f.addEventListener("Drop",this._listener.onDrop);f.addEventListener("Destroy",this._listener.onDestroy)}k.prototype={destroy:function(){var f=this._view;if(f)f.removeEventListener("DragStart",this._listener.onDragStart),f.removeEventListener("DragEnd",this._listener.onDragEnd),f.removeEventListener("DragEnter",this._listener.onDragEnter),f.removeEventListener("DragOver",
this._listener.onDragOver),f.removeEventListener("Drop",this._listener.onDrop),f.removeEventListener("Destroy",this._listener.onDestroy),this._view=null},_onDestroy:function(){this.destroy()},_onDragStart:function(f){var d=this._view,b=d.getSelection(),d=d.getModel();if(d.getBaseModel)b.start=d.mapOffset(b.start),b.end=d.mapOffset(b.end),d=d.getBaseModel();if(d=d.getText(b.start,b.end))this._dragSelection=b,f.event.dataTransfer.effectAllowed="copyMove",f.event.dataTransfer.setData("Text",d)},_onDragEnd:function(j){if(this._dragSelection){var d=
this._view,b=j.event.dataTransfer.dropEffect;if(!f.isFirefox&&(b!=="none"||this._dropText))b=j.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(j=b==="move")&&d.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var b=this._dropText,i=this._dropOffset;if(j)if(i>=this._dragSelection.end)i-=this._dragSelection.end-this._dragSelection.start;else if(i>=this._dragSelection.start)i=this._dragSelection.start;d.setText(b,
i,i);d.setSelection(i,i+b.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(f){this._onDragOver(f)},_onDragOver:function(j){var d=j.event.dataTransfer.types,b=!this._view.getOptions("readonly");b&&d&&(b=d.contains?d.contains("text/plain")||d.contains("Text"):d.indexOf("text/plain")!==-1||d.indexOf("Text")!==-1);if(b){if(!f.isFirefox)this._dropEffect=j.event.dataTransfer.dropEffect=(f.isMac?j.event.altKey:
j.event.ctrlKey)?"copy":"move"}else j.event.dataTransfer.dropEffect="none"},_onDrop:function(j){var d=this._view,b=j.event.dataTransfer.getData("Text");if(b){if(!f.isFirefox)j.event.dataTransfer.dropEffect=this._dropEffect;j=d.getOffsetAtLocation(j.x,j.y);this._dragSelection?(this._dropOffset=j,this._dropText=b):(d.setText(b,j,j),d.setSelection(j,j+b.length))}}};return{TextDND:k}});
define("orion/editor/templates",[],function(){function f(f,d,b){this.prefix=f;this.description=d;this.template=b;this._parse()}function k(f,d){this._keywords=f||[];this._templates=[];this.addTemplates(d||[])}f.prototype={getProposal:function(f,d,b){var f=d-f.length,d={},i,a=b.delimiter!==void 0?b.delimiter:"\n";b.indentation&&(a+=b.indentation);for(var h=b.tab!==void 0?b.tab:"\t",g=0,e=this.variables,c=this.segments,b=[],k=0;k<c.length;k++){var n=c[k],m=e[n];if(m!==void 0)switch(n){case "${tab}":n=
h;break;case "${delimiter}":n=a;break;case "${cursor}":n="";i=g;break;default:var r=d[n];r||(r=d[n]={data:m.data,positions:[]});n=m.substitution;r.data&&r.data.values&&(n=r.data.values[0]);r.positions.push({offset:f+g,length:n.length})}b.push(n);g+=n.length}var a=[],q;for(q in d)d.hasOwnProperty(q)&&a.push(d[q]);b=b.join("");if(i===void 0)i=b.length;return{proposal:b,description:this.description,groups:a,escapePosition:f+i}},match:function(f){return this.prefix.indexOf(f)===0},_parse:function(){var f=
this.template,d=[],b={},i,a=0,f=f.replace(/\n/g,"${delimiter}"),f=f.replace(/\t/g,"${tab}");f.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(h,g,e){var c=h.substring(2,h.length-1),g=h,k=c,n=null,m=k.indexOf(":");m!==-1&&(k=k.substring(0,m),g="${"+k+"}",n=JSON.parse(c.substring(m+1).replace("\\}","}").trim()));(c=b[g])||(c=b[g]={});c.substitution=k;if(n)c.data=n;(i=f.substring(a,e))&&d.push(i);d.push(g);a=e+h.length;return k});(i=f.substring(a,f.length))&&d.push(i);this.segments=d;this.variables=b}};
k.prototype={addTemplates:function(j){for(var d=this.getTemplates(),b=0;b<j.length;b++)d.push(new f(j[b].prefix,j[b].description,j[b].template))},computeProposals:function(f,d,b){var i=this.getPrefix(f,d,b),a=[];if(!this.isValid(i,f,d,b))return a;a=a.concat(this.getTemplateProposals(i,d,b));return a=a.concat(this.getKeywordProposals(i))},getKeywords:function(){return this._keywords},getKeywordProposals:function(f){var d=[],b=this.getKeywords();if(b)for(var i=0;i<b.length;i++)b[i].indexOf(f)===0&&
d.push({proposal:b[i].substring(f.length),description:b[i]});return d},getPrefix:function(f,d,b){return b.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(f,d,b){for(var i=[],a=this.getTemplates(),h=0;h<a.length;h++){var g=a[h];g.match(f)&&(g=g.getProposal(f,d,b),this.removePrefix(f,g),i.push(g))}return i},removePrefix:function(f,d){if(!(d.overwrite=d.proposal.substring(0,f.length)!==f))d.proposal=d.proposal.substring(f.length)},isValid:function(){return!0}};return{Template:f,
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(f,k,j,d,b,i){function a(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 c=this.editor.mapOffset(a.start),b=this.linkedModeModel,e,d;b;)if(e=this._getPositionChanged(b,c,c+a.removedCharCount),d=e.position,d===void 0||d.model!==b)this.exitLinkedMode(!1),b=this.linkedModeModel;else break;if(b){b=0;a=a.addedCharCount-a.removedCharCount;e=e.positions;for(var g,f=0;f<e.length;++f){g=e[f];d=g.position;var h=d.offset<=c&&c<=d.offset+d.length;h&&!g.ansestor?(d.offset+=b,d.length+=a,b+=a):(d.offset+=b,g.ansestor&&h&&(d.length+=
a));if(g.escape)g.model.escapePosition=d.offset}this._updateAnnotations(e)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var c=this.editor,b=c.mapOffset(a.start),e=this.editor.mapOffset(a.end),d=this.linkedModeModel,g,f;d;)if(g=this._getPositionChanged(d,b,e),f=g.position,f===void 0||f.model!==d)this.exitLinkedMode(!1),d=this.linkedModeModel;else break;if(d){var h=this._compoundChange;h?h.owner.model===d&&h.owner.group===f.group||(this.endUndo(),this.startUndo()):this.startUndo();
d.selectedGroupIndex=f.group;var h=0,i=a.text.length-(e-b);g=g.positions;var j;b-=f.position.offset;for(var o=e-f.position.offset,k=0;k<g.length;++k)if(j=g[k],e=j.position,j.oldOffset=e.offset,j.model===d&&j.group===f.group?(e.offset+=h,e.length+=i,h+=i):(e.offset+=h,j.ansestor&&(e.length+=f.count*i)),j.escape)j.model.escapePosition=e.offset;this.ignoreVerify=!0;for(k=g.length-1;k>=0;k--)j=g[k],j.model===d&&j.group===f.group&&c.setText(a.text,j.oldOffset+b,j.oldOffset+o);this.ignoreVerify=!1;a.text=
null;this._updateAnnotations(g)}}}.bind(this)}}var h={};a.prototype=new j.KeyMode;i.mixin(a.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(f.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,d=c.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",this.linkedModeListener.onModelChanged);
d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(f.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 e=this.linkedModeModel;if(e){e.selectedGroupIndex=a;var a=e.groups[a],c=a.positions[0],d=this.editor;d.setSelection(c.offset,c.offset+c.length);if(e=this.contentAssist)if(e.offset=void 0,a.data&&a.data.type==="link"&&a.data.values)(this._groupContentAssistProvider=new b.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=d.getSelection();return a.start===
a.end&&(a=d.getCaretOffset(),c.offset<=a&&a<=c.offset+c.length)?d.getText(c.offset,a):""},e.offset=c.offset,e.deactivate(),e.activate();else if(this._groupContentAssistProvider)this._groupContentAssistProvider=null,e.deactivate()}this._updateAnnotations()},_getModelPositions:function(a,b,c){for(var d=b.groups,f=0;f<d.length;f++)for(var h=d[f].positions,i=0;i<h.length;i++){var j=h[i];c&&(j={offset:j.offset+c,length:j.length});j={index:i,group:f,count:h.length,model:b,position:j};a.push(j);if(b.nextModel&&
b.nextModel.parentGroup===f)j.ansestor=!0,this._getModelPositions(a,b.nextModel,(c||0)+h[i].offset-h[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),f=a.length-1;f>=0;f--){var h=a[f].position;if(h.offset<=b&&c<=h.offset+h.length){d=a[f];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var b=this.editor.getAnnotationModel();if(b){for(var c=[],f=[],h=b.getTextModel(),h=b.getAnnotations(0,h.getCharCount()),i;h.hasNext();)switch(i=h.next(),i.type){case d.AnnotationType.ANNOTATION_LINKED_GROUP:case d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:c.push(i)}if(h=
this.linkedModeModel)for(var a=a||this._getSortedPositions(h),j=0;j<a.length;j++)if(i=a[j],i.model===h){var k=d.AnnotationType.ANNOTATION_LINKED_GROUP;i.group===h.selectedGroupIndex&&(k=i.index===0?d.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:d.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);i=i.position;i=d.AnnotationType.createAnnotation(k,i.offset,i.offset+i.length,"");f.push(i)}b.replaceAnnotations(c,f)}}});h.LinkedMode=a;return h});
define("orion/editor/factories","orion/editor/actions,orion/editor/undoStack,orion/editor/rulers,orion/editor/annotations,orion/editor/textDND,orion/editor/linkedMode".split(","),function(f,k,j,d,b,i){function a(){}function h(){}function g(){}function e(){}function c(){}function l(){}var n={};a.prototype={createKeyBindings:function(a,c,b,d){var d=new f.TextActions(a,c,d),e=new i.LinkedMode(a,c,b),a=new f.SourceCodeActions(a,c,b,e);return{textActions:d,linkedMode:e,sourceCodeActions:a}}};n.KeyBindingsFactory=
a;h.prototype={createUndoStack:function(a){a=a.getTextView();return new k.UndoStack(a,200)}};n.UndoFactory=h;g.prototype={createLineNumberRuler:function(a){return new j.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};n.LineNumberRulerFactory=g;e.prototype={createFoldingRuler:function(a){return new j.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};n.FoldingRulerFactory=e;c.prototype={createAnnotationModel:function(a){return new d.AnnotationModel(a)},
createAnnotationStyler:function(a,c){return new d.AnnotationStyler(a,c)},createAnnotationRulers:function(a){var c=new j.AnnotationRuler(a,"left",{styleClass:"ruler annotations"}),a=new j.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:c,overviewRuler:a}}};n.AnnotationFactory=c;l.prototype={createTextDND:function(a,c){return new b.TextDND(a.getTextView(),c)}};n.TextDNDFactory=l;return n});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(f,k,j,d){return d.mixin({},f,k,j)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'<div id="topWidget_id" style="height:100%;width:100%;position:relative">\n\t<div class="leftPanelLayout ">\n\t\t<div class="titleContainer" id="left_title_id"></div>\n\t\t<div class="compareEditorParent" id="left_editor_id"></div>\n\t\t<div class="statusContainer" id="left_status_id"></div>\n\t</div>\n\t<div class="split compareSplitLayout"></div>\n\t<div class="rightPanelLayout">\n\t\t<div class="titleContainer" id="right_title_id"></div>\n\t\t<div class="compareEditorParent"  id="right_editor_wrapper_id">\n\t\t\t<div class="canvasContainer">\n\t\t\t\t<canvas id="diff_canvas_id" class="compareCanvas" width="46" height="3000"></canvas>\n\t\t\t</div>\n\t\t\t<div class="compareEditorParentWithCanvas" id="right_editor_id"></div>\n\t\t</div>\n\t\t<div class="statusContainer" id="right_status_id"></div>\n\t</div>\n</div>'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(f,k,j){var d=d||{};d.TwoWayCompareUIFactory=function(){function b(b){this._parentDivID=b.parentDivID;this._commandSpanId=b.commandSpanId;this._showTitle=b.showTitle;this._leftTitle=b.leftTitle;this._rightTitle=b.rightTitle;this._showLineStatus=b.showLineStatus}b.prototype={_init:function(){var b=this._parentDivID+"_";this._topWidgetDiv=f.node("topWidget_id");
this._topWidgetDiv.id=b+"topWidget_id";this._leftEditorParentDiv=f.node("left_editor_id");this._leftEditorParentDiv.id=b+"left_editor_id";this._rightEditorParentDiv=f.node("right_editor_id");this._rightEditorParentDiv.id=b+"right_editor_id";this._rightEditorWrapperDiv=f.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=b+"right_editor_wrapper_id";this._leftTitleDiv=f.node("left_title_id");this._leftTitleDiv.id=b+"left_title_id";this._rightTitleDiv=f.node("right_title_id");this._rightTitleDiv.id=
b+"right_title_id";this._leftStatusDiv=f.node("left_status_id");this._leftStatusDiv.id=b+"left_status_id";this._rightStatusDiv=f.node("right_status_id");this._rightStatusDiv.id=b+"right_status_id";this._diffCanvasDiv=f.node("diff_canvas_id");this._diffCanvasDiv.id=b+"diff_canvas_id";this._splitterId=b+"orion_splitter";if(!this._showTitle)this._leftEditorParentDiv.style.top="0px",this._rightEditorWrapperDiv.style.top="0px",this._leftTitleDiv.style.height="0px",this._rightTitleDiv.style.height="0px";
if(!this._showLineStatus)this._leftEditorParentDiv.style.marginBottom="0px",this._rightEditorWrapperDiv.style.marginBottom="0px",this._leftStatusDiv.style.height="0px",this._rightStatusDiv.style.height="0px"},_createSplitter:function(){var b=f.$(".split",this._topWidgetDiv);b.id=this._splitterId;var a=f.$(".leftPanelLayout",this._topWidgetDiv),d=f.$(".rightPanelLayout",this._topWidgetDiv);if(b&&a&&d)this._splitter=new k.Splitter({node:b,sidePanel:a,mainPanel:d})},buildUI:function(){f.node(this._parentDivID).innerHTML=
j;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(b){return f.$(".leftPanelLayout",this._topWidgetDiv)===b},getEditorParentDiv:function(b){return b?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(b){return b?this._leftTitleDiv:this._rightTitleDiv},getStatusDiv:function(b){return b?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv}};
return b}();return d});
var JsDiff=function(){function f(a){for(var b=[],d=0;d<a.length;d++)a[d]&&b.push(a[d]);return b}function k(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}var j=function(a){this.ignoreWhitespace=a};j.prototype={diff:function(a,b){if(b==a)return[{value:b}];if(!b)return[{value:a,removed:!0}];if(!a)return[{value:b,added:!0}];var b=this.tokenize(b),a=this.tokenize(a),d=b.length,c=a.length,f=d+c,i=[{newPos:-1,components:[]}],j=this.extractCommon(i[0],
b,a,0);if(i[0].newPos+1>=d&&j+1>=c)return i[0].components;for(var k=1;k<=f;k++)for(var q=-1*k;q<=k;q+=2){var s;s=i[q-1];var t=i[q+1],j=(t?t.newPos:0)-q;s&&(i[q-1]=void 0);var p=s&&s.newPos+1<d,x=t&&0<=j&&j<c;if(!p&&!x)i[q]=void 0;else if(!p||x&&s.newPos<t.newPos?(s={newPos:t.newPos,components:t.components.slice(0)},this.pushComponent(s.components,a[j],void 0,!0)):(s={newPos:s.newPos,components:s.components.slice(0)},s.newPos++,this.pushComponent(s.components,b[s.newPos],!0,void 0)),j=this.extractCommon(s,
b,a,q),s.newPos+1>=d&&j+1>=c)return s.components;else i[q]=s}},pushComponent:function(a,b,d,c){var f=a[a.length-1];f&&f.added===d&&f.removed===c?a[a.length-1]={value:this.join(f.value,b),added:d,removed:c}:a.push({value:b,added:d,removed:c})},extractCommon:function(a,b,d,c){for(var f=b.length,i=d.length,j=a.newPos,c=j-c;j+1<f&&c+1<i&&this.equals(b[j+1],d[c+1]);)j++,c++,this.pushComponent(a.components,b[j],void 0,void 0);a.newPos=j;return c},equals:function(a,b){var d=/\S/;return this.ignoreWhitespace&&
!d.test(a)&&!d.test(b)?!0:a==b},join:function(a,b){return a+b},tokenize:function(a){return a}};var d=new j,b=new j(!1);b.tokenize=function(a){return f(a.split(/(\s+|\b)/))};var i=new j(!0);i.tokenize=function(a){return f(a.split(/([{}:;,]|\s+)/))};var a=new j;a.tokenize=function(a){return a.split(/^/m)};return{diffChars:function(a,b){return d.diff(a,b)},diffWords:function(a,d){return b.diff(a,d)},diffLines:function(b,d){return a.diff(b,d)},diffCss:function(a,b){return i.diff(a,b)},createPatch:function(b,
d,e,c,f){var i=[];i.push("Index: "+b);i.push("===================================================================");i.push("--- "+b+"\t"+c);i.push("+++ "+b+"\t"+f);b=a.diff(d,e);b.push({value:"",lines:[]});for(var e=d=0,c=[],j=f=1,k=0;k<b.length;k++){var q=b[k],s=q.lines||q.value.replace(/\n$/,"").split("\n");q.lines=s;if(q.added||q.removed){if(!d){var t=b[k-1],d=f,e=j;t&&(c.push.apply(c,t.lines.slice(-4).map(function(a){return" "+a})),d-=4,e-=4)}c.push.apply(c,s.map(function(a){return(q.added?"+":
"-")+a}));q.added?j+=s.length:f+=s.length}else d&&(s.length<=8&&k<b.length-1?c.push.apply(c,s.map(function(a){return" "+a})):(t=Math.min(s.length,4),i.push("@@ -"+d+","+(f-d+t)+" +"+e+","+(j-e+t)+" @@"),i.push.apply(i,c),i.push.apply(i,s.slice(0,t).map(function(a){return" "+a})),e=d=0,c=[])),f+=s.length,j+=s.length}b.length>1&&!/\n$/.test(b[b.length-2].value)&&i.push("\\ No newline at end of file\n");return i.join("\n")},convertChangesToXML:function(a){for(var b=[],d=0;d<a.length;d++){var c=a[d];
c.added?b.push("<ins>"):c.removed&&b.push("<del>");b.push(k(c.value));c.added?b.push("</ins>"):c.removed&&b.push("</del>")}return b.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(f){var k=k||{};k.JSDiffAdapter=function(){function j(){}j.prototype={_specialLine:function(d,b,f){return b.value===d&&f!==d},adapt:function(d,b,i){i||(i="\n");for(var a=d.split(i),h=b.split(i),g=a[a.length-1]==="",h=h[h.length-1]==="",e=f.diffLines(d,b),d=[],b=[],c=0,j=0,k=-1,m=0,r=!0,q=i,s=0;s<e.length;s++){var t=e[s],p=t.lines||t.value.split(i),x=p.length,u=0;p.length>1&&p[p.length-1]===""&&x--;x>1&&!r&&p[0]===""&&(x--,u++);t.lines=p;
if(!t.added&&!t.removed){if(!this._specialLine(i,t,q)){if(c||j)d.push([c,j,k]),j=c=0,k=-1,m+=j;d.push([x,x,0]);m+=x}}else if(t.added){k===-1&&(k=b.length+1);c+=x;for(r=u;r<x+u;r++)b.push(t.lines[r])}else j+=x;r=!1;p.length>1&&p[p.length-1]===""&&(r=!0);q=t.value?t.value[t.value.length-1]:i}if(c||j)d.push([c,j,k]),m+=j;m<a.length&&a.length>1&&(i=d[d.length-1],i[2]===0?(i[0]+=1,i[1]+=1):i[2]===-1?d.push([1,1,0]):g===h?d.push([1,1,0]):(h&&(i[0]+=1),g&&(i[1]+=1)));return{mapper:d,changContents:{array:b,
index:0}}},adaptCharDiff:function(d,b,i){for(var d=i?f.diffWords(d,b):f.diffChars(d,b),b=[],a=i=0,h=0,g=0,e=0;e<d.length;e++){var c=d[e];if(!c.added&&!c.removed){if(h>0||g>0)b.push([a,a+h,i,i+g]),a+=h,i+=g,g=h=0;a+=c.value.length;i+=c.value.length}else c.added?h+=c.value.length:g+=c.value.length}(h>0||g>0)&&b.push([a,a+h,i,i+g]);return b}};return j}();return k});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(f,k,j,d){var b={},i,a,h,g,e,c,l,n,m,r,q,s,t,p,x,u;b.DiffTreeNavigator=function(){function b(a,c,d,e,g,f){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,c,d,e,g,f)}i="orion.annotation.diff.addedBlock";a="orion.annotation.diff.currentAddedBlock";h="orion.annotation.diff.deletedBlock";g="orion.annotation.diff.currentDeletedBlock";
e="orion.annotation.diff.blockTop";c="orion.annotation.diff.currentBlockTop";l="orion.annotation.diff.blockConflict";n="orion.annotation.diff.currentBlockConflict";m="orion.annotation.diff.addedWord";r="orion.annotation.diff.currentAddedWord";q="orion.annotation.diff.deletedWord";s="orion.annotation.diff.currentDeletedWord";t="orion.annotation.diff.emptyDeletedWordLeft";p="orion.annotation.diff.emptyDeletedWordRight";x="orion.annotation.diff.emptyAddedWordLeft";u="orion.annotation.diff.emptyAddedWordRight";
j.AnnotationType.registerType(i,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});j.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});j.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});j.AnnotationType.registerType(g,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});j.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
j.AnnotationType.registerType(c,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});j.AnnotationType.registerType(l,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});j.AnnotationType.registerType(n,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});j.AnnotationType.registerType(m,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});j.AnnotationType.registerType(r,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});j.AnnotationType.registerType(q,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});j.AnnotationType.registerType(s,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});j.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});j.AnnotationType.registerType(p,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
j.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});j.AnnotationType.registerType(u,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});b.prototype={initAll:function(a,c,b,d,e,g,f){this._charOrWordDiff=a?a:"word";if(c)this._initialized=!0;this.editorWrapper=[{editor:c,diffFeeder:d},{editor:b,diffFeeder:e}];this._curveRuler=f;(this._overviewRuler=g)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var c=
0;c<this.editorWrapper.length;c++)this.editorWrapper[c].diffFeeder.init(this.editorWrapper[c].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var c=0;c<this.editorWrapper[a].annoTypes.length;c++)this.editorWrapper[a].annoTypes[c].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].current),this.editorWrapper[a].annoTypes[c].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[c].normal)}this._root.children=[];c=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!c||c.length===0)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var b=new d.JSDiffAdapter;for(a=0;a<c.length;a++){var e=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(e);var g=this.generatePairWordAnnotations(e,a,b);if(g)e.children=g}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new f.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,c,b,d,e){if(this.editorWrapper[c].annoTypes)for(var g=0;g<this.editorWrapper[c].annoTypes.length;g++)this.editorWrapper[c].annoTypes[g].type===b&&this.replaceDiffAnnotations(this.editorWrapper[c].editor,e?e:this.editorWrapper[c].annoTypes[g].list,d?this.editorWrapper[c].annoTypes[g].normal:this.editorWrapper[c].annoTypes[g].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,c){this.iterator&&(this.iterator.iterateOnTop(a,c),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var c=this.iterator.iterate(a);if(c){var b=this.iterator.cursor();b.type==="block"&&b.children&&b.children.length>0&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return c},
gotoBlock:function(a,c){if(this.iterator){if(a<0||a>=this._root.children.length||this._root.children.length===0)a=0;c!==void 0&&c>=0&&this._root.children[a].children&&c<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[c]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,c,b){if(b===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){var b=
this._root.children[d],e=a===0?b.oldA:b.newA;if(c>=e.start&&c<=e.end){d=b;if(b.children&&b.children.length>0)for(e=0;e<b.children.length;e++){var g=b.children[e],f=a===0?g.oldA:g.newA;if(c>=f.start&&c<=f.end){d=g;break}}return d}}return null}},gotoChange:function(a,c){for(var b=0;b<this.editorWrapper.length;b++){var d=this._hitDiffAnnotation(b,a,c);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,c),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;var a=
this.iterator.cursor();return!a?-1:a.type==="block"?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return a.type==="block"?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();a<0&&(a=0);var c=this.getFeeder().getDiffBlocks();if(!c||c.length===0)return-1;a>c.length-1&&(a=0);return c[a][1]},replaceDiffAnnotations:function(a,c,b,d){if(c&&b&&(a=a.getAnnotationModel())){for(var e=
a.getAnnotations(0,a.getTextModel().getCharCount()),g=[];d&&e.hasNext();){var f=e.next();f.type===b&&g.push(f)}a.replaceAnnotations(g,c)}},updateCurrentAnnotation:function(a,c){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var b=this.iterator.cursor();if(b){var d,e,g={start:b.oldA.start,end:b.oldA.end},f={start:b.newA.start,end:b.newA.end};b.type===
"word"?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(g,this.editorWrapper[0].editor.getTextView().getModel()),e=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(f,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(b.index),e=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(b.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (j.AnnotationType.getType(d.current))(g.start,g.end)],d,!0);
e&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (j.AnnotationType.getType(e.current))(f.start,f.end)],e,!0);if(a)this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1;else if(c)this.autoSelecting=!0,c!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(b.oldA.start,b.oldA.end,!0),c!==this.editorWrapper[1].editor.getTextView()&&
this.editorWrapper[1].editor.setSelection(b.newA.start,b.newA.end,!0),this.autoSelecting=!1}}},generatePairBlockAnnotations:function(a,c){var b=this.generateBlockDiffAnnotations(0,c),d=this.generateBlockDiffAnnotations(1,c);return{parent:a,index:c,type:"block",oldA:b,newA:d}},generatePairWordAnnotations:function(a,c,b){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(c),e=this.editorWrapper[1].diffFeeder.getTextOnBlock(c),c=null,g=0,f=0;if(d&&e&&d.text&&e.text&&d.text.length<=5E3&&e.text.length<=
5E3)c=b.adaptCharDiff(d.text,e.text,this._charOrWordDiff==="word"),f=e.start,g=d.start;else return null;b=[];d=[];this.generateWordDiffAnnotations(0,b,g,c,2,3);this.generateWordDiffAnnotations(1,d,f,c,0,1);c=[];for(g=0;g<b.length;g++)c.push({parent:a,index:g,type:"word",oldA:b[g],newA:d[g]});return c},getAnnoModelList:function(a,c,b){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===c&&this.editorWrapper[a].annoTypes[d].normal===b)return this.editorWrapper[a].annoTypes[d].list;
return null},generateBlockDiffAnnotations:function(a,c){var b=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(c),d=this.getAnnoModelList(a,"block",b.normal),e=this.editorWrapper[a].diffFeeder.getCharRange(c),b=j.AnnotationType.createAnnotation(b.normal,e.start,e.end);d&&d.push(b);return b},generateWordDiffAnnotations:function(a,c,b,d,e,g){if(d)for(var f=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1}),a=this.getAnnoModelList(a,"word",f.normal),h=0;h<d.length;h++){var i=
j.AnnotationType.createAnnotation(f.normal,d[h][e]+b,d[h][g]+b);a.push(i);c.push(i)}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,c){var b=a.getLineHeight(),d=a.getClientArea(),b=Math.floor(d.height/b/3);a.setTopIndex(c-b>0?c-b:0)},_positionDiffBlock:function(){var a=
this.getCurrentBlockIndex();a<0&&(a=0);var c=this.getFeeder().getDiffBlocks();c.length!==0&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),c[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=k.lookUpLineIndex(this.getMapper(),0,c[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&this.gotoBlock(a<0?0:k.getAnnotationIndex(this.getFeeder().getDiffBlocks(),
a))},gotoDiff:function(a,c){this.gotoChange(a,c)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return b}();b.DiffBlockFeeder=function(){function a(){}a.prototype={getWordAnnoTypes:function(a){this._mapperColumnIndex===
0?a.push({type:"word",current:r,normal:m,list:[]}):a.push({type:"word",current:s,normal:q,list:[]});a.push({type:"word",current:t});a.push({type:"word",current:p});a.push({type:"word",current:x});a.push({type:"word",current:u})},getCurrentWordAnnoType:function(a,c){return a.start===a.end&&c?this._mapperColumnIndex===0?{current:this._repositionEmptyWord(a,c),normal:m}:{current:this._repositionEmptyWord(a,c),normal:q}:this._mapperColumnIndex===0?{current:r,normal:m}:{current:s,normal:q}},_repositionEmptyWord:function(a,
c){var b=c.getLineAtOffset(a.start),d=c.getLineStart(b),e=c.getLineEnd(b);if(d!==e){if(a.start===e)return a.start--,this._mapperColumnIndex===0?u:p;a.end++}else if(b>0&&(b--,d=c.getLineStart(b),e=c.getLineEnd(b),d!==e))return a.start=e-1,a.end=e,this._mapperColumnIndex===0?u:p;return this._mapperColumnIndex===0?x:t},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];
return a===-1?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return null;var c=this._diffBlocks[a][0],b=c+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1,a=this._textModel.getLineStart(c);if(b<c)return{start:a,end:a};c=this._textModel.getLineEnd(b,!0);return{start:a,end:c}},getTextOnBlock:function(a){if(!this._diffBlocks||
this._diffBlocks.length===0)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,a.end)}},isMapperEmpty:function(){return this._mapper.length===0}};return a}();b.TwoWayDiffBlockFeeder=function(){function d(a,c,b){this._mapperColumnIndex=b;this.init(a,c)}d.prototype=new b.DiffBlockFeeder;d.prototype.init=function(a,c){this._textModel=a;this._diffBlocks=void 0;if(c){this._mapper=c;this._diffBlocks=[];for(var b=0,d=0;d<this._mapper.length;d++)this._mapper[d][2]!==
0&&this._diffBlocks.push([b,d]),b+=this._mapper[d][this._mapperColumnIndex]}};d.prototype.getBlockAnnoTypes=function(b){this._mapperColumnIndex===0?b.push({type:"block",normal:i,current:a,list:[]}):b.push({type:"block",normal:h,current:g,list:[]});b.push({type:"block",normal:e,current:c,list:[]});b.push({type:"block",normal:l,current:n,list:[]})};d.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||this._diffBlocks.length===0||this._diffBlocks.length<=b)return null;b=this._diffBlocks[b][1];
if(this._mapper[b][this._mapperColumnIndex]===0)return{normal:e,current:c};else if(k.isMapperConflict(this.getMapper(),b))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:i,current:a,list:[]};return{type:"block",normal:h,current:g,list:[]}};return d}();b.inlineDiffBlockFeeder=function(){function c(a,b){this._mapperColumnIndex=b;this.init(a)}c.prototype=new b.DiffBlockFeeder;c.prototype.setModel=function(a){this._textModel=a};c.prototype.init=function(a){this._diffBlocks=
void 0;if(a){this._mapper=a;this._diffBlocks=[];this._gapBlocks=[];for(var c=a=0,b=0;b<this._mapper.length;b++){if(this._mapper[b][2]!==0){if(this._mapperColumnIndex===0){var d=a+this._mapper[b][1];this._diffBlocks.push([d,b]);this._gapBlocks.push([d,d+this._mapper[b][0],c])}else this._diffBlocks.push([a,b]),this._gapBlocks.push([a,a+this._mapper[b][1],c]);a+=this._mapper[b][0]+this._mapper[b][1]}else this._gapBlocks.push([a,a+this._mapper[b][this._mapperColumnIndex],c]),a+=this._mapper[b][this._mapperColumnIndex];
c+=this._mapper[b][this._mapperColumnIndex]}}};c.prototype.getBlockAnnoTypes=function(c){this._mapperColumnIndex===0?c.push({type:"block",normal:i,current:a,list:[]}):c.push({type:"block",normal:h,current:g,list:[]});c.push({type:"block",normal:l,current:n,list:[]})};c.prototype.getCurrentBlockAnnoType=function(c){if(!this._diffBlocks||this._diffBlocks.length===0)return null;c=this._diffBlocks[c][1];if(this._mapper[c][this._mapperColumnIndex]===0)return{current:r,normal:m};else if(k.isMapperConflict(this.getMapper(),
c))return{normal:l,current:n};else if(this._mapperColumnIndex===0)return{type:"block",normal:i,current:a,list:[]};return{type:"block",normal:h,current:g,list:[]}};c.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||this._diffBlocks.length===0)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};c.prototype.getLineNumber=function(a){for(var c=0;c<this._gapBlocks.length;c++)if(this._gapBlocks[c][0]!==this._gapBlocks[c][1]&&a>=this._gapBlocks[c][0]&&a<this._gapBlocks[c][1])return a-
this._gapBlocks[c][0]+this._gapBlocks[c][2];return-1};return c}();return b});
define("orion/compare/compareView","i18n!orion/compare/nls/messages,orion/Deferred,orion/webui/littlelib,orion/compare/diffParser,orion/compare/compareRulers,orion/editor/editor,orion/editor/editorFeatures,orion/keyBinding,orion/editor/textView,orion/compare/compareUIFactory,orion/compare/compareUtils,orion/compare/jsdiffAdapter,orion/compare/diffTreeNavigator".split(","),function(f,k,j,d,b,i,a,h,g,e,c,l,n){var m={};m.CompareView=function(){function a(){this._diffParser=new d.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(){return"\n"},_generateMapper:function(a,c,b,d,e){var g=this._getLineDelim(a,b);this._diffParser.setLineDelim(g);if(this.options.mapper&&this.options.toggler)return{delim:g,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if(typeof c==="string"&&typeof a==="string"){a=(new l.JSDiffAdapter).adapt(a,c,g);if(this.options.toggler)this.options.mapper=
a.mapper,this.options.newFile.Content=c,this.options.diffArray=a.changContents;return{delim:g,mapper:a.mapper,output:c,diffArray:a.changContents}}else{c=this._diffParser.parse(a,b,d,e);a=this._diffParser.getDiffArray();if(this.options.toggler)this.options.mapper=c.mapper,this.options.newFile.Content=c.outPutFile,this.options.diffArray=a;return{delim:g,mapper:c.mapper,output:c.outPutFile,diffArray:a}}},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&this.options.highlighters.length>
0&&!(a.length<1||a.length>2))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],a.length===2&&this.options.highlighters.length===2&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(c){a.push(c.highlighter.highlight(c.target.fileName,c.target.contentType,c.target.editor))}.bind(this));k.all(a,function(a){return{_error:a}}).then(function(){this._diffNavigator.renderAnnotations();
this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,c){c&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(c){this.options[c]=a[c]}.bind(this))},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},
initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(){}};return a}();m.TwoWayCompareView=function(){function c(a){this.setOptions(a,!0);this._diffNavigator=new n.DiffTreeNavigator("word");
this.type="twoWay";this._uiFactory=this.options.uiFactory;if(!this._uiFactory)this._uiFactory=new e.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI();this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new b.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}
c.prototype=new m.CompareView;c.prototype.initEditors=function(a){this._editors=[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new b.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));
window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return f["There are unsaved changes."]}.bind(this)};c.prototype.getEditors=function(){return this._editors};c.prototype.gotoDiff=function(a,c,b){b=b?this._editors[1].getTextView():this._editors[0].getTextView();this._diffNavigator.gotoDiff(b.getModel().getLineStart(a)+c,b)};c.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};c.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};
c.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};c.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};c.prototype._createEditor=function(c,b,d,e,h){var j=typeof e.readonly==="undefined"?!0:e.readonly,k=function(){var a=new g.TextView({parent:b,readonly:j,tabSize:4});this._viewLoadedCounter++;this._viewLoadedCounter===2&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var c=this.getSplitter();c&&c.addResizeListener(function(c){if(c){var b=
!1;(b=this._uiFactory.isLeftPane(c)?h:!h)&&a.resize()}}.bind(this));return a}.bind(this),o=e.keyBindingFactory;o||(o=new a.KeyBindingsFactory);var l=null;if(d)var n="",l=function(a,c){if(d)n=c?f["ERROR: "]+a:a,d.textContent=""+n};k=new i.Editor({textViewFactory:k,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,keyBindingFactory:o,statusReporter:l,domNode:b});k.installTextView();k.setInput(null,null,e.Content?e.Content:c);k.setOverviewRulerVisible(!1);var m=k.getTextView();
m.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(m.getCaretOffset(),m)}.bind(this));m.getModel().addEventListener("Changed",function(a){if(!this._curveRuler.onChanged(a,!h))this.options.mapper=null}.bind(this));h?m.addEventListener("Scroll",function(){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):
m.addEventListener("Scroll",function(){this._curveRuler&&this._curveRuler.render()}.bind(this));return k};c.prototype.destroy=function(){this._editors&&(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};c.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new b.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),c=new b.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);this._editors[0].getTextView().addRuler(c);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};c.prototype.refresh=function(a){var c=this.options.oldFile.Content,b=this.options.newFile.Content,d=this.options.diffContent;typeof b==="string"?d=this._generateMapper(c,b,d,this.options.hasConflicts):(d=this._generateMapper(c,b,d,this.options.hasConflicts),
b=d.output);var e=new n.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),d.mapper,1),g=new n.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),d.mapper,0);this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editors[0],this._editors[1],e,g,this._overviewRuler,this._curveRuler);this._curveRuler.init(d.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,b),this._editors[0].setInput(this.options.oldFile.Name,
null,c));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();this._viewLoadedCounter===2&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);a=this._uiFactory.getTitleDiv(!0);
if((c=this._uiFactory.getTitleDiv(!1))&&a)j.empty(c),j.empty(a),c.appendChild(document.createTextNode(this.options.oldFile.Name)),a.appendChild(document.createTextNode(this.options.newFile.Name));a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;c=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+5;return a>c?a:c};return c}();m.InlineCompareView=function(){function d(a){this.setOptions(a,
!0);this._diffNavigator=new n.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}d.prototype=new m.CompareView;d.prototype.addRulers=function(){if(this._textView&&!this._hasRuler)this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0};d.prototype.removeRulers=function(){if(this._textView&&this._hasRuler)this._textView.removeRuler(this._rulerOrigin),
this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1};d.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};d.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};d.prototype.initEditors=function(c){var d=j.node(this._editorDiv),e=function(){return new g.TextView({parent:d,readonly:!0,tabSize:4})}.bind(this);this._editor=
new i.Editor({textViewFactory:e,undoStackFactory:new a.UndoFactory,annotationFactory:new a.AnnotationFactory,domNode:d});this._editor.installTextView();this._editor.setInput(null,null,c);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new b.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._rulerNew=new b.LineNumberCompareRuler(this._diffNavigator,
0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new b.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){a.newValue&&a.newValue.start!==a.newValue.end||!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder&&this._diffNavigator.gotoDiff(this._textView.getCaretOffset(),
this._textView)}.bind(this))};d.prototype._initDiffPosition=function(a){var c=a.getModel();if(c&&c.getAnnotations&&(c=c.getAnnotations(),c.length>0)){var c=c[0][0],b=a.getLineHeight(),d=a.getClientArea(),b=Math.floor(d.height/b/3);a.setTopIndex(c-b>0?c-b:0)}};d.prototype.refresh=function(){var a=this.options.oldFile.Content,b=this._generateMapper(a,this.options.newFile.Content,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);this._textView.getModel().setText(a);var a=new n.inlineDiffBlockFeeder(b.mapper,
1),d=new n.inlineDiffBlockFeeder(b.mapper,0);c.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),b.mapper,b.diffArray.array,b.diffArray.index,this._diffParser._lineDelimiter);a.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?"char":"word",this._editor,this._editor,a,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);
this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();b=this._textView.getTopIndex();this._textView.redrawLines(b,b+1,this._overviewRuler);this._textView.redrawLines(b,b+1,this._rulerOrigin);this._textView.redrawLines(b,b+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};d.prototype.setConflicting=
function(a){this._conflcit=a};return d}();m.toggleableCompareView=function(){function a(c,b){if(b)b.toggler=this;this._widget=c==="inline"?new m.InlineCompareView(b):new m.TwoWayCompareView(b)}a.prototype={startup:function(){this._widget.startup()},toggle:function(){var a=this._widget.options,c=this._widget.getCurrentDiffPos();a.blockNumber=c.block;a.changeNumber=c.change;this._widget.destroy();j.empty(j.node(a.parentDivId));this._widget=this._widget.type==="inline"?new m.TwoWayCompareView(a):new m.InlineCompareView(a);
this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return m});
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(f,k){function j(a,c){this.keywords=a;this.whitespacesVisible=c;this.setText("")}function d(){j.call(this,null,!0)}function b(a){j.call(this,null,a)}function i(){j.call(this,null,!1)}function a(a,c,f){this.commentStart="/*";this.commentEnd="*/";var k=[];switch(c){case "java":k=g;break;case "js":k=h;break;case "css":k=e}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=
!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new j(k,this.whitespacesVisible);this._firstScanner=new i;this._commentScanner=new b(this.whitespacesVisible);this._whitespaceScanner=new d;if(c==="css")this._scanner.isCSS=!0,this._firstScanner.isCSS=!0;this.view=a;this.annotationModel=f;this._bracketAnnotations=void 0;var l=this;this._listener={onChanged:function(a){l._onModelChanged(a)},onDestroy:function(a){l._onDestroy(a)},onLineStyle:function(a){l._onLineStyle(a)},
onMouseDown:function(a){l._onMouseDown(a)},onSelection:function(a){l._onSelection(a)}};c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var h=k.JSKeywords,
g=k.JAVAKeywords,e=k.CSSKeywords,c={styleClass:"token_singleline_comment"},l={styleClass:"token_multiline_comment"},n={styleClass:"token_doc_comment"},m={styleClass:"token_doc_html_markup"},r={styleClass:"token_task_tag"},q={styleClass:"token_doc_tag"},s={styleClass:"token_string"},t={styleClass:"token_number"},p={styleClass:"token_keyword"},x={styleClass:"token_space",unmergeable:!0},u={styleClass:"token_tab",unmergeable:!0},v={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 c=this.isCSS,b=this.offset-1;if(!c&&48<=a&&a<=57){var d=c=!1,e=!1,g=
a;do if(a=this._read(),a===46&&!c)c=!0;else if(a===101&&!d)c=d=!0,a=this._read(),a!==45&&this._unread(a);else if(a===120&&g===48&&this.offset-b===2)c=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&&c){do a=this._read();while(97<=a&&a<=122||65<=a&&a<=90||a===95||48<=a&&a<=57||45===a&&c);this._unread(a);a=this.keywords;if(a.length>0){b=this.text.substring(b,this.offset);for(c=0;c<a.length;c++)if(this.keywords[c]===
b)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(),c;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();c=7;for(a===42&&(c=8);;){for(;a===42;)if(a=this._read(),a===47)return c;if(a===-1)return this._unread(a),
c;a=this._read()}}this._unread(a);return 1;case 39:for(c=4;;)switch(a=this._read(),a){case 39:return c;case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=5,a=this._read(),a!==10&&this._unread(a)}}break;case 34:for(c=4;;)switch(a=this._read(),a){case 34:return c;case 13:case 10:case -1:return this._unread(a),c;case 92:switch(a=this._read(),a){case 10:c=5;break;case 13:c=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}}};b.prototype=new j(null);b.prototype.setType=function(a){this._type=a};b.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}}};i.prototype=new j(null);i.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),1}};a.prototype={destroy:function(){var a=this.view;if(a){var c=a.getModel();c.getBaseModel&&(c=c.getBaseModel());c.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,c){if(this.whitespacesVisible!==a)this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,c&&this.view.redraw()},setTabsVisible:function(a){if(this.tabsVisible!==
a)this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setSpacesVisible:function(a){if(this.spacesVisible!==a)this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw()},setDetectHyperlinks:function(a){this.detectHyperlinks=a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,c,b,d,e){var g;d===void 0&&(d=-1);if(e===void 0)e=
a.length;for(;e-d>1;)if(g=Math.floor((e+d)/2),c<=a[g].start)e=g;else if(b&&c<a[g].end){e=g;break}else d=g;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 c=this.annotationModel;if(c){c.removeAnnotations(f.AnnotationType.ANNOTATION_FOLDING);for(var b=[],d=a.getBaseModel(),e=this.comments,g=0;g<e.length;g++){var h=
e[g];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&b.push(h)}c.replaceAnnotations(null,b)}}}},_createFoldingAnnotation:function(a,c,b,d){var e=c.getLineAtOffset(b),c=c.getLineAtOffset(d);return e===c?null:new (f.AnnotationType.getType(f.AnnotationType.ANNOTATION_FOLDING))(b,d,a)},_computeTasks:function(a,c,b){if(this.detectTasks){var d=this.annotationModel;if(d){var e=this.view.getModel(),g=e;e.getBaseModel&&(g=e.getBaseModel());for(var h=d.getAnnotations(c,b),e=[],i=f.AnnotationType.ANNOTATION_TASK;h.hasNext();){var j=
h.next();j.type===i&&e.push(j)}h=[];j=this._commentScanner;j.setText(g.getText(c,b));for(var k;k=j.nextToken();){var l=j.getStartOffset()+c;k===14&&(k=g.getLineEnd(g.getLineAtOffset(l)),a!==6&&(k=Math.min(k,b-this.commentEnd.length)),h.push(f.AnnotationType.createAnnotation(i,l,k,g.getText(l,k))))}d.replaceAnnotations(e,h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var c=this.view,b=c.getModel(),c=c.getSelection();if(c.start===c.end&&b.getLineAtOffset(c.start)===a)return v}return null},
_getStyles:function(a,c,b){a.getBaseModel&&(b=a.mapOffset(b));for(var d=b+c.length,e=[],g=b,f=this.comments,h=this._binarySearch(f,b,!0);h<f.length;h++){if(f[h].start>=d)break;var i=f[h].start,j=f[h].end;g<i&&this._parse(c.substring(g-b,i-b),g,e);var k=f[h].type,m;switch(k){case 8:m=n;break;case 7:m=l;break;case 5:m=s}g=Math.max(g,i);i=Math.min(d,j);(k===8||k===7)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(c.substring(g-b,i-b),g,e,m,k):k===5&&this.whitespacesVisible?this._parseString(c.substring(g-
b,i-b),g,e,s):e.push({start:g,end:i,style:m});g=j}g<d&&this._parse(c.substring(g-b,d-b),g,e);if(a.getBaseModel)for(c=0;c<e.length;c++)b=e[c].end-e[c].start,e[c].start=a.mapOffset(e[c].start,!0),e[c].end=e[c].start+b;return e},_parse:function(a,b,d){var e=this._scanner;for(e.setText(a);a=e.nextToken();){var g=e.getStartOffset()+b,f=null;switch(a){case 2:f=p;break;case 3:f=t;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(e.getData(),g,d,s);continue}else f=s;break;case 8:this._parseComment(e.getData(),
g,d,n,a);continue;case 6:this._parseComment(e.getData(),g,d,c,a);continue;case 7:this._parseComment(e.getData(),g,d,l,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(f=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=x)}d.push({start:g,end:e.getOffset()+b,style:f})}},_parseComment:function(a,c,b,d,e){var g=this._commentScanner;g.setText(a);for(g.setType(e);a=g.nextToken();){var e=g.getStartOffset()+c,f=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&
(f=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(f=x);break;case 12:f=m;break;case 13:f=q;break;case 14:f=r;break;default:this.detectHyperlinks&&(f=this._detectHyperlinks(g.getData(),e,b,f))}f&&b.push({start:e,end:g.getOffset()+c,style:f})}},_parseString:function(a,c,b,d){var e=this._whitespaceScanner;for(e.setText(a);a=e.nextToken();){var g=e.getStartOffset()+c,f=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(f=u);break;case 11:this.whitespacesVisible&&this.spacesVisible&&
(f=x)}f&&b.push({start:g,end:e.getOffset()+c,style:f})}},_detectHyperlinks:function(a,c,b,d){var e=null,g;if((g=a.indexOf("://"))>0){for(var e=a,f=g;f>0;){g=e.charCodeAt(f-1);if(!(97<=g&&g<=122||65<=g&&g<=90||45===g||48<=g&&g<=57))break;f--}if(f>0&&(g="\"\"''(){}[]<>".indexOf(e.substring(f-1,f)),g!==-1&&(g&1)===0&&(g=e.lastIndexOf("\"\"''(){}[]<>".substring(g+1,g+2)))!==-1)){var h=g;g=this._clone(d);g.tagName="a";g.attributes={href:e.substring(f,h)};b.push({start:c,end:c+f,style:d});b.push({start:c+
f,end:c+h,style:g});b.push({start:c+h,end:c+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?(g=this._clone(d),g.tagName="a",g.attributes={href:e},g):d},_clone:function(a){if(!a)return a;var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c},_findComments:function(a,c){var c=c||0,b=this._firstScanner,d;b.setText(a);for(var e=[];d=b.nextToken();)(d===7||d===8||d===5)&&e.push({start:b.getStartOffset()+
c,end:b.getOffset()+c,type:d}),(d===6||d===7||d===8)&&this._computeTasks(d,b.getStartOffset()+c,b.getOffset()+c);return e},_findMatchingBracket:function(a,c){var b="{}()[]<>",d=a.getText(c,c+1),e=b.indexOf(d,0);if(e===-1)return-1;var g;g=e&1?b.substring(e-1,e):b.substring(e+1,e+2);for(var f=a.getLineAtOffset(c),b=a.getLine(f),h=a.getLineStart(f),i=a.getLineEnd(f),b=this._findBrackets(d,g,b,h,h,i),i=0;i<b.length;i++)if(h=b[i]>=0?1:-1,b[i]*h-1===c){var j=1;if(e&1){for(i--;i>=0;i--)if(h=b[i]>=0?1:-1,
j+=h,j===0)return b[i]*h-1;for(f-=1;f>=0;){b=a.getLine(f);h=a.getLineStart(f);i=a.getLineEnd(f);b=this._findBrackets(d,g,b,h,h,i);for(e=b.length-1;e>=0;e--)if(h=b[e]>=0?1:-1,j+=h,j===0)return b[e]*h-1;f--}}else{for(i++;i<b.length;i++)if(h=b[i]>=0?1:-1,j+=h,j===0)return b[i]*h-1;f+=1;for(e=a.getLineCount();f<e;){b=a.getLine(f);h=a.getLineStart(f);i=a.getLineEnd(f);b=this._findBrackets(d,g,b,h,h,i);for(i=0;i<b.length;i++)if(h=b[i]>=0?1:-1,j+=h,j===0)return b[i]*h-1;f++}}break}return-1},_findBrackets:function(a,
c,b,d,e,g){for(var f=[],a=a.charCodeAt(0),c=c.charCodeAt(0),h=e,i=this._scanner,j,k=this.comments,l=this._binarySearch(k,e,!0);l<k.length;l++){if(k[l].start>=g)break;j=k[l].start;var n=k[l].end;if(h<j)for(i.setText(b.substring(h-e,j-e));j=i.nextToken();)j===a?f.push(i.getStartOffset()+h-e+d+1):j===c&&f.push(-(i.getStartOffset()+h-e+d+1));h=n}if(h<g)for(i.setText(b.substring(h-e,g-e));j=i.nextToken();)j===a?f.push(i.getStartOffset()+h-e+d+1):j===c&&f.push(-(i.getStartOffset()+h-e+d+1));return f},_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 c=a.oldValue,b=a.newValue,d=this.view,a=d.getModel(),e;if(this.highlightCaretLine){var g=a.getLineAtOffset(c.start);e=a.getLineAtOffset(b.start);var h=b.start===b.end,c=c.start===c.end;g===e&&c&&h||(c&&d.redrawLines(g,g+1),(g!==e||!c)&&h&&d.redrawLines(e,e+1))}if(this.annotationModel){var c=this._bracketAnnotations,
i,j;if(b.start===b.end&&(j=d.getCaretOffset())>0)j-=1,a.getBaseModel&&(j=a.mapOffset(j),a=a.getBaseModel()),a=this._findMatchingBracket(a,j),a!==-1&&(i=[f.AnnotationType.createAnnotation(f.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),f.AnnotationType.createAnnotation(f.AnnotationType.ANNOTATION_CURRENT_BRACKET,j,j+1)]);this._bracketAnnotations=i;this.annotationModel.replaceAnnotations(c,i)}},_onMouseDown:function(a){if(a.clickCount===2){var c=this.view,b=c.getModel(),d=c.getOffsetAtLocation(a.x,
a.y);if(d>0){var e=d-1,g=b;b.getBaseModel&&(e=b.mapOffset(e),g=b.getBaseModel());e=this._findMatchingBracket(g,e);e!==-1&&(a.preventDefault(),a=e,b.getBaseModel&&(a=b.mapOffset(a,!0)),d>a&&(d--,a++),c.setSelection(a,d))}}},_onModelChanged:function(a){var c=a.start,b=a.removedCharCount,d=a.addedCharCount-b,e=this.view,a=e.getModel(),g=a.getBaseModel?a.getBaseModel():a,b=c+b,h=g.getCharCount(),i=this.comments.length,j=g.getLineStart(g.getLineAtOffset(c)),k=this._binarySearch(this.comments,j,!0),l=this._binarySearch(this.comments,
b,!1,k-1,i);k<i&&this.comments[k].start<=j&&j<this.comments[k].end?(j=this.comments[k].start,j>c&&(j+=d)):j=k===i&&i>0&&h-d===this.comments[i-1].end?this.comments[i-1].start:j;var n;l<i?(n=this.comments[l].end,n>c&&(n+=d),l+=1):(l=i,n=h);for(var m,h=this._findComments(g.getText(j,n),j),i=k;i<this.comments.length;i++)m=this.comments[i],m.start>c&&(m.start+=d),m.start>c&&(m.end+=d);var q=l-k!==h.length;if(!q)for(i=0;i<h.length;i++){m=this.comments[k+i];var r=h[i];if(m.start!==r.start||m.end!==r.end||
m.type!==r.type){q=!0;break}}i=[k,l-k].concat(h);Array.prototype.splice.apply(this.comments,i);q&&(i=j,m=n,a!==g&&(i=a.mapOffset(i,!0),m=a.mapOffset(m,!0)),e.redrawRange(i,m));if(this.foldingEnabled&&g!==a&&this.annotationModel){e=this.annotationModel;k=e.getAnnotations(j,n);j=[];for(n=[];k.hasNext();)if(m=k.next(),m.type===f.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,l=m.end,i>
c&&(i-=d),l>c&&(l-=d),i<=c&&c<l&&i<=b&&b<l&&(i=g.getLineAtOffset(m.start),l=g.getLineAtOffset(m.end),i!==l?m.expanded||(m.expand(),e.modifyAnnotation(m)):e.removeAnnotation(m)))}c=[];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,g,m.start,m.end))&&c.push(m)}e.replaceAnnotations(j,c)}}};return{TextStyler:a}});
define("orion/editor/textMateStyler",["orion/regex"],function(f){function k(b){var d;if(b instanceof Array){d=Array(b.length);for(var a=0;a<b.length;a++)d[a]=k(b[a])}else for(a in d={},b)if(Object.prototype.hasOwnProperty.call(b,a)){var f=b[a];d[a]=typeof f==="object"&&f!==null?k(f):f}return d}function j(b,d,a){this.initialize(b);this.grammar=k(d);this.externalGrammars=a?k(a):[];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(b){return b[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(b){function f(a,c){throw Error('Unsupported regex feature "'+a+'": "'+c[0]+'" at index: '+c.index+" in "+c.input);}var a="",h,b=d.processGlobalFlag("x",b,function(a){for(var c="",b=!1,d=a.length,g=0;g<d;){var f=a.charAt(g);if(!b&&f==="#")for(;g<d&&f!=="\r"&&f!=="\n";)f=a.charAt(++g);
else if(!b&&/\s/.test(f))for(;g<d&&/\s/.test(f);)f=a.charAt(++g);else f==="\\"?(c+=f,/\s/.test(a.charAt(g+1))||(c+=a.charAt(g+1),g+=1)):(f==="["?b=!0:f==="]"&&(b=!1),c+=f),g+=1}return c}),b=d.processGlobalFlag("i",b,function(b){a+="i";return b});for(h=0;h<this.unsupported.length;h++){var g;(g=this.unsupported[h].regex.exec(b))&&f(this.unsupported[h].func(g),g)}return RegExp(b,a)},processGlobalFlag:function(b,d,a){function f(a,c){for(var b=0,d=a.length,g=-1,h=c;h<d&&g===-1;h++)switch(a.charAt(h)){case "\\":h++;
break;case "(":b++;break;case ")":b--,b===0&&(g=h)}return g}var g="(?"+b+")",b="(?"+b+":";if(d.substring(0,g.length)===g)return a(d.substring(g.length));else if(d.substring(0,b.length)===b){g=f(d,0);if(g<d.length-1)throw Error("Only a "+b+") group that encloses the entire regex is supported in: "+d);return a(d.substring(b.length,g))}return d},hasBackReference:function(b){return/\\\d+/.test(b.source)},getSubstitutedRegex:function(b,d,a){for(var a=typeof a==="undefined"?!0:!1,b=b.source.split(/(\\\d+)/g),
h=[],g=0;g<b.length;g++){var e=b[g],c=/\\(\d+)/.exec(e);c?(e=d[c[1]]||"",h.push(a?f.escape(e):e)):h.push(e)}return RegExp(h.join(""))},groupify:function(b,d){for(var a=b.source,f=a.length,g=[],e=0,c=[],j=1,k=1,m=[],r={},q={},s=0;s<f;s++){var t=g[g.length-1],p=a.charAt(s);switch(p){case "(":if(t===4)g.pop(),m.push(")"),c[c.length-1].end=s;var x=s+2<f?a.charAt(s+1)+""+a.charAt(s+2):null;if(x==="?:"||x==="?="||x==="?!"){var u;x==="?:"?u=1:(u=3,e++);g.push(u);c.push({start:s,end:-1,type:u});m.push(p);
m.push(x);s+=x.length}else g.push(2),c.push({start:s,end:-1,type:2,oldNum:j,num:k}),m.push(p),e===0&&(q[k]=null),r[j]=k,j++,k++;break;case ")":t=g.pop();t===3&&e--;c[c.length-1].end=s;m.push(p);break;case "*":case "+":case "?":case "}":var v=p,o=a.charAt(s-1),x=s-1;if(p==="}"){for(u=s-1;a.charAt(u)!=="{"&&u>=0;u--);o=a.charAt(u-1);x=u-1;v=a.substring(u,s+1)}u=c[c.length-1];if(o===")"&&(u.type===2||u.type===4)){m.splice(u.start,0,"(");m.push(v);m.push(")");p={start:u.start,end:m.length-1,type:4,num:u.num};
for(o=0;o<c.length;o++)if(t=c[o],(t.type===2||t.type===4)&&t.start>=u.start&&t.end<=x)if(t.start+=1,t.end+=1,t.num+=1,t.type===2)r[t.oldNum]=t.num;c.push(p);k++;break}default:p!=="|"&&t!==2&&t!==4&&e===0&&(g.push(4),c.push({start:s,end:-1,type:4,num:k}),m.push("("),q[k]=null,k++),m.push(p),p==="\\"&&(p=a.charAt(s+1),m.push(p),s+=1)}}for(;g.length;)g.pop(),m.push(")");var a=RegExp(m.join("")),f={},d=d||r,w;for(w in d)d.hasOwnProperty(w)&&(f[w]="\\"+d[w]);a=this.getSubstitutedRegex(a,f,!1);return[a,
r,q]},complexCaptures:function(b){if(!b)return!1;for(var d in b)if(b.hasOwnProperty(d)&&d!=="0")return!0;return!1}};j.prototype={initialize:function(b){this.textView=b;this.textView.stylerOptions=this;var d=this;this._listener={onModelChanged:function(a){d.onModelChanged(a)},onDestroy:function(a){d.onDestroy(a)},onLineStyle:function(a){d.onLineStyle(a)},onStorage:function(a){d.onStorage(a)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Destroy",this._listener.onDestroy);
b.addEventListener("LineStyle",this._listener.onLineStyle);b.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView)this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null;this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(b){for(b=[b];b.length!==0;){var d=
b.pop();if(!d._resolvedRule||!d._typedRule)if(d._resolvedRule=this._resolve(d),d._typedRule=this._createTypedRule(d),this.addStyles(d.name),this.addStyles(d.contentName),this.addStylesForCaptures(d.captures),this.addStylesForCaptures(d.beginCaptures),this.addStylesForCaptures(d.endCaptures),d._resolvedRule!==d&&b.push(d._resolvedRule),d.patterns)for(var a=0;a<d.patterns.length;a++)b.push(d.patterns[a])}},addStyles:function(b){if(b&&!this._styles[b]){this._styles[b]=[];for(var d=b.split("."),a=0;a<
d.length;a++)this._styles[b].push(d.slice(0,a+1).join("-"))}},addStylesForCaptures:function(b){for(var d in b)b.hasOwnProperty(d)&&this.addStyles(b[d].name)},ContainerRule:function(){function b(b){this.rule=b;this.subrules=b.patterns}b.prototype.valueOf=function(){return"aa"};return b}(),BeginEndRule:function(){function b(b){this.rule=b;this.beginRegex=d.toRegExp(b.begin);this.endRegex=d.toRegExp(b.end);this.subrules=b.patterns||[];this.endRegexHasBackRef=d.hasBackReference(this.endRegex);var a=d.complexCaptures(b.captures),
b=d.complexCaptures(b.beginCaptures)||d.complexCaptures(b.endCaptures);if(this.isComplex=a||b)a=d.groupify(this.beginRegex),this.beginRegex=a[0],this.beginOld2New=a[1],this.beginConsuming=a[2],a=d.groupify(this.endRegex,this.beginOld2New),this.endRegex=a[0],this.endOld2New=a[1],this.endConsuming=a[2]}b.prototype.valueOf=function(){return this.beginRegex};return b}(),MatchRule:function(){function b(b){this.rule=b;this.matchRegex=d.toRegExp(b.match);if(this.isComplex=d.complexCaptures(b.captures))b=
d.groupify(this.matchRegex),this.matchRegex=b[0],this.matchOld2New=b[1],this.matchConsuming=b[2]}b.prototype.valueOf=function(){return this.matchRegex};return b}(),_createTypedRule:function(b){return b.match?new this.MatchRule(b):b.begin?new this.BeginEndRule(b):new this.ContainerRule(b)},_resolve:function(b){var d=b;if(b.include){if(b.begin||b.end||b.match)throw Error('Unexpected regex pattern in "include" rule '+b.include);b=b.include;if(b.charAt(0)==="#"){if(d=this.grammar.repository&&this.grammar.repository[b.substring(1)],
!d)throw Error("Couldn't find included rule "+b+" in grammar repository");}else if(b==="$self")d=this.grammar;else if(b==="$base")throw Error('Include "$base" is not supported');else if(d=this._allGrammars[b],!d)for(var a=0;a<this.externalGrammars.length;a++){var f=this.externalGrammars[a];if(f.scopeName===b){this.preprocess(f);d=this._allGrammars[b]=f;break}}}return d},ContainerNode:function(){function b(b,a){this.parent=b;this.rule=a;this.children=[];this.end=this.start=null}b.prototype.addChild=
function(b){this.children.push(b)};b.prototype.valueOf=function(){var b=this.rule;return"ContainerNode { "+(b.include||"")+" "+(b.name||"")+(b.comment||"")+"}"};return b}(),BeginEndNode:function(){function b(b,a,f){this.parent=b;this.rule=a;this.children=[];this.setStart(f);this.endMatch=this.end=null;this.endRegexSubstituted=a.endRegexHasBackRef?d.getSubstitutedRegex(a.endRegex,f):null}b.prototype.addChild=function(b){this.children.push(b)};b.prototype.getIndexInParent=function(){return this.parent?
this.parent.children.indexOf(this):-1};b.prototype.setStart=function(b){this.start=b.index;this.beginMatch=b};b.prototype.setEnd=function(b){b&&typeof b==="object"?(this.endMatch=b,this.end=b.index+b[0].length):(this.endMatch=null,this.end=b)};b.prototype.shiftStart=function(b){this.start+=b;this.beginMatch.index+=b};b.prototype.shiftEnd=function(b){this.end+=b;this.endMatch&&(this.endMatch.index+=b)};b.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+
"}"};return b}(),push:function(b,d){if(d)for(var a=d.length;a>0;)b.push(d[--a])},exec:function(b,d,a){(d=b.exec(d))&&(d.index+=a);b.lastIndex=0;return d},afterMatch:function(b){return b.index+b[0].length},getEndMatch:function(b,d,a){if(b instanceof this.BeginEndNode){var f=b.rule,b=b.endRegexSubstituted||f.endRegex;return!b?null:this.exec(b,d,a)}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(b){var d=b.addedCharCount,a=b.removedCharCount,b=b.start;if(this._tree){var f=this.textView.getModel(),g=f.getCharCount(),f=f.getLineEnd(f.getLineAtOffset(b)-1),e=this.getFirstDamaged(f,f),f=f===-1?0:f,d=e?this.parse(e,!0,f,b,d,a):g;this.textView.redrawRange(f,d)}else this.initialParse()},getFirstDamaged:function(b,d){if(b<0)return this._tree;for(var a=[this._tree],f=null;a.length;){var g=a.pop();if(!g.parent||this.isDamaged(g,b,d)){g instanceof this.BeginEndNode&&(f=
g);for(var e=0;e<g.children.length;e++)a.push(g.children[e])}}return f||this._tree},isDamaged:function(b,d,a){return b.start<=a&&b.end>d},parse:function(b,d,a,f,g,e){var c=this.textView.getModel(),j=c.getLineStart(c.getLineCount()-1),k=c.getCharCount(),m=this.getInitialExpected(b,a),r=-1;if(d)b.repaired=!0,b.endNeedsUpdate=!0,r=(r=b.children[b.children.length-1])?c.getLineEnd(c.getLineAtOffset(r.end+(g-e))):-1,f=c.getLineEnd(c.getLineAtOffset(f+e)),r=Math.max(r,f);for(var r=r===-1?k:r,f=m,q=b,s=!1,
t=a,p=-1;q&&(!d||t<r);){var x=this.getNextMatch(c,q,t);x||(t=t>=j?k:c.getLineStart(c.getLineAtOffset(t)+1));var u=x&&x.match,v=x&&x.rule,o=x&&x.isEnd;if(x&&x.isSub){if(t=this.afterMatch(u),v instanceof this.BeginEndRule)s=!0,d&&v===f.rule&&q===f.parent?(q=f,q.setStart(u),q.repaired=!0,q.endNeedsUpdate=!0,f=this.getNextExpected(f,"begin")):(d&&(this.prune(q,f),d=!1),u=new this.BeginEndNode(q,v,u),q.addChild(u),q=u)}else if(o||t===k){if(q instanceof this.BeginEndNode)u?(s=!0,p=Math.max(p,q.end),q.setEnd(u),
t=this.afterMatch(u),d&&q===f&&q.parent===f.parent?(q.repaired=!0,delete q.endNeedsUpdate,f=this.getNextExpected(f,"end")):d&&(this.prune(q,f),d=!1)):(q.setEnd(k),delete q.endNeedsUpdate);q=q.parent}d&&t>=r&&!s&&(this.prune(b,m),d=!1)}this.removeUnrepairedChildren(b,d,a);this.cleanup(d,b,a,r,k,g,e);return d?Math.max(p,t):t},removeUnrepairedChildren:function(b,d,a){if(d){for(var d=b.children,f=-1,g=0;g<d.length;g++){var e=d[g];if(!e.repaired&&this.isDamaged(e,a,Number.MAX_VALUE)){f=g;break}}if(f!==
-1)b.children.length=f}},cleanup:function(b,d,a,f,g,e,c){if(b){b=e-c;g=this.getIntersecting(f-b+1,g);d=this.getIntersecting(a,f);for(a=0;a<g.length;a++)f=g[a],!f.repaired&&f instanceof this.BeginEndNode&&(f.shiftEnd(b),f.shiftStart(b));for(a=0;a<d.length;a++)f=d[a],f.repaired&&f.endNeedsUpdate&&f.shiftEnd(b),delete f.endNeedsUpdate,delete f.repaired}else{d=this.getIntersecting(a,f);for(a=0;a<d.length;a++)delete d[a].repaired}},getNextMatch:function(b,d,a,f){var g=b.getLineAtOffset(a),g=b.getLineEnd(g),
e=b.getText(a,g),c=[],j=[],b=[],g=[];for(this.push(c,d.rule.subrules);c.length;){var k=c.length?c.pop():null,k=k&&k._resolvedRule._typedRule;if(k instanceof this.ContainerRule&&j.indexOf(k)===-1)j.push(k),this.push(c,k.subrules);else if(!k||!f||k.matchRegex){var m=k&&this.exec(k.matchRegex||k.beginRegex,e,a);m&&(b.push(m),g.push(k))}}c=Number.MAX_VALUE;j=-1;for(k=0;k<b.length;k++)if(m=b[k],m.index<c)c=m.index,j=k;if(!f&&(a=this.getEndMatch(d,e,a)))if(f=d.rule.applyEndPatternLast,j===-1||a.index<c||
!f&&a.index===c)return{isEnd:!0,rule:d.rule,match:a};return j===-1?null:{isSub:!0,rule:g[j],match:b[j]}},getInitialExpected:function(b,d){var a,f;if(b===this._tree)for(a=0;a<b.children.length;a++){if(f=b.children[a],f.start>=d)return f}else if(b instanceof this.BeginEndNode&&b.endMatch){var g=b.endMatch.index;for(a=0;a<b.children.length;a++)if(f=b.children[a],f.start>=d)break;if(f&&f.start<g)return f}return b},getNextExpected:function(b,d){if(d==="begin"){var a=b.children[0];return a?a:b}else if(d===
"end"&&(a=b.parent)){var f=a.children[a.children.indexOf(b)+1];return f?f:a}return null},prune:function(b,d){if(d.parent===b)b.children.length=d.getIndexInParent();else if(b instanceof this.BeginEndNode)b.endMatch=null,b.end=null;if(b.parent)b.parent.children.length=b.getIndexInParent()+1},onLineStyle:function(b){this._tree||this.initialParse();var d=b.lineStart,a=this.textView.getModel(),f=a.getLineEnd(b.lineIndex),g=a.getLineEnd(a.getLineAtOffset(d)-1),g=this.getFirstDamaged(g,g),d=this.getLineScope(a,
g,d,f);b.ranges=this.toStyleRanges(d);b.ranges.sort(function(a,c){return a.start-c.start})},getLineScope:function(b,d,a,f){for(var g=a,e=this.getInitialExpected(d,a),c=[],j=[];d&&g<f;){var k=this.getNextMatch(b,d,g);if(!k)break;var m=k&&k.match,r=k&&k.rule,q=k&&k.isSub,k=k&&k.isEnd;m.index!==g&&j.push({start:g,end:m.index,node:d});if(q)g=this.afterMatch(m),r instanceof this.BeginEndRule?(this.addBeginScope(c,m,r),d=e,e=this.getNextExpected(e,"begin")):this.addMatchScope(c,m,r);else if(k)g=this.afterMatch(m),
this.addEndScope(c,m,r),e=this.getNextExpected(e,"end"),d=d.parent}g<f&&j.push({start:g,end:f,node:d});b=this.getInheritedLineScope(j,a,f);return c.concat(b)},getInheritedLineScope:function(b){for(var d=[],a=0;a<b.length;a++)for(var f=b[a],g=f.node;g;){var e=g.rule.rule,c=e.name;if(e=e.contentName||c){this.addScopeRange(d,f.start,f.end,e);break}g=g.parent}return d},addBeginScope:function(b,d,a){var f=a.rule;this.addCapturesScope(b,d,f.beginCaptures||f.captures,a.isComplex,a.beginOld2New,a.beginConsuming)},
addEndScope:function(b,d,a){var f=a.rule;this.addCapturesScope(b,d,f.endCaptures||f.captures,a.isComplex,a.endOld2New,a.endConsuming)},addMatchScope:function(b,d,a){var f=a.rule,g=f.name;(f=f.captures)?this.addCapturesScope(b,d,f,a.isComplex,a.matchOld2New,a.matchConsuming):this.addScope(b,d,g)},addScope:function(b,d,a){a&&b.push({start:d.index,end:this.afterMatch(d),scope:a})},addScopeRange:function(b,d,a,f){f&&b.push({start:d,end:a,scope:f})},addCapturesScope:function(b,d,a,f,g,e){if(a)if(f){for(var f=
{1:0},c=0,j=1;d[j]!==void 0;j++)e[j]!==void 0&&(c+=d[j].length),d[j+1]!==void 0&&(f[j+1]=c);e=d.index;for(c=1;a[c];c++){var j=a[c].name,k=g[c],m=e+f[k];typeof d[k]!=="undefined"&&this.addScopeRange(b,m,m+d[k].length,j)}}else this.addScope(b,d,a[0]&&a[0].name)},getIntersecting:function(b,d){for(var a=[],f=this._tree?[this._tree]:[];f.length;){var g=f.pop(),e=!1;g instanceof this.ContainerNode?e=!0:this.isDamaged(g,b,d)&&(e=!0,a.push(g));if(e)for(var e=g.children.length,c=0;c<e;c++)f.push(g.children[c])}return a.reverse()},
toStyleRanges:function(b){for(var d=[],a=0;a<b.length;a++){var f=b[a],g=this._styles[f.scope];if(!g)throw Error("styles not found for "+f.scope);g=g.join(" ");d.push({start:f.start,end:f.end,style:{styleClass:g}})}return d}};return{RegexUtil:d,TextMateStyler:j}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(f,k){function j(a){return a.getProperty("objectClass").indexOf(b)!==-1&&a.getProperty("type")==="highlighter"}function d(a,b,d){this.initialize(a,b,d);this.lineStyles=[]}var b="orion.edit.highlighter",i=b+" service must be an event emitter";k.AnnotationType.registerType("orion.annotation.highlightError",{title:f.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}});
d.prototype={initialize:function(a,d,g){this.textView=a;this.serviceRegistry=d;this.annotationModel=g;this.services=[];var e=this;this.listener={onModelChanging:function(a){e.onModelChanging(a)},onModelChanged:function(a){e.onModelChanged(a)},onDestroy:function(a){e.onDestroy(a)},onLineStyle:function(a){e.onLineStyle(a)},onStyleReady:function(a){e.onStyleReady(a)},onServiceAdded:function(a){e.onServiceAdded(a.serviceReference,e.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){e.onServiceRemoved(a.serviceReference,
e.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(b);for(g=0;g<a.length;g++){var c=a[g];j(c)&&this.addServiceListener(d.getService(c))}},
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 b=this.startLine;(a.addedLineCount||a.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[b,a.removedLineCount].concat(this._getEmptyStyle(a.addedLineCount)))},
onStyleReady:function(a){var b=a.lineStyles||a.style,a=Number.MAX_VALUE,d=-1,e=this.textView.getModel(),c;for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(this.lineStyles[c]=b[c],a=Math.min(a,c),d=Math.max(d,c));a=Math.max(a,0);d=Math.min(d,e.getLineCount());if(b=this.annotationModel){for(var f=b.getAnnotations(e.getLineStart(a),e.getLineEnd(d)),i=[];f.hasNext();){var j=f.next();j.type==="orion.annotation.highlightError"&&i.push(j)}f=[];for(j=a;j<=d;j++){c=j;var r=this.lineStyles[c],r=r&&r.errors;
c=e.getLineStart(c);if(r)for(var q=0;q<r.length;q++){var s=r[q];f.push(k.AnnotationType.createAnnotation("orion.annotation.highlightError",s.start+c,s.end+c))}}b.replaceAnnotations(i,f)}this.textView.redrawLines(a,d+1)},onLineStyle:function(a){function b(a,c){for(var d=a.length,g=[],f=0;f<d;f++){var h=a[f];g.push({start:h.start+c,end:h.end+c,style:h.style})}return g}var d=this.lineStyles[a.lineIndex];if(d)if(d.ranges)a.ranges=b(d.ranges,a.lineStart);else if(d.style)a.style=d.style},_getEmptyStyle:function(a){for(var b=
[],d=0;d<a;d++)b.push(null);return b},setContentType:function(a){this.contentType=a;if(this.services)for(a=0;a<this.services.length;a++){var b=this.services[a];if(b.setContentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(b.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):b.setContentType(this.contentType)}}},onServiceAdded:function(a,b){j(a)&&this.addServiceListener(b)},onServiceRemoved:function(a,
b){this.services.indexOf(b)!==-1&&this.removeServiceListener(b)},addServiceListener:function(a){if(typeof a.addEventListener==="function"){if(a.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(a),a.setContentType&&this.contentType){var b=this.serviceRegistry.getService("orion.page.progress");b?b.progress(a.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):a.setContentType(this.contentType)}}else typeof console!==
"undefined"&&console.log(Error(i))},removeServiceListener:function(a){typeof a.removeEventListener==="function"?(a.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),a=this.services.indexOf(a),a!==-1&&this.services.splice(a,1)):typeof console!=="undefined"&&console.log(Error(i))}};return d});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(f,k,j,d){function b(a,b,g,e,c,i,n){function m(a,c){var e=a.getProperty("contentType"),f=a.getProperty("fileTypes");if(e)return b.isSomeExtensionOf(g,e).then(function(c){return c?a:null});else if(c&&f&&f.indexOf(c)!==-1)return e=new d,e.resolve(a),e;return null}var r=function(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new f.TextStyler(e,"js",c);break;case "text/x-java-source":b=new f.TextStyler(e,"java",c);break;case "text/css":b=new f.TextStyler(e,"css",c)}return b}(g);if(r)return i=new d,i.resolve(r),i;for(var r=i&&i.split(".").pop().toLowerCase(),i=a.getServiceReferences("orion.edit.highlighter"),q=[],s=[],t=0;t<i.length;t++){var p=i[t];p.getProperty("type")==="grammar"&&q.push(p.getProperty("grammar"));(p=m(p,r))&&s.push(p)}return d.all(s,function(a){return{_error:a}}).then(function(b){for(var d,f=b.length-
1;f>=0;f--){var h=b[f];if(h&&!h._error&&(n||h.getProperty("type")!=="highlighter")){d=h;break}}var i;if(d)if(b=d.getProperty("type"),b==="highlighter")i=new j(e,a,c),i.setContentType(g);else if(b==="grammar"||typeof b==="undefined")d=d.getProperty("grammar"),i=new k.TextMateStyler(e,d,q);return i})}function i(a){this.serviceRegistry=a;this.styler=null}i.prototype={setup:function(a,d,g,e,c){c=typeof c==="undefined"?!0:c;if(this.styler)this.styler.destroy&&this.styler.destroy(),this.styler=null;var f=
this;return b(this.serviceRegistry,this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,d,g,e,c).then(function(a){return f.styler=a})},getStyler:function(){return this.styler}};return{createStyler:b,SyntaxHighlighter:i}});
define("orion/searchAndReplace/textSearcher",["i18n!orion/search/nls/messages","orion/editor/find","orion/commands","orion/objects","orion/webui/littlelib"],function(f,k,j,d,b){function i(a,b,d,e){k.Find.call(this,a,d,e);this._commandService=b}i.prototype=new k.Find;d.mixin(i.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 b=a.findString,a=a.replaceString,d=document.getElementById("localSearchFindWith");d||(this._createActionTable(),d=document.getElementById("localSearchFindWith"));if(b)d.value=b;if(a)document.getElementById("localSearchReplaceWith").value=a;window.setTimeout(function(){d.select();
d.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw==",this._replaceInfo.title=f["Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw==",
this._replaceInfo.title=f["Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."]);this._replaceInfo.style.display=""},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(b){var d=document.createElement("input");d.type="text";d.name=f["Find:"];d.className="parameterInput";d.id="localSearchFindWith";d.placeholder=
f["Find With"];d.oninput=function(c){return a._handleInput(c)};d.onkeydown=function(c){return a._handleKeyDown(c)};b.appendChild(d);a._createButton("Next",b,function(){a.find(!0)});a._createButton("Previous",b,function(){a.find(!1)});var e=a._editor.getTextView().getOptions("readonly");if(!e){var c=document.createElement("input");c.type="text";c.name=f["ReplaceWith:"];c.className="parameterInput";c.id="localSearchReplaceWith";c.placeholder=f["Replace With"];c.onkeydown=function(c){return a._handleKeyDown(c)};
b.appendChild(c);a._replaceInfo=a._createInfoImage(null,b,null);a._showReplaceInfo();a._createButton(f.Replace,b,function(){a.replace()});a._createButton(f["Replace All"],b,function(){a.replaceAll()})}c=document.createElement("div");b.appendChild(c);c.classList.add("findOptionsDiv");var i=j.createDropdownMenu(c,f.Options,null,"dismissButton",null,!0);i.menuButton.classList.add("parameterInlineButton");j.createCheckedMenuItem(i.menu,f["Show all"],a._showAll,function(c){a.setOptions({showAll:c.target.checked});
i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,f["Case sensitive"],!a._caseInsensitive,function(c){a.setOptions({caseInsensitive:!c.target.checked});i.dropdown.close(!0);a.find(!0)});j.createCheckedMenuItem(i.menu,f["Wrap search"],a._wrap,function(c){a.setOptions({wrap:c.target.checked});i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,f["Incremental search"],a._incremental,function(c){a.setOptions({incremental:c.target.checked});i.dropdown.close(!0)});j.createCheckedMenuItem(i.menu,f["Whole Word"],
a._wholeWord,function(c){a.setOptions({wholeWord:c.target.checked});i.dropdown.close(!0);a.find(!0)});a._regExBox=j.createCheckedMenuItem(i.menu,f["Regular expression"],a._regex,function(c){a.setOptions({regex:c.target.checked});i.dropdown.close(!0);a.find(!0);a._showReplaceInfo()});e||j.createCheckedMenuItem(i.menu,f["Find after replace"],a._findAfterReplace,function(c){a.setOptions({findAfterReplace:c.target.checked});i.dropdown.close(!0)});return d},function(){a.hide()})},_createButton:function(a,
d,g){var e=document.createElement("button");e.addEventListener("click",g.bind(this),!1);var c=this;e.addEventListener("keydown",function(a){a.keyCode===b.KEY.ESCAPE&&c.hide()});e.appendChild(document.createTextNode(a));e.className="dismissButton parameterInlineButton";d.appendChild(e)},_createInfoImage:function(a,b){var d=document.createElement("img");d.classList.add("replaceInfo");d.addEventListener("click",function(){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);
this._showReplaceInfo()}.bind(this));b.appendChild(d);return d},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var b=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;if(b&&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(b&&a.keyCode===82)return a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.replace(),!1;return a.keyCode===27?(this.hide(),!1):!0}});return{TextSearcher:i}});
define("orion/edit/nls/root/messages",{Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"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.",
ReadingMetadata:"Reading metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find",noResponse:"No response from server.  Check your internet connection and try again.",savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",ViewTooltip:"View",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",
Project:"Project",New:"New",Add:"Add",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",NoProject:"${0} is not a project. To convert it to a project use ${1}.",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(f,k){var j={root:k};Object.keys(f).forEach(function(d){typeof j[d]==="undefined"&&(j[d]=f[d])});return j});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate"],function(f,k,j){function d(b,d){for(var a=d.getFileMetadata(),h=b.getServiceReferences("orion.edit.blamer"),g=0;g<h.length;g++){var e=h[g],c={};c.validationProperties=e.getProperty("validationProperties");c.forceSingleItem=!0;c=f._makeValidator(c,b);if(c.validationFunction.bind(c)(a))return b.getService(e)}return null}return{isVisible:function(b,f){return!!d(b,f)&&!!b.getService("orion.core.blame")},getBlame:function(b,
f){var a=d(b,f);a&&a.doBlame(f.getInput()).then(function(a){for(var d=k.getOrionHome(),e=0;e<a.length;e++){var c=a[e],f=new j(c.CommitLink),i={};i.OrionHome=d;c.CommitLink=f.expand(i)}b.getService("orion.core.blame")._setAnnotations(a)})}}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(f){var k={};f.getServiceReferences("orion.edit.context").forEach(function(j){var d=f.getService(j);Object.keys(d).forEach(function(b){typeof d[b]==="function"&&(k[b]=d[b].bind(d))})});return k}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/webui/littlelib,orion/webui/dialogs/OpenResourceDialog,orion/widgets/input/DropDownMenu,orion/Deferred,orion/URITemplate,orion/commands,orion/keyBinding,orion/commandRegistry,orion/extensionCommands,orion/contentTypes,orion/searchUtils,orion/PageUtil,orion/PageLinks,orion/blamer,orion/regex,orion/util,orion/edit/editorContext".split(","),function(f,k,j,d,b,i,a,h,g,e,c,l,n,m,r,q,s,t,p){function x(c){var b=new a(c.uriTemplate),
d=c.params||{};d.OrionHome=d.OrionHome||r.getOrionHome();var b=b.expand(d),d=document.createElement("div"),e=document.createElement("iframe");e.id=c.id;e.name=c.id;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";e.frameborder=c.border!==void 0?c.border:1;e.src=b;e.className="delegatedUI";if(c.width)d.style.width=c.width,e.style.width=c.width;if(c.height)d.style.height=c.height,e.style.height=c.height;e.style.visibility="hidden";c.parent!==null&&(c.parent||window.document.body).appendChild(d);
d.appendChild(e);e.style.left=c.left||(window.innerWidth-parseInt(e.clientWidth,10))/2+"px";e.style.top=c.top||(window.innerHeight-parseInt(e.clientHeight,10))/2+"px";e.style.visibility="";window.addEventListener("message",function z(a){if(a.source===e.contentWindow&&typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===c.id)){if(a.cancelled)c.cancelled&&c.cancelled();else if(a.result)c.done&&c.done(a.result);else if(a.Status||a.status)c.status&&c.status(a.Status||
a.status);window.removeEventListener("message",z,!1);e.parentNode.removeChild(e)}},!1);return d}function u(a,c,b,d,e,g,f,h,i,j,k){this.serviceRegistry=a;this.commandService=c;this.fileClient=b;this.inputManager=d;this.toolbarId=e;this.pageNavId=f;this.isReadOnly=g;this._localSearcher=h;this._searcher=i;this.editorSettings=j;this.localSettings=k}var v={},o=null;v.createDelegatedUI=x;u.prototype={generateEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);
this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a));this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a);this.isReadOnly||this._generateEditCommands(a)},_generateSettingsCommand:function(a){var c=this,d=new h.Command({imageClass:"core-sprite-wrench",tooltip:f.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return!!a.getTextView()},callback:function(e){var g=d.settingsDropDown;if(!g||g.isDestroyed())g=d.settingsDropDown=
new b(e.domParent,e.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){g.focus()},onHide:function(){a.focus()}}),g.updateContent=c.localSettings.show.bind(c.localSettings),g.getContentNode().tabIndex=0;g.click()}});this.commandService.addCommand(d);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new g.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(a){this.commandService.addCommand(new h.Command({name:f.Undo,id:"orion.undo",
visibleWhen:function(){return!!a.getTextView()},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 h.Command({name:f.Redo,id:"orion.redo",visibleWhen:function(){return!!a.getTextView()},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 b=!1,e=new h.Command({name:f.searchFiles,tooltip:f.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return!!a.getTextView()},callback:function(){a.getTextView().invokeAction("searchFiles")}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.pageNavId,"orion.searchFiles",1,null,!0,new g.KeyBinding("h",!0));a.getTextView().setKeyBinding(new g.KeyBinding("h",
!0),"searchFiles");a.getTextView().setAction("searchFiles",function(){if(!b){var e=a.getSelection(),e=a.getText(e.start,e.end),g=c.serviceRegistry.getService("orion.page.progress"),h=new d.OpenResourceDialog({searcher:c._searcher,progress:g,searchRenderer:c._searcher.defaultRenderer,nameSearch:!1,title:f.searchFiles,message:f.searchTerm,initialText:e,onHide:function(){b=!1;a.focus()}});window.setTimeout(function(){b=!0;h.show(j.node(c.toolbarId))},0);return!0}},e)}},_generateSaveCommand:function(a){var c=
this;a.getTextView().setKeyBinding(new g.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:f.Save});this.commandService.addCommand(new h.Command({name:f.Save,tooltip:f.saveFile,id:"orion.save",
visibleWhen:function(){return!a.getTextView()||c.inputManager.getReadOnly()?!1:!c.editorSettings||!c.editorSettings().autoSave},callback:function(){a.getTextView().invokeAction("save")}}));this.commandService.registerCommandContribution(this.toolbarId,"orion.save",1,null,!1,new g.KeyBinding("s",!0))},_generateGotoLineCommnand:function(a){var c=this,b=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var c=a.getModel().getLineAtOffset(a.getCaretOffset())+
1;return[new e.CommandParameter("line","number","Line:",c.toString())]}),b=new h.Command({name:f.gotoLine,tooltip:f.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return!!a.getTextView()},parameters:b,callback:function(c){var b=a.getModel();c.parameters&&c.parameters.valueFor("line")?c=c.parameters.valueFor("line"):(c=b.getLineAtOffset(a.getCaretOffset()),(c=prompt(f.gotoLinePrompt,c+1))&&(c=parseInt(c,10)));if(c)a.onGotoLine(c-1,0)}});this.commandService.addCommand(b);this.commandService.registerCommandContribution(this.pageNavId,
"orion.gotoLine",1,null,!0,new g.KeyBinding("l",!t.isMac,!1,!1,t.isMac),new e.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},b)},_generateFindCommnand:function(a){var c=this,b=new e.ParametersDescription([new e.CommandParameter("find","text","Find:")],{clientCollect:!0},function(){var b=a.getSelection(),d="";b.end>b.start&&(d=a.getModel().getText(b.start,
b.end),c._localSearcher&&c._localSearcher.getOptions().regex&&(d=s.escape(d)));return[new e.CommandParameter("find","text","Find:",d)]}),b=new h.Command({name:f.Find,tooltip:f.Find,id:"orion.editor.find",visibleWhen:function(){return!!a.getTextView()},parameters:b,callback:function(b){if(c._localSearcher){var d="",e=null,g=a.getSelection();g.end>g.start&&b.parameters.valueFor("useEditorSelection")?(d=a.getModel().getText(g.start,g.end),c._localSearcher.getOptions().regex&&(d=s.escape(d))):b.parameters&&
b.parameters.valueFor("find")&&(d=b.parameters.valueFor("find"),e=m.matchResourceParameters(),n.convertFindURLBinding(e));if(e){c._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive});b={};if(e.atLine)b.start=a.getModel().getLineStart(e.atLine-1);c._localSearcher.show({findString:d,replaceString:e.replaceWith});c._localSearcher.find(!0,b)}else c._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(b);this.commandService.registerCommandContribution(this.pageNavId,
"orion.editor.find",2,null,!0,new g.KeyBinding("f",!0),new e.URLBinding("find","find"));a.getTextView().setAction("find",function(a){if(a)return c._localSearcher.show(a),!0;c.commandService.runCommand("orion.editor.find",null,null,new e.ParametersDescription([new e.CommandParameter("useEditorSelection","text","","true")],{clientCollect:!0}));return!0},b)},_generateBlame:function(a){var c=this,b=new h.Command({name:f.Blame,tooltip:f.BlameTooltip,id:"orion.edit.blame",parameters:new e.ParametersDescription([new e.CommandParameter("blame",
"boolean")],{clientCollect:!0}),visibleWhen:function(){return!a.getTextView()?!1:c.editorSettings&&!c.editorSettings().showBlame?!1:q.isVisible(c.serviceRegistry,c.inputManager)},callback:function(d){b.visible=!b.visible;if(d.parameters&&d.parameters.valueFor("blame"))b.visible=d.parameters.valueFor("blame")==="true";b.visible?q.getBlame(c.serviceRegistry,c.inputManager):a.showBlame([])}});this.commandService.addCommand(b);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",
1,null,!1,new g.KeyBinding("b",!0,!0),new e.URLBinding("blame","blame"))},_generateEditCommands:function(a){function b(a){var c=new g.KeyBinding;g.KeyBinding.apply(c,a);return c}function d(a,c){!c&&a&&typeof a.HTML!=="undefined"&&delete a.HTML;var b=e.serviceRegistry.getService("orion.page.message");b?b.setProgressResult(a):window.console.log(a)}var e=this,n=this.serviceRegistry,m=n.getServiceReferences("orion.edit.command"),q=this.inputManager,u=n.getService("orion.page.progress"),r=function(c,b,
g){var i=g.visibleWhen;g.visibleWhen=function(c){return!a.getTextView()||e.inputManager.getReadOnly()?!1:!i||i(c)};g.callback=function(){a=this;var e=a.getSelection(),g=a.getModel(),h=function(c){typeof c==="object"&&c?(c.text&&a.setText(c.text),c.selection&&(a.setSelection(c.selection.start,c.selection.end,!0),a.focus())):typeof c==="string"&&(a.setText(c,e.start,e.end,!0),a.setSelection(e.start,e.start+c.length),a.focus())},i;b.execute?(g={contentType:q.getContentType(),input:q.getInput()},i=p.getEditorContext(n),
i.openDelegatedUI=x,i.setStatus=d,g=b.execute(i,g),i=null):(g=b.run(g.getText(e.start,e.end),g.getText(),e,q.getInput()),i=function(a){if(a&&a.uriTemplate){var b={};b.uriTemplate=a.uriTemplate;b.params=q.getFileMetadata();b.id=c.id;b.width=a.width;b.height=a.height;b.done=h;b.status=d;x(b)}else a.Status||a.status?d(a.Status||a.status):h(a)});u.showWhile(g,k.formatMessage(f.running,c.name)).then(i);return!0};g.callback=g.callback.bind(a);return new h.Command(g)};i.when(function(a){if(o)return o;var c=
a.getService("orion.core.contentTypeRegistry");c||(c=new l.ContentTypeRegistry(a),c=a.getService("orion.core.contentTypeRegistry"));return c.getContentTypes().then(function(a){return o=a})}(this.serviceRegistry),function(){var d=[],g=100;m.forEach(function(f){for(var h=e.serviceRegistry.getService(f),i={},j=f.getPropertyKeys(),k=0;k<j.length;k++)i[j[k]]=f.getProperty(j[k]);i.forceSingleItem=!0;f=c._createCommandOptions(i,f,e.serviceRegistry,o,!1,function(){return q.getFileMetadata()});d.push(f);f.then(function(c){c=
r(i,h,c);e.commandService.addCommand(c);e.commandService.registerCommandContribution(e.toolbarId,c.id,g);if(i.key){var d=a.getTextView();d.setKeyBinding(b(i.key),c.id);d.setAction(c.id,c.callback,c)}});g++});i.all(d,function(a){return{_error:a}}).then(function(){var c;if(c=q.getFileMetadata()){var b=j.node("pageActions");b&&(e.commandService.destroy(b),e.commandService.renderCommands(b.id,b,c,a,"button"));if(b=j.node("pageNavigationActions"))e.commandService.destroy(b),e.commandService.renderCommands(b.id,
b,a,a,"button")}})})}};v.EditorCommandFactory=u;return v});
define("orion/inputManager","i18n!orion/edit/nls/messages,orion/i18nUtil,orion/Deferred,orion/EventTarget,orion/objects,orion/PageUtil".split(","),function(f,k,j,d,b,i){function a(a){this._document=a.document||document;this._timeout=a.timeout;for(var a="keypress,keydown,keyup,mousemove,mousedown,mousemove".split(","),c=function(){this._resetTimer()}.bind(this),b=0;b<a.length;b++)this._document.addEventListener(a[b],c,!0);d.attach(this)}function h(a,c){if(a){if(c.status===0)c={Severity:"Error",Message:f.noResponse};
else{var b=c.responseText;if(b)try{c=JSON.parse(b)}catch(d){c={Severity:"Error",Message:b}}}a.setProgressResult(c)}else window.console.log(c)}function g(a){d.attach(this);this.editor=a.editor;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.progressService=a.progressService;this.contentTypeRegistry=a.contentTypeRegistry;this.selection=a.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}a.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()}};b.mixin(g.prototype,{_maybeLoadWorkspace:function(a){var c=this.fileClient;return a===c.fileServiceRootURL(a)?c.loadWorkspace(a).then(function(a){return a.Location}):
(new j).resolve(a)},_read:function(a){var c=this.fileClient,b=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return c.read.apply(c,[a].concat(b))})},load:function(){var a=this.getInput();if(a){var c=this.fileClient,b=this._parsedLocation.resource,d=this.progressService,g=function(a,c,b){return!d?a:d.progress(a,k.formatMessage(c,b))},i=this.getEditor();if(this._fileMetadata)!this._saving&&!this._fileMetadata.Directory&&!this._readonly&&g(c.read(b,!0),f.ReadingMetadata,
a).then(function(d){if(this._fileMetadata&&this._fileMetadata.Location===d.Location&&this._fileMetadata.ETag!==d.ETag)this._fileMetadata=d,(!i.isDirty()||window.confirm(f.loadOutOfSync))&&g(c.read(b),f.Reading,a).then(function(c){i.setInput(a,null,c);this._unsavedChanges=[]}.bind(this))}.bind(this));else{var j=b;if(j.indexOf("/gitapi/commit/")===0){var s=j.indexOf("/file"),t=j.indexOf("?",s);if(t===-1)t=j.length;j=j.substring(s,t);this._readonly=!0}var p=window.setTimeout(function(){p=null;i.reportStatus(k.formatMessage(f.Fetching,
a))},800),x=function(){i.reportStatus("");p&&window.clearTimeout(p)},u=function(a){x();var c=this.serviceRegistry.getService("orion.page.message");h(c,a);this._setNoInput()}.bind(this);this._acceptPatch=null;g(this._read(j,!0),f.ReadingMetadata,j).then(function(d){d.Directory?g(c.fetchChildren(d.ChildrenLocation),f.Reading,a).then(function(c){x();d.Children=c;this._setInputContents(this._parsedLocation,a,c,d)}.bind(this),u):g(c.read(b,!1,!0),f.Reading,a).then(function(c){x();if(typeof c!=="string")this._acceptPatch=
c.acceptPatch,c=c.result;this._setInputContents(this._parsedLocation,a,c,d)}.bind(this),u)}.bind(this),u)}}},processParameters:function(a){var c=this.getEditor();c.processParameters&&c.processParameters(a)},getEditor:function(){return this.editor},getInput:function(){return this._input},getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var a=this._fileMetadata;return this._readonly||!a||a.Attributes&&a.Attributes.ReadOnly},getContentType:function(){return this._contentType},
save:function(){function a(c){if(g===o.getInput())o.getFileMetadata().ETag=c.ETag,b.setInput(g,null,i,!0);b.reportStatus("");d&&v.setProgressResult({Message:f.Saved,Severity:"Normal"});o.afterSave&&o.afterSave();o._saving=!1}function c(a){b.reportStatus("");h(v,a);o._saving=!1;o._errorSaving=!0}if(!this._saving){var b=this.getEditor();if(b.isDirty()&&!this.getReadOnly()){var d=this._errorSaving;this._saving=!0;var g=this.getInput();b.reportStatus(f["Saving..."]);this.dispatchEvent({type:"Saving",
inputManager:this});b.markClean();var i=b.getText(),j=i;if(this._getSaveDiffsEnabled()&&!this._errorSaving){for(var s=this._unsavedChanges,t=0,p=0;p<s.length;p++)t+=s[p].text.length;i.length>t&&(j={diff:s})}this._unsavedChanges=[];this._errorSaving=!1;var s={ETag:this.getFileMetadata().ETag},x=this._parsedLocation.resource,j=this.fileClient.write(x,j,s),u=this.progressService,v=this.serviceRegistry.getService("orion.page.message");u&&(j=u.progress(j,k.formatMessage(f.savingFile,g)));var o=this;j.then(a,
function(b){b.status===412?window.confirm(f.saveOutOfSync)?(b=o.fileClient.write(x,i),u&&(b=u.progress(b,k.formatMessage(f.savingFile,g))),b.then(a,c)):o._saving=!1:c(b)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(b){this._autoSaveEnabled=b!==-1;this._idle?this._idle.setTimeout(b):(this._idle=new a({document:document,timeout:b}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=
a},setInput:function(a){if(!this._ignoreInput&&(a||(a=i.hash()),typeof a==="string")){var c=this.getEditor();a&&a[0]!=="#"&&(a="#"+a);var b=i.matchResourceParameters(a);if(c.isDirty()&&(c=this._location,i.matchResourceParameters(c).resource!==b.resource))if(this._autoSaveEnabled)this.save();else if(!window.confirm(f.confirmUnsavedChanges)){window.location.hash=c;return}this._location=a;this._parsedLocation=b;this._ignoreInput=!0;this.selection.setSelections(a);this._ignoreInput=!1;(a=b.resource)?
a===this._input?this.processParameters(b):(this._input=a,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(a){var c=a.lastIndexOf("/");c!==-1&&(a=a.substring(c+1));this._title=a},setSaveDiffsEnabled:function(a){this._saveDiffsEnabled=a},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&this._acceptPatch!==null&&this._acceptPatch.indexOf("application/json-patch")!==-1},_setNoInput:function(a){a?this.fileClient.loadWorkspace("").then(function(a){this._input=
a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=null,this.setContentType(null),this.editor.uninstall(),this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(a,c,b,d){var g,f=!1;d?(this._fileMetadata=d,this.setTitle(d.Location||String(d)),this.setContentType(this.contentTypeRegistry.getFileContentType(d)),g=d.Name,f=d.Directory):(this._fileMetadata=null,this.setTitle(c),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),
g=this.getTitle());var h=this.getEditor();f?h.uninstall():h.getTextView()||(h.install(),h.getTextView().addEventListener("Focus",function(){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()}.bind(this)),h.getModel().addEventListener("Changing",function(a){if(this._getSaveDiffsEnabled()){var c=this._unsavedChanges.length,b=a.removedCharCount,d=a.start,e=a.start+b,g=0;a.addedCharCount===0?g=-1:b===0&&(g=1);if(c>0&&g===this.previousChangeType){c=this._unsavedChanges[c-
1];if(b===0&&d===c.end+c.text.length){c.text+=a.text;return}if(a.addedCharCount===0&&e===c.start){c.start=d;return}}this.previousChangeType=g;this._unsavedChanges.push({start:d,end:e,text:a.text})}}.bind(this)));this.dispatchEvent({type:"InputChanged",input:a,name:g,title:c,contentType:this.getContentType(),metadata:d,location:window.location,contents:b});if(!f)h.setInput(c,null,b),this._unsavedChanges=[],this.processParameters(a)}});return{InputManager:g}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages,require,orion/Deferred,orion/webui/littlelib,orion/compare/compareUtils,orion/compare/diffProvider,orion/compare/compareView,orion/highlight,orion/fileClient,orion/globalCommands,orion/commands,orion/keyBinding,orion/searchAndReplace/textSearcher,orion/editorCommands,orion/objects,orion/inputManager,orion/editor/editorFeatures,orion/URL-shim".split(","),function(f,k,j,d,b,i,a,h,g,e,c,l,n,m,r,q,s){function t(a){this._syntaxHighlither=
new h.SyntaxHighlighter(a)}k={};k.DefaultDiffProvider=function(){function a(c){this.serviceRegistry=c;this._diffProvider=new i.DiffProvider(c)}a.prototype={_resolveTwoFiles:function(a,c){var b=this;return j.all([b._getContentType(a),b._getContentType(c)],function(a){return{_error:a}}).then(function(d){if(Array.isArray(d)&&d.length===2&&d[0]&&d[1]){var e=d[0],d=d[1];return(new j).resolve({oldFile:{URL:a,Name:b._resolveFileName(a),Type:e},newFile:{URL:c,Name:b._resolveFileName(c),Type:d},diffContent:b._diffContent})}else return e=
a?b._resolveFileName(a):"",d=c?b._resolveFileName(c):"",(new j).resolve({oldFile:{URL:a,Name:e,Type:null},newFile:{URL:c,Name:d,Type:null},diffContent:b._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var c=this;return this._diffProvider.getDiffFileURI(a).then(function(a){return c._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,c,b){this._hasConflicts=b;if(c)return this._resolveTwoFiles(c,a);else if(this._diffProvider){var d=this;return d._diffProvider.getDiffContent(a).then(function(c){d._diffContent=d._hasConflicts?c.split("diff --git")[1]:c;return d._resolveComplexFileURL(a)},function(){})}else console.log("A diff provider is needed for compound diff URL")}};return a}();t.prototype={highlight:function(a,c,b){return this._syntaxHighlither.setup(c,b.getTextView(),null,a,!1)}};
k.ResourceComparer=function(){function h(c,b,i,j){this._registry=c;this._commandService=b;this._fileClient=new g.FileClient(c);this._fileClient=new g.FileClient(c);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(i,!0);this._compareView=i.toggleable?new a.toggleableCompareView(i.type==="inline"?"inline":"twoWay",j):i.type==="inline"?new a.inlineCompareView(j):new a.TwoWayCompareView(j);this._compareView.getWidget().setOptions({extCmdHolder:this});
j.highlighters||this._compareView.getWidget().setOptions({highlighters:[new t(c),new t(c)]});j.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:!0}});j.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:i.readonly}});this.initExtCmds();var k=this;this._inputManager=new q.InputManager({serviceRegistry:c,fileClient:k._fileClient,progressService:k._progress});r.mixin(this._inputManager,{filePath:"",getInput:function(){return this.filePath},setDirty:function(a){e.setDirtyIndicator(a)},
getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return k._compareView.getWidget().getEditors()[1]},setInput:function(a){this._parsedLocation={resource:a};k._progress.progress(k._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;if(k.options.savable){var c=d.node("pageActions");c&&(k._commandService.destroy(c),k._commandService.renderCommands(c.id,c,k._compareView.getWidget().getEditors()[1],k._compareView.getWidget().getEditors()[1],
"button"))}a&&this.setTitle(a.Location,a)}.bind(this),function(c){console.error("Error loading file metadata: "+c.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){var d;if(b)d=b.Name;e.setPageTarget({task:f.Compare,name:d,target:b,serviceRegistry:c,commandService:k._commandService,searchService:k._searchService,fileService:k._fileClient});a.charAt(0)==="*"?(e.setDirtyIndicator(!0),a.substring(1)):e.setDirtyIndicator(!1)},afterSave:function(){var a=k._compareView.getWidget().getEditors()[1].getTextView().getText();
k._compareView.getWidget().options.newFile.Content=a;k._compareView.getWidget().refresh()}});if(!i.readonly&&!i.toggleable&&this._compareView.getWidget().type==="twoWay")this._compareView.getWidget().options.newFile.keyBindingFactory=function(a,c,b,d){c=new n.TextSearcher(a,k._commandService,b);b=(new s.KeyBindingsFactory).createKeyBindings(a,b,d,c);(new m.EditorCommandFactory(k._registry,k._commandService,k._fileClient,k._inputManager,"pageActions",!1,"pageNavigationActions",c)).generateEditorCommands(a);
return b};this._compareView.getWidget().initEditors(f["fetching..."]);if(!i.readonly&&!i.toggleable&&this._compareView.getWidget().type==="twoWay"){var l=this._compareView.getWidget().getEditors();l[1].addEventListener("DirtyChanged",function(){this._inputManager.setDirty(l[1].isDirty())}.bind(this))}}h.prototype={_clearOptions:function(){this.options={}},setOptions:function(a,c){c&&this._clearOptions();if(!this.options)this.options={};a&&Object.keys(a).forEach(function(c){this.options[c]=a[c]}.bind(this))},
generateLink:function(a){a=a.getCurrentDiffPos();a=b.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;prompt(f["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return b.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,
conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,b=new c.Command({tooltip:f["Generate link of the current diff"],name:f["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},
callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),d=new c.Command({tooltip:f["Open the compare page"],name:f.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(b);this._commandService.addCommand(d);this._commandService.registerCommandContribution(a,
"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new l.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var c=[];a.forEach(function(a){c.push(this._loadSingleFile(a))}.bind(this));return j.all(c,function(a){return{_error:a}})},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(c){a.Content=c;return a}.bind(this),
function(c){if(c.status===404)a.Content="";return a}.bind(this))},start:function(){if(this.options.resource)if(this.options.diffProvider){var a=this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(c){a._compareView.getWidget().setOptions(c);var b=a._compareView.getWidget().options;b.oldFile.readonly=!0;if(a.options.readonly)b.newFile.readonly=!0;return a._getFilesContents(b.diffContent?[b.oldFile]:[b.oldFile,b.newFile]).then(function(){var c=
a._compareView.getWidget().refresh(!0);if(!a.options.readonly&&!a.options.toggleable&&a._compareView.getWidget().type==="twoWay")this._inputManager.filePath=a._compareView.getWidget().options.newFile.URL,a._inputManager.setInput(b.newFile.URL,a._compareView.getWidget().getEditors()[1]);return(new j).resolve(c)}.bind(a))})}else console.log("A diff provider is needed for Complex diff URL")}};return h}();return k});
define("orion/git/util",["i18n!git/nls/gitmessages","orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib"],function(f,k,j,d){function b(a){for(var b=0;b<h.length;b++)if(a.type===h[b])return!0;return!1}function i(b){for(var d=0;d<a.length;d++)if(b.type===a[d])return!0;return!1}var a=["Missing","Modified","Untracked","Conflicting"],h=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:b,isUnstaged:i,isChange:function(a){return b(a)||
i(a)},hasStagedChanges:function(a){for(var b=0;b<h.length;b++)if(a[h[b]].length>0)return!0;return!1},hasUnstagedChanges:function(b){for(var d=0;d<a.length;d++)if(b[a[d]].length>0)return!0;return!1},createCompareWidget:function(a,b,c,f,h,i,r,q,s){var t=new j.DefaultDiffProvider(a),i=new k.CompareCommandFactory({commandService:b,commandSpanId:i,gridRenderer:q});(new j.ResourceComparer(a,b,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:f,diffProvider:t,resource:c,compareTo:s,editableInComparePage:r},
{parentDivId:h,commandProvider:i})).start().then(function(a){var c=420;a<c&&(c=a);d.node(h).style.height=c+"px"})}}});
define("orion/dynamicContent",["require","orion/webui/littlelib","orion/webui/tooltip"],function(f,k,j){function d(a,b){if(a===void 0)throw Error("Missing reqired argument: id");if(b===void 0)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressSpinner:"}function b(a,b){if(a===void 0)throw Error("Missing reqired argument: id");if(b===void 0)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressDots:"}function i(a,
b){if(!a)throw Error("Missing reqired argument: objects");if(!b)throw Error("Missing reqired argument: populate");this._objects=a;this._populate=b}function a(){}function h(b){if(!b)throw Error("Missing required argument: model");this._model=b;this.use(new a)}d.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.src=f.toUrl("images/none.png");a.className="progressPane_running";this._anchor.appendChild(a)},stop:function(){var a=k.node(this._prefix+this._id);
a&&a.parentNode.removeChild(a)},error:function(a){var b=k.node(this._prefix+this._id);b.src=f.toUrl("images/problem.gif");b.className="";new j.Tooltip({node:b,text:a})}};d.prototype.constructor=d;b.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.style.textDecoration="blink";a.appendChild(document.createTextNode(" ..."));this._anchor.appendChild(a)},stop:function(){var a=k.node(this._prefix+this._id);a&&a.parentNode.removeChild(a)},error:function(a){var b=
k.node(this._prefix+this._id);b.parentNode.removeChild(b);var c=document.createElement("img");c.src=f.toUrl("images/problem.gif");this._anchor.appendChild(c);new j.Tooltip({node:b,text:a})}};b.prototype.constructor=b;i.prototype={getObjects:function(){return this._objects},getDetails:function(a){return this._populate(a)}};i.prototype.constructor=i;a.prototype={progressIndicator:b,setupProperties:{progressIndicators:[]},errorHandler:function(a,b){this.explorer.progressIndicators[a].error(b)}};a.prototype.constructor=
a;h.prototype={render:function(){var a=this;this._initialRender&&this._initialRender();for(var b=function(c){return function(){a._renderAfterItemPopulation(c);a.progressIndicators[c].stop()}},c=function(c){return function(b){if(a._errorHandler)a._errorHandler(c,b);else throw Error(b);}},d=0;d<this._model.getObjects().length;d++)this._renderBeforeItemPopulation(d),this.progressIndicators[d].start(),this._model.getDetails(d).then(b(d),c(d));this._cleanupRender&&this._cleanupRender()},use:function(a){for(var b in a)if(b===
"populateItem")this._populateItem=a.populateItem.bind(a),a.explorer=this;else if(b==="renderBeforeItemPopulation")this._renderBeforeItemPopulation=a.renderBeforeItemPopulation.bind(a),a.explorer=this;else if(b==="renderAfterItemPopulation")this._renderAfterItemPopulation=a.renderAfterItemPopulation.bind(a),a.explorer=this;else if(b==="errorHandler")this._errorHandler=a.errorHandler.bind(a),a.explorer=this;else if(b==="initialRender")this._initialRender=a.initialRender.bind(a),a.explorer=this;else if(b===
"cleanupRender")this._cleanupRender=a.cleanupRender.bind(a),a.explorer=this;else if(b==="progressIndicator")this.progressIndicator=a.progressIndicator,a.explorer=this;else if(b==="setupProperties"){for(var c in a.setupProperties)this[c]=a.setupProperties[c];a.explorer=this}}};h.prototype.constructor=h;return{DynamicContentModel:i,DynamicContentExplorer:h,DynamicContentRenderer:a,ProgressSpinner:d,ProgressDots:b}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(f){return{makeRelative:function(f){if(!f)return f;var j=window.location.protocol+"//"+window.location.host;return f.indexOf(j)===0?f.substring(j.length):f},isAtRoot:function(k){if(!k)return!1;if(k==="/workspace")return!0;var j=new URL(f.toUrl("workspace"),window.location.href);return(new URL(k,window.location.href)).href.indexOf(j.href)===0}}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(f){function k(f){this._prefix="/git/credentials";this._preferenceService=f.getService("orion.core.preference")}k.prototype={put:function(j,d){var b={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};if(d!==void 0){if(d.gitSshUsername!==void 0&&d.gitSshUsername!==null)b.gitSshUsername=d.gitSshUsername;if(d.gitSshPassword!==void 0&&d.gitSshPassword!==null)b.gitSshPassword=d.gitSshPassword;if(d.gitPrivateKey!==void 0&&
d.gitPrivateKey!==null)b.gitPrivateKey=d.gitPrivateKey;if(d.gitPassphrase!==void 0&&d.gitPassphrase!==null)b.gitPassphrase=d.gitPassphrase}var i=new f;this._preferenceService.getPreferences(this._prefix,2).then(function(a){var d=a.get("settings");d===void 0?i.reject():d.enabled?(a.put(j,b),i.resolve()):i.reject()});return i},get:function(j){var d={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},b=new f;this._preferenceService.getPreferences(this._prefix,2).then(function(f){var a=
f.get("settings");a===void 0?b.reject():a.enabled?(f=f.get(j),f!==void 0?b.resolve(f):b.resolve(d)):b.reject()});return b},isEnabled:function(){var j=new f;this._preferenceService.getPreferences(this._prefix,2).then(function(d){d=d.get("settings");d===void 0?j.resolve(!1):j.resolve(d.enabled)});return j},enable:function(){var j=new f;this._preferenceService.getPreferences(this._prefix,2).then(function(d){d.put("settings",{enabled:!0});j.resolve()});return j},disable:function(){var j=new f;this._preferenceService.getPreferences(this._prefix,
2).then(function(d){d.put("settings",{enabled:!1});j.resolve()});return j},remove:function(j){var d=new f;this._preferenceService.getPreferences(this._prefix,2).then(function(b){b.remove(j);d.resolve()});return d},getRepositories:function(){var j=new f;this._preferenceService.getPreferences(this._prefix,2).then(function(d){for(var b=[],d=d.keys(),f=0;f<d.length;++f)d[f]!=="settings"&&b.push(d[f]);j.resolve(b)});return j}};return k.prototype.constructor=k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(f){function k(f){this._prefix="/git/config";this._preferenceService=f.getService("orion.core.preference")}k.prototype={getConfig:function(){var j=new f;this._preferenceService.getPreferences(this._prefix).then(function(d){d=d.get("userInfo");j.resolve(d)});return j},setConfig:function(j){var d=new f;this._preferenceService.getPreferences(this._prefix).then(function(b){b.put("userInfo",j);d.resolve()});return d}};return k.prototype.constructor=
k});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(f,k){function j(d){this._init(d)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div id="header"></div>';j.prototype._init=function(d){var b=this;this.title="Git Push";this.modal=!0;this.messages=f;this.location=d.location;this.dialog2=d.dialog;this.func=d.func;this.buttons=[];this.buttons.push({callback:function(){b.destroy();b.dialog2.show()},text:"More"});this.buttons.push({callback:function(){b.destroy();b.func()},
text:"OK"});this._initialize()};j.prototype._bindToDom=function(){var d=this.$header;d.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));d.appendChild(document.createElement("br"));d.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};j.prototype.constructor=j;return{ConfirmPushDialog:j}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(f,k,j,d){function b(a,b){this.explorer=b;this._init(a)}function i(a){this._init(a)}var a=function(){function a(b,d,c,f){this.gitClient=b;this.rootPath=d;this.fetchItems=c;this.root=f?f:null}a.prototype=new j.ExplorerModel;a.prototype.getRoot=function(a){var b=this;this.root?a(this.root):this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})};
a.prototype.getIdentity=function(a){a.Location?(a=a.Location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):a="ROOT";return a};a.prototype.getChildren=function(a,b){a.children=[];if(a.Children){for(var c=0;c<a.Children.length;c++)a.Children[c].parent=a,a.children[c]=a.Children[c];b(a.Children)}else a.BranchLocation&&a.RemoteLocation?(a.children=[{GroupNode:"true",Location:a.BranchLocation,Name:"Branches",parent:a},{GroupNode:"true",Location:a.RemoteLocation,BranchLocation:a.BranchLocation,Name:"Remotes",
parent:a},{GroupNode:"true",Location:a.TagLocation,Name:"Tags",parent:a}],b(a.children)):a.GroupNode?this.gitClient.getGitBranch(a.Location).then(function(c){a.children=c.Children;for(var d=0;d<c.Children.length;d++)c.Children[d].parent=a;b(c.Children)}):a.Type==="Remote"&&this.gitClient.getGitBranch(a.Location).then(function(c){a.children=c.Children;for(var d=0;d<c.Children.length;d++)c.Children[d].parent=a;b(c.Children)})};return a}();b.prototype=new j.SelectionRenderer;b.prototype.constructor=
b;b.prototype.getLabelColumnIndex=function(){return 0};b.prototype.getCellElement=function(a,b,d){var c=document.createElement("td");d.appendChild(c);a=document.createElement("span");a.id=d.id+"navSpan";c.appendChild(a);a.className="mainNavColumn singleNavColumn";(b.children||b.Children||b.GroupNode||b.Type==="Remote"||b.BranchLocation&&b.RemoteLocation)&&this.getExpandImage(d,a);d=b.Name;b.Type==="RemoteTrackingBranch"&&!b.Id&&(d=b.Name+f[" [New branch]"]);a.appendChild(document.createTextNode(d))};
i.prototype=new k.Dialog;i.prototype.TEMPLATE='<div><div id="treeContentPane" style="width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"></div><div id="newBranchPane" style="padding: 8px"><label for="newBranch">${New Branch:}</label><input id="newBranch" value="" disabled=true/></div></div>';i.prototype._init=function(a){var b=this;this.title=a.title||f["Choose a Folder"];this.modal=!0;this.messages=f;this.func=a.func;this.treeRoot=a.treeRoot;this.gitClient=
a.gitClient;this.hideNewBranch=a.hideNewBranch;this.serviceRegistry=a.serviceRegistry;this.buttons=[];this.buttons.push({callback:function(){b.$remoteOk.classList.contains(this.DISABLED)||(b.destroy(),b._execute.bind(b)())},text:"OK",isDefault:!0,id:"remoteOk"})};i.prototype._bindToDom=function(){var a=this;this.$newBranch.addEventListener("input",function(){a._validate()});if(this.hideNewBranch)this.$newBranchPane.style.display="none"};i.prototype._beforeShowing=function(){this._initialize();this._loadRemoteChildren()};
i.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};i.prototype._loadRemoteChildren=function(){this._createTree(new a(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))};i.prototype._createTree=function(a){var f=this,e=this.serviceRegistry.getService("orion.remotePrompter.selection");e||(e=new d.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var c=new b({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=
new j.Explorer(this.serviceRegistry,e,c);c.explorer=this.explorer;this.explorer.createTree("treeContentPane",a);e.addEventListener("selectionChanged",function(a){f.$newBranch.disabled=a.selection&&a.selection.Type==="Remote"?!1:!0;f._validate(a.selection)})};i.prototype._validate=function(a){var b=function(a){a&&a.Type==="RemoteTrackingBranch"?this.$remoteOk.classList.remove(this.DISABLED):a&&a.Type==="Remote"&&this.$newBranch.value!==""?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};
a?b.bind(this)(a):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(b.bind(this))};i.prototype._execute=function(){var a=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(b){if(a.func)if(b.Type==="RemoteTrackingBranch")a.func(b,b.parent);else{var d=b.CloneLocation.substring(b.CloneLocation.indexOf(b.CloneLocation.split("/")[3])),c={};c.parent=b;c.FullName="refs/remotes/"+b.Name+"/"+a.$newBranch.value;c.Name=b.Name+"/"+a.$newBranch.value;
c.Type="RemoteTrackingBranch";c.Location="/gitapi/remote/"+b.Name+"/"+encodeURIComponent(a.$newBranch.value)+"/"+d;a.func(null,b,c)}})};i.prototype.constructor=i;return{RemotePrompterDialog:i}});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(f,k){function j(d){this._init(d)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div><div id="treeContentPane" style="padding: 8px"><label for="reviewReqUrl">${Paste link in email or IM}</label><br><input id="reviewReqUrl" style="width: 50em" value=""/></div><div id="newBranchPane" style="padding: 8px"><label for="reviewerName">${Send the link to the reviewer}</label><br><input id="reviewerName" style="width: 30em"  value=""/></div></div>';j.prototype._init=
function(d){var b=this;this.title=d.title||f["Contribution Review Request"];this.modal=!0;this.messages=f;this.url=d.url;this.func=d.func;this.buttons=[];this.buttons.push({callback:function(){b.destroy();b.func(b.$reviewerName.value)},text:f.Submit});this._initialize()};j.prototype._bindToDom=function(){this.$reviewReqUrl.value=this.url};j.prototype.constructor=j;return{ReviewRequestDialog:j}});
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,orion/util".split(","),function(f,k,j,d,b,i,a,h,g){function e(a,b,c,d,e,f){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function c(a){h.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=a.modelEventDispatcher?a.modelEventDispatcher:new h;this.modelEventDispatcher=b;var c=this;this._modelListeners={};"copy,copyMultiple,create,delete,deleteMultiple,import,move,moveMultiple".split(",").forEach(function(a){b.addEventListener(a,
c._modelListeners[a]=c.modelHandler[a].bind(c))});var d=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self";d.setTarget&&d.setTarget(a)}},{pid:"nav.config"})}e.prototype=new a.ExplorerModel;e.prototype.getRoot=function(a){a(this.root)};e.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};e.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){c.destroyed||b(c.processParent(a,d))}):b([])};e.prototype.hasChildren=function(){var a=!1;this.root.Children&&(a=this.root.Children.length>0);return a};e.prototype.constructor=e;c.prototype=Object.create(a.Explorer.prototype);c.prototype.destroy=function(){var b=this;Object.keys(this._modelListeners).forEach(function(a){b.modelEventDispatcher.removeEventListener(a,b._modelListeners[a])});a.Explorer.prototype.destroy.call(this)};c.prototype.modelHandler=
{copy:function(){},copyMultiple:function(a){var b=this,c={};a.items.forEach(function(a){a=a.newValue.Parents&&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,e=null;if(a.Projects)if(d.treeRoot.Location===b.Location){var f=d.treeRoot,b=c.ChildrenLocation?c:this.fileClient.read(c.ContentLocation,!0);j.when(b,function(a){d.dispatchEvent({type:"rootMoved",oldValue:f,newValue:a});d.loadResourceList(a)})}else e=d.isExpanded(b)&&b;else b.Directory&&(e=d.isExpanded(b)&&
c);d.changedItem(a,!0);e&&d.changedItem(e,!0)},moveMultiple:function(){this.changedItem(this.treeRoot,!0)}};var l;c.prototype._makeDropTarget=function(a,c,e){function h(a,c,d,e,g,j){c=c||"";if(a.isFile)i.isAtRoot(d.Location)?e.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:f["You cannot copy files directly into the workspace.  Create a folder first."]}):a.file(function(a){g(d,a,e,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(b.formatMessage(f["Unzip ${0}?"],
a.name)))});else if(a.isDirectory){var k=a.createReader(),l=function(b){k.readEntries(function(d){for(var f=0;f<d.length;f++)h(d[f],c+a.name+"/",b,e,g,j)})},n=e.registry.getService("orion.page.progress");i.isAtRoot(d.Location)?n.progress(j.createProject(d.ChildrenLocation,a.name),"Initializing project "+a.name).then(function(a){e.loadResourceList(e.treeRoot.Path,!0);n.progress(j.read(a.ContentLocation,!0),"Loading project info "+a.name).then(function(a){l(a)})}):n.progress(j.createFolder(d.Location,
a.name),"Creating folder "+a.name).then(function(a){e.changedItem(d,!0);l(a)})}}if(this.dragAndDrop){var j=this,k=this.dragAndDrop,p=function(a){l=a.target};if(e)this._oldDragStart&&c.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=p;c.addEventListener("dragstart",p,!1);p=function(){l=null};if(e)this._oldDragEnd&&c.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=p;c.addEventListener("dragend",p,!1);p=function(a){c.classList.remove("dragOver");a.preventDefault();
a.stopPropagation()};if(e)this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=p;c.addEventListener("dragleave",p,!1);p=function(a){if(!g.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";c.classList.add("dragOver");d.stop(a)};if(e)this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=p;c.addEventListener("dragenter",
p,!1);p=function(a){if(!g.isIE&&(a.dataTransfer.effectAllowed==="all"||a.dataTransfer.effectAllowed==="uninitialized"||a.dataTransfer.effectAllowed.indexOf("copy")>=0))a.dataTransfer.dropEffect="copy";d.stop(a)};if(e&&!this._oldDragOver)c.addEventListener("dragover",p,!1),this._oldDragOver=p;p=function(e){c.classList.remove("dragOver");if(l){var g=j.fileClient,p=l.href,o=p.indexOf("#"),p=p.substring(o+1),w=j.registry.getService("orion.page.progress");w.showWhile(g.copyFile(p,a.Location),b.formatMessage(f["Copying ${0}"],
p)).then(function(){j.changedItem(a,!0)},function(a){w?w.setProgressResult(a):window.console.log(a)})}else if(e.dataTransfer.items&&e.dataTransfer.items.length>0)for(g=0;g<e.dataTransfer.items.length;g++)p=null,typeof e.dataTransfer.items[g].getAsEntry==="function"?p=e.dataTransfer.items[g].getAsEntry():typeof e.dataTransfer.items[g].webkitGetAsEntry==="function"&&(p=e.dataTransfer.items[g].webkitGetAsEntry()),p&&h(p,null,a,j,k,j.fileClient);else if(e.dataTransfer.files&&e.dataTransfer.files.length>
0)for(g=0;g<e.dataTransfer.files.length;g++)p=e.dataTransfer.files[g],!p.length&&(!p.type||p.type==="")?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:b.formatMessage(f["Did not drop ${0}.  Folder drop is not supported in this browser."],p.name)}):i.isAtRoot(a.Location)?j.registry.getService("orion.page.message").setProgressResult({Severity:"Error",Message:f["You cannot copy files directly into the workspace.  Create a folder first."]}):k(a,p,j,p.name.indexOf(".zip")===
p.name.length-4&&window.confirm(b.formatMessage(f["Unzip ${0}?"],p.name)));d.stop(e)};if(e)this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=p;c.addEventListener("drop",p,!1)}};c.prototype.changedItem=function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=this,d=new j;a.children=null;this.model.getChildren(a,function(e){c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,e,b);d.resolve(e)});return d};c.prototype.isExpanded=
function(a){return this.renderer.tableTree.isExpanded(this.model.getId(a))};c.prototype.getNameNode=function(a){if(a=this.model.getId(a))return d.node(a+"NameLink")};c.prototype.scopeUp=function(){};c.prototype.scopeDown=function(){};c.prototype.loadResourceList=function(a,b,c){a&&typeof a==="object"&&(a=a.ChildrenLocation||a.ContentLocation);a=i.makeRelative(a);if(!b&&a===this._lastPath)return(new j).resolve(this.treeRoot);this._lastPath=a;var d=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),
"Loading "+a).then(function(){d.treeRoot.Path=a;typeof c==="function"&&c();d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new j).resolve(d.treeRoot)},function(a){d.treeRoot.Path=null;d.dispatchEvent({type:"rootChanged",root:d.treeRoot});return(new j).reject(a)}):(new j).resolve(d.treeRoot)};c.prototype.load=function(a,b,c){var f=d.node(this.parentId),g=d.node("progress");if(!g)g=document.createElement("div"),g.id="progress",d.empty(f),f.appendChild(g);d.empty(g);var h=setTimeout(function(){d.empty(g);
g.appendChild(document.createTextNode(b))},500),i=this;return j.when(a,function(a){clearTimeout(h);if(!i.destroyed){i.treeRoot={};for(var b in a)i.treeRoot[b]=a[b];i.model=new e(i.registry,i.treeRoot,i.fileClient,i.parentId,i.excludeFiles,i.excludeFolders);i.model.processParent(i.treeRoot,a.Children);if(i.dragAndDrop)i._hookedDrag?i._makeDropTarget(i.treeRoot,f,!0):(a=(a=f&&("draggable"in f||"ondragstart"in f&&"ondrop"in f))&&!(!window.File||!window.FileList||!window.FileReader),i._hookedDrag=!0,
a?i._makeDropTarget(i.treeRoot,f,!0):(i.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser.")));i.createTree(i.parentId,i.model,{navHandlerFactory:i.navHandlerFactory,setFocus:typeof i.setFocus==="undefined"?!0:i.setFocus,selectionPolicy:i.renderer.selectionPolicy,onCollapse:function(a){if(i.getNavHandler())i.getNavHandler().onCollapse(a)}});if(typeof c==="function")try{c()}catch(d){i.registry&&i.registry.getService("orion.page.message").setErrorMessage(d)}if(typeof i.onchange===
"function")i.onchange(i.treeRoot);return(new j).resolve(i.treeRoot)}},function(a){clearTimeout(h);i.registry.getService("orion.page.message").setProgressResult(a);return(new j).reject(a)})};c.prototype.onchange=function(){};c.prototype.constructor=c;return{FileExplorer:c,FileModel:e}});
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(f,k,j,d,b,i,a,h){function g(a,b){this.explorer=b;this._init(a)}function e(a){this._init(a)}g.prototype=new a.SelectionRenderer;g.prototype.constructor=g;g.prototype.getLabelColumnIndex=function(){return 0};g.prototype.getCellElement=
function(a,b,d){a=document.createElement("td");d.appendChild(a);var e=document.createElement("span");e.id=d.id+"navSpan";a.appendChild(e);e.className="mainNavColumn singleNavColumn";this.getExpandImage(d,e);e.appendChild(document.createTextNode(b.Name))};e.prototype=new j.Dialog;e.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>';
e.prototype._init=function(a){this.title=a.title||f["Choose a Folder"];this.modal=!0;this.buttons=[{text:f.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()};e.prototype._bindToDom=function(){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
e.prototype.loadFolderList=function(a){a=d.makeRelative(a);this.selection=new b.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new h.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(a){return new g({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},a)}});this.explorer.loadResourceList(a,!0,null)};e.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};e.prototype.constructor=e;return{DirectoryPrompterDialog:e}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","orion/URITemplate","require"],function(f,k,j,d,b){function i(a){this._init(a)}var a=new d("edit/edit.html#{,resource,params*}");i.prototype=new j.Dialog;i.prototype.TEMPLATE='<span id="basicPane"><div style="padding: 8px"><label for="gitUrl">${Repository URL:}</label><input id="gitUrl" style="width: 50em" value=""/></div><div style="padding: 8px; text-align: right;"><a id="advancedLink" href="javascript:">${Choose target location}</a><a id="advancedLinkHide" href="javascript:" style="display: none">${Default target location}</a></div></span><span id="advancedPane" style="display: none;"><div style="padding: 8px"><input id="isNewProject" type="radio" name="isNewProject" checked value="new"/><label for="gitName" style="padding: 0 8px">${New folder:}</label><input id="gitName" value=""></div><div style="padding: 8px"><input id="isExistingProject" type="radio" name="isNewProject" value="existing"/><label for="gitPath" style="padding: 0 8px">${Existing directory:}</label><input id="gitPath" type="hidden" value=""><span id="shownGitPath" style="padding-right: 24px"></span><a id="changeGitPath" href="javascript:">${Change...}</a></div></span>';i.prototype._init=
function(a){var b=this;this.title=a.title?a.title:f["Clone Git Repository"];this.modal=!0;this.messages=f;this.advancedShown=!1;this.alwaysShowAdvanced=a.alwaysShowAdvanced;this.advancedOnly=a.advancedOnly;this.url=a.url;this.serviceRegistry=a.serviceRegistry;this.fileClient=a.fileClient;this.func=a.func;this.buttons=[];this.buttons.push({callback:function(){b.destroy();b._execute()},text:"OK"});this._initialize()};i.prototype._bindToDom=function(){var a=this;if(this.url)this.$gitUrl.value=this.url;
if(this.advancedOnly)this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){a.$gitName.focus()},400);this.$changeGitPath.addEventListener("click",function(){a._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(){a._checkNewExisting()});this.$isNewProject.addEventListener("click",function(){a._checkNewExisting()});this.$gitName.addEventListener("focus",function(){a._showNewProject()});this.$advancedLink.addEventListener("click",
function(){a._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(){a._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};i.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};i.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";this.$advancedLink.style.display=
"none";this.$advancedLinkHide.style.display=""};i.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};i.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};i.prototype._showNewProject=function(){this.$isNewProject.checked=!0};i.prototype._openDirectoryPickerDialog=function(){function d(c){var e=document.createElement("a");
e.href=b.toUrl(a.expand({resource:c.ChildrenLocation}));e.textContent=c.Name;return e}var g=this;this.$isExistingProject.checked=!0;var e=new k.DirectoryPrompterDialog({title:f["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(a){if(a&&a.Location){for(g.$gitPath.value=a.Location;g.$shownGitPath.hasChildNodes();)g.$shownGitPath.removeChild(g.$shownGitPath.lastChild);for(g.$shownGitPath.appendChild(d(a));a.parent&&a.parent.Location!=="/";)g.$shownGitPath.insertBefore(document.createTextNode("/"),
g.$shownGitPath.firstChild),g.$shownGitPath.insertBefore(d(a.parent),g.$shownGitPath.firstChild),a=a.parent}}});this._addChildDialog(e);e.show()};i.prototype.constructor=i;return{CloneGitRepositoryDialog:i}});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog"],function(f,k,j){function d(b){this._init(b)}d.prototype=new j.Dialog;d.prototype.TEMPLATE='<div id="gitCredentialsLabel" style="padding: 8px">${Repository URL:}<strong id="url"></strong></div><div id="gitSshUsernameRow" style="padding: 8px"><label id="gitSshUsernameLabel" for="gitSshUsername">${Username:}</label><input id="gitSshUsername" value=""></div><div id="gitSshPasswordRow" style="padding: 8px"><input id="isSshPassword" type="radio" name="isSshPassword" checked value="password"/><label id="gitSshPasswordLabel" for="gitSshPassword" style="padding: 0 8px">${Ssh password:}</label><input type="password" id="gitSshPassword" value="" style="width: 30em"></div><div style="padding: 8px"><div id="gitPrivateKeyRow"><input id="isPrivateKey" type="radio" name="isSshPassword" value="privateKey" style="vertical-align: top"/><label id="gitPrivateKeyLabel" for="gitPrivateKey" style="padding: 0 8px; vertical-align: top">${Private key:}</label><textarea id="gitPrivateKey" value=""></textarea></div><div id="gitPrivateKeyFileRow" style="padding-left: 8em"><label id="gitPrivateKeyFileLabel" for="gitPrivateKeyFile">${Private key file (optional):}</label><br><input id="gitPrivateKeyFile" multiple="false" type="file" size="53" label="Browse..."></div><div id="gitPassphraseRow" style="padding-left: 8em"><label id="gitPassphraseLabel" for="gitPassphrase">${Passphrase (optional):}</label><br><input type="password" id="gitPassphrase" value="" style="width: 30em"></div></div><div id="gitSaveCredentialsRow" style="padding: 8px"><img id="gitSaveCredentialsInfo" src="/images/info.gif""><input id="gitSaveCredentials" type="checkbox" name="gitSaveCredentials"><label id="gitSaveCredentialsLabel" for="gitSaveCredentials">${Don\'t prompt me again:}</label></div>';d.prototype._init=
function(b){var d=this;this.title=b.title||f["Git Credentials"];this.modal=!0;this.messages=f;this.options=b;if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase)this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0;if(b.serviceRegistry)this._sshService=b.serviceRegistry.getService("orion.net.ssh"),this._progressService=b.serviceRegistry.getService("orion.page.progress");this.buttons=[];this.buttons.push({callback:function(){d.destroy();
d._execute()},text:"OK",isDefault:!0});this._initialize()};d.prototype._bindToDom=function(){var b=this;if(!this.options.username)this.$gitSshUsernameRow.style.display="none";if(!this.options.password)this.$gitSshPasswordRow.style.display="none";if(!this.options.privatekey)this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none";if(!this.options.passphrase)this.$gitPassphraseRow.style.display="none";if(this.options.errordata&&this.options.errordata.Url)this.$gitCredentialsLabel.style.display=
"block",this.$url.textContent=this.options.errordata.Url;if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!=="")this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){b.$gitSshPassword.focus()},400);(new k(this.options.serviceRegistry)).isEnabled().then(function(d){if(!d)b.$gitSaveCredentials.style.display="none",b.$gitSaveCredentialsLabel.style.display="none",b.$gitSaveCredentialsInfo.style.display=
"none"});this.$gitSshPassword.addEventListener("focus",function(){b.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(){b.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",function(d){b.privateKeyFile=d.target.files[0]})};d.prototype._execute=function(){var b=this,d=this.$gitPrivateKey.value,
a=this.$url.textContent,f=function(a){if(b._sshService)b._sshService.getKnownHosts().then(function(c){if(b.options.func){var d=typeof b.options.failedOperation==="undefined"?b.options.errordata.failedOperation:b.options.failedOperation;d!=="undefined"&&b._progressService.removeOperation(d);b.options.func({gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$isSshPassword.checked?b.$gitSshPassword.value:"",gitPrivateKey:b.$isPrivateKey.checked?a:"",gitPassphrase:b.$isPrivateKey.checked?b.$gitPassphrase.value:
"",knownHosts:c})}});else if(b.options.func){var c=typeof b.options.failedOperation==="undefined"?b.options.errordata.failedOperation:b.options.failedOperation;c!=="undefined"&&b._progressService.removeOperation(c);b.options.func({gitSshUsername:b.$gitSshUsername.value,gitSshPassword:b.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:b.$gitPassphrase.value,knownHosts:b.$gitSshKnownHosts.value})}};if(this.privateKeyFile){var g=new FileReader;g.onload=function(){return function(e){d=e.target.result;
e=new k(b.options.serviceRegistry);b.$gitSaveCredentials.checked?e.put(a,{gitPrivateKey:d,gitPassphrase:b.$gitPassphrase.value}).then(function(){f(d)}):f(d)}}(this.privateKeyFile);g.readAsText(this.privateKeyFile)}else d.length>0?(g=new k(b.options.serviceRegistry),b.$gitSaveCredentials.checked?g.put(a,{gitPrivateKey:d,gitPassphrase:b.$gitPassphrase.value}).then(function(){f(d)}):f(d)):(g=new k(b.options.serviceRegistry),b.$gitSaveCredentials.checked?g.put(a,{gitSshUsername:b.$gitSshUsername.value,
gitSshPassword:b.$gitSshPassword.value}).then(function(){f(d)}):f(d))};d.prototype.constructor=d;return{GitCredentialsDialog:d}});
define("orion/git/widgets/OpenCommitDialog","require,i18n!git/nls/gitmessages,orion/i18nUtil,orion/Deferred,orion/webui/dialog,orion/URITemplate,orion/webui/littlelib".split(","),function(f,k,j,d,b,i,a){function h(a){this._init(a)}var g=new i("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");h.prototype=new b.Dialog;h.prototype.TEMPLATE='<div><label for="resourceName">${Type the commit name (sha1):}</label></div><div><input type="text" id="resourceName"></div><div id="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>';h.prototype._init=
function(a){this.title=a.title||k["Find Commit"];this.modal=!0;this.messages=k;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=a.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=a.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=a.commitName;this._initialize()};h.prototype._bindToDom=function(){var b=this;this.$resourceName.addEventListener("input",
function(){b.time=+new Date;b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(c){if(c.keyCode===a.KEY.ENTER){var d=a.$("a",b.$results);d&&(a.stop(c),window.open(d.href),b.hide())}},!1);this.$resourceName.value=this.commitName};h.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var a=(new Date).getTime();a-this.time>this.SEARCH_DELAY?(this.time=a,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};h.prototype._findCommitLocation=function(a,b,f){var g=this;f||(f=new d);a.length>0?this.serviceRegistry.getService("orion.page.progress").progress(g.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b+a[0].ContentLocation+"?page=1&pageSize=1"),"Getting commit details "+b).then(function(a){f.resolve(a.Children[0])},function(){g._findCommitLocation(a.slice(1),b,f)}):f.reject();return f};h.prototype._doSearch=function(){var b=this,c=this.$resourceName&&this.$resourceName.value;
if(c){var d=document.createElement("div");d.appendChild(document.createTextNode(k["Searching..."]));a.empty(this.$results);this.$results.appendChild(d);this.serviceRegistry.getService("orion.page.message").setProgressMessage(k["Looking for the commit"]);this._findCommitLocation(this.repositories,c).then(function(c){a.empty(b.$results);b._displayCommit(c,b.$results);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(){var c=document.createElement("div");c.appendChild(document.createTextNode("No commits found"));
a.empty(b.$results);b.$results.appendChild(c);b.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};h.prototype._displayCommit=function(b,c){var d=this,h=document.createElement("div");h.style.padding="10px";h.style.maxWidth="480px";a.empty(c);c.appendChild(h);var i=b.Message.split(/(\r?\n|$)/)[0],r=document.createElement("a");r.className="navlinkonpage";r.href=f.toUrl(g.expand({resource:b.Location}));r.textContent=i;h.appendChild(r);r.addEventListener("mouseup",function(a){a.button===
0&&!a.ctrlKey&&!a.metaKey&&d.hide()},!1);r.addEventListener("keyup",function(b){b.keyCode===a.KEY.ENTER&&d.hide()},!1);i=document.createElement("div");i.style.paddingTop="15px";h.appendChild(i);if(b.AuthorImage)h=new Image,h.src=b.AuthorImage,h.name=b.AuthorName,h.className="git-author-icon",i.appendChild(h);h=document.createElement("div");h.textContent=j.formatMessage(k[" authored by ${0} {${1}) on ${2}"],b.AuthorName,b.AuthorEmail,(new Date(b.Time)).toLocaleString());i.appendChild(h);h=document.createElement("div");
h.textContent=j.formatMessage(k["committed by 0 (1)"],b.CommitterName,b.CommitterEmail);i.appendChild(h);h=document.createElement("div");h.style.paddingTop="15px";h.textContent=k["commit:"]+b.Name;i.appendChild(h);if(b.Parents&&b.Parents.length>0)c=document.createElement("div"),c.textContent=k["parent:"],h=document.createElement("a"),h.className="navlinkonpage",h.href=f.toUrl(g.expand({resource:b.Parents[0].Location})),h.textContent=b.Parents[0].Name,c.appendChild(h),h.addEventListener("mouseup",
function(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&d.hide()},!1),h.addEventListener("keyup",function(b){b.keyCode===a.KEY.ENTER&&d.hide()},!1),i.appendChild(c)};h.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};h.prototype.constructor=h;return{OpenCommitDialog:h}});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(f,k){function j(d){this._init(d)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="display: none; padding-top: 10px; padding-bottom: 10px;" id="commitInfoBar"><strong id="commitInfo"></strong></div><div style="padding:4px"><label id="commitMessageLabel" for="commitMessage">${Message:}</label><input id="commitMessage" style="width: 30em" value=""></div><div style="padding:4px"><label id="amendLabel" for="amend">${Amend:}</label><input id="amend" type="checkbox"></div><div style="padding:4px"><label id="committerNameLabel" for="committerName">${Committer Name:}</label><input id="committerName" style="width: 30em" value=""></div><div style="padding:4px"><label id="committerEmailLabel" for="committerEmail">${Committer Email:}</label><input id="committerEmail" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorNameLabel" for="authorName">${Author Name:}</label><input id="authorName" style="width: 30em" value=""></div><div style="padding:4px"><label id="authorEmailLabel" for="authorEmail">${Author Email:}</label><input id="authorEmail" style="width: 30em" value=""></div>';j.prototype._init=
function(d){var b=this;this.title=f["Commit Changes"];this.modal=!0;this.messages=f;this.options=d;this.buttons=[];this.buttons.push({callback:function(){b._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};j.prototype._bindToDom=function(){var d=this;if(this.options.body.Message)this.$commitMessage.value=this.options.body.Message;this.$commitMessage.addEventListener("keyup",function(){d._validate()});if(this.options.body.Amend)this.$amend.checked=!0;if(this.options.body.CommitterName)this.$committerName.value=
this.options.body.CommitterName;this.$committerName.addEventListener("keyup",function(){d._validate()});if(this.options.body.CommitterEmail)this.$committerEmail.value=this.options.body.CommitterEmail;this.$committerEmail.addEventListener("keyup",function(){d._validate()});if(this.options.body.AuthorName)this.$authorName.value=this.options.body.AuthorName;this.$authorName.addEventListener("keyup",function(){d._validate()});if(this.options.body.AuthorEmail)this.$authorEmail.value=this.options.body.AuthorEmail;
this.$authorEmail.addEventListener("keyup",function(){d._validate()});this._validate()};j.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=f["The author mail is required."]):
(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=f["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=f["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=f["The committer name is required."]):(this.$commitInfoBar.style.display=
"block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=f["The commit message is required."])};j.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var d={};d.Message=this.$commitMessage.value;d.Amend=this.$amend.checked?!0:!1;d.CommitterName=this.$committerName.value;d.CommitterEmail=this.$committerEmail.value;d.AuthorName=this.$authorName.value;d.AuthorEmail=this.$authorEmail.value;this.options.func(d)}this.hide()}};
j.prototype.constructor=j;return{CommitDialog:j}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(f,k){function j(d){this._init(d)}j.prototype=new k.Dialog;j.prototype.TEMPLATE='<div style="padding:4px"><input type="radio" name="radio" value="urlRadio" id="urlRadio" checked/>'+f["URL:"]+'<input type="text" name="url" id="url"/></div><div style="padding:4px"><input type="radio" name="radio" value="fileRadio" id="fileRadio"/>'+f["File:"]+'<input type="file" name="selectedFile" id="selectedFile" class="uploadChooser" /></div>';j.prototype._init=
function(d){var b=this;this.title=f["Apply Patch"];this.modal=!0;this.messages=f;this.options=d;this.buttons=[];this.buttons.push({callback:function(){b._applyPatch()},text:f.OK});this._initialize()};j.prototype._bindToDom=function(){this.$selectedFile.onchange=function(){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=function(){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};j.prototype._applyPatch=function(){var d=new FormData;
d.append("uploadedfile",this.$selectedFile.files[0]);d.append("url",this.$url.value);d.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(d)};j.prototype.handleReadyState=function(){this.req.readyState===4&&(this.req.status===200?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):
this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};j.prototype.constructor=j;return{ApplyPatchDialog:j}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages,require,orion/Deferred,orion/i18nUtil,orion/webui/littlelib,orion/commands,orion/commandRegistry,orion/git/util,orion/compare/compareUtils,orion/git/gitPreferenceStorage,orion/git/gitConfigPreference,orion/git/widgets/ConfirmPushDialog,orion/git/widgets/RemotePrompterDialog,orion/git/widgets/ReviewRequestDialog,orion/git/widgets/CloneGitRepositoryDialog,orion/git/widgets/GitCredentialsDialog,orion/git/widgets/OpenCommitDialog,orion/git/widgets/CommitDialog,orion/git/widgets/ApplyPatchDialog,orion/URL-shim,orion/PageLinks,orion/URITemplate".split(","),function(f,
k,j,d,b,i,a,h,g,e,c,l,n,m,r,q,s,t,p,x,u,v){var o={};(function(){function w(a){return k.toUrl(C.expand({resource:a}))}function y(a){var b;try{b=JSON.parse(a.responseText)}catch(c){b={Message:f["Problem while performing the action"]}}b.HttpCode=a.status;return b}var B=!1,x=new v("git/git-repository.html#{,resource,params*}"),G=new v("git/git-log.html#{,resource,params*}?page=1"),z=new v("git/git-log.html#{,resource,params*}"),A=new v("git/git-commit.html#{,resource,params*}?page=1&pageSize=1"),C=new v(h.statusUILocation+
"#{,resource,params*}"),I=new v("edit/edit.html#{,resource,params*}");o.updateNavTools=function(a,c,d,e,f,g,h){var i=b.node(e);if(i)c.destroy(i);else throw"could not find toolbar "+e;c.renderCommands(e,i,g,d,"button");if(h&&(e=b.node(h)))c.destroy(e),c.renderCommands(h,e,g,d,"button");if(f&&(g=b.node(f)))c.destroy(f),c.renderCommands(f,g,null,d,"button");B||(B=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=b.node(f);e&&(c.destroy(e),c.renderCommands(f,
e,a.selections,d,"button"))}))};o.handleKnownHostsError=function(a,b,c,e){if(confirm(d.formatMessage(f["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var g=a.getService("orion.net.ssh");g.addKnownHosts(b.Host+" "+b.KeyType+" "+b.HostKey).then(function(){g.getKnownHosts().then(function(b){c.knownHosts=b;typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation);e(c)})})}};
o.handleSshAuthenticationError=function(a,b,c,d,f){var b=b?b.Url:void 0,g=function(){(new q.GitCredentialsDialog({title:f,serviceRegistry:a,func:d,errordata:c.errordata,failedOperation:c.failedOperation})).show()};c.gitSshUsername&&c.gitSshUsername!==""||c.gitSshPassword&&c.gitSshPassword!==""||c.gitPrivateKey&&c.gitPrivateKey!==""?g():(new e(a)).get(b).then(function(b){b.gitPrivateKey!==""||b.gitSshUsername!==""||b.gitSshPassword!==""?(typeof c.failedOperation!=="undefined"&&a.getService("orion.page.progress").removeOperation(c.failedOperation),
d({knownHosts:c.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):g()},g)};o.getDefaultSshOptions=function(a,b){var c=new j,d=a.getService("orion.net.ssh"),e=b&&!b.optionsRequested?b.valueFor("sshuser"):"",f=b&&!b.optionsRequested?b.valueFor("sshpassword"):"";d.getKnownHosts().then(function(a){c.resolve({knownHosts:a,gitSshUsername:e,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})});return c};o.handleProgressServiceResponse=
function(a,b,c,d,e,f){a&&a.status!==void 0&&(a=y(a));if(!a||a.HttpCode===void 0)d&&d(a);else switch(a.HttpCode){case 401:if(a.JsonData)b.errordata=a.JsonData;if(a.failedOperation)b.failedOperation=a.failedOperation;o.handleSshAuthenticationError(c,a.JsonData,b,e,f);break;case 400:if(a.JsonData&&a.JsonData.HostKey){if(a.failedOperation)b.failedOperation=a.failedOperation;o.handleKnownHostsError(c,a.JsonData,b,e);break}else if(a.JsonData&&a.JsonData.Host){if(a.JsonData)b.errordata=a.JsonData;if(a.failedOperation)b.failedOperation=
a.failedOperation;o.handleSshAuthenticationError(c,a.JsonData,b,e,f);break}default:b=[],b.Severity="Error",b.HTML=!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,c.getService("orion.page.message").setProgressResult(b),d&&d(a)}};o.gatherSshCredentials=function(a,b,c){var g=new j,h;if(b.items.RemoteLocation!==void 0)h=b.items.RemoteLocation[0].GitUrl;else if(b.items.GitUrl!==void 0)h=b.items.GitUrl;else if(b.items.errorData!==void 0)h=b.items.errorData.Url;else if(b.items.toRef!==void 0)h=
b.items.toRef.RemoteLocation[0].GitUrl;var i=function(c){a.getService("orion.net.ssh").getKnownHosts().then(function(a){b.sshObject=c;g.resolve({knownHosts:a,gitSshUsername:c.gitSshUsername,gitSshPassword:c.gitSshPassword,gitPrivateKey:c.gitPrivateKey,gitPassphrase:c.gitPassphrase})})},k=b.errorData;if(k&&k.HostKey)return confirm(d.formatMessage(f["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],k.KeyType,k.Host,k.HostFingerprint))&&a.getService("orion.net.ssh").addKnownHosts(k.Host+
" "+k.KeyType+" "+k.HostKey).then(function(){b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new e(a)).get(h).then(function(a){i(a)},function(){i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})}),g;var l=function(){if(!b.parameters&&!b.optionsRequested)i({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&
!b.optionsRequested){var d=b.parameters?b.parameters.valueFor("sshuser"):"",f=b.parameters?b.parameters.valueFor("sshpassword"):"",g=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,j=new e(a);g?j.put(h,{gitSshUsername:d,gitSshPassword:f}).then(function(){i({gitSshUsername:d,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}):i({gitSshUsername:d,gitSshPassword:f,gitPrivateKey:"",gitPassphrase:""})}else(new q.GitCredentialsDialog({title:c,serviceRegistry:a,
func:i,errordata:k})).show()};b.sshObject&&(b.sshObject.gitSshUsername!==""||b.sshObject.gitSshPassword!==""||b.sshObject.gitPrivateKey!=="")?l():(new e(a)).get(h).then(function(a){a.gitPrivateKey!==""||a.gitSshUsername!==""||a.gitSshPassword!==""?i(a):l()},l);return g};o.handleGitServiceResponse=function(a,b,c,d){a&&a.status!==void 0&&(a=y(a));if(!a||!a.HttpCode)c&&c(a);else switch(a.HttpCode){case 401:d(a);break;case 400:if(a.JsonData&&a.JsonData.HostKey){d(a);break}default:d=[],d.Severity="Error",
d.HTML=!1,d.Message=a.DetailedMessage?a.DetailedMessage:a.Message,b.getService("orion.page.message").setProgressResult(d),c&&c(a)}};o.createFileCommands=function(b,c,h){function y(a){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:f["Problem while performing the action"]}catch(e){c.Message=f["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(c)}var p=new a.ParametersDescription([new a.CommandParameter("name",
"text",f["Local Branch Name:"])]),p=new i.Command({name:f.Checkout,tooltip:f["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:p,callback:function(a){var c=a.items,e=function(a,c,e){b.getService("orion.page.progress").showWhile(b.getService("orion.git.provider").checkoutTag(a,c,e),d.formatMessage(f["Checking out tag ${0}"],e)).then(function(){h.changedItem()},y)},g=c.Repository?
c.Repository.Location:c.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(g,c.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.Type==="Tag"}});c.addCommand(p);p=new i.Command({name:f.Checkout,tooltip:f["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",
id:"eclipse.checkoutBranch",callback:function(a){var c=a.items,e=b.getService("orion.git.provider"),g=b.getService("orion.page.message"),i=b.getService("orion.page.progress");g.setProgressMessage(c.Name?d.formatMessage(f["Checking out branch ${0}..."],c.Name):f["Checking out branch..."]);c.Type==="Branch"?i.progress(e.checkoutBranch(c.CloneLocation,c.Name),"Checking out branch "+c.Name).then(function(){g.setProgressResult(f["Branch checked out."]);h.changedItem(c.parent)},function(a){y(a)}):i.progress(e.addBranch(c.Repository?
c.Repository.BranchLocation:c.parent.parent.BranchLocation,null,c.Name),"Adding branch "+c.Name).then(function(a){i.progress(e.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+c.Name).then(function(){g.setProgressResult(f["Branch checked out."]);h.changedItem(c.Repository?c.Repository.BranchLocation:c.parent.parent.parent)},function(a){y(a)})},function(a){y(a)})},visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});c.addCommand(p);p=new a.ParametersDescription([new a.CommandParameter("name",
"text","Name:")]);p=new i.Command({name:f["New Branch"],tooltip:f["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:p,callback:function(a){var c=a.items,d=b.getService("orion.page.progress"),e=function(a,e){d.progress(b.getService("orion.git.provider").addBranch(a,e),"Adding branch "+e).then(function(){h.changedItem(c)},y)},f;f=c.Type==="Clone"?c.BranchLocation:c.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(f,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.GroupNode&&a.Name==="Branches"||a.Type==="Clone"&&h.parentId==="artifacts"}});c.addCommand(p);p=new i.Command({name:f.Delete,tooltip:f["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var c=a.items,a=b.getService("orion.page.progress");confirm(d.formatMessage(f["Are you sure you want to delete branch ${0}?"],c.Name))&&a.progress(b.getService("orion.git.provider").removeBranch(c.Location),
"Removing branch "+c.Name).then(function(){h.changedItem?h.changedItem(c.parent):h.displayBranches&&h.displayBranches(c.ParentLocation,null)},y)},visibleWhen:function(a){return a.Type==="Branch"&&!a.Current}});c.addCommand(p);p=new i.Command({name:f.Delete,tooltip:f["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var c=a.items,e=b.getService("orion.page.progress");confirm(d.formatMessage(f["You're going to delete remote branch ${0} and push the change."],
c.Name)+"\n\n"+f["Are you sure?"])&&o.getDefaultSshOptions(b).then(function(a){var d=arguments.callee,g=b.getService("orion.git.provider"),i=b.getService("orion.page.message"),g=e.progress(g.doPush(c.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),f["Removing remote branch: "]+c.Name);i.createProgressMonitor(g,f["Removing remote branch: "]+c.Name);g.then(function(e){o.handleProgressServiceResponse(e,a,b,function(a){a.Result.Severity=="Ok"&&h.changedItem(c.parent)},
d,f["Delete Remote Branch"])},function(e){o.handleProgressServiceResponse(e,a,b,function(){},d,f["Removing remote branch: "]+c.Name)})})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});c.addCommand(p);p=new a.ParametersDescription([new a.CommandParameter("name","text","Name:"),new a.CommandParameter("url","url","Url:")]);p=new i.Command({name:f["New Remote"],tooltip:f["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:p,callback:function(a){var c=a.items,d=
b.getService("orion.page.progress"),e=function(a,e,f){d.progress(b.getService("orion.git.provider").addRemote(a,e,f),"Adding remote "+a).then(function(){h.changedItem(c)},y)},f;f=c.Type==="Clone"?c.RemoteLocation:c.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&e(f,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&a.Name==="Remotes"||a.Type==="Clone"&&h.parentId==="artifacts"}});c.addCommand(p);p=new i.Command({name:f.Delete,
tooltip:f["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var c=a.items;confirm(d.formatMessage(f["Are you sure you want to delete remote ${0}?"],c.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").removeRemote(c.Location),"Removing remote "+c.Name).then(function(){h.changedItem(c.parent)},y)},visibleWhen:function(a){return a.Type==="Remote"}});c.addCommand(p);p=new i.Command({name:f.Pull,
tooltip:f["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var c=a.items,d=c.Location,e=c.Name;o.getDefaultSshOptions(b).then(function(a){var g=arguments.callee,i=b.getService("orion.git.provider"),j=b.getService("orion.page.message"),i=b.getService("orion.page.progress").progress(i.doPull(d,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),f["Pulling: "]+e);j.createProgressMonitor(i,
f["Pulling: "]+e);var k;i.then(function(d){o.handleProgressServiceResponse(d,a,b,function(){c.Type==="Clone"&&h.changedItem(c)},g,"Pull Git Repository")},function(d){if(k)d.failedOperation=k;o.handleProgressServiceResponse(d,a,b,function(){h.changedItem(c)},g,f["Pull Git Repository"])},function(a){k=a.Location})})},visibleWhen:function(a){return a.Type==="Clone"}});c.addCommand(p);p=new i.Command({name:f["Git Log"],tooltip:f["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return k.toUrl(G.expand({resource:a.items.CommitLocation}))},
visibleWhen:function(a){return a.Type==="Branch"||a.Type==="RemoteTrackingBranch"}});c.addCommand(p);p=new i.Command({name:f["Git Log"],tooltip:f["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(G.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});c.addCommand(p);p=new i.Command({name:f["Git Status"],tooltip:f["Open the status for the repository"],
id:"eclipse.openGitStatus",hrefCallback:function(a){return w(a.items.StatusLocation)},visibleWhen:function(a){return!a.StatusLocation?!1:!0}});c.addCommand(p);p=new i.Command({name:f.ShowInEditor,tooltip:f.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return k.toUrl(I.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});c.addCommand(p);p=new i.Command({name:f["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(a){a=
a.items;return b.getService("orion.page.progress").progress(b.getService("orion.git.provider").getDiff(a[1].DiffLocation,a[0].Name),"Generating Diff for "+a[0].Name+" and "+a[1].Name).then(function(a){return g.generateCompareHref(a.Location,{readonly:!0})})},visibleWhen:function(a){return h.isDirectory?!1:Array.isArray(a)&&a.length===2&&a[0].Type==="Commit"&&a[1].Type==="Commit"?!0:!1}});c.addCommand(p);p=new i.Command({name:f["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",
id:"eclipse.compareWithWorkingTree",hrefCallback:function(a){return g.generateCompareHref(a.items.DiffLocation,{})},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!==null&&!h.isDirectory}});c.addCommand(p);p=new i.Command({name:f.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return k.toUrl(I.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return a.Type==="Commit"&&a.ContentLocation!=null&&
!h.isDirectory}});c.addCommand(p);p=new i.Command({name:f.Fetch,tooltip:f["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(d){var g=d.items,i=g.Location,j=g.Name,k=function(d,g){d.JsonData.HostKey?(g.parameters=null,g.errorData=d.JsonData,g.errorData.failedOperation=d.failedOperation,c.collectParameters(g)):g.optionsRequested?(g.errorData=d.JsonData,g.errorData.failedOperation=d.failedOperation,c.collectParameters(g)):
(new e(b)).isEnabled().then(function(b){g.parameters=b?d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],
{hasOptionalParameters:!0}):d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0});g.errorData=d.JsonData;g.errorData.failedOperation=d.failedOperation;c.collectParameters(g)})},l=function(){d.parameters&&d.parameters.optionsRequested?
(d.parameters=null,d.optionsRequested=!0,c.collectParameters(d)):(d.errorData&&d.errorData.failedOperation&&b.getService("orion.page.progress").removeOperation(d.errorData.failedOperation),o.gatherSshCredentials(b,d).then(function(a){var c=b.getService("orion.git.provider"),e=b.getService("orion.page.message"),a=b.getService("orion.page.progress").progress(c.doFetch(i,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),f["Fetching remote: "]+j);e.createProgressMonitor(a,
f["Fetching remote: "]+j);a.then(function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem(g)},function(a){k(a,d)})},function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem(g)},function(a){k(a,d)})})}))};if(d.items.GitUrl)l();else{var m=b.getService("orion.git.provider"),n=b.getService("orion.page.progress");n.progress(m.getGitRemote(i),"Getting remote details "+j).then(function(a){n.progress(m.getGitClone(a.CloneLocation),"Getting git repository information "+a.Name).then(function(a){d.items.GitUrl=
a.Children[0].GitUrl;l()},y)},y)}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(p);p=new i.Command({name:f["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:f["Fetch from the remote branch into your remote tracking branch overriding its current content"],id:"eclipse.orion.git.fetchForce",callback:function(d){if(confirm(f["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+
"\n\n"+f["Are you sure?"])){var g=d.items,i=g.Location,j=g.Name,k=function(d,g){d.JsonData.HostKey?(g.parameters=null,g.errorData=d.JsonData,g.errorData.failedOperation=d.failedOperation,c.collectParameters(g)):g.optionsRequested?(g.errorData=d.JsonData,c.collectParameters(g)):(new e(b)).isEnabled().then(function(b){g.parameters=b?d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],
{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",
f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0});g.errorData=d.JsonData;g.errorData.failedOperation=d.failedOperation;c.collectParameters(g)})},l=function(){d.parameters&&d.parameters.optionsRequested?(d.parameters=null,d.optionsRequested=!0,c.collectParameters(d)):(d.errorData&&d.errorData.failedOperation&&b.getService("orion.page.progress").removeOperation(d.errorData.failedOperation),o.gatherSshCredentials(b,d).then(function(a){var c=
b.getService("orion.git.provider"),e=b.getService("orion.page.progress"),l=b.getService("orion.page.message"),a=e.progress(c.doFetch(i,!0,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),f["Fetching remote: "]+j);l.createProgressMonitor(a,f["Fetching remote: "]+j);a.then(function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem(g)},function(a){k(a,d)})},function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem(g)},function(a){k(a,d)})})}))};if(d.items.GitUrl)l();
else{var m=b.getService("orion.git.provider");m.getGitRemote(i).then(function(a){m.getGitClone(a.CloneLocation).then(function(a){d.items.GitUrl=a.Children[0].GitUrl;l()})})}}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Remote"?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(p);p=new i.Command({name:f.Merge,tooltip:f["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.merge",callback:function(a){var c=a.items,a=b.getService("orion.git.provider"),e=b.getService("orion.page.progress"),g=b.getService("orion.page.message");e.progress(a.doMerge(c.HeadLocation,c.Name,!1),"Merging "+c.Name).then(function(a){var b={};if(a.Result==="FAST_FORWARD"||a.Result==="ALREADY_UP_TO_DATE")b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){var e=c.HeadLocation.replace("commit/HEAD","status");b.Severity="Warning";b.HTML=!0;b.Message="<span>"+a.Result;
if(a.FailingPaths){var i="",j=!0,k;for(k in a.FailingPaths)j||(i+=", "),j=!1,i+=k;if(!j)b.Severity="Error",b.Message+=". "+d.formatMessage(f["Failing paths: ${0}"],i)}b.Message+=d.formatMessage(f[". Go to ${0}."],'<a href="'+w(e)+'">'+f["Git Status page"]+"</a>")+"</span>"}else if(a.error)e=c.HeadLocation.replace("commit/HEAD","status"),b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):
b.Message=a.error.message,b.HTML=!0,b.Message="<span>"+b.Message+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(e)+'">'+f["Git Status page"]+"</a>")+"</span>";g.setProgressResult(b);h.changedItem(c)},function(a,e){var g=[],i=c.HeadLocation.replace("commit/HEAD","status");g.Severity="Error";g.HTML=!0;g.Message="<span>"+JSON.stringify(e.xhr.responseText).DetailedMessage+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(i)+'">'+f["Git Status page"]+"</a>")+".</span>";b.getService("orion.page.message").setProgressResult(g);
h.changedItem(c)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(p);p=new i.Command({name:f["Merge Squash"],tooltip:f["Squash the content of the branch to the index"],imageClass:"git-sprite-merge-squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(a){var c=a.items,a=b.getService("orion.git.provider"),e=b.getService("orion.page.progress"),
g=b.getService("orion.page.message");e.progress(a.doMerge(c.HeadLocation,c.Name,!0),"Merging "+c.Name).then(function(a){var b=[];if(a.Result==="FAST_FORWARD_SQUASHED"||a.Result==="ALREADY_UP_TO_DATE")b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){var e=c.HeadLocation.replace("commit/HEAD","status");b.Severity="Warning";b.HTML=!0;b.Message="<span>"+a.Result+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(e)+'">'+f["Git Status page"]+"</a>")+"</span>"}else if(a.error)e=c.HeadLocation.replace("commit/HEAD",
"status"),b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="<span>"+b.Message+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(e)+'">'+f["Git Status page"]+"</a>")+"</span>";g.setProgressResult(b);h.changedItem(c)},function(a,e){var g=[],i=c.HeadLocation.replace("commit/HEAD","status");g.Severity="Error";g.HTML=!0;g.Message="<span>"+JSON.stringify(e.xhr.responseText).DetailedMessage+
d.formatMessage(f[". Go to ${0}."],'<a href="'+w(i)+'">'+f["Git Status page"]+"</a>")+".</span>";b.getService("orion.page.message").setProgressResult(g);h.changedItem(c)})},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"?!0:a.Type==="Branch"&&!a.Current?!0:a.Type==="Commit"&&a.toRef&&a.toRef.Type==="RemoteTrackingBranch"?!0:!1}});c.addCommand(p);p=new i.Command({name:f.Rebase,tooltip:f["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+
"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=b.getService("orion.page.message"),e=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRebase(c.HeadLocation,c.Name,"BEGIN"),c.Name?f["Rebase on top of "]+c.Name:f.Rebase);a.createProgressMonitor(e,c.Name?f["Rebase on top of "]+c.Name:f.Rebase);e.then(function(a){var e=[],g=c.HeadLocation.replace("commit/HEAD",
"status");a.Result==="OK"||a.Result==="FAST_FORWARD"||a.Result==="UP_TO_DATE"?(e.Severity="Ok",e.HTML=!1,e.Message=a.Result):a.Result==="STOPPED"?(e.Severity="Warning",e.HTML=!0,e.Message="<span>"+a.Result+f[". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing"]+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_WRONG_REPOSITORY_STATE"?(e.Severity="Error",e.HTML=!0,e.Message="<span>"+a.Result+f[". Repository state is invalid (i.e. already during rebasing)"]+
d.formatMessage(". Go to ${0}.",'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_UNMERGED_PATHS"?(e.Severity="Error",e.HTML=!0,e.Message="<span>"+a.Result+f[". Repository contains unmerged paths"]+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+".</span>"):a.Result==="FAILED_PENDING_CHANGES"?(e.Severity="Error",e.HTML=!0,e.Message="<span>"+a.Result+f[". Repository contains pending changes. Please commit or stash them"]+d.formatMessage(f[". Go to ${0}."],
'<a href="'+w(g)+'">Git Status page</a>')+".</span>"):(e.Severity="Warning",e.HTML=!0,e.Message="<span>"+a.Result+d.formatMessage(f[". Go to ${0}."],'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+".</span>");b.getService("orion.page.message").setProgressResult(e);h.changedItem(c)},y)},visibleWhen:function(a){this.tooltip=f["Rebase your commits by removing them from the active branch, "]+f["starting the active branch again based on the latest state of '"]+a.Name+"' "+f["and applying each commit again to the updated active branch."];
return a.Type==="RemoteTrackingBranch"||a.Type==="Branch"&&!a.Current}});c.addCommand(p);p=new i.Command({name:f["Push All"],tooltip:f["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(d){var g=d.targetBranch,i,k=d.items;if(k.toRef)k=k.toRef;k.CloneLocation.split("/");var m=function(d,g){d.JsonData.HostKey?(g.parameters=null,g.errorData=d.JsonData,g.errorData.failedOperation=
d.failedOperation,c.collectParameters(g)):g.optionsRequested?(g.errorData=d.JsonData,g.errorData.failedOperation=d.failedOperation,c.collectParameters(g)):(new e(b)).isEnabled().then(function(b){g.parameters=b?d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",
f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0});
g.errorData=d.JsonData;g.errorData.failedOperation=d.failedOperation;c.collectParameters(g)})};if(d.parameters&&d.parameters.optionsRequested)d.parameters=null,d.optionsRequested=!0,c.collectParameters(d);else{var w=b.getService("orion.git.provider"),p=b.getService("orion.page.progress");d.errorData&&d.errorData.failedOperation&&p.removeOperation(d.errorData.failedOperation);var y=function(a,c,e,g,i){var j=b.getService("orion.page.message"),a=p.progress(w.doPush(c,e,!0,i,a.gitSshUsername,a.gitSshPassword,
a.knownHosts,a.gitPrivateKey,a.gitPassphrase),f["Pushing remote: "]+g);j.createProgressMonitor(a,f["Pushing remote: "]+g);a.then(function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem()},function(a){m(a,d)})},function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem()},function(a){m(a,d)})})};p.progress(w.getGitClone(k.CloneLocation),"Getting git repository details "+k.Name).then(function(a){var c=a.Children[0].RemoteLocation,e=a.Children[0].ConfigLocation,h=function(a){o.handleProgressServiceResponse(a,
{},b)};o.gatherSshCredentials(b,d).then(function(a){var m=new j;if(k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1)m=p.progress(w.getGitRemote(c),"Getting git remote details "+k.Name);else{var o={};o.Children=k.RemoteLocation;m.resolve(o)}m.then(function(c){g?y(a,g.Location,"HEAD",g.Name,!1):(c=new n.RemotePrompterDialog({title:f["Choose Branch"],serviceRegistry:b,gitClient:w,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(b,c,g){i=b===null?g:b;var f="branch."+k.Name+
".remote";p.progress(w.addCloneConfigurationProperty(e,f,i.parent.Name),"Adding git configuration property "+k.Name).then(function(){d.targetBranch=i;y(a,i.Location,"HEAD",i.Name,!1)},function(b){b.status===409?w.getGitCloneConfig(e).then(function(b){if(b.Children)for(var c=0;c<b.Children.length;c++)if(b.Children[c].Key===f){p.progress(w.editCloneConfigurationProperty(b.Children[c].Location,i.parent.Name),"Updating configuration property "+i.parent.Name).then(function(){d.targetBranch=i;y(a,i.Location,
"HEAD",i.Name,!1)},h);break}},h):h(b)})}}),k.RemoteLocation.length===1&&k.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:f["Choose Branch"],serviceRegistry:b,gitClient:w,dialog:c,location:k.RemoteLocation[0].Children[0].Name,func:function(){d.targetBranch=k.RemoteLocation[0].Children[0];y(a,k.RemoteLocation[0].Children[0].Location,"HEAD",k.Name,!1)}})),c.show())})})})}},visibleWhen:function(a){return a.toRef?a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&
a.toRef.RemoteLocation:a.Type==="Branch"&&a.Current&&a.RemoteLocation}});c.addCommand(p);p=new i.Command({name:f["Force Push All"],tooltip:f["Push commits and tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(d){var g=d.confirmedWarnings,i=d.targetBranch;if(!g)if(confirm(f["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+
"\n\n"+f["Are you sure?"]))g=d.confirmedWarnings=!0;else return;var k,m=d.items;if(m.toRef)m=m.toRef;var w=m.CloneLocation.split("/"),p=function(d,g){d.JsonData.HostKey?(g.parameters=null,g.errorData=d.JsonData,c.collectParameters(g)):g.optionsRequested?(g.errorData=d.JsonData,c.collectParameters(g)):(new e(b)).isEnabled().then(function(b){g.parameters=b?d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials",
"boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):d.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser",
"text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0});g.errorData=d.JsonData;c.collectParameters(g)})};if(d.parameters&&d.parameters.optionsRequested)d.parameters=null,d.optionsRequested=!0,c.collectParameters(d);else{var y=b.getService("orion.git.provider"),q=b.getService("orion.page.progress"),u=function(a,c,e,g,i){var j=b.getService("orion.page.message"),a=q.progress(y.doPush(c,e,!0,i,a.gitSshUsername,a.gitSshPassword,a.knownHosts,
a.gitPrivateKey,a.gitPassphrase),f["Pushing remote: "]+g);j.createProgressMonitor(a,f["Pushing remote: "]+g);a.then(function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem()},function(a){p(a,d)})},function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem(m)},function(a){p(a,d)})})};q.progress(y.getGitClone(m.CloneLocation),"Getting git repository details "+m.Name).then(function(a){var c=a.Children[0].RemoteLocation,e=a.Children[0].ConfigLocation;o.gatherSshCredentials(b,d).then(function(a){var g=
new j;if(m.RemoteLocation.length===1&&m.RemoteLocation[0].Children.length===1)g=q.progress(y.getGitRemote(c),"Getting remote details "+m.Name);else{var h={};h.Children=m.RemoteLocation;g.resolve(h)}g.then(function(c){i?u(a,i.Location,"HEAD",i.Name,!0):(c=new n.RemotePrompterDialog({title:f["Choose Branch"],serviceRegistry:b,gitClient:y,treeRoot:{Children:c.Children},hideNewBranch:!1,func:function(b,c,g){k=b===null?g:b;var f="/gitapi/config/branch."+m.Name+".remote/clone/file/"+w[4];q.progress(y.addCloneConfigurationProperty(e,
"branch."+m.Name+".remote",k.parent.Name),"Setting git configuration property "+m.Name).then(function(){d.targetBranch=k;u(a,k.Location,"HEAD",k.Name,!0)},function(b){b.status===409&&q.progres(y.editCloneConfigurationProperty(f,k.parent.Name),"Setting git configuration property "+k.parent.Name).then(function(){d.targetBranch=k;u(a,k.Location,"HEAD",k.Name,!0)})})}}),m.RemoteLocation.length===1&&m.RemoteLocation[0].Children.length===1&&(c=new l.ConfirmPushDialog({title:f["Choose Branch"],serviceRegistry:b,
gitClient:y,dialog:c,location:m.RemoteLocation[0].Children[0].Name,func:function(){d.targetBranch=m.RemoteLocation[0].Children[0];u(a,m.RemoteLocation[0].Children[0].Location,"HEAD",m.Location,!0)}})),c.show())})})})}},visibleWhen:function(a){if(a.toRef)return a.RepositoryPath===""&&a.toRef.Type==="Branch"&&a.toRef.Current&&a.toRef.RemoteLocation}});c.addCommand(p);p=new i.Command({name:f["< Previous Page"],tooltip:f["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return k.toUrl(z.expand({resource:a.items.PreviousLocation}))},
visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.PreviousLocation!==void 0:!1}});c.addCommand(p);p=new i.Command({name:f["Next Page >"],tooltip:f["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",hrefCallback:function(a){return k.toUrl(z.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"||a.toRef&&a.toRef.Type==="Branch"||a.RepositoryPath!==null?a.NextLocation!==
void 0:!1}});c.addCommand(p);p=new i.Command({name:f["< Previous Page"],tooltip:f["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return k.toUrl(x.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return a.Type==="Tag"?a.PreviousLocation!==void 0:!1}});c.addCommand(p);p=new i.Command({name:f["Next Page >"],tooltip:f["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return k.toUrl(x.expand({resource:a.items.NextLocation}))},
visibleWhen:function(a){return a.Type==="Tag"?a.NextLocation!==void 0:!1}});c.addCommand(p);p=new i.Command({name:f.Reset,tooltip:f["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items;if(confirm(d.formatMessage(f.GitResetIndexConfirm,c.Name))){var a=b.getService("orion.git.provider"),e=b.getService("orion.page.message"),
a=b.getService("orion.page.progress").progress(a.resetIndex(c.IndexLocation,c.Name),"Resetting git index for "+c.Name);e.createProgressMonitor(a,f["Resetting index..."]);a.then(function(){h.changedItem(c);e.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=a.message;e.setProgressResult(b)})}},visibleWhen:function(a){return a.Type==="RemoteTrackingBranch"}});c.addCommand(p);p=new a.ParametersDescription([new a.CommandParameter("name",
"text",f["Name:"])]);p=new i.Command({name:f.Tag,tooltip:f["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var c=a.items,d=function(a,d){b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doAddTag(a,d),"Adding tag "+d).then(function(){h.changedItem(c)},y)},e=c.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&d(e,a.parameters.valueFor("name"))},
visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(p);p=new i.Command({name:f.Delete,tooltip:f["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var c=a.items;confirm(d.formatMessage(f["Are you sure you want to delete tag ${0}?"],c.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRemoveTag(c.Location),"Removing tag "+c.Name).then(function(){h.changedItem(c.parent)},y)},visibleWhen:function(a){return a.Type===
"Tag"}});c.addCommand(p);p=new a.ParametersDescription([new a.CommandParameter("reviewer","text",f["Reviewer name"])],{hasOptionalParameters:!0});p=new i.Command({name:f["Ask for review"],tooltip:f["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var c=b.getService("orion.page.progress"),d=function(a){var b=document.createElement("a");b.href=a;b.protocol==="ssh:"&&(b=a.indexOf("@"),b!==-1&&(a="ssh://"+a.substr(b+1)));
return a},e=function(e){var g=a.items,f=g.Location.replace(g.Name,"HEAD"),h=g.AuthorName,i=g.Name,j=g.Message;c.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting repository details "+g.Name).then(function(a){window.location.href.split("#");var k=u.getOrionHome(),a=d(a.Children[0].GitUrl),k=k+"/git/reviewRequest.html#"+a+"_"+g.Name;c.progress(b.getService("orion.git.provider").sendCommitReviewRequest(i,f,e,k,h,j),"Sending review request for "+i).then(function(a){var c=
{Severity:"Ok",HTML:!1};c.Message=a.Result;b.getService("orion.page.message").setProgressResult(c)},y)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)e(a.parameters.valueFor("reviewer"));else{var g=a.items;c.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting git details "+g.Name).then(function(a){window.location.href.split("#");var b=u.getOrionHome(),a=d(a.Children[0].GitUrl);(new m.ReviewRequestDialog({title:f["Contribution Review Request"],
url:b+"/git/reviewRequest.html#"+a+"_"+g.Name,func:e})).show()},y)}},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(p);p=new i.Command({name:f["Cherry-Pick"],tooltip:f["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry-pick",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),g=c.Location.replace(c.Name,"HEAD");a.progress(e.doCherryPick(g,
c.Name),"Cherry picking "+c.Name).then(function(a){var e=[],g=c.Location.replace("commit/"+c.Name,"status");if(a.Result==="OK")e.Severity="Ok",a.HeadUpdated?(e.HTML=!1,e.Message=a.Result):(e.HTML=!0,e.Message="<span>"+f["Nothing changed."]+"</span>");else if(a.Result==="CONFLICTING")e.Severity="Warning",e.HTML=!0,g=d.formatMessage(f[". Go to ${0}."],'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+"</span>",e.Message="<span>"+a.Result+f[". Some conflicts occurred"]+g;else if(a.Result==="FAILED"){e.Severity=
"Error";e.HTML=!0;e.Message="<span>"+a.Result;if(a.FailingPaths){var h="",i=!0,j;for(j in a.FailingPaths)i||(h+=", "),i=!1,h+=j;i||(e.Message+=". "+d.formatMessage(f["Failing paths: ${0}"],h))}e.Message+=d.formatMessage(f[". Go to ${0}."],'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+"</span>"}else e.Severity="Warning",e.HTML=!1,e.Message=a.Result;b.getService("orion.page.message").setProgressResult(e)},y)},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(p);p=new i.Command({name:f.Revert,
tooltip:f["Revert changes introduced by the commit into your active branch"],id:"eclipse.orion.git.revert",imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){var c=a.items,a=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),g=c.Location.replace(c.Name,"HEAD");a.progress(e.doRevert(g,c.Name),"Reverting "+c.Name).then(function(a){var e=[],g=c.Location.replace("commit/"+c.Name,"status");a.Result==="OK"?(e.Severity="Ok",e.HTML=!1,e.Message=a.Result):
a.Result==="FAILURE"?(g=d.formatMessage(f[". Go to ${0}."],'<a href="'+w(g)+'">'+f["Git Status page"]+"</a>")+"</span>",e.Severity="Warning",e.HTML=!0,e.Message="<span>"+a.Result+f[". Could not revert into active branch"]+g):(e.Severity="Warning",e.HTML=!1,e.Message=a.Result);b.getService("orion.page.message").setProgressResult(e)},y)},visibleWhen:function(a){return a.Type==="Commit"}});c.addCommand(p)};o.createGitClonesCommands=function(b,g,h,l,m,n){function w(a){var c={Severity:"Error",HTML:!1};
try{var d=JSON.parse(a.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?d.Message:f["Problem while performing the action"]}catch(e){c.Message=f["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(c)}function y(a){Array.isArray(a)&&(a=a.length>1?{}:a[0]);return a}l=new a.ParametersDescription([new a.CommandParameter("key","text",f["Key:"]),new a.CommandParameter("value","text",f["Value:"])]);l=new i.Command({name:f["New Configuration Entry"],
tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:l,callback:function(a){var c=a.items,d=b.getService("orion.git.provider"),e=b.getService("orion.page.progress");a.parameters.valueFor("key")&&a.parameters.valueFor("value")&&e.progress(d.addCloneConfigurationProperty(c.ConfigLocation,a.parameters.valueFor("key"),a.parameters.valueFor("value")),"Setting configuration propetry: "+a.parameters.valueFor("key")).then(function(){h.changedItem(c)},
w)}});g.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("value","text",f["Value:"])]);l=new i.Command({name:f.Edit,tooltip:f["Edit the configuration entry"],imageClass:"core-sprite-edit",id:"eclipse.orion.git.editConfigEntryCommand",parameters:l,callback:function(a){var c=a.items,d=b.getService("orion.git.provider"),e=b.getService("orion.page.progress");a.parameters.valueFor("value")&&e.progress(d.editCloneConfigurationProperty(c.Location,a.parameters.valueFor("value")),"Editing configuration property "+
c.Key).then(function(){h.changedItem(c)},w)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});g.addCommand(l);l=new i.Command({name:f.Delete,tooltip:f["Delete the configuration entry"],imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(a){var c=a.items,a=b.getService("orion.git.provider"),e=b.getService("orion.page.progress");confirm(d.formatMessage(f["Are you sure you want to delete ${0}?"],c.Key))&&e.progress(a.deleteCloneConfigurationProperty(c.Location),
"Deleting configuration property "+c.Key).then(function(){h.changedItem(c)},w)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});g.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("url","url",f["Repository URL:"])],{hasOptionalParameters:!0});m=new i.Command({name:f["Clone Repository"],tooltip:f["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(a){var d=a.items,e=b.getService("orion.git.provider"),g=b.getService("orion.page.progress"),
i=function(a,i,j){o.getDefaultSshOptions(b).then(function(l){var m=arguments.callee,w=new c(b);b.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");w.getConfig().then(function(c){g.progress(e.cloneGitRepository(j,a,i,h.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase,c,!0),"Cloning repository "+j).then(function(a){o.handleProgressServiceResponse(a,l,b,function(a){e.getGitClone(a.Location).then(function(a){var b=
"",c;for(c in d.projectDescription)b+=c+"="+d.projectDescription[c]+"\n";n.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=k.toUrl(I.expand({resource:a.Children[0].ContentLocation}));window.location=b})})},m,f["Clone Git Repository"])},function(a){o.handleProgressServiceResponse(a,l,b,function(){},m,f["Clone Git Repository"])})})})};d.url&&d.projectDescription.name&&(b.getService("orion.page.message").setProgressMessage("Looking for project "+d.projectDescription.name),
n.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var c=a.Children[b];if(c.Name===d.projectDescription.name){c.Git?e.getGitClone(c.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===d.url?window.location=k.toUrl(I.expand({resource:a.Children[0].ContentLocation+"?depth=1"})):console.info("Folder project is used")}):console.info("Folder project is used");return}}i(d.url,null,d.projectDescription.name)}))},visibleWhen:function(){return!0}});g.addCommand(m);l=new i.Command({name:f["Clone Repository"],
tooltip:f["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:l,callback:function(a){var d=b.getService("orion.git.provider"),e=b.getService("orion.page.progress"),g=function(a,g,i){o.getDefaultSshOptions(b).then(function(j){var k=arguments.callee;(new c(b)).getConfig().then(function(c){c=e.progress(d.cloneGitRepository(i,a,g,h.defaultPath,j.gitSshUsername,j.gitSshPassword,j.knownHosts,j.gitPrivateKey,j.gitPassphrase,c),"Cloning repository "+i);b.getService("orion.page.message").createProgressMonitor(c,
f["Cloning repository: "]+a);c.then(function(a){o.handleProgressServiceResponse(a,j,b,function(){h.changedItem&&h.changedItem()},k,f["Clone Git Repository"])},function(a){o.handleProgressServiceResponse(a,j,b,function(){},k,f["Clone Git Repository"])})})})};a.parameters.valueFor("url")&&!a.parameters.optionsRequested?g(a.parameters.valueFor("url")):(new r.CloneGitRepositoryDialog({serviceRegistry:b,fileClient:n,url:a.parameters.valueFor("url"),alwaysShowAdvanced:a.parameters.optionsRequested,func:g})).show()},
visibleWhen:function(){return!0}});g.addCommand(l);l=new i.Command({name:f["Clone Repository"],tooltip:f["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepositoryReviewReq",callback:function(a){var d=b.getService("orion.git.provider"),e=b.getService("orion.page.progress");(new r.CloneGitRepositoryDialog({serviceRegistry:b,fileClient:n,url:a.userData,alwaysShowAdvanced:!1,func:function(a,g,i){o.getDefaultSshOptions(b).then(function(j){var k=arguments.callee;(new c(b)).getConfig().then(function(c){c=
e.progress(d.cloneGitRepository(i,a,g,h.defaultPath,j.gitSshUsername,j.gitSshPassword,j.knownHosts,j.gitPrivateKey,j.gitPassphrase,c),"Cloning git repository "+i);b.getService("orion.page.message").createProgressMonitor(c,f["Cloning repository: "]+a);c.then(function(a){o.handleProgressServiceResponse(a,j,b,function(){h.changedItem&&h.changedItem()},k,f["Clone Git Repository"])},function(a){o.handleProgressServiceResponse(a,j,b,function(){},k,f["Clone Git Repository"])})})})}})).show()},visibleWhen:function(){return!0}});
g.addCommand(l);l=new i.Command({name:f["Add Remote"],tooltip:f["Add a new remote to the repository"],id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(c){if(c.parameters&&c.parameters.valueFor("remoteName"))c.remoteName=c.parameters.valueFor("remoteName");var d=function(c,d){c.JsonData.HostKey?(d.parameters=null,d.errorData=c.JsonData,g.collectParameters(d)):d.optionsRequested?(d.errorData=c.JsonData,g.collectParameters(d)):
(new e(b)).isEnabled().then(function(b){d.parameters=b?c.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"]),new a.CommandParameter("saveCredentials","boolean",f["Don't prompt me again:"])],
{hasOptionalParameters:!0}):c.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0}):new a.ParametersDescription([new a.CommandParameter("sshuser","text",f["SSH User Name:"]),new a.CommandParameter("sshpassword","password",f["SSH Password:"])],{hasOptionalParameters:!0});d.errorData=c.JsonData;g.collectParameters(d)})};if(c.parameters&&c.parameters.optionsRequested)c.parameters=null,c.optionsRequested=!0,g.collectParameters(c);
else{var i=function(a,e,g){var i=b.getService("orion.page.progress");i.progress(b.getService("orion.git.provider").addRemote(a,e,c.userData),"Adding git remote "+e).then(function(){o.gatherSshCredentials(b,c).then(function(a){b.getService("orion.git.provider").getGitRemote(g.RemoteLocation).then(function(j){for(var k,l=0;l<j.Children.length;l++)j.Children[l].Name===e&&(k=j.Children[l]);var m=b.getService("orion.git.provider"),j=b.getService("orion.page.message"),l=i.progress(m.doFetch(k.Location,
!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),"Fetching remote "+e);j.createProgressMonitor(l,f["Fetching remote: "]+k.Location);l.then(function(a){o.handleGitServiceResponse(a,b,function(){i.progress(m.getGitRemote(k.Location),"Getting remote details "+e).then(function(){h.changedItem(g)},w)},function(a){d(a,c)})},function(a){o.handleGitServiceResponse(a,b,function(){h.changedItem(g)},function(a){d(a,c)})})})})},w)};c.remoteName?i(c.items.RemoteLocation,c.remoteName,
c.items):(c.parameters=new a.ParametersDescription([new a.CommandParameter("remoteName","text",f["Remote Name:"])],{hasOptionalParameters:!1}),g.collectParameters(c))}},visibleWhen:function(){return!0}});g.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("folderName","text",f["New folder:"])],{hasOptionalParameters:!0});l=new i.Command({name:f["Init Repository"],tooltip:f["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:l,callback:function(a){var d=
b.getService("orion.git.provider"),e=b.getService("orion.page.progress"),g=function(a,g,i){o.getDefaultSshOptions(b).then(function(j){var k=arguments.callee;(new c(b)).getConfig().then(function(c){c=e.progress(d.cloneGitRepository(i,a,g,h.defaultPath,null,null,null,null,null,c),f["Initializing repository: "]+i);b.getService("orion.page.message").createProgressMonitor(c,f["Initializing repository: "]+i);c.then(function(a){o.handleProgressServiceResponse(a,j,b,function(){h.changedItem&&h.changedItem()},
k,f["Init Git Repository"])},function(a){o.handleProgressServiceResponse(a,j,b,function(){},k,f["Init Git Repository"])})})})};a.parameters.valueFor("folderName")&&!a.parameters.optionsRequested?g(null,null,a.parameters.valueFor("folderName")):(new r.CloneGitRepositoryDialog({serviceRegistry:b,title:f["Init Git Repository"],fileClient:n,advancedOnly:!0,func:g})).show()},visibleWhen:function(){return!0}});g.addCommand(l);l=new i.Command({name:f.Delete,tooltip:f["Delete the repository"],imageClass:"core-sprite-delete",
id:"eclipse.git.deleteClone",visibleWhen:function(a){return a.Type==="Clone"},callback:function(a){var c=a.items,a=b.getService("orion.git.provider"),e=b.getService("orion.page.progress");if(Array.isArray(c)){if(confirm(d.formatMessage(f["Are you sure you want do delete ${0} repositories?"],c.length)))for(var g=0,i=0;i<c.length;i++)e.progress(a.removeGitRepository(c[i].Location),"Removing repository "+c.Name).then(function(){g++;g>=c.length&&h.changedItem&&h.changedItem()},w)}else confirm(d.formatMessage(f["Are you sure you want to delete ${0}?"],
c.Name))&&e.progress(a.removeGitRepository(c.Location),"Removing repository "+c.Name).then(function(){if(h.changedItem)window.location=k.toUrl(x.expand({}))},w)}});g.addCommand(l);l=new i.Command({name:f["Apply Patch"],tooltip:f["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",callback:function(a){var a=y(a.items),c=new j;(new p.ApplyPatchDialog({title:f["Apply Patch"],diffLocation:a.DiffLocation,deferred:c})).show();
var d=b.getService("orion.page.message");c.then(function(a){var b;try{var c=JSON.parse(a);if(c.JsonData&&c.JsonData.modifiedFieles){b="Patch applied, files modified: ";for(var a=!0,e=0;e<c.JsonData.modifiedFieles.length;e++)a||(b+=", "),b+=c.JsonData.modifiedFieles[e],a=!1;c=[];c.Severity="Info";c.HTML=!1;c.Message=b;d.setProgressResult(c);return}}catch(g){}d.setMessage("Patch applied")},function(a){var b=JSON.parse(a),a="Apply patch failed.";b.DetailedMessage?(a+=" ",a+=b.DetailedMessage):b.Message&&
(a+=" ",a+=b.Message);b=[];b.Severity="Error";b.HTML=!1;b.Message=a;d.setProgressResult(b)})},visibleWhen:function(a){return a.Type==="Clone"}});g.addCommand(l);l=new a.ParametersDescription([new a.CommandParameter("commitName","text",f["Commit name:"])],{hasOptionalParameters:!0});l=new i.Command({name:f["Open Commit"],tooltip:f["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",parameters:l,callback:function(a){var c=
b.getService("orion.page.progress"),d=function(e,g,h){h==null&&(h=new j);e.length>0?c.progress(b.getService("orion.git.provider").doGitLog("/gitapi/commit/"+a.parameters.valueFor("commitName")+e[0].ContentLocation+"?page=1&pageSize=1",null,null,f["Looking for the commit"]),"Looking for commit "+a.parameters.valueFor("commitName")).then(function(a){h.resolve(a.Children[0].Location)},function(){d(e.slice(1),g,h)}):h.reject();return h},e=function(c){a.parameters.optionsRequested?(new s.OpenCommitDialog({repositories:c,
serviceRegistry:b,commitName:a.parameters.valueFor("commitName")})).show():(b.getService("orion.page.message").setProgressMessage(f["Looking for the commit"]),d(c,a.parameters.valueFor("commitName")).then(function(a){a&&(a=k.toUrl(A.expand({resource:a})),window.open(a));b.getService("orion.page.message").setProgressMessage("")},function(){var a=[];a.Severity="warning";a.HTML=!1;a.Message=f["No commits found"];b.getService("orion.page.message").setProgressResult(a)}))};if(a.items.Type==="Clone"){var g=
[a.items];e(g)}else a.items.CloneLocation?c.progress(b.getService("orion.git.provider").getGitClone(a.items.CloneLocation),"Getting git repository details").then(function(a){e(a.Children)}):(g=a.items,e(g))},visibleWhen:function(a){return a.Type==="Clone"||a.CloneLocation||a.length>1&&a[0].Type==="Clone"}});g.addCommand(l)};o.createGitStatusCommands=function(b,c,d){function e(a){var c={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);c.Message=d.DetailedMessage?d.DetailedMessage:d.Message?
d.Message:f["Problem while performing the action"]}catch(g){c.Message=f["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(c)}function g(a){Array.isArray(a)||(a=[a]);return a}function j(a,c){var g=b.getService("orion.page.message"),h=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRebase(a,"",c),"Rebasing git repository");g.createProgressMonitor(h,c);h.then(function(a){if(a.Result==="OK"||a.Result==="ABORTED"||a.Result==="FAST_FORWARD"||
a.Result==="UP_TO_DATE"){var c=[];c.Severity="Ok";c.HTML=!1;c.Message=a.Result;b.getService("orion.page.message").setProgressResult(c);d.changedItem({})}if(a.Result==="STOPPED")c=[],c.Severity="Warning",c.HTML=!1,c.Message=a.Result+f[". Repository still contains conflicts."],b.getService("orion.page.message").setProgressResult(c),d.changedItem({});else if(a.Result==="FAILED_UNMERGED_PATHS")c=[],c.Severity="Error",c.HTML=!1,c.Message=a.Result+f[". Repository contains unmerged paths. Resolve conflicts first."],
b.getService("orion.page.message").setProgressResult(c)},e)}var k=new i.Command({name:f.Stage,tooltip:f["Stage the change"],imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(a){var c=g(a.items),h=b.getService("orion.page.message"),i=b.getService("orion.page.progress");if(c.length===1)a=i.progress(b.getService("orion.git.provider").stage(c[0].indexURI),f["Staging changes"]),h.createProgressMonitor(a,f["Staging changes"]);else{for(var j=
[],k=0;k<c.length;k++)j[k]=c[k].name;a=i.progress(b.getService("orion.git.provider").stageMultipleFiles(a.userData.Clone.IndexLocation,j),f["Staging changes"]);h.createProgressMonitor(a,"Staging changes")}a.then(function(){d.changedItem(c)},e)},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!h.isChange(a[b])||h.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:f.Unstage,tooltip:f["Unstage the change"],imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",
id:"eclipse.orion.git.unstageCommand",callback:function(a){var c=g(a.items),h=b.getService("orion.page.message"),i=b.getService("orion.page.progress");if(c.length===1)a=i.progress(b.getService("orion.git.provider").unstage(c[0].indexURI,c[0].name),"Unstaging changes");else{for(var j=[],k=0;k<c.length;k++)j[k]=c[k].name;a=i.progress(b.getService("orion.git.provider").unstage(a.userData.Clone.IndexLocation,j),"Unstaging changes")}h.createProgressMonitor(a,f["Staging changes"]);a.then(function(){d.changedItem(c)},
e)},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!h.isChange(a[b])||!h.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new a.ParametersDescription([new a.CommandParameter("name","text",f["Commit message:"],"",4),new a.CommandParameter("amend","boolean",f["Amend:"],!1)],{hasOptionalParameters:!0});k=new i.Command({name:f.Commit,tooltip:f.Commit,id:"eclipse.orion.git.commitCommand",parameters:k,callback:function(a){var c=a.items.status,g=function(a){var g=
b.getService("orion.page.message"),a=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").commitAll(c.Clone.HeadLocation,null,JSON.stringify(a)),f["Committing changes"]);g.createProgressMonitor(a,f["Committing changes"]);a.then(function(){d.changedItem(c)},e)},h=function(b,c){for(var d=0;d<c.length;d++)if(c[d].Key==="user.name")b.CommitterName=c[d].Value,b.AuthorName=c[d].Value;else if(c[d].Key==="user.email")b.CommitterEmail=c[d].Value,b.AuthorEmail=c[d].Value;b.Message&&
b.CommitterName&&b.CommitterEmail&&!a.parameters.optionsRequested?g(b):(new t.CommitDialog({body:b,func:g})).show()},i={};i.Message=a.parameters.valueFor("name");i.Amend=a.parameters.valueFor("amend");var j=c.Clone.Config;if(i.Amend&&!i.Message){var k=b.getService("orion.page.message"),l=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doGitLog(c.CommitLocation+"?page=1&pageSize=1"),f["Committing changes"]);k.createProgressMonitor(l,f["Committing changes"]);l.then(function(a){i.Message=
a.Children[0].Message;h(i,j)},function(){h(i,j)})}else h(i,j)},visibleWhen:function(){return!0}});c.addCommand(k);k=new i.Command({name:f.Reset,tooltip:f["Reset the branch, discarding all staged and unstaged changes"],imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",callback:function(a){var c=a.items;b.getService("orion.page.dialog").confirm(f["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+f["Are you sure you want to continue?"],
function(a){if(a){var a=b.getService("orion.page.message"),g=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").unstageAll(c.IndexLocation,"HARD"),f["Resetting local changes"]);a.createProgressMonitor(g,f["Resetting local changes"]);g.then(function(){d.changedItem(c)},e)}})},visibleWhen:function(a){return h.hasStagedChanges(a)||h.hasUnstagedChanges(a)}});c.addCommand(k);k=new i.Command({name:f.Checkout,tooltip:f["Checkout files, discarding all changes"],imageClass:"git-sprite-checkout",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(a){var c=g(a.items);b.getService("orion.page.dialog").confirm(f["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+f["Are you sure you want to continue?"],function(g){if(g){for(var g=b.getService("orion.page.message"),h=b.getService("orion.page.progress"),i=[],j=0;j<c.length;j++)i[j]=c[j].name;h=h.progress(b.getService("orion.git.provider").checkoutPath(a.userData.Clone.Location,
i),f["Resetting local changes"]);g.createProgressMonitor(h,f["Resetting local changes"]);h.then(function(){d.changedItem(c)},e)}})},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(!h.isChange(a[b])||h.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:f["Show Patch"],tooltip:f["Show workspace changes as a patch"],id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){for(var b=g(a.items),a=a.userData.Clone.DiffLocation+"?parts=diff",
c=0;c<b.length;c++)a+="&Path=",a+=b[c].name;return a},visibleWhen:function(a){a=g(a);if(a.length===0)return!1;for(var b=0;b<a.length;b++)if(h.isStaged(a[b]))return!1;return!0}});c.addCommand(k);k=new i.Command({name:f.Continue,tooltip:f["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return j(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(k);k=new i.Command({name:f["Skip Patch"],
tooltip:f["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return j(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(k);k=new i.Command({name:f.Abort,tooltip:f["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return j(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState.indexOf("REBASING")!==-1}});c.addCommand(k)}})();return o});
define("orion/git/widgets/CommitTooltipDialog","i18n!git/nls/gitmessages,require,orion/URITemplate,orion/webui/littlelib,orion/i18nUtil,orion/webui/popupdialog".split(","),function(f,k,j,d,b,i){function a(a){this._init(a)}var h=new j("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");a.prototype=new i.PopupDialog;a.prototype.TEMPLATE='<div id="parentPane" style="padding:10px; width:520px"></div>';a.prototype._init=function(a){this.commit=a.commit;this._initialize(a.triggerNode,null,null,
"mouseover",1E3)};a.prototype._bindToDom=function(){this._displayCommit(this.commit)};a.prototype._displayCommit=function(a){var d=this.$parentPane,c=a.Message.split(/(\r?\n|$)/)[0],i=document.createElement("a");i.className="navlinkonpage";i.href=k.toUrl(h.expand({resource:a.Location}));i.textContent=c;d.appendChild(i);c=document.createElement("div");c.style.paddingTop="15px";d.appendChild(c);if(a.AuthorImage)d=new Image,d.src=a.AuthorImage,d.name=a.AuthorName,d.className="git-author-icon",c.appendChild(d);
d=document.createElement("div");d.textContent=b.formatMessage(f[" authored by ${0} {${1}) on ${2}"],a.AuthorName,a.AuthorEmail,(new Date(a.Time)).toLocaleString());c.appendChild(d);d=document.createElement("div");d.textContent=b.formatMessage(f["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);c.appendChild(d);d=document.createElement("div");d.style.paddingTop="15px";d.textContent=f["commit:"]+a.Name;c.appendChild(d);if(a.Parents&&a.Parents.length>0)d=document.createElement("div"),d.textContent=
f["parent:"],i=document.createElement("a"),i.className="navlinkonpage",i.href=k.toUrl(h.expand({resource:a.Parents[0].Location})),i.textContent=a.Parents[0].Name,d.appendChild(i),c.appendChild(d);i=a.Tags&&a.Tags.length>0;if(a.Branches&&a.Branches.length>0){d=document.createElement("section");d.style.paddingTop="15px";d.textContent=f["branches: "];c.appendChild(d);var j=document.createElement("div");d.appendChild(j);for(d=0;d<a.Branches.length;++d){var m=document.createElement("span");m.style.paddingLeft=
"10px";m.textContent=a.Branches[d].FullName;j.appendChild(m)}}if(i){d=document.createElement("div");d.style.paddingTop="15px";c.appendChild(d);d=document.createElement("section");c.appendChild(d);c=document.createElement("span");c.textContent=f["tags: "];d.appendChild(c);c=document.createElement("div");d.appendChild(c);for(d=0;d<a.Tags.length;++d)i=document.createElement("span"),i.style.paddingLeft="10px",i.textContent=a.Tags[d].Name,c.appendChild(i)}};a.prototype.constructor=a;return{CommitTooltipDialog:a}});
define("orion/git/gitRepositoryExplorer","i18n!git/nls/gitmessages,require,orion/commandRegistry,orion/section,orion/i18nUtil,orion/webui/littlelib,orion/git/util,orion/URITemplate,orion/PageUtil,orion/dynamicContent,orion/fileUtils,orion/globalCommands,orion/git/gitCommands,orion/Deferred,orion/git/widgets/CommitTooltipDialog".split(","),function(f,k,j,d,b,i,a,h,g,e,c,l,n,m,r){var j={},q=new h("git/git-repository.html#{,resource,params*}"),s=new h("git/git-repository.html#{,resource,params*}?page=1&pageSize=20"),
t=new h(a.statusUILocation+"#{,resource,params*}"),p=new h("git/git-log.html#{,resource,params*}?page=1"),x=new h("git/git-commit.html#{,resource,params*}?page=1&pageSize=1");j.GitRepositoryExplorer=function(){function a(b,c,d,e,g,f,h){this.parentId=g;this.registry=b;this.linkService=d;this.commandService=c;this.selection=e;this.parentId=g;this.pageNavId=f;this.actionScopeId=h;this.checkbox=!1}a.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var c=JSON.parse(a.responseText);
b.Message=c.DetailedMessage?c.DetailedMessage:c.Message}catch(d){b.Message=a.DetailedMessage||a.Message||a.message}this.registry.getService("orion.page.message").setProgressResult(b);a.status===404&&(this.initTitleBar(),this.displayRepositories())};a.prototype.setDefaultPath=function(a){this.defaultPath=a};a.prototype.changedItem=function(){this.redisplay(!1)};a.prototype.redisplay=function(a){a===void 0&&(a=!0);var b=g.matchResourceParameters();if(b.resource)this.displayRepository(b.resource);else{var b=
c.makeRelative(this.defaultPath),d=k.toUrl("gitapi/clone._"),d=d.substring(0,d.length-2);this.displayRepositories2(b[0]==="/"?d+b:d+"/"+b,a)}};a.prototype.displayRepositories2=function(a,b){var c=this;this.loadingDeferred=new m;b&&this.loadingDeferred.then(function(){c.commandService.processURL(window.location.href)});this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitClone(a),"Getting git repository details").then(function(a){if(a.Children.length===
0)c.initTitleBar({}),c.displayRepositories([],"full");else if(a.Children[0].Type==="Clone")a=a.Children,c.initTitleBar(a),c.displayRepositories(a,"full",!0)},function(a){c.handleError(a)})};a.prototype.displayRepository=function(a){var b=this;this.loadingDeferred=new m;this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitClone(a),"Getting git repository details").then(function(a){var c=i.node(b.pageNavId);c&&(i.empty(c),b.commandService.renderCommands(b.pageNavId,
c,a,b,"button"));if(a.Children)a.Children.length===0?(b.initTitleBar({}),b.displayRepositories([],"full")):a.Children.length&&a.Children.length===1&&a.Children[0].Type==="Clone"?(a=a.Children,b.initTitleBar(a[0]),b.displayRepositories(a),b.displayStatus(a[0]),b.displayCommits(a[0]),b.displayBranches(a[0]),b.displayTags(a[0]),b.displayRemotes(a[0]),b.displayConfig(a[0])):a.Children[0].Type==="Clone"?(a=a.Children,b.initTitleBar(a),b.displayRepositories(a,"full",!0)):a.Children[0].Type==="Branch"?(a=
a.Children,b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").getGitClone(a[0].CloneLocation),"Getting git repository details").then(function(a){a=a.Children;b.initTitleBar(a[0],"Branches");b.displayRepositories(a,"mini",!0);b.displayBranches(a[0],"full");b.displayRemoteBranches(a[0],"full")},function(a){b.handleError(a)})):a.Children[0].Type==="Tag"?(a=a.Children,b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").getGitClone(a[0].CloneLocation),
"Getting git repository details").then(function(a){a=a.Children;b.initTitleBar(a[0],f.Tags);b.displayRepositories(a,"mini",!0);b.displayTags(a[0],"full")},function(a){b.handleError(a)})):a.Children[0].Type==="Config"&&b.registry.getService("orion.page.progress").progress(b.registry.getService("orion.git.provider").getGitClone(a.CloneLocation),"Getting git repository details").then(function(a){a=a.Children;b.initTitleBar(a[0],f.Configuration);b.displayRepositories(a,"mini",!0);b.displayConfig(a[0],
"full")},function(a){b.handleError(a)})},function(a){b.handleError(a)})};var h=function(a,b,c,d,e){if(a=i.node(c))b.destroy(a);else throw"could not find toolbar "+c;b.renderCommands(d,a,e,null,"button")};a.prototype.initTitleBar=function(a,b){var c={},d="repoPageActions",e;a&&a.Type==="Clone"&&b?(e=a,c.Name=b,c.Parents=[],c.Parents[0]={},c.Parents[0].Name=e.Name,c.Parents[0].Location=e.Location,c.Parents[0].ChildrenLocation=e.Location,c.Parents[1]={},c.Parents[1].Name=f.Repo):a&&a.Type==="Clone"?
(e=a,c.Name=e.Name,c.Parents=[],c.Parents[0]={},c.Parents[0].Name=f.Repo):(c.Name=f.Repo,d="reposPageActions");h(this.registry,this.commandService,"pageActions",d,e||{});l.setPageTarget({task:f.Repo,target:e,breadcrumbTarget:c,makeBreadcrumbLink:function(a,b){a.href=k.toUrl(q.expand({resource:b||""}))},serviceRegistry:this.registry,commandService:this.commandService})};a.prototype.decorateRepository=function(a,b,c){var d=this,c=c||new m;b||(b="full");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.core.file").loadWorkspace(a.ContentLocation+
"?parts=meta"),"Loading workspace info").then(function(e){try{a.Content={};var g="root / ";if(e.Parents!==null)for(var f=e.Parents.length;f>0;f--)g+=e.Parents[f-1].Name+" / ";g+=e.Name;a.Content.Path=g;b!=="full"?c.resolve():d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getGitStatus(a.StatusLocation),"Getting status for "+a.Name).then(function(b){try{a.Status=b,d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getGitBranch(a.BranchLocation),
"Getting branches for "+a.Name).then(function(b){try{for(var e=b.Children||[],g,b=0;b<e.length;b++)if(e[b].Current){g=e[b];break}!g||g.RemoteLocation[0]===null?c.resolve():g.RemoteLocation.length===1&&g.RemoteLocation[0].Children.length===1&&g.RemoteLocation[0].Children[0].CommitLocation?d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").getLog(g.RemoteLocation[0].Children[0].CommitLocation+"?page=1&pageSize=20","HEAD"),"Getting incomming commits "+a.Name).then(function(b){a.CommitsToPush=
b.Children===void 0?0:b.Children.length;c.resolve()},function(){c.reject()}):d.registry.getService("orion.page.progress").progress(d.registry.getService("orion.git.provider").doGitLog(g.CommitLocation+"?page=1&pageSize=20"),"Getting outgoing commits "+a.Name).then(function(b){a.CommitsToPush=b.Children===void 0?0:b.Children.length;c.resolve()},function(){c.reject()})}catch(f){c.reject()}},function(){c.reject()})}catch(e){c.reject()}},function(){c.reject()})}catch(h){c.reject(h)}},function(){c.reject()});
return c};a.prototype.displayRepositories=function(a,b,c){var g=this;this.registry.getService("orion.page.message");var h=new e.DynamicContentModel(a,function(b){return g.decorateRepository.bind(g)(a[b])}),h=new e.DynamicContentExplorer(h);h.use({initialRender:function(){var c=i.node("table");if(c)if(i.empty(c),!a||a.length===0)(new d.Section(c,{id:"repositorySection",title:"Repository",iconClass:["gitImageSprite","git-sprite-repository"]})).setTitle(b==="full"?f["No Repositories"]:f["Repository Not Found"]),
g.loadingDeferred.resolve();else{var e=document.createElement("div");e.className="sectionTable";c.appendChild(e);e.innerHTML='<div id="repositoryNode" class="mainPadding"></div>'}},cleanupRender:function(){g.loadingDeferred.resolve()},renderBeforeItemPopulation:function(d){var e=document.createElement("div");e.className="sectionTableItem "+(a.length===1?"":"lightTreeTableRow");i.node("repositoryNode").appendChild(e);var h=document.createElement("div");h.style.overflow="hidden";e.appendChild(h);e=
document.createElement("div");e.className="stretch";h.appendChild(e);var j=document.createElement("span");e.appendChild(j);if(c){var l=document.createElement("a");l.href=k.toUrl(q.expand({resource:a[d].Location}));l.appendChild(document.createTextNode(a[d].Name));j.appendChild(l)}else j.appendChild(document.createTextNode(a[d].Name));this.explorer.progressIndicators[d]=new this.explorer.progressIndicator(d,j);j=document.createElement("div");e.appendChild(j);j=document.createElement("span");j.textContent=
a[d].GitUrl!==null?f["git url:"]+a[d].GitUrl:f["(no remote)"];e.appendChild(j);j=document.createElement("div");e.appendChild(j);j=document.createElement("span");j.id="location"+d;e.appendChild(j);if(b==="full")j=document.createElement("div"),j.style.paddingTop="10px",e.appendChild(j),j=document.createElement("span"),j.id="repositoryState"+d,j.style.paddingLeft="10px",e.appendChild(j),j=document.createElement("span"),j.id="workspaceState"+d,j.style.paddingLeft="10px",e.appendChild(j),j=document.createElement("span"),
j.id="commitsState"+d,j.style.paddingLeft="10px",e.appendChild(j),e=document.createElement("div"),e.className="sectionTableItemActions",e.id="repositoryActionsArea",h.appendChild(e),g.commandService.renderCommands(g.actionScopeId,e,a[d],g,"tool")},renderAfterItemPopulation:function(d){g.renderRepository(a[d],d,a.length,b,c)}});h.render()};a.prototype.renderRepository=function(a,c,d,e){if(d=i.node("location"+c))if(d.textContent=f["location: "]+a.Content.Path,d=a.Status,e==="full"){var e=d.Untracked.length+
d.Conflicting.length+d.Modified.length+d.Missing.length,g=d.Changed.length+d.Added.length+d.Removed.length,e=e>0||g>0?b.formatMessage(f["${0} file(s) to stage and ${1} file(s) to commit."],e,g):f["Nothing to commit."];if(d.RepositoryState!=="SAFE")i.node("repositoryState"+c).textContent=f["Rebase in progress!"];i.node("workspaceState"+c).textContent=e;a=a.CommitsToPush;i.node("commitsState"+c).textContent=a>0?a+f[" commit(s) to push."]:f["Nothing to push."]}};a.prototype.displayStatus=function(a){var b=
a.StatusLocation,c=this,e=i.node("table"),e=new d.Section(e,{id:"workingDirectorySection",title:f["Working Directory"],content:'<div id="workingDirectoryNode" class="mainPadding"></div>'});c.commandService.registerCommandContribution(e.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10);c.commandService.renderCommands(e.actionsNode.id,e.actionsNode.id,{ViewAllLink:t.expand({resource:a.StatusLocation}),ViewAllLabel:f["See Full Status"],ViewAllTooltip:f["See the status"]},c,"button");
var g=e.createProgressMonitor();g.begin("Loading status");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(b),"Loading status").then(function(b){g.done();c.renderStatus(a,b)},function(a){g.done(a)})};a.prototype.renderStatus=function(a,c){var d=i.node("workingDirectoryNode");d&&i.empty(d);var e=document.createElement("div");e.className="sectionTableItem";d.appendChild(e);var g=document.createElement("div");g.style.overflow="hidden";
e.appendChild(g);var e=c.Untracked.length+c.Conflicting.length+c.Modified.length+c.Missing.length,d=c.Changed.length+c.Added.length+c.Removed.length,h=f["You have no changes to commit."];if(e>0||d>0)h=f["You have changes to commit in your workspace!"];var j=document.createElement("div");j.style.overflow="vbox stretch details-view";g.appendChild(j);if(c.RepositoryState!=="SAFE")g=document.createElement("div"),g.textContent=f["Rebase in progress!"],j.appendChild(g);g=document.createElement("div");g.textContent=
h;j.appendChild(g);h=document.createElement("div");h.textContent=b.formatMessage(f["${0} file(s) to stage and ${1} file(s) to commit."],e,d);j.appendChild(h)};a.prototype.decorateBranches=function(a,b){var c=this,b=b||new m;a.length>0?this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").doGitLog(a[0].CommitLocation+"?page=1&pageSize=1"),"Getting branch last commit "+a[0].Name).then(function(d){a[0].Commit=d.Children[0];c.decorateBranches(a.slice(1),
b)}):b.resolve();return b};a.prototype.displayBranches=function(a,b){var c=a.BranchLocation,e=this,g=i.node("table"),h=new d.Section(g,{id:"branchSection",title:f.Branches,iconClass:["gitImageSprite","git-sprite-branch"],slideout:!0,content:'<div id="branchNode"></div>',canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),j=h.createProgressMonitor();j.begin("Getting branches");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(c+
(b==="full"?"?commits=1":"?commits=1&page=1&pageSize=5")),"Getting branches "+a.Name).then(function(d){d=d.Children;j.done();e.commandService.destroy(h.actionsNode.id);b!=="full"&&d.length!==0&&(e.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),e.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,{ViewAllLink:q.expand({resource:c}),ViewAllLabel:f["View All"],ViewAllTooltip:f["View all local and remote tracking branches"]},
e,"button"));e.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.addBranch",200);e.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,a,e,"button");var g=document.createElement("div");g.className="mainPadding";for(var k=0;k<d.length;k++)d[k].ParentLocation=c,e.renderBranch(d[k],k,g);i.empty(i.node("branchNode"));i.node("branchNode").appendChild(g)},function(a){j.done();e.handleError(a)})};a.prototype.renderBranch=function(a,c,d){c=document.createElement("div");c.className=
"sectionTableItem lightTreeTableRow";d.appendChild(c);d=document.createElement("div");d.style.overflow="hidden";c.appendChild(d);if(a.Current)c=document.createElement("span"),c.className="sectionIcon gitImageSprite git-sprite-branch-active",d.appendChild(c);c=document.createElement("div");c.className="stretch";d.appendChild(c);var e=document.createElement("span");e.className=a.Current?"activeBranch":"";e.textContent=a.Name;c.appendChild(e);var e=a.Commit.Children[0],g=a.RemoteLocation.length&&a.RemoteLocation.length===
1&&a.RemoteLocation[0].Children.length&&a.RemoteLocation[0].Children.length===1?b.formatMessage(f["tracks ${0}, "],a.RemoteLocation[0].Children[0].Name):f["tracks no branch, "],h=document.createElement("div");h.textContent=g+b.formatMessage(f["last modified ${0} by ${1}"],(new Date(e.Time)).toLocaleString(),e.AuthorName);c.appendChild(h);c=document.createElement("div");c.className="sectionTableItemActions";c.id="branchActionsArea";d.appendChild(c);this.commandService.renderCommands(this.actionScopeId,
c,a,this,"tool")};a.prototype.displayRemoteBranches=function(a){var b=a.RemoteLocation,c=this,e=i.node("table"),g=new d.Section(e,{id:"remoteBranchSection",title:"Remote Branches",iconClass:["gitImageSprite","git-sprite-branch"],content:'<div id="remoteBranchNode" class="mainPadding"></div>',canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),h=g.createProgressMonitor();h.begin("Getting remote branches");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitRemote(b),
"Getting remote branches "+a.Name).then(function(b){b=b.Children;h.done();b.length===0?g.setTitle(f["No Remote Branches"]):(h=g.createProgressMonitor(),h.begin(f["Rendering branches"]),c.displayRemoteBranches2(g,b,a).then(function(){h.done()},function(){h.done()}))},function(a){h.done(a)})};a.prototype.displayRemoteBranches2=function(a,b,c,d,e){var g=this,d=d||new m;b.length>0?this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitRemote(b[0].Location),
"Getting remote branches "+b[0].Name).then(function(f){for(var f=f.Children,h=0;h<f.length;h++)f[h].Repository=c,g.renderRemoteBranch(f[h],h);g.displayRemoteBranches2(a,b.slice(1),c,d,e||f.length>0,f)},function(a){d.reject(a)}):(e||a.setTitle(f["No Remote Branches"]),d.resolve());return d};a.prototype.renderRemoteBranch=function(a){var b=document.createElement("div");b.className="sectionTableItem lightTreeTableRow";i.node("remoteBranchNode").appendChild(b);var c=document.createElement("div");c.style.overflow=
"hidden";b.appendChild(c);b=document.createElement("div");b.className="stretch";c.appendChild(b);var d=document.createElement("span");d.textContent=a.Name;b.appendChild(d);b=document.createElement("div");b.className="sectionTableItemActions";b.id="branchActionsArea";c.appendChild(b);this.commandService.renderCommands(this.actionScopeId,b,a,this,"tool")};a.prototype.displayCommits=function(a){var c=this,e=i.node("table"),g=new d.Section(e,{id:"commitSection",title:f.Commits,slideout:!0,content:'<div id="commitNode"></div>',
canHide:!0,preferenceService:this.registry.getService("orion.core.preference")}),h=g.createProgressMonitor();h.begin(f["Getting current branch"]);var j=document.createElement("div");j.className="mainPadding";this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(a.BranchLocation),"Getting current branch "+a.Name).then(function(a){for(var a=a.Children,d,e=0;e<a.length;e++)if(a[e].Current){d=a[e];break}d?(a=d.RemoteLocation.length===1&&d.RemoteLocation[0].Children.length===
1,g.setTitle(b.formatMessage(f['Commits for "${0}" branch'],d.Name)),c.commandService.destroy(g.actionsNode.id),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),c.commandService.renderCommands(g.actionsNode.id,g.actionsNode.id,{ViewAllLink:p.expand({resource:d.CommitLocation}),ViewAllLabel:f["See Full Log"],ViewAllTooltip:f["See the full log"]},c,"button"),a&&(c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.fetch",
100),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.merge",100),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.rebase",100),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.resetIndex",100),c.commandService.renderCommands(g.actionsNode.id,g.actionsNode.id,d.RemoteLocation[0].Children[0],c,"button")),c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.orion.git.push",100),c.commandService.renderCommands(g.actionsNode.id,
g.actionsNode.id,d,c,"button"),d.RemoteLocation[0]===null?(h.done(),c.renderNoCommit(j)):(h.worked(b.formatMessage(f['Getting commits for "${0}" branch'],d.Name)),a&&d.RemoteLocation[0].Children[0].CommitLocation?c.registry.getService("orion.git.provider").getLog(d.RemoteLocation[0].Children[0].CommitLocation+"?page=1&pageSize=20","HEAD").then(function(a){h.worked(f["Rendering commits"]);for(var b=a.Children.length,e=0;e<a.Children.length;e++)c.renderCommit(a.Children[e],!0,e,j);h.worked(f["Getting outgoing commits"]);
c.registry.getService("orion.git.provider").getLog(d.CommitLocation+"?page=1&pageSize=20",d.RemoteLocation[0].Children[0].Id).then(function(a){h.worked("Rendering commits");for(var d=0;d<a.Children.length;d++)c.renderCommit(a.Children[d],!1,d+b,j);b+=a.Children.length;b===0&&c.renderNoCommit(j);h.done()},function(a){h.done(a)})},function(a){h.done(a)}):c.registry.getService("orion.git.provider").doGitLog(d.CommitLocation+"?page=1&pageSize=20").then(function(a){h.worked(f["Rendering commits"]);for(var b=
0;b<a.Children.length;b++)c.renderCommit(a.Children[b],!0,b,j);a.Children.length===0&&c.renderNoCommit(j);h.done()},function(a){h.done(a)}))):h.done()});i.empty(i.node("commitNode"));i.node("commitNode").appendChild(j)};a.prototype.renderNoCommit=function(a){var b=document.createElement("div");b.className="sectionTableItem";a.appendChild(b);a=document.createElement("div");a.style.overflow="hidden";b.appendChild(a);b=document.createElement("div");b.className="stretch";a.appendChild(b);a=document.createElement("div");
a.textContent=f["The branch is up to date."];b.appendChild(a);a=document.createElement("div");a.textContent=f["You have no outgoing or incoming commits."];b.appendChild(a)};a.prototype.renderCommit=function(a,b,c,d){c=document.createElement("div");c.className="sectionTableItem lightTreeTableRow";d.appendChild(c);d=document.createElement("div");d.style.overflow="hidden";c.appendChild(d);b=b?"git-sprite-outgoing-commit":"git-sprite-incoming-commit";c=document.createElement("span");c.className="sectionIcon gitImageSprite "+
b;d.appendChild(c);if(a.AuthorImage)b=document.createElement("div"),b.style["float"]="left",c=new Image,c.src=a.AuthorImage,c.name=a.AuthorName,c.className="git-author-icon",b.appendChild(c),d.appendChild(b);b=document.createElement("div");b.className="stretch";d.appendChild(b);c=document.createElement("a");c.className="navlinkonpage";c.href=k.toUrl(x.expand({resource:a.Location}));c.textContent=a.Message;b.appendChild(c);new r.CommitTooltipDialog({commit:a,triggerNode:c});c=document.createElement("div");
b.appendChild(c);c=document.createElement("span");c.textContent=f[" (SHA "]+a.Name+f[") by "]+a.AuthorName+" on "+(new Date(a.Time)).toLocaleString();b.appendChild(c);b=document.createElement("div");b.className="sectionTableItemActions";b.id="branchActionsArea";d.appendChild(b);this.commandService.renderCommands(this.actionScopeId,b,a,this,"tool")};a.prototype.decorateTag=function(a,b){b=b||new m;this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").doGitLog(a.CommitLocation+
"?page=1&pageSize=1"),"Getting tag last commit "+a.Name).then(function(c){a.Commit=c.Children[0];b.resolve()},function(){b.reject()});return b};a.prototype.displayTags=function(a,b){var c=this,h=document.createElement("a"),j=g.matchResourceParameters();h.href=j.resource;var h=h.search?h.search:"?page=1&pageSize=20",j=i.node("table"),l=new d.Section(j,{id:"tagSection",iconClass:["gitImageSprite","git-sprite-tag"],title:"Tags"+(b==="full"?"":" (5 most recent)"),content:'<div id="tagNode"></div>',canHide:!0,
hidden:!0,preferenceService:c.registry.getService("orion.core.preference")}),m=l.createProgressMonitor();m.begin(f["Getting tags"]);var n=document.createElement("div");n.className="mainPadding";this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(a.TagLocation+(b==="full"?h:"?page=1&pageSize=5")),"Getting tags "+a.Name).then(function(d){var g=d.Children,d=new e.DynamicContentModel(g,function(a){return c.decorateTag.bind(c)(g[a])}),d=
new e.DynamicContentExplorer(d);d.use({initialRender:function(){m.done();var d=i.node("tagNode");d&&(i.empty(d),d.appendChild(n),c.commandService.destroy(l.actionsNode.id),b!=="full"&&g.length!==0&&(c.commandService.registerCommandContribution(l.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),c.commandService.renderCommands(l.actionsNode.id,l.actionsNode.id,{ViewAllLink:k.toUrl(s.expand({resource:a.TagLocation})),ViewAllLabel:f["View All"],ViewAllTooltip:f["View all tags"]},c,"button")),
g.length===0&&l.setTitle(f["No Tags"]))},renderBeforeItemPopulation:function(a){var b=document.createElement("div");b.className="sectionTableItem lightTreeTableRow";n.appendChild(b);var d=document.createElement("div");d.style.overflow="hidden";b.appendChild(d);b=document.createElement("div");b.className="stretch";d.appendChild(b);var e=document.createElement("span");e.textContent=g[a].Name;b.appendChild(e);this.explorer.progressIndicators[a]=new this.explorer.progressIndicator(a,e);e=document.createElement("div");
e.id="tagDetailsView"+a;b.appendChild(e);b=document.createElement("div");b.className="sectionTableItemActions";b.id="tagActionsArea";d.appendChild(b);c.commandService.renderCommands(c.actionScopeId,b,g[a],c,"tool")},renderAfterItemPopulation:function(a){c.renderTag(g[a],a)}});d.render()},function(a){m.done();c.handleError(a)})};a.prototype.renderTag=function(a,b){var c=document.createElement("span");c.className="tag-description";i.empty(i.node("tagDetailsView"+b));i.node("tagDetailsView"+b).appendChild(c);
var d=a.Commit,e=document.createElement("a");e.className="navlinkonpage";e.href=k.toUrl(x.expand({resource:d.Location}));e.textContent=d.Message;c.appendChild(e);c.appendChild(document.createTextNode(f[" by "]+d.AuthorName+f[" on "]+(new Date(d.Time)).toLocaleString()));new r.CommitTooltipDialog({commit:d,triggerNode:e})};a.prototype.displayRemotes=function(a){var b=a.RemoteLocation,c=this,e=i.node("table"),g=new d.Section(e,{id:"remoteSection",title:f.Remotes,iconClass:["gitImageSprite","git-sprite-remote"],
slideout:!0,content:'<div id="remoteNode" class="mainPadding"></div>',canHide:!0,hidden:!0,preferenceService:this.registry.getService("orion.core.preference")}),h=g.createProgressMonitor();h.begin("Getting remotes");c.commandService.registerCommandContribution(g.actionsNode.id,"eclipse.addRemote",100);c.commandService.renderCommands(g.actionsNode.id,g.actionsNode.id,a,c,"button");this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitRemote(b),
"Getting remotes "+a.Name).then(function(a){a=a.Children;h.worked(f["Rendering remotes"]);if(a.length===0)g.setTitle(f["No Remotes"]);else for(var b=0;b<a.length;b++)c.renderRemote(a[b],b);h.done()},function(a){h.done();c.handleError(a)})};a.prototype.renderRemote=function(a){var b=document.createElement("div");b.className="sectionTableItem lightTreeTableRow";i.node("remoteNode").appendChild(b);var c=document.createElement("div");c.style.overflow="hidden";b.appendChild(c);b=document.createElement("div");
b.className="stretch";c.appendChild(b);var d=document.createElement("div");d.textContent=a.Name;b.appendChild(d);d=document.createElement("div");d.textContent=a.GitUrl;b.appendChild(d);b=document.createElement("div");b.className="sectionTableItemActions";b.id="remoteActionsArea";c.appendChild(b);this.commandService.renderCommands(this.actionScopeId,b,a,this,"tool")};a.prototype.displayConfig=function(a,b){var c=a.ConfigLocation,e=this,g=i.node("table"),h=new d.Section(g,{id:"configSection",title:f.Configuration+
(b==="full"?"":" (user.*)"),slideout:!0,content:'<div id="configNode" class="mainPadding"></div>',canHide:!0,hidden:!0,preferenceService:this.registry.getService("orion.core.preference")}),j=h.createProgressMonitor();j.begin(f["Getting confituration"]);this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitCloneConfig(c),"Getting configuration of "+a.Name).then(function(d){j.worked("Rendering configuration");d=d.Children;b!=="full"&&d.length!==
0&&(e.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),e.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,{ViewAllLink:q.expand({resource:c}),ViewAllLabel:f["View All"],ViewAllTooltip:f["View all configuration entries"]},e,"button"));b==="full"&&(e.commandService.registerCommandContribution(h.actionsNode.id,"eclipse.orion.git.addConfigEntryCommand",1E3),e.commandService.renderCommands(h.actionsNode.id,h.actionsNode.id,a,
e,"button"));if(d.length===0)h.setTitle("No Configuration");else for(var g=0;g<d.length;g++)(b==="full"||d[g].Key.indexOf("user.")!==-1)&&e.renderConfigEntry(d[g],g);j.done()},function(a){j.done();e.handleError(a)})};a.prototype.renderConfigEntry=function(a){var b=document.createElement("div");b.className="sectionTableItem lightTreeTableRow";i.node("configNode").appendChild(b);var c=document.createElement("div");c.style.overflow="hidden";b.appendChild(c);b=document.createElement("div");b.className=
"stretch";c.appendChild(b);var d=document.createElement("span");d.textContent=a.Key;b.appendChild(d);d=document.createElement("span");d.style.paddingLeft="10px";d.textContent=a.Value;b.appendChild(d);b=document.createElement("div");b.className="sectionTableItemActions";b.id="configActionsArea";c.appendChild(b);this.commandService.renderCommands(this.actionScopeId,b,a,this,"tool")};return a}();return j});
define("orion/operation",["orion/xhr","orion/Deferred"],function(f,k){function j(b,d,a,h){f("GET",b,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(g){g=g.response?JSON.parse(g.response):null;d.progress(g);!g.type||g.type==="loadstart"||g.type==="progress"?setTimeout(function(){j(b,d,a,h)},2E3):(g.type==="error"||g.type==="abort"?d.reject(h?h(g):g.Result):d.resolve(a?a(g):g.Result.JsonData),g.Location||f("DELETE",b,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var b=a;if(a.responseText!==
void 0){b=a.responseText;try{b=JSON.parse(a.responseText)}catch(c){}}b.Message!==void 0?(b.HttpCode=b.HttpCode===void 0?a.status:b.HttpCode,b.Severity=b.Severity===void 0?"Error":b.Severity,d.reject(b)):d.reject({Severity:"Error",Message:b,HttpCode:a.status})})}function d(b,d){d.then(null,function(a){a instanceof Error&&a.name==="Cancel"&&f("PUT",b,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(b,f,a){var h=new k;d(b,h);j(b,h,f,a);return h}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(f,k,j,d){var b=b||{};b.GitService=function(){function b(a){if(a)this._serviceRegistry=a,this._serviceRegistration=a.registerService("orion.git.provider",this),this._sshService=a.getService("orion.net.ssh")}b.prototype={checkGitService:function(){},cloneGitRepository:function(a,b,d,e,c,i,n,m,r,q,s){var t=this,p={};if(a)p.Name=a;if(d)p.Path=d;if(b)p.GitUrl=b;p.Location=e;if(c)p.GitSshUsername=c;if(i)p.GitSshPassword=
i;if(n)p.GitSshKnownHost=n;if(m)p.GitSshPrivateKey=m;if(r)p.GitSshPassphrase=r;if(q){if(q.GitMail)p.GitMail=q.GitMail;if(q.GitName)p.GitName=q.GitName}if(s)p.initProject=s;var a=f.toUrl("gitapi/clone/._"),a=a.substring(0,a.length-2),x=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(p)}).then(function(a){t._getGitServiceResponse(x,a)},function(a){t._handleGitServiceResponseError(x,a)});return x},removeGitRepository:function(a){var b=
this,d=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},getGitStatus:function(a){var b=this,d=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},stage:function(a){var b=
this,d=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},stageMultipleFiles:function(a,b){var d=this,e=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,
a)});return e},unstageAll:function(a,b){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},unstage:function(a,b){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(a){d._getGitServiceResponse(e,
a)},function(a){d._handleGitServiceResponseError(e,a)});return e},checkoutPath:function(a,b){var d=this,e=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b,RemoveUntracked:"true"})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},commitAll:function(a,b,d){var e=this,c=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:d}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},getGitClone:function(a){var b=this,d=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},getGitCloneConfig:function(a){var b=this,d=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},getGitBranch:function(a){var b=this,d=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},getGitRemote:function(a){var b=this,d=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},checkoutBranch:function(a,b){var d=this,e=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},resetIndex:function(a,b){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:b,Reset:"HARD"})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},addBranch:function(a,b,d){var e=this,c={};if(b)c.Name=b;if(d)c.Branch=d;var f=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(c)}).then(function(a){e._getGitServiceResponse(f,a)},function(a){e._handleGitServiceResponseError(f,
a)});return f},removeBranch:function(a){var b=this,d=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},addRemote:function(a,b,d){var e=this,c=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:b,RemoteURI:d})}).then(function(a){e._getGitServiceResponse(c,
a)},function(a){e._handleGitServiceResponseError(c,a)});return c},removeRemote:function(a){var b=this,d=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},doGitLog:function(a){var b=this,d=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,
a)},function(a){b._handleGitServiceResponseError(d,a)});return d},getDiff:function(a,b){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},doFetch:function(a,b,d,e,c,f,i){var m=this,r=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:b,GitSshUsername:d,GitSshPassword:e,GitSshKnownHost:c,GitSshPrivateKey:f,GitSshPassphrase:i})}).then(function(a){m._getGitServiceResponse(r,a)},function(a){m._handleGitServiceResponseError(r,a)});return r},doPull:function(a,b,d,e,c,f,i){var m=this,r=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:b,GitSshUsername:d,GitSshPassword:e,GitSshKnownHost:c,GitSshPrivateKey:f,
GitSshPassphrase:i})}).then(function(a){m._getGitServiceResponse(r,a)},function(a){m._handleGitServiceResponseError(r,a)});return r},doMerge:function(a,b,d){var e=this,c=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:b,Squash:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},doCherryPick:function(a,b){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},doRevert:function(a,b){var d=this,e=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},doRebase:function(a,
b,d){var e=this,c={};c.Rebase=b;if(d)c.Operation=d;var f=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(c)}).then(function(a){e._getGitServiceResponse(f,a)},function(a){e._handleGitServiceResponseError(f,a)});return f},doPush:function(a,b,d,e,c,f,i,m,r){var q=this,s=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:b,PushTags:d,
Force:e,GitSshUsername:c,GitSshPassword:f,GitSshKnownHost:i,GitSshPrivateKey:m,GitSshPassphrase:r})}).then(function(a){q._getGitServiceResponse(s,a)},function(a){q._handleGitServiceResponseError(s,a)});return s},getLog:function(a,b){var d=this,e=new j,c=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){c.resolve(a.xhr.getResponseHeader("Location"))},function(a){d._handleGitServiceResponseError(e,
a)});c.then(function(a){k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)})});return e},getDefaultRemoteBranch:function(a){var b=this,d=new j,e=new j;k("GET",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(e,a)},function(a){b._handleGitServiceResponseError(d,a)});
e.then(function(a){k("GET",a.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)})});return d},doAddTag:function(a,b){var d=this,e=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,
a)});return e},doRemoveTag:function(a){var b=this,d=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},checkoutTag:function(a,b,d){var e=this,c=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:b,Branch:d})}).then(function(a){e._getGitServiceResponse(c,
a)},function(a){e._handleGitServiceResponseError(c,a)});return c},addCloneConfigurationProperty:function(a,b,d){var e=this,c=new j;k("POST",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:b,Value:d})}).then(function(a){e._getGitServiceResponse(c,a)},function(a){e._handleGitServiceResponseError(c,a)});return c},editCloneConfigurationProperty:function(a,b){var d=this,e=new j;k("PUT",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:b})}).then(function(a){d._getGitServiceResponse(e,a)},function(a){d._handleGitServiceResponseError(e,a)});return e},deleteCloneConfigurationProperty:function(a){var b=this,d=new j;k("DELETE",a,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(d,a)},function(a){b._handleGitServiceResponseError(d,a)});return d},sendCommitReviewRequest:function(a,b,d,e,c,f){var i=
this,m=new j;k("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:a,ReviewReqUrl:e,ReviewReqNotifyLogin:d,ReviewReqAuthorName:c,ReviewMessage:f})}).then(function(a){i._getGitServiceResponse(m,a)},function(a){i._handleGitServiceResponseError(m,a)});return m},_getGitServiceResponse:function(a,b){var g=b.response?JSON.parse(b.response):null;if(b.xhr&&b.xhr.status===202){var e=d.handle(g.Location);e.then(a.resolve,function(b){b.failedOperation=
g.Location;a.reject(b)},a.progress);a.then(null,function(a){e.reject(a)})}else a.resolve(g)},_handleGitServiceResponseError:function(a,b){a.reject(b)}};return b}();return b});
define("orion/ssh/sshTools",[],function(){var f=f||{};f.SshService=function(){function f(j){if(j)this._serviceRegistry=j,this._serviceRegistration=j.registerService("orion.net.ssh",this)}f.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(f,d){d||(d="");var b=localStorage.getItem(d+this._KNOWN_HOSTS);b?b.indexOf(f)<0&&localStorage.setItem(d+this._KNOWN_HOSTS,b+"\n"+f):localStorage.setItem(d+this._KNOWN_HOSTS,f)},clearKnownhosts:function(f){f||(f="");localStorage.removeItem(f+this._KNOWN_HOSTS)},
getKnownHosts:function(f){f||(f="");return localStorage.getItem(f+this._KNOWN_HOSTS)}};return f}();return f});
define("orion/links",[],function(){function f(f){this._init(f)}f.prototype={_init:function(f){this._registry=f.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(f,j,d,b,i){var a=f.search(d);a>0&&(j.appendChild(document.createTextNode(f.substring(0,a))),f=f.substring(a));var d=f.replace(d,""),a=f.substring(0,f.length-d.length),h=a.split(" ",b);if(h.length===b){for(var f=document.createElement("a"),g=0;g<b;g++)i=i.replace("%"+
(g+1),h[g]);f.setAttribute("href",i);f.textContent=a;j.appendChild(f);f=d}return f},addLinks:function(f,j){var d=j||document.createElement("div"),b=this._registry.getServiceReferences("orion.core.linkScanner");if(b.length>0)for(var i=b[0],b=RegExp(i.getProperty("pattern"),"i"),a=i.getProperty("words"),i=i.getProperty("anchor"),h=f.search(b);h>=0;)f=this._replaceLink(f,d,b,a,i),h=f.search(b);f.length>0&&d.appendChild(document.createTextNode(f));return d}};f.prototype.constructor=f;return{TextLinkService:f}});
var eclipse;
define('built-git-repository.js',"i18n!git/nls/gitmessages,require,orion/browserCompatibility,orion/bootstrap,orion/status,orion/progress,orion/PageUtil,orion/keyBinding,orion/commandRegistry,orion/commands,orion/dialogs,orion/selection,orion/fileClient,orion/operationsClient,orion/searchClient,orion/globalCommands,orion/git/gitRepositoryExplorer,orion/git/gitCommands,orion/git/gitClient,orion/ssh/sshTools,orion/links".split(","),function(f,k,j,d,b,i,a,h,g,e,c,l,n,m,r,q,s,t,p,x,u){d.startup().then(function(d){var j=d.serviceRegistry,
d=d.preferences;new c.DialogService(j);var w=new l.Selection(j);new x.SshService(j);var y=new g.CommandRegistry({selection:w}),w=new m.OperationsClient(j),B=new i.ProgressService(j,w,y);new b.StatusReportingService(j,w,"statusPane","notifications","notificationArea");w=new u.TextLinkService({serviceRegistry:j});new p.GitService(j);var H=new n.FileClient(j),G=new r.Searcher({serviceRegistry:j,commandService:y,fileService:H}),z=new s.GitRepositoryExplorer(j,y,w,null,"artifacts","pageNavigationActions",
"itemLevelCommands");q.generateBanner("orion-repository",j,y,d,G,z);t.createFileCommands(j,y,z,"pageActions","selectionTools");t.createGitClonesCommands(j,y,z,"pageActions","selectionTools",H);y.addCommandGroup("pageActions","eclipse.gitGroup",100);y.addCommandGroup("pageActions","eclipse.gitGroup",200);y.registerCommandContribution("reposPageActions","eclipse.cloneGitRepository",100,"eclipse.gitGroup",!1,null,new g.URLBinding("cloneGitRepository","url"));y.registerCommandContribution("reposPageActions",
"eclipse.createGitProject",300,"eclipse.gitGroup",!0,null,new g.URLBinding("createProjectContext","name"));y.registerCommandContribution("reposPageActions","eclipse.initGitRepository",200,"eclipse.gitGroup");y.registerCommandContribution("repoPageActions","eclipse.orion.git.pull",100,"eclipse.gitGroup");y.registerCommandContribution("repoPageActions","eclipse.orion.git.applyPatch",200,"eclipse.gitGroup");y.registerCommandContribution("repoPageActions","eclipse.git.deleteClone",300,"eclipse.gitGroup");
y.registerCommandContribution("repoPageActions","eclipse.orion.git.openCommitCommand",1E3,"eclipse.gitGroup",!0,new h.KeyBinding("h",!0,!0),new g.URLBinding("openGitCommit","commitName"));y.registerCommandContribution("itemLevelCommands","eclipse.openCloneContent",100);y.registerCommandContribution("itemLevelCommands","eclipse.openGitStatus",100);y.registerCommandContribution("itemLevelCommands","eclipse.openGitLog",100);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.pull",200);
y.registerCommandContribution("itemLevelCommands","eclipse.removeBranch",1E3);y.registerCommandContribution("itemLevelCommands","eclipse.checkoutTag",200);y.registerCommandContribution("itemLevelCommands","eclipse.removeTag",1E3);y.registerCommandContribution("itemLevelCommands","eclipse.checkoutBranch",200);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.applyPatch",300);y.registerCommandContribution("itemLevelCommands","eclipse.git.deleteClone",1E3);y.registerCommandContribution("itemLevelCommands",
"eclipse.orion.git.fetch",500);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.merge",600);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.mergeSquash",700);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.rebase",700);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.resetIndex",800);y.registerCommandContribution("itemLevelCommands","eclipse.removeRemote",1E3);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.deleteConfigEntryCommand",
1E3);y.registerCommandContribution("itemLevelCommands","eclipse.orion.git.editConfigEntryCommand",200);y.registerCommandContribution("pageNavigationActions","eclipse.orion.git.previousTagPage",1);y.registerCommandContribution("pageNavigationActions","eclipse.orion.git.nextTagPage",2);j=new e.Command({name:f["View All"],id:"eclipse.orion.git.repositories.viewAllCommand",hrefCallback:function(a){return k.toUrl(a.items.ViewAllLink)},visibleWhen:function(a){this.name=a.ViewAllLabel;this.tooltip=a.ViewAllTooltip;
return a.ViewAllLabel&&a.ViewAllTooltip&&a.ViewAllLink}});y.addCommand(j);var A=a.matchResourceParameters();typeof A["createProject.name"]==="undefined"&&y.processURL(window.location.href);B.progress(H.loadWorkspace(),"Loading default workspace").then(function(a){z.setDefaultPath(a.Location);var a={},b;for(b in A)b.indexOf("createProject")!=-1&&(a[b.replace("createProject.","")]=A[b]);y.runCommand("eclipse.createGitProject",{url:A.cloneGit,projectDescription:a},null,null);typeof A["createProject.name"]===
"undefined"&&z.redisplay()});var C=A.resource;window.addEventListener("hashchange",function(){y.closeParameterCollector();var b=a.matchResourceParameters().resource;C!==b&&(C=b,B.progress(H.loadWorkspace(),"Loading default workspace").then(function(a){z.setDefaultPath(a.Location);z.redisplay()}))},!1)})});